summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-transport-profiler.c
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-15 15:28:41 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-15 15:28:41 +0100
commit5d6ed5fbda01a324d8d9b800928339d4a90343c3 (patch)
treeb52f65dfc01e42f989df7aa2569ae69695fd9a54 /src/transport/gnunet-transport-profiler.c
parent294393abdca9f482321696e9aaec64b1a0488607 (diff)
Still porting to new getopt API.
Diffstat (limited to 'src/transport/gnunet-transport-profiler.c')
-rw-r--r--src/transport/gnunet-transport-profiler.c52
1 files changed, 31 insertions, 21 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;
/**
* Selected level of verbosity.
*/
-static int verbosity;
+static unsigned int verbosity;
/**
@@ -610,26 +610,36 @@ main (int argc, char * const *argv)
benchmark_iterations = DEFAULT_ITERATION_COUNT;
benchmark_running = GNUNET_NO;
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
-
- { 's', "send", NULL,
- gettext_noop ("send data to peer"),
- 0, &GNUNET_GETOPT_set_one, &benchmark_send},
- { 'r', "receive", NULL, gettext_noop
- ("receive data from peer"), 0,
- &GNUNET_GETOPT_set_one, &benchmark_receive},
- { 'i', "iterations", NULL, gettext_noop
- ("iterations"), 1,
- &GNUNET_GETOPT_set_uint, &benchmark_iterations},
- { 'n', "number", NULL, gettext_noop
- ("number of messages to send"), 1,
- &GNUNET_GETOPT_set_uint, &benchmark_count},
- { 'm', "messagesize", NULL, gettext_noop
- ("message size to use"), 1,
- &GNUNET_GETOPT_set_uint, &benchmark_size},
- { 'p', "peer", "PEER",
- gettext_noop ("peer identity"), 1, &GNUNET_GETOPT_set_string,
- &cpid },
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('s',
+ "send",
+ gettext_noop ("send data to peer"),
+ &benchmark_send),
+ GNUNET_GETOPT_OPTION_SET_ONE ('r',
+ "receive",
+ gettext_noop ("receive data from peer"),
+ &benchmark_receive),
+ GNUNET_GETOPT_OPTION_SET_UINT ('i',
+ "iterations",
+ NULL,
+ gettext_noop ("iterations"),
+ &benchmark_iterations),
+ GNUNET_GETOPT_OPTION_SET_UINT ('n',
+ "number",
+ NULL,
+ gettext_noop ("number of messages to send"),
+ &benchmark_count),
+ GNUNET_GETOPT_OPTION_SET_UINT ('m',
+ "messagesize",
+ NULL,
+ gettext_noop ("message size to use"),
+ &benchmark_size),
+ GNUNET_GETOPT_OPTION_STRING ('p',
+ "peer",
+ "PEER",
+ gettext_noop ("peer identity"),
+ &cpid),
GNUNET_GETOPT_OPTION_VERBOSE (&verbosity),
GNUNET_GETOPT_OPTION_END
};