aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-put.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-27 20:45:02 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-27 20:45:02 +0000
commit89bc96f3fc0509f872c8372caac099d81ed36622 (patch)
tree70bb96f0deed1ea53631b72671900442b230de30 /src/dht/gnunet-dht-put.c
parent969cb768a0afbd921ec9ee05ce2d545f9f740fda (diff)
downloadgnunet-89bc96f3fc0509f872c8372caac099d81ed36622.tar.gz
gnunet-89bc96f3fc0509f872c8372caac099d81ed36622.zip
migration
Diffstat (limited to 'src/dht/gnunet-dht-put.c')
-rw-r--r--src/dht/gnunet-dht-put.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c
index 4a752ea24..727eebe63 100644
--- a/src/dht/gnunet-dht-put.c
+++ b/src/dht/gnunet-dht-put.c
@@ -24,7 +24,7 @@
24 * @author Nathan Evans 24 * @author Nathan Evans
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_dht_service.h" 27#include "gnunet_dht_service_new.h"
28 28
29/** 29/**
30 * The type of the query 30 * The type of the query
@@ -47,6 +47,11 @@ static unsigned long long timeout_request = 5;
47static unsigned long long expiration_seconds = 3600; 47static unsigned long long expiration_seconds = 3600;
48 48
49/** 49/**
50 * Desired replication level.
51 */
52static unsigned int replication = 5;
53
54/**
50 * Be verbose 55 * Be verbose
51 */ 56 */
52static int verbose; 57static int verbose;
@@ -146,7 +151,7 @@ run (void *cls, char *const *args, const char *cfgfile,
146 if (verbose) 151 if (verbose)
147 fprintf (stderr, _("Issuing put request for `%s' with data `%s'!\n"), 152 fprintf (stderr, _("Issuing put request for `%s' with data `%s'!\n"),
148 query_key, data); 153 query_key, data);
149 GNUNET_DHT_put (dht_handle, &key, DEFAULT_PUT_REPLICATION, GNUNET_DHT_RO_NONE, 154 GNUNET_DHT_put (dht_handle, &key, replication, GNUNET_DHT_RO_NONE,
150 query_type, strlen (data), data, expiration, timeout, 155 query_type, strlen (data), data, expiration, timeout,
151 &message_sent_cont, NULL); 156 &message_sent_cont, NULL);
152 157
@@ -157,21 +162,24 @@ run (void *cls, char *const *args, const char *cfgfile,
157 * gnunet-dht-put command line options 162 * gnunet-dht-put command line options
158 */ 163 */
159static struct GNUNET_GETOPT_CommandLineOption options[] = { 164static struct GNUNET_GETOPT_CommandLineOption options[] = {
160 {'k', "key", "KEY",
161 gettext_noop ("the query key"),
162 1, &GNUNET_GETOPT_set_string, &query_key},
163 {'d', "data", "DATA", 165 {'d', "data", "DATA",
164 gettext_noop ("the data to insert under the key"), 166 gettext_noop ("the data to insert under the key"),
165 1, &GNUNET_GETOPT_set_string, &data}, 167 1, &GNUNET_GETOPT_set_string, &data},
168 {'e', "expiration", "EXPIRATION",
169 gettext_noop ("how long to store this entry in the dht (in seconds)"),
170 1, &GNUNET_GETOPT_set_ulong, &expiration_seconds},
171 {'k', "key", "KEY",
172 gettext_noop ("the query key"),
173 1, &GNUNET_GETOPT_set_string, &query_key},
174 {'r', "replication", "LEVEL",
175 gettext_noop ("how many replicas to create"),
176 1, &GNUNET_GETOPT_set_uint, &replication},
166 {'t', "type", "TYPE", 177 {'t', "type", "TYPE",
167 gettext_noop ("the type to insert data as"), 178 gettext_noop ("the type to insert data as"),
168 1, &GNUNET_GETOPT_set_uint, &query_type}, 179 1, &GNUNET_GETOPT_set_uint, &query_type},
169 {'T', "timeout", "TIMEOUT", 180 {'T', "timeout", "TIMEOUT",
170 gettext_noop ("how long to execute this query before giving up?"), 181 gettext_noop ("how long to execute this query before giving up?"),
171 1, &GNUNET_GETOPT_set_ulong, &timeout_request}, 182 1, &GNUNET_GETOPT_set_ulong, &timeout_request},
172 {'e', "expiration", "EXPIRATION",
173 gettext_noop ("how long to store this entry in the dht (in seconds)"),
174 1, &GNUNET_GETOPT_set_ulong, &expiration_seconds},
175 {'V', "verbose", NULL, 183 {'V', "verbose", NULL,
176 gettext_noop ("be verbose (print progress information)"), 184 gettext_noop ("be verbose (print progress information)"),
177 0, &GNUNET_GETOPT_set_one, &verbose}, 185 0, &GNUNET_GETOPT_set_one, &verbose},