diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 15:28:41 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 15:28:41 +0100 |
commit | 5d6ed5fbda01a324d8d9b800928339d4a90343c3 (patch) | |
tree | b52f65dfc01e42f989df7aa2569ae69695fd9a54 | |
parent | 294393abdca9f482321696e9aaec64b1a0488607 (diff) | |
download | gnunet-5d6ed5fbda01a324d8d9b800928339d4a90343c3.tar.gz gnunet-5d6ed5fbda01a324d8d9b800928339d4a90343c3.zip |
Still porting to new getopt API.
-rw-r--r-- | src/ats-tests/gnunet-solver-eval.c | 29 | ||||
-rw-r--r-- | src/ats-tool/gnunet-ats.c | 84 | ||||
-rw-r--r-- | src/core/gnunet-core.c | 9 | ||||
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo.c | 67 | ||||
-rw-r--r-- | src/rest/gnunet-rest-server.c | 14 | ||||
-rw-r--r-- | src/testbed/generate-underlay-topology.c | 12 | ||||
-rw-r--r-- | src/testbed/gnunet-testbed-profiler.c | 43 | ||||
-rw-r--r-- | src/transport/gnunet-transport-profiler.c | 52 | ||||
-rw-r--r-- | src/transport/gnunet-transport.c | 76 |
9 files changed, 239 insertions, 147 deletions
diff --git a/src/ats-tests/gnunet-solver-eval.c b/src/ats-tests/gnunet-solver-eval.c index c19afe895..1bb7fdee7 100644 --- a/src/ats-tests/gnunet-solver-eval.c +++ b/src/ats-tests/gnunet-solver-eval.c | |||
@@ -931,17 +931,24 @@ main (int argc, char *argv[]) | |||
931 | opt_log = GNUNET_NO; | 931 | opt_log = GNUNET_NO; |
932 | opt_plot = GNUNET_NO; | 932 | opt_plot = GNUNET_NO; |
933 | 933 | ||
934 | static struct GNUNET_GETOPT_CommandLineOption options[] = | 934 | struct GNUNET_GETOPT_CommandLineOption options[] = |
935 | { | 935 | { |
936 | { 's', "solver", NULL, | 936 | GNUNET_GETOPT_OPTION_STRING ('s', |
937 | gettext_noop ("solver to use"), | 937 | "solver", |
938 | 1, &GNUNET_GETOPT_set_string, &opt_solver}, | 938 | NULL, |
939 | { 'e', "experiment", NULL, | 939 | gettext_noop ("solver to use"), |
940 | gettext_noop ("experiment to use"), | 940 | &opt_solver), |
941 | 1, &GNUNET_GETOPT_set_string, &opt_exp_file}, | 941 | |
942 | { 'e', "experiment", NULL, | 942 | GNUNET_GETOPT_OPTION_STRING ('e', |
943 | gettext_noop ("experiment to use"), | 943 | "experiment", |
944 | 1, &GNUNET_GETOPT_set_one, &opt_verbose}, | 944 | NULL, |
945 | gettext_noop ("experiment to use"), | ||
946 | &opt_exp_file), | ||
947 | |||
948 | GNUNET_GETOPT_OPTION_SET_ONE ('e', | ||
949 | "experiment", | ||
950 | gettext_noop ("experiment to use"), | ||
951 | &opt_verbose), | ||
945 | GNUNET_GETOPT_OPTION_END | 952 | GNUNET_GETOPT_OPTION_END |
946 | }; | 953 | }; |
947 | 954 | ||
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c index 5fc1d6e92..f645ba56d 100644 --- a/src/ats-tool/gnunet-ats.c +++ b/src/ats-tool/gnunet-ats.c | |||
@@ -944,34 +944,62 @@ main (int argc, | |||
944 | stat_receive_done = GNUNET_NO; | 944 | stat_receive_done = GNUNET_NO; |
945 | opt_type_str = NULL; | 945 | opt_type_str = NULL; |
946 | 946 | ||
947 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 947 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
948 | { 'u', "used", NULL, | 948 | GNUNET_GETOPT_OPTION_SET_ONE ('u', |
949 | gettext_noop ("get list of active addresses currently used"), 0, | 949 | "used", |
950 | &GNUNET_GETOPT_set_one, &opt_list_used }, | 950 | gettext_noop ("get list of active addresses currently used"), |
951 | { 'a', "all", NULL, gettext_noop ("get list of all active addresses"), 0, | 951 | &opt_list_used), |
952 | &GNUNET_GETOPT_set_one, &opt_list_all }, | 952 | GNUNET_GETOPT_OPTION_SET_ONE ('a', |
953 | { 'C', "connect", "PEER", | 953 | "all", |
954 | gettext_noop ("connect to PEER"), 1, | 954 | gettext_noop ("get list of all active addresses"), |
955 | &GNUNET_GETOPT_set_string, &cpid_str }, | 955 | &opt_list_all), |
956 | { 'n', "numeric", NULL, | 956 | |
957 | gettext_noop ("do not resolve IP addresses to hostnames"), 0, | 957 | GNUNET_GETOPT_OPTION_STRING ('C', |
958 | &GNUNET_GETOPT_set_one, &opt_resolve_addresses_numeric }, | 958 | "connect", |
959 | { 'm', "monitor", NULL, gettext_noop ("monitor mode"), 0, | 959 | NULL, |
960 | &GNUNET_GETOPT_set_one, &opt_monitor }, | 960 | gettext_noop ("connect to PEER"), |
961 | { 'p', "preference", NULL, gettext_noop ("set preference for the given peer"), | 961 | &cpid_str), |
962 | 0, &GNUNET_GETOPT_set_one, &opt_set_pref }, | 962 | GNUNET_GETOPT_OPTION_SET_ONE ('n', |
963 | { 'q', "quotas", NULL, gettext_noop ("print all configured quotas"), 0, | 963 | "numeric", |
964 | &GNUNET_GETOPT_set_one, &opt_print_quotas }, | 964 | gettext_noop ("do not resolve IP addresses to hostnames"), |
965 | { 'i', "id", "TYPE", gettext_noop ("peer id"), 1, &GNUNET_GETOPT_set_string, | 965 | &opt_resolve_addresses_numeric), |
966 | &opt_pid_str }, | 966 | |
967 | { 't', "type", "TYPE", | 967 | GNUNET_GETOPT_OPTION_SET_ONE ('m', |
968 | gettext_noop ("preference type to set: latency | bandwidth"), 1, | 968 | "monitor", |
969 | &GNUNET_GETOPT_set_string, &opt_type_str }, | 969 | gettext_noop ("monitor mode"), |
970 | { 'k', "value", "VALUE", gettext_noop ("preference value"), 1, | 970 | &opt_monitor), |
971 | &GNUNET_GETOPT_set_uint, &opt_pref_value }, | 971 | |
972 | { 'V', "verbose", NULL, | 972 | GNUNET_GETOPT_OPTION_SET_ONE ('p', |
973 | gettext_noop ("verbose output (include ATS address properties)"), 0, | 973 | "preference", |
974 | &GNUNET_GETOPT_set_one, &opt_verbose }, | 974 | gettext_noop ("set preference for the given peer"), |
975 | &opt_set_pref), | ||
976 | |||
977 | GNUNET_GETOPT_OPTION_SET_ONE ('q', | ||
978 | "quotas", | ||
979 | gettext_noop ("print all configured quotas"), | ||
980 | &opt_print_quotas), | ||
981 | GNUNET_GETOPT_OPTION_STRING ('i', | ||
982 | "id", | ||
983 | "TYPE", | ||
984 | gettext_noop ("peer id"), | ||
985 | &opt_pid_str), | ||
986 | |||
987 | GNUNET_GETOPT_OPTION_STRING ('t', | ||
988 | "type", | ||
989 | "TYPE", | ||
990 | gettext_noop ("preference type to set: latency | bandwidth"), | ||
991 | &opt_type_str), | ||
992 | |||
993 | GNUNET_GETOPT_OPTION_SET_UINT ('k', | ||
994 | "value", | ||
995 | "VALUE", | ||
996 | gettext_noop ("preference value"), | ||
997 | &opt_pref_value), | ||
998 | |||
999 | GNUNET_GETOPT_OPTION_SET_ONE ('V', | ||
1000 | "verbose", | ||
1001 | gettext_noop ("verbose output (include ATS address properties)"), | ||
1002 | &opt_verbose), | ||
975 | GNUNET_GETOPT_OPTION_END | 1003 | GNUNET_GETOPT_OPTION_END |
976 | }; | 1004 | }; |
977 | 1005 | ||
diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c index d91dc304d..ed89b1946 100644 --- a/src/core/gnunet-core.c +++ b/src/core/gnunet-core.c | |||
@@ -171,10 +171,11 @@ main (int argc, | |||
171 | char *const *argv) | 171 | char *const *argv) |
172 | { | 172 | { |
173 | int res; | 173 | int res; |
174 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 174 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
175 | {'m', "monitor", NULL, | 175 | GNUNET_GETOPT_OPTION_SET_ONE ('m', |
176 | gettext_noop ("provide information about all current connections (continuously)"), | 176 | "monitor", |
177 | 0, &GNUNET_GETOPT_set_one, &monitor_connections}, | 177 | gettext_noop ("provide information about all current connections (continuously)"), |
178 | &monitor_connections), | ||
178 | GNUNET_GETOPT_OPTION_END | 179 | GNUNET_GETOPT_OPTION_END |
179 | }; | 180 | }; |
180 | 181 | ||
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index a5907c63f..59ffe2efd 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c | |||
@@ -837,31 +837,48 @@ state_machine (void *cls) | |||
837 | int | 837 | int |
838 | main (int argc, char *const *argv) | 838 | main (int argc, char *const *argv) |
839 | { | 839 | { |
840 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 840 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
841 | {'n', "numeric", NULL, | 841 | GNUNET_GETOPT_OPTION_SET_ONE ('n', |
842 | gettext_noop ("don't resolve host names"), | 842 | "numeric", |
843 | 0, &GNUNET_GETOPT_set_one, &no_resolve}, | 843 | gettext_noop ("don't resolve host names"), |
844 | {'q', "quiet", NULL, | 844 | &no_resolve), |
845 | gettext_noop ("output only the identity strings"), | 845 | |
846 | 0, &GNUNET_GETOPT_set_one, &be_quiet}, | 846 | GNUNET_GETOPT_OPTION_SET_ONE ('q', |
847 | {'f', "friends", NULL, | 847 | "quiet", |
848 | gettext_noop ("include friend-only information"), | 848 | gettext_noop ("output only the identity strings"), |
849 | 0, &GNUNET_GETOPT_set_one, &include_friend_only}, | 849 | &be_quiet), |
850 | {'s', "self", NULL, | 850 | GNUNET_GETOPT_OPTION_SET_ONE ('f', |
851 | gettext_noop ("output our own identity only"), | 851 | "friends", |
852 | 0, &GNUNET_GETOPT_set_one, &get_self}, | 852 | gettext_noop ("include friend-only information"), |
853 | {'i', "info", NULL, | 853 | &include_friend_only), |
854 | gettext_noop ("list all known peers"), | 854 | |
855 | 0, &GNUNET_GETOPT_set_one, &get_info}, | 855 | GNUNET_GETOPT_OPTION_SET_ONE ('s', |
856 | {'d', "dump-hello", NULL, | 856 | "self", |
857 | gettext_noop ("dump hello to file"), | 857 | gettext_noop ("output our own identity only"), |
858 | 1, &GNUNET_GETOPT_set_string, &dump_hello}, | 858 | &get_self), |
859 | {'g', "get-hello", NULL, | 859 | |
860 | gettext_noop ("also output HELLO uri(s)"), | 860 | GNUNET_GETOPT_OPTION_SET_ONE ('i', |
861 | 0, &GNUNET_GETOPT_set_one, &get_uri}, | 861 | "info", |
862 | {'p', "put-hello", "HELLO", | 862 | gettext_noop ("list all known peers"), |
863 | gettext_noop ("add given HELLO uri to the database"), | 863 | &get_info), |
864 | 1, &GNUNET_GETOPT_set_string, &put_uri}, | 864 | |
865 | GNUNET_GETOPT_OPTION_STRING ('d', | ||
866 | "dump-hello", | ||
867 | NULL, | ||
868 | gettext_noop ("dump hello to file"), | ||
869 | &dump_hello), | ||
870 | |||
871 | GNUNET_GETOPT_OPTION_SET_ONE ('g', | ||
872 | "get-hello", | ||
873 | gettext_noop ("also output HELLO uri(s)"), | ||
874 | &get_uri), | ||
875 | |||
876 | GNUNET_GETOPT_OPTION_STRING ('p', | ||
877 | "put-hello", | ||
878 | "HELLO", | ||
879 | gettext_noop ("add given HELLO uri to the database"), | ||
880 | &put_uri), | ||
881 | |||
865 | GNUNET_GETOPT_OPTION_END | 882 | GNUNET_GETOPT_OPTION_END |
866 | }; | 883 | }; |
867 | int ret; | 884 | int ret; |
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index b115deb20..0b6c18267 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c | |||
@@ -66,7 +66,7 @@ static struct GNUNET_SCHEDULER_Task *httpd_task; | |||
66 | /** | 66 | /** |
67 | * The port the service is running on (default 7776) | 67 | * The port the service is running on (default 7776) |
68 | */ | 68 | */ |
69 | static unsigned long port = GNUNET_REST_SERVICE_PORT; | 69 | static unsigned long long port = GNUNET_REST_SERVICE_PORT; |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * The listen socket of the service for IPv4 | 72 | * The listen socket of the service for IPv4 |
@@ -748,7 +748,7 @@ run (void *cls, | |||
748 | return; | 748 | return; |
749 | } | 749 | } |
750 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 750 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
751 | "Service listens on port %lu\n", | 751 | "Service listens on port %llu\n", |
752 | port); | 752 | port); |
753 | httpd = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_NO_LISTEN_SOCKET, | 753 | httpd = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_NO_LISTEN_SOCKET, |
754 | 0, | 754 | 0, |
@@ -783,10 +783,12 @@ run (void *cls, | |||
783 | int | 783 | int |
784 | main (int argc, char *const *argv) | 784 | main (int argc, char *const *argv) |
785 | { | 785 | { |
786 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 786 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
787 | {'p', "port", NULL, | 787 | GNUNET_GETOPT_OPTION_SET_ULONG ('p', |
788 | gettext_noop ("listen on specified port (default: 7776)"), 1, | 788 | "port", |
789 | &GNUNET_GETOPT_set_ulong, &port}, | 789 | "PORT", |
790 | gettext_noop ("listen on specified port (default: 7776)"), | ||
791 | &port), | ||
790 | GNUNET_GETOPT_OPTION_END | 792 | GNUNET_GETOPT_OPTION_END |
791 | }; | 793 | }; |
792 | static const char* err_page = | 794 | static const char* err_page = |
diff --git a/src/testbed/generate-underlay-topology.c b/src/testbed/generate-underlay-topology.c index 36580a2a3..ab7d81c8b 100644 --- a/src/testbed/generate-underlay-topology.c +++ b/src/testbed/generate-underlay-topology.c | |||
@@ -70,7 +70,7 @@ enum GNUNET_TESTBED_TopologyOption topology; | |||
70 | /** | 70 | /** |
71 | * The number of peers to include in the topology | 71 | * The number of peers to include in the topology |
72 | */ | 72 | */ |
73 | static int num_peers; | 73 | static unsigned int num_peers; |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * program result | 76 | * program result |
@@ -335,11 +335,15 @@ int | |||
335 | main (int argc, char *const argv[]) | 335 | main (int argc, char *const argv[]) |
336 | { | 336 | { |
337 | struct GNUNET_GETOPT_CommandLineOption option[] = { | 337 | struct GNUNET_GETOPT_CommandLineOption option[] = { |
338 | {'p', "num-peers", "COUNT", | 338 | |
339 | gettext_noop ("create COUNT number of peers"), | 339 | GNUNET_GETOPT_OPTION_SET_UINT ('p', |
340 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_peers}, | 340 | "num-peers", |
341 | "COUNT", | ||
342 | gettext_noop ("create COUNT number of peers"), | ||
343 | &num_peers), | ||
341 | GNUNET_GETOPT_OPTION_END | 344 | GNUNET_GETOPT_OPTION_END |
342 | }; | 345 | }; |
346 | |||
343 | int ret; | 347 | int ret; |
344 | 348 | ||
345 | exit_result = GNUNET_SYSERR; | 349 | exit_result = GNUNET_SYSERR; |
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index 9468b3c91..29f77193d 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c | |||
@@ -276,23 +276,34 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
276 | int | 276 | int |
277 | main (int argc, char *const *argv) | 277 | main (int argc, char *const *argv) |
278 | { | 278 | { |
279 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 279 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
280 | {'p', "num-peers", "COUNT", | 280 | |
281 | gettext_noop ("create COUNT number of peers"), | 281 | GNUNET_GETOPT_OPTION_SET_UINT ('p', |
282 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_peers}, | 282 | "num-peers", |
283 | {'e', "num-errors", "COUNT", | 283 | "COUNT", |
284 | gettext_noop ("tolerate COUNT number of continious timeout failures"), | 284 | gettext_noop ("create COUNT number of peers"), |
285 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails}, | 285 | &num_peers), |
286 | {'n', "non-interactive", NULL, | 286 | |
287 | gettext_noop ("run profiler in non-interactive mode where upon " | 287 | GNUNET_GETOPT_OPTION_SET_UINT ('e', |
288 | "testbed setup the profiler does not wait for a " | 288 | "num-errors", |
289 | "keystroke but continues to run until a termination " | 289 | "COUNT", |
290 | "signal is received"), | 290 | gettext_noop ("tolerate COUNT number of continious timeout failures"), |
291 | GNUNET_NO, &GNUNET_GETOPT_set_one, &noninteractive}, | 291 | &num_cont_fails), |
292 | |||
293 | GNUNET_GETOPT_OPTION_SET_ONE ('n', | ||
294 | "non-interactive", | ||
295 | gettext_noop ("run profiler in non-interactive mode where upon " | ||
296 | "testbed setup the profiler does not wait for a " | ||
297 | "keystroke but continues to run until a termination " | ||
298 | "signal is received"), | ||
299 | &noninteractive), | ||
300 | |||
292 | #if !ENABLE_SUPERMUC | 301 | #if !ENABLE_SUPERMUC |
293 | {'H', "hosts", "FILENAME", | 302 | GNUNET_GETOPT_OPTION_STRING ('H', |
294 | gettext_noop ("name of the file with the login information for the testbed"), | 303 | "hosts", |
295 | GNUNET_YES, &GNUNET_GETOPT_set_string, &hosts_file}, | 304 | "FILENAME", |
305 | gettext_noop ("name of the file with the login information for the testbed"), | ||
306 | &hosts_file), | ||
296 | #endif | 307 | #endif |
297 | GNUNET_GETOPT_OPTION_END | 308 | GNUNET_GETOPT_OPTION_END |
298 | }; | 309 | }; |
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 | */ |
154 | static int verbosity; | 154 | static 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 | */ |
298 | static int verbosity; | 298 | static 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 | }; |