diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 11:40:24 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 11:40:47 +0100 |
commit | 796d0e5aa54ed99dd00fae26982a0e99f9d99f8e (patch) | |
tree | 45b58e703374b2227ab606b2758467c3c4fa79c4 /src/testing | |
parent | f51f3438fa3451ee758152e53fe823780fb1e261 (diff) | |
download | gnunet-796d0e5aa54ed99dd00fae26982a0e99f9d99f8e.tar.gz gnunet-796d0e5aa54ed99dd00fae26982a0e99f9d99f8e.zip |
Porting 'nat'.
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/gnunet-testing.c | 40 | ||||
-rw-r--r-- | src/testing/list-keys.c | 15 |
2 files changed, 34 insertions, 21 deletions
diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c index 07f1560cb..686b38192 100644 --- a/src/testing/gnunet-testing.c +++ b/src/testing/gnunet-testing.c | |||
@@ -348,17 +348,35 @@ run_no_scheduler (void *cls, char *const *args, const char *cfgfile, | |||
348 | int | 348 | int |
349 | main (int argc, char *const *argv) | 349 | main (int argc, char *const *argv) |
350 | { | 350 | { |
351 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 351 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
352 | {'C', "cfg", NULL, gettext_noop ("create unique configuration files"), | 352 | GNUNET_GETOPT_OPTION_SET_ONE ('C', |
353 | GNUNET_NO, &GNUNET_GETOPT_set_one, &create_cfg}, | 353 | "cfg", |
354 | {'k', "key", "FILENAME", gettext_noop ("extract hostkey file from pre-computed hostkey list"), | 354 | gettext_noop ("create unique configuration files"), |
355 | GNUNET_YES, &GNUNET_GETOPT_set_string, &create_hostkey}, | 355 | &create_cfg), |
356 | {'n', "number", "NUMBER", gettext_noop ("number of unique configuration files to create, or number of the hostkey to extract"), | 356 | GNUNET_GETOPT_OPTION_STRING ('k', |
357 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &create_no}, | 357 | "key", |
358 | {'t', "template", "FILENAME", gettext_noop ("configuration template"), | 358 | "FILENAME", |
359 | GNUNET_YES, &GNUNET_GETOPT_set_string, &create_cfg_template}, | 359 | gettext_noop ("extract hostkey file from pre-computed hostkey list"), |
360 | {'r', "run", "SERVICE", gettext_noop ("run the given service, wait on stdin for 'r' (restart) or 'q' (quit)"), | 360 | &create_hostkey), |
361 | GNUNET_YES, &GNUNET_GETOPT_set_string, &run_service_name}, | 361 | |
362 | GNUNET_GETOPT_OPTION_SET_UINT ('n', | ||
363 | "number", | ||
364 | "NUMBER", | ||
365 | gettext_noop ("number of unique configuration files to create, or number of the hostkey to extract"), | ||
366 | &create_no), | ||
367 | |||
368 | |||
369 | GNUNET_GETOPT_OPTION_STRING ('t', | ||
370 | "template", | ||
371 | "FILENAME", | ||
372 | gettext_noop ("configuration template"), | ||
373 | &create_cfg_template), | ||
374 | |||
375 | GNUNET_GETOPT_OPTION_STRING ('r', | ||
376 | "run", | ||
377 | "SERVICE", | ||
378 | gettext_noop ("run the given service, wait on stdin for 'r' (restart) or 'q' (quit)"), | ||
379 | &run_service_name), | ||
362 | GNUNET_GETOPT_OPTION_END | 380 | GNUNET_GETOPT_OPTION_END |
363 | }; | 381 | }; |
364 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 382 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
diff --git a/src/testing/list-keys.c b/src/testing/list-keys.c index 1fd46ebf2..cfb49460a 100644 --- a/src/testing/list-keys.c +++ b/src/testing/list-keys.c | |||
@@ -6,10 +6,6 @@ static unsigned int nkeys; | |||
6 | static unsigned int nskip; | 6 | static unsigned int nskip; |
7 | static int result; | 7 | static int result; |
8 | 8 | ||
9 | |||
10 | |||
11 | |||
12 | |||
13 | /** | 9 | /** |
14 | * Main run function. | 10 | * Main run function. |
15 | * | 11 | * |
@@ -87,12 +83,11 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
87 | int main (int argc, char *argv[]) | 83 | int main (int argc, char *argv[]) |
88 | { | 84 | { |
89 | struct GNUNET_GETOPT_CommandLineOption option[] = { | 85 | struct GNUNET_GETOPT_CommandLineOption option[] = { |
90 | {'n', "num-keys", "COUNT", | 86 | GNUNET_GETOPT_OPTION_SET_UINT ('n', |
91 | gettext_noop ("list COUNT number of keys"), | 87 | "num-keys", |
92 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &nkeys}, | 88 | "COUNT", |
93 | {'s', "skip", "COUNT", | 89 | gettext_noop ("list COUNT number of keys"), |
94 | gettext_noop ("skip COUNT number of keys in the beginning"), | 90 | &nkeys), |
95 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &nskip}, | ||
96 | GNUNET_GETOPT_OPTION_END | 91 | GNUNET_GETOPT_OPTION_END |
97 | }; | 92 | }; |
98 | int ret; | 93 | int ret; |