aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-transport-profiler.c52
-rw-r--r--src/transport/gnunet-transport.c76
2 files changed, 75 insertions, 53 deletions
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c
index dceff7e3b..bd4d3072b 100644
--- a/src/transport/gnunet-transport-profiler.c
+++ b/src/transport/gnunet-transport-profiler.c
@@ -151,7 +151,7 @@ static struct GNUNET_PeerIdentity pid;
151/** 151/**
152 * Selected level of verbosity. 152 * Selected level of verbosity.
153 */ 153 */
154static int verbosity; 154static unsigned int verbosity;
155 155
156 156
157/** 157/**
@@ -610,26 +610,36 @@ main (int argc, char * const *argv)
610 benchmark_iterations = DEFAULT_ITERATION_COUNT; 610 benchmark_iterations = DEFAULT_ITERATION_COUNT;
611 benchmark_running = GNUNET_NO; 611 benchmark_running = GNUNET_NO;
612 612
613 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 613 struct GNUNET_GETOPT_CommandLineOption options[] = {
614 614
615 { 's', "send", NULL, 615 GNUNET_GETOPT_OPTION_SET_ONE ('s',
616 gettext_noop ("send data to peer"), 616 "send",
617 0, &GNUNET_GETOPT_set_one, &benchmark_send}, 617 gettext_noop ("send data to peer"),
618 { 'r', "receive", NULL, gettext_noop 618 &benchmark_send),
619 ("receive data from peer"), 0, 619 GNUNET_GETOPT_OPTION_SET_ONE ('r',
620 &GNUNET_GETOPT_set_one, &benchmark_receive}, 620 "receive",
621 { 'i', "iterations", NULL, gettext_noop 621 gettext_noop ("receive data from peer"),
622 ("iterations"), 1, 622 &benchmark_receive),
623 &GNUNET_GETOPT_set_uint, &benchmark_iterations}, 623 GNUNET_GETOPT_OPTION_SET_UINT ('i',
624 { 'n', "number", NULL, gettext_noop 624 "iterations",
625 ("number of messages to send"), 1, 625 NULL,
626 &GNUNET_GETOPT_set_uint, &benchmark_count}, 626 gettext_noop ("iterations"),
627 { 'm', "messagesize", NULL, gettext_noop 627 &benchmark_iterations),
628 ("message size to use"), 1, 628 GNUNET_GETOPT_OPTION_SET_UINT ('n',
629 &GNUNET_GETOPT_set_uint, &benchmark_size}, 629 "number",
630 { 'p', "peer", "PEER", 630 NULL,
631 gettext_noop ("peer identity"), 1, &GNUNET_GETOPT_set_string, 631 gettext_noop ("number of messages to send"),
632 &cpid }, 632 &benchmark_count),
633 GNUNET_GETOPT_OPTION_SET_UINT ('m',
634 "messagesize",
635 NULL,
636 gettext_noop ("message size to use"),
637 &benchmark_size),
638 GNUNET_GETOPT_OPTION_STRING ('p',
639 "peer",
640 "PEER",
641 gettext_noop ("peer identity"),
642 &cpid),
633 GNUNET_GETOPT_OPTION_VERBOSE (&verbosity), 643 GNUNET_GETOPT_OPTION_VERBOSE (&verbosity),
634 GNUNET_GETOPT_OPTION_END 644 GNUNET_GETOPT_OPTION_END
635 }; 645 };
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index fcfc94ac8..c0442950d 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -295,7 +295,7 @@ static struct GNUNET_SCHEDULER_Task *op_timeout;
295/** 295/**
296 * Selected level of verbosity. 296 * Selected level of verbosity.
297 */ 297 */
298static int verbosity; 298static unsigned int verbosity;
299 299
300/** 300/**
301 * Resolver process handle. 301 * Resolver process handle.
@@ -1439,37 +1439,49 @@ main (int argc,
1439 char * const *argv) 1439 char * const *argv)
1440{ 1440{
1441 int res; 1441 int res;
1442 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 1442 struct GNUNET_GETOPT_CommandLineOption options[] = {
1443 { 'a', "all", NULL, 1443 GNUNET_GETOPT_OPTION_SET_ONE ('a',
1444 gettext_noop ("print information for all peers (instead of only connected peers)"), 1444 "all",
1445 0, &GNUNET_GETOPT_set_one, &iterate_all }, 1445 gettext_noop ("print information for all peers (instead of only connected peers)"),
1446 { 'b', "benchmark", NULL, 1446 &iterate_all),
1447 gettext_noop ("measure how fast we are receiving data from all peers (until CTRL-C)"), 1447 GNUNET_GETOPT_OPTION_SET_ONE ('b',
1448 0, &GNUNET_GETOPT_set_one, &benchmark_receive }, 1448 "benchmark",
1449 { 'D', "disconnect", 1449 gettext_noop ("measure how fast we are receiving data from all peers (until CTRL-C)"),
1450 NULL, gettext_noop ("disconnect from a peer"), 0, 1450 &benchmark_receive),
1451 &GNUNET_GETOPT_set_one, &do_disconnect }, 1451 GNUNET_GETOPT_OPTION_SET_ONE ('D',
1452 { 'i', "information", NULL, 1452 "disconnect",
1453 gettext_noop ("provide information about all current connections (once)"), 1453 gettext_noop ("disconnect from a peer"),
1454 0, &GNUNET_GETOPT_set_one, &iterate_connections }, 1454 &do_disconnect),
1455 { 'm', "monitor", NULL, 1455 GNUNET_GETOPT_OPTION_SET_ONE ('i',
1456 gettext_noop ("provide information about all current connections (continuously)"), 1456 "information",
1457 0, &GNUNET_GETOPT_set_one, &monitor_connections }, 1457 gettext_noop ("provide information about all current connections (once)"),
1458 { 'e', "events", NULL, 1458 &iterate_connections),
1459 gettext_noop ("provide information about all connects and disconnect events (continuously)"), 1459 GNUNET_GETOPT_OPTION_SET_ONE ('m',
1460 0, &GNUNET_GETOPT_set_one, &monitor_connects }, 1460 "monitor",
1461 { 'n', "numeric", 1461 gettext_noop ("provide information about all current connections (continuously)"),
1462 NULL, gettext_noop ("do not resolve hostnames"), 0, 1462 &monitor_connections),
1463 &GNUNET_GETOPT_set_one, &numeric }, 1463 GNUNET_GETOPT_OPTION_SET_ONE ('e',
1464 { 'p', "peer", "PEER", 1464 "events",
1465 gettext_noop ("peer identity"), 1, &GNUNET_GETOPT_set_string, 1465 gettext_noop ("provide information about all connects and disconnect events (continuously)"),
1466 &cpid }, 1466 &monitor_connects),
1467 { 'P', "plugins", NULL, 1467 GNUNET_GETOPT_OPTION_SET_ONE ('n',
1468 gettext_noop ("monitor plugin sessions"), 0, &GNUNET_GETOPT_set_one, 1468 "numeric",
1469 &monitor_plugins }, 1469 gettext_noop ("do not resolve hostnames"),
1470 { 's', "send", NULL, gettext_noop 1470 &numeric),
1471 ("send data for benchmarking to the other peer (until CTRL-C)"), 0, 1471 GNUNET_GETOPT_OPTION_STRING ('p',
1472 &GNUNET_GETOPT_set_one, &benchmark_send }, 1472 "peer",
1473 "PEER",
1474 gettext_noop ("peer identity"),
1475 &cpid),
1476 GNUNET_GETOPT_OPTION_SET_ONE ('P',
1477 "plugins",
1478 gettext_noop ("monitor plugin sessions"),
1479 &monitor_plugins),
1480 GNUNET_GETOPT_OPTION_SET_ONE ('s',
1481 "send",
1482 gettext_noop
1483 ("send data for benchmarking to the other peer (until CTRL-C)"),
1484 &benchmark_send),
1473 GNUNET_GETOPT_OPTION_VERBOSE (&verbosity), 1485 GNUNET_GETOPT_OPTION_VERBOSE (&verbosity),
1474 GNUNET_GETOPT_OPTION_END 1486 GNUNET_GETOPT_OPTION_END
1475 }; 1487 };