/**
* Be verbose
*/
-static int verbose;
+static unsigned int verbose;
/**
* Use DHT demultixplex_everywhere
}
-
-/**
- * gnunet-dht-get command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'k', "key", "KEY",
- gettext_noop ("the query key"),
- 1, &GNUNET_GETOPT_set_string, &query_key},
- {'r', "replication", "LEVEL",
- gettext_noop ("how many parallel requests (replicas) to create"),
- 1, &GNUNET_GETOPT_set_uint, &replication},
- {'t', "type", "TYPE",
- gettext_noop ("the type of data to look for"),
- 1, &GNUNET_GETOPT_set_uint, &query_type},
- {'T', "timeout", "TIMEOUT",
- gettext_noop ("how long to execute this query before giving up?"),
- 1, &GNUNET_GETOPT_set_relative_time, &timeout_request},
- {'x', "demultiplex", NULL,
- gettext_noop ("use DHT's demultiplex everywhere option"),
- 0, &GNUNET_GETOPT_set_one, &demultixplex_everywhere},
- {'V', "verbose", NULL,
- gettext_noop ("be verbose (print progress information)"),
- 0, &GNUNET_GETOPT_set_one, &verbose},
- GNUNET_GETOPT_OPTION_END
-};
-
-
/**
* Entry point for gnunet-dht-get
*
int
main (int argc, char *const *argv)
{
+
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_STRING ('k',
+ "key",
+ "KEY",
+ gettext_noop ("the query key"),
+ &query_key),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('r',
+ "replication",
+ "LEVEL",
+ gettext_noop ("how many parallel requests (replicas) to create"),
+ &replication),
+
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('t',
+ "type",
+ "TYPE",
+ gettext_noop ("the type of data to look for"),
+ &query_type),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('T',
+ "timeout",
+ "TIMEOUT",
+ gettext_noop ("how long to execute this query before giving up?"),
+ &timeout_request),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('x',
+ "demultiplex",
+ gettext_noop ("use DHT's demultiplex everywhere option"),
+ &demultixplex_everywhere),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('V',
+ "verbose",
+ gettext_noop ("be verbose (print progress information)"),
+ &verbose),
+ GNUNET_GETOPT_OPTION_END
+ };
+
+
+
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
return 2;
return (GNUNET_OK ==
NULL);
}
-
-/**
- * gnunet-dht-monitor command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'k', "key", "KEY",
- gettext_noop ("the query key"),
- 1, &GNUNET_GETOPT_set_string, &query_key},
- {'t', "type", "TYPE",
- gettext_noop ("the type of data to look for"),
- 1, &GNUNET_GETOPT_set_uint, &block_type},
- {'T', "timeout", "TIMEOUT",
- gettext_noop ("how long should the monitor command run"),
- 1, &GNUNET_GETOPT_set_relative_time, &timeout_request},
- {'V', "verbose", NULL,
- gettext_noop ("be verbose (print progress information)"),
- 0, &GNUNET_GETOPT_set_one, &verbose},
- GNUNET_GETOPT_OPTION_END
-};
-
-
/**
* Entry point for gnunet-dht-monitor
*
int
main (int argc, char *const *argv)
{
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_STRING ('k',
+ "key",
+ "KEY",
+ gettext_noop ("the query key"),
+ &query_key),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('t',
+ "type",
+ "TYPE",
+ gettext_noop ("the type of data to look for"),
+ &block_type),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('T',
+ "timeout",
+ "TIMEOUT",
+ gettext_noop ("how long should the monitor command run"),
+ &timeout_request),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('V',
+ "verbose",
+ gettext_noop ("be verbose (print progress information)"),
+ &verbose),
+
+ GNUNET_GETOPT_OPTION_END
+ };
+
+
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
return 2;
/**
* Be verbose
*/
-static int verbose;
+static unsigned int verbose;
/**
* Use #GNUNET_DHT_DEMULTIPLEX_EVERYWHERE.
NULL);
}
-
-/**
- * gnunet-dht-put command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'d', "data", "DATA",
- gettext_noop ("the data to insert under the key"),
- 1, &GNUNET_GETOPT_set_string, &data},
- {'e', "expiration", "EXPIRATION",
- gettext_noop ("how long to store this entry in the dht (in seconds)"),
- 1, &GNUNET_GETOPT_set_relative_time, &expiration},
- {'k', "key", "KEY",
- gettext_noop ("the query key"),
- 1, &GNUNET_GETOPT_set_string, &query_key},
- {'x', "demultiplex", NULL,
- gettext_noop ("use DHT's demultiplex everywhere option"),
- 0, &GNUNET_GETOPT_set_one, &demultixplex_everywhere},
- {'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},
- {'V', "verbose", NULL,
- gettext_noop ("be verbose (print progress information)"),
- 0, &GNUNET_GETOPT_set_one, &verbose},
- GNUNET_GETOPT_OPTION_END
-};
-
-
/**
* Entry point for gnunet-dht-put
*
int
main (int argc, char *const *argv)
{
+
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_STRING ('d',
+ "data",
+ "DATA",
+ gettext_noop ("the data to insert under the key"),
+ &data),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('e',
+ "expiration",
+ "EXPIRATION",
+ gettext_noop ("how long to store this entry in the dht (in seconds)"),
+ &expiration),
+
+ GNUNET_GETOPT_OPTION_STRING ('k',
+ "key",
+ "KEY",
+ gettext_noop ("the query key"),
+ &query_key),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('x',
+ "demultiplex",
+ gettext_noop ("use DHT's demultiplex everywhere option"),
+ &demultixplex_everywhere),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('r',
+ "replication",
+ "LEVEL",
+ gettext_noop ("how many replicas to create"),
+ &replication),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('R',
+ "record",
+ gettext_noop ("use DHT's record route option"),
+ &record_route),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('t',
+ "type",
+ "TYPE",
+ gettext_noop ("the type to insert data as"),
+ &query_type),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('V',
+ "verbose",
+ gettext_noop ("be verbose (print progress information)"),
+ &verbose),
+
+ GNUNET_GETOPT_OPTION_END
+ };
+
+
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return 2;
{
int rc;
- static struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'n', "peers", "COUNT",
- gettext_noop ("number of peers to start"),
- 1, &GNUNET_GETOPT_set_uint, &num_peers},
- {'s', "searches", "COUNT",
- gettext_noop ("maximum number of times we try to search for successor circle formation (0 for R5N)"),
- 1, &GNUNET_GETOPT_set_uint, &max_searches},
- {'H', "hosts", "FILENAME",
- gettext_noop ("name of the file with the login information for the testbed"),
- 1, &GNUNET_GETOPT_set_string, &hosts_file},
- {'D', "delay", "DELAY",
- gettext_noop ("delay between rounds for collecting statistics (default: 30 sec)"),
- 1, &GNUNET_GETOPT_set_relative_time, &delay_stats},
- {'P', "PUT-delay", "DELAY",
- gettext_noop ("delay to start doing PUTs (default: 1 sec)"),
- 1, &GNUNET_GETOPT_set_relative_time, &delay_put},
- {'G', "GET-delay", "DELAY",
- gettext_noop ("delay to start doing GETs (default: 5 min)"),
- 1, &GNUNET_GETOPT_set_relative_time, &delay_get},
- {'r', "replication", "DEGREE",
- gettext_noop ("replication degree for DHT PUTs"),
- 1, &GNUNET_GETOPT_set_uint, &replication},
- {'t', "timeout", "TIMEOUT",
- gettext_noop ("timeout for DHT PUT and GET requests (default: 1 min)"),
- 1, &GNUNET_GETOPT_set_relative_time, &timeout},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_SET_UINT ('n',
+ "peers",
+ "COUNT",
+ gettext_noop ("number of peers to start"),
+ &num_peers),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('s',
+ "searches",
+ "COUNT",
+ gettext_noop ("maximum number of times we try to search for successor circle formation (0 for R5N)"),
+ &max_searches),
+
+ GNUNET_GETOPT_OPTION_STRING ('H',
+ "hosts",
+ "FILENAME",
+ gettext_noop ("name of the file with the login information for the testbed"),
+ &hosts_file),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('D',
+ "delay",
+ "DELAY",
+ gettext_noop ("delay between rounds for collecting statistics (default: 30 sec)"),
+ &delay_stats),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('P',
+ "PUT-delay",
+ "DELAY",
+ gettext_noop ("delay to start doing PUTs (default: 1 sec)"),
+ &delay_put),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('G',
+ "GET-delay",
+ "DELAY",
+ gettext_noop ("delay to start doing GETs (default: 5 min)"),
+ &delay_get),
+ GNUNET_GETOPT_OPTION_SET_UINT ('r',
+ "replication",
+ "DEGREE",
+ gettext_noop ("replication degree for DHT PUTs"),
+ &replication),
+
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t',
+ "timeout",
+ "TIMEOUT",
+ gettext_noop ("timeout for DHT PUT and GET requests (default: 1 min)"),
+ &timeout),
GNUNET_GETOPT_OPTION_END
};
int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
#if HAVE_MHD
- {'a', "advertise", NULL,
- gettext_noop ("advertise our hostlist to other peers"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &advertising},
+ GNUNET_GETOPT_OPTION_SET_ONE ('a',
+ "advertise",
+ gettext_noop ("advertise our hostlist to other peers"),
+ &advertising),
#endif
- {'b', "bootstrap", NULL,
- gettext_noop
- ("bootstrap using hostlists (it is highly recommended that you always use this option)"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &bootstrapping},
- {'e', "enable-learning", NULL,
- gettext_noop ("enable learning about hostlist servers from other peers"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &learning},
+ GNUNET_GETOPT_OPTION_SET_ONE ('b',
+ "bootstrap",
+ gettext_noop ("bootstrap using hostlists (it is highly recommended that you always use this option)"),
+ &bootstrapping),
+ GNUNET_GETOPT_OPTION_SET_ONE ('e',
+ "enable-learning",
+ gettext_noop ("enable learning about hostlist servers from other peers"),
+ &learning),
#if HAVE_MHD
- {'p', "provide-hostlist", NULL,
- gettext_noop ("provide a hostlist server"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &provide_hostlist},
+ GNUNET_GETOPT_OPTION_SET_ONE ('p',
+ "provide-hostlist",
+ gettext_noop ("provide a hostlist server"),
+ &provide_hostlist),
#endif
GNUNET_GETOPT_OPTION_END
};
/**
* Be verbose (configuration option)
*/
-static int verbose;
+static unsigned int verbose;
/**
* Name of the file with the hosts to run the test over (configuration option)
int
main (int argc, char *const *argv)
{
- static struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'C', "connections", "COUNT",
- gettext_noop ("limit to the number of connections to NSE services, 0 for none"),
- 1, &GNUNET_GETOPT_set_uint, &connection_limit},
- {'d', "details", "FILENAME",
- gettext_noop ("name of the file for writing connection information and statistics"),
- 1, &GNUNET_GETOPT_set_string, &data_filename},
- {'H', "hosts", "FILENAME",
- gettext_noop ("name of the file with the login information for the testbed"),
- 1, &GNUNET_GETOPT_set_string, &hosts_file},
- {'o', "output", "FILENAME",
- gettext_noop ("name of the file for writing the main results"),
- 1, &GNUNET_GETOPT_set_string, &output_filename},
- {'p', "peers", "NETWORKSIZESPEC",
- gettext_noop ("Number of peers to run in each round, separated by commas"),
- 1, &GNUNET_GETOPT_set_string, &num_peer_spec},
- {'V', "verbose", NULL,
- gettext_noop ("be verbose (print progress information)"),
- 0, &GNUNET_GETOPT_increment_value, &verbose},
- {'w', "wait", "DELAY",
- gettext_noop ("delay between rounds"),
- 1, &GNUNET_GETOPT_set_relative_time, &wait_time},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_SET_UINT ('C',
+ "connections",
+ "COUNT",
+ gettext_noop ("limit to the number of connections to NSE services, 0 for none"),
+ &connection_limit),
+ GNUNET_GETOPT_OPTION_STRING ('d',
+ "details",
+ "FILENAME",
+ gettext_noop ("name of the file for writing connection information and statistics"),
+ &data_filename),
+
+ GNUNET_GETOPT_OPTION_STRING ('H',
+ "hosts",
+ "FILENAME",
+ gettext_noop ("name of the file with the login information for the testbed"),
+ &hosts_file),
+
+ GNUNET_GETOPT_OPTION_STRING ('o',
+ "output",
+ "FILENAME",
+ gettext_noop ("name of the file for writing the main results"),
+ &output_filename),
+
+
+ GNUNET_GETOPT_OPTION_STRING ('p',
+ "peers",
+ "NETWORKSIZESPEC",
+ gettext_noop ("Number of peers to run in each round, separated by commas"),
+ &num_peer_spec),
+
+ GNUNET_GETOPT_OPTION_INCREMENT_VALUE ('V',
+ "verbose",
+ gettext_noop ("be verbose (print progress information)"),
+ &verbose),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('w',
+ "wait",
+ "DELAY",
+ gettext_noop ("delay between rounds"),
+ &wait_time),
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))