int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- { 's', "sourcecfg", "FILENAME",
- gettext_noop ("specifies the configuration to use to access an alternative datastore; will merge that datastore into our current datastore"),
- 1, &GNUNET_GETOPT_set_filename, &alternative_cfg },
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_FILENAME ('s',
+ "sourcecfg",
+ "FILENAME",
+ gettext_noop ("specifies the configuration to use to access an alternative datastore; will merge that datastore into our current datastore"),
+ &alternative_cfg),
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
/**
* Should we actually bind to #bind_addr and receive and process STUN requests?
*/
-static unsigned int do_stun;
+static int do_stun;
/**
* Handle to NAT operation.
main (int argc,
char *const argv[])
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'i', "in", "ADDRESS",
- gettext_noop ("which IP and port are we locally using to bind/listen to"),
- GNUNET_YES, &GNUNET_GETOPT_set_string, &local_addr },
- {'r', "remote", "ADDRESS",
- gettext_noop ("which remote IP and port should be asked for connection reversal"),
- GNUNET_YES, &GNUNET_GETOPT_set_string, &remote_addr },
- {'S', "section", NULL,
- gettext_noop ("name of configuration section to find additional options, such as manual host punching data"),
- GNUNET_YES, &GNUNET_GETOPT_set_string, §ion_name },
- {'s', "stun", NULL,
- gettext_noop ("enable STUN processing"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &do_stun },
- {'t', "tcp", NULL,
- gettext_noop ("use TCP"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &use_tcp },
- {'u', "udp", NULL,
- gettext_noop ("use UDP"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &use_udp },
- {'W', "watch", NULL,
- gettext_noop ("watch for connection reversal requests"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &listen_reversal },
- GNUNET_GETOPT_OPTION_END
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_STRING ('i',
+ "in",
+ "ADDRESS",
+ gettext_noop ("which IP and port are we locally using to bind/listen to"),
+ &local_addr),
+
+ GNUNET_GETOPT_OPTION_STRING ('r',
+ "remote",
+ "ADDRESS",
+ gettext_noop ("which remote IP and port should be asked for connection reversal"),
+ &remote_addr),
+
+ GNUNET_GETOPT_OPTION_STRING ('S',
+ "section",
+ NULL,
+ gettext_noop ("name of configuration section to find additional options, such as manual host punching data"),
+ §ion_name),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('s',
+ "stun",
+ gettext_noop ("enable STUN processing"),
+ &do_stun),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('t',
+ "tcp",
+ gettext_noop ("use TCP"),
+ &use_tcp),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('u',
+ "udp",
+ gettext_noop ("use UDP"),
+ &use_udp),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('W',
+ "watch",
+ gettext_noop ("watch for connection reversal requests"),
+ &listen_reversal),
+ GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK !=
int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'C', "cfg", NULL, gettext_noop ("create unique configuration files"),
- GNUNET_NO, &GNUNET_GETOPT_set_one, &create_cfg},
- {'k', "key", "FILENAME", gettext_noop ("extract hostkey file from pre-computed hostkey list"),
- GNUNET_YES, &GNUNET_GETOPT_set_string, &create_hostkey},
- {'n', "number", "NUMBER", gettext_noop ("number of unique configuration files to create, or number of the hostkey to extract"),
- GNUNET_YES, &GNUNET_GETOPT_set_uint, &create_no},
- {'t', "template", "FILENAME", gettext_noop ("configuration template"),
- GNUNET_YES, &GNUNET_GETOPT_set_string, &create_cfg_template},
- {'r', "run", "SERVICE", gettext_noop ("run the given service, wait on stdin for 'r' (restart) or 'q' (quit)"),
- GNUNET_YES, &GNUNET_GETOPT_set_string, &run_service_name},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_SET_ONE ('C',
+ "cfg",
+ gettext_noop ("create unique configuration files"),
+ &create_cfg),
+ GNUNET_GETOPT_OPTION_STRING ('k',
+ "key",
+ "FILENAME",
+ gettext_noop ("extract hostkey file from pre-computed hostkey list"),
+ &create_hostkey),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('n',
+ "number",
+ "NUMBER",
+ gettext_noop ("number of unique configuration files to create, or number of the hostkey to extract"),
+ &create_no),
+
+
+ GNUNET_GETOPT_OPTION_STRING ('t',
+ "template",
+ "FILENAME",
+ gettext_noop ("configuration template"),
+ &create_cfg_template),
+
+ GNUNET_GETOPT_OPTION_STRING ('r',
+ "run",
+ "SERVICE",
+ gettext_noop ("run the given service, wait on stdin for 'r' (restart) or 'q' (quit)"),
+ &run_service_name),
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
static unsigned int nskip;
static int result;
-
-
-
-
/**
* Main run function.
*
int main (int argc, char *argv[])
{
struct GNUNET_GETOPT_CommandLineOption option[] = {
- {'n', "num-keys", "COUNT",
- gettext_noop ("list COUNT number of keys"),
- GNUNET_YES, &GNUNET_GETOPT_set_uint, &nkeys},
- {'s', "skip", "COUNT",
- gettext_noop ("skip COUNT number of keys in the beginning"),
- GNUNET_YES, &GNUNET_GETOPT_set_uint, &nskip},
+ GNUNET_GETOPT_OPTION_SET_UINT ('n',
+ "num-keys",
+ "COUNT",
+ gettext_noop ("list COUNT number of keys"),
+ &nkeys),
GNUNET_GETOPT_OPTION_END
};
int ret;