const struct GNUNET_PeerIdentity *get_path,
unsigned int get_path_length,
const struct GNUNET_PeerIdentity *put_path,
- unsigned int put_path_length, enum GNUNET_BLOCK_Type type,
- size_t size, const void *data)
+ unsigned int put_path_length,
+ enum GNUNET_BLOCK_Type type,
+ size_t size,
+ const void *data)
{
FPRINTF (stdout,
_("Result %d, type %d:\n%.*s\n"),
- result_count, type,
- (unsigned int) size, (char *) data);
+ result_count,
+ type,
+ (unsigned int) size,
+ (char *) data);
+ if (verbose)
+ {
+ FPRINTF (stdout,
+ " GET path: ");
+ for (unsigned int i=0;i<get_path_length;i++)
+ FPRINTF (stdout,
+ "%s%s",
+ (0 == i) ? "" : "-",
+ GNUNET_i2s (&get_path[i]));
+ FPRINTF (stdout,
+ "\n PUT path: ");
+ for (unsigned int i=0;i<put_path_length;i++)
+ FPRINTF (stdout,
+ "%s%s",
+ (0 == i) ? "" : "-",
+ GNUNET_i2s (&put_path[i]));
+ FPRINTF (stdout,
+ "\n");
+ }
result_count++;
}
static int verbose;
/**
- * Use DHT demultixplex_everywhere
+ * Use #GNUNET_DHT_DEMULTIPLEX_EVERYWHERE.
*/
static int demultixplex_everywhere;
+/**
+ * Use #GNUNET_DHT_RO_RECORD_ROUTE.
+ */
+static int record_route;
+
/**
* Handle to the DHT
*/
const struct GNUNET_CONFIGURATION_Handle *c)
{
struct GNUNET_TIME_Absolute expiration;
+ enum GNUNET_DHT_RouteOption ro;
cfg = c;
if ((NULL == query_key) || (NULL == data))
if (verbose)
FPRINTF (stderr, _("Issuing put request for `%s' with data `%s'!\n"),
query_key, data);
+ ro = GNUNET_DHT_RO_NONE;
+ if (demultixplex_everywhere)
+ ro |= GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE;
+ if (record_route)
+ ro |= GNUNET_DHT_RO_RECORD_ROUTE;
GNUNET_DHT_put (dht_handle,
&key,
replication,
- (demultixplex_everywhere) ? GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE : GNUNET_DHT_RO_NONE,
+ ro,
query_type,
strlen (data),
data,
{'r', "replication", "LEVEL",
gettext_noop ("how many replicas to create"),
1, &GNUNET_GETOPT_set_uint, &replication},
+ {'R', "record", NULL,
+ gettext_noop ("use DHT's record route option"),
+ 0, &GNUNET_GETOPT_set_one, &record_route},
{'t', "type", "TYPE",
gettext_noop ("the type to insert data as"),
1, &GNUNET_GETOPT_set_uint, &query_type},