diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 21:03:50 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 21:03:50 +0100 |
commit | fef8c5c79d628ac0823fdae238fd0b70a1f1eb94 (patch) | |
tree | 4e05a8fc5f3254fbe2b3325a7c6f6f61f892b66a /src/set/gnunet-set-profiler.c | |
parent | e6b3fec9e4a573e1f0c594a3c2f345357c0c12b8 (diff) | |
download | gnunet-fef8c5c79d628ac0823fdae238fd0b70a1f1eb94.tar.gz gnunet-fef8c5c79d628ac0823fdae238fd0b70a1f1eb94.zip |
porting.
Diffstat (limited to 'src/set/gnunet-set-profiler.c')
-rw-r--r-- | src/set/gnunet-set-profiler.c | 86 |
1 files changed, 56 insertions, 30 deletions
diff --git a/src/set/gnunet-set-profiler.c b/src/set/gnunet-set-profiler.c index 8404b191c..349bce6ea 100644 --- a/src/set/gnunet-set-profiler.c +++ b/src/set/gnunet-set-profiler.c | |||
@@ -59,8 +59,8 @@ static struct GNUNET_PeerIdentity local_peer; | |||
59 | static struct GNUNET_SET_ListenHandle *set_listener; | 59 | static struct GNUNET_SET_ListenHandle *set_listener; |
60 | 60 | ||
61 | static int byzantine; | 61 | static int byzantine; |
62 | static int force_delta; | 62 | static unsigned int force_delta; |
63 | static int force_full; | 63 | static unsigned int force_full; |
64 | static unsigned int element_size = 32; | 64 | static unsigned int element_size = 32; |
65 | 65 | ||
66 | /** | 66 | /** |
@@ -426,34 +426,60 @@ pre_run (void *cls, char *const *args, const char *cfgfile, | |||
426 | int | 426 | int |
427 | main (int argc, char **argv) | 427 | main (int argc, char **argv) |
428 | { | 428 | { |
429 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 429 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
430 | { 'A', "num-first", NULL, | 430 | GNUNET_GETOPT_OPTION_SET_UINT ('A', |
431 | gettext_noop ("number of values"), | 431 | "num-first", |
432 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_a }, | 432 | NULL, |
433 | { 'B', "num-second", NULL, | 433 | gettext_noop ("number of values"), |
434 | gettext_noop ("number of values"), | 434 | &num_a), |
435 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_b }, | 435 | |
436 | { 'b', "byzantine", NULL, | 436 | GNUNET_GETOPT_OPTION_SET_UINT ('B', |
437 | gettext_noop ("use byzantine mode"), | 437 | "num-second", |
438 | GNUNET_NO, &GNUNET_GETOPT_set_one, &byzantine }, | 438 | NULL, |
439 | { 'f', "force-full", NULL, | 439 | gettext_noop ("number of values"), |
440 | gettext_noop ("force sending full set"), | 440 | &num_b), |
441 | GNUNET_NO, &GNUNET_GETOPT_set_uint, &force_full }, | 441 | |
442 | { 'd', "force-delta", NULL, | 442 | GNUNET_GETOPT_OPTION_SET_ONE ('b', |
443 | gettext_noop ("number delta operation"), | 443 | "byzantine", |
444 | GNUNET_NO, &GNUNET_GETOPT_set_uint, &force_delta }, | 444 | gettext_noop ("use byzantine mode"), |
445 | { 'C', "num-common", NULL, | 445 | &byzantine), |
446 | gettext_noop ("number of values"), | 446 | |
447 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_c }, | 447 | GNUNET_GETOPT_OPTION_SET_UINT ('f', |
448 | { 'x', "operation", NULL, | 448 | "force-full", |
449 | gettext_noop ("operation to execute"), | 449 | NULL, |
450 | GNUNET_YES, &GNUNET_GETOPT_set_string, &op_str }, | 450 | gettext_noop ("force sending full set"), |
451 | { 'w', "element-size", NULL, | 451 | &force_full), |
452 | gettext_noop ("element size"), | 452 | |
453 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &element_size }, | 453 | GNUNET_GETOPT_OPTION_SET_UINT ('d', |
454 | { 's', "statistics", NULL, | 454 | "force-delta", |
455 | gettext_noop ("write statistics to file"), | 455 | NULL, |
456 | GNUNET_YES, &GNUNET_GETOPT_set_filename, &statistics_filename }, | 456 | gettext_noop ("number delta operation"), |
457 | &force_delta), | ||
458 | |||
459 | GNUNET_GETOPT_OPTION_SET_UINT ('C', | ||
460 | "num-common", | ||
461 | NULL, | ||
462 | gettext_noop ("number of values"), | ||
463 | &num_c), | ||
464 | |||
465 | GNUNET_GETOPT_OPTION_STRING ('x', | ||
466 | "operation", | ||
467 | NULL, | ||
468 | gettext_noop ("operation to execute"), | ||
469 | &op_str), | ||
470 | |||
471 | GNUNET_GETOPT_OPTION_SET_UINT ('w', | ||
472 | "element-size", | ||
473 | NULL, | ||
474 | gettext_noop ("element size"), | ||
475 | &element_size), | ||
476 | |||
477 | GNUNET_GETOPT_OPTION_FILENAME ('s', | ||
478 | "statistics", | ||
479 | "FILENAME", | ||
480 | gettext_noop ("write statistics to file"), | ||
481 | &statistics_filename), | ||
482 | |||
457 | GNUNET_GETOPT_OPTION_END | 483 | GNUNET_GETOPT_OPTION_END |
458 | }; | 484 | }; |
459 | GNUNET_PROGRAM_run2 (argc, argv, "gnunet-set-profiler", | 485 | GNUNET_PROGRAM_run2 (argc, argv, "gnunet-set-profiler", |