2 This file is part of GNUnet.
3 (C) 2011 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file src/transport/gnunet-transport.c
23 * @brief Tool to help configure, measure and control the transport subsystem.
24 * @author Christian Grothoff
25 * @author Nathan Evans
27 * This utility can be used to test if a transport mechanism for
28 * GNUnet is properly configured.
32 #include "gnunet_util_lib.h"
33 #include "gnunet_resolver_service.h"
34 #include "gnunet_protocols.h"
35 #include "gnunet_transport_service.h"
36 #include "gnunet_nat_lib.h"
39 * How long do we wait for the NAT test to report success?
40 * Should match NAT_SERVER_TIMEOUT in 'nat_test.c'.
42 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
43 #define RESOLUTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
44 #define OP_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
47 * Benchmarking block size in KB
53 * Which peer should we connect to?
58 * Handle to transport service.
60 static struct GNUNET_TRANSPORT_Handle *handle;
63 * Configuration handle
65 static struct GNUNET_CONFIGURATION_Handle *cfg;
70 struct GNUNET_TRANSPORT_TryConnectHandle * tc_handle;
75 static int benchmark_send;
80 static int benchmark_receive;
85 static int benchmark_receive;
90 static int iterate_connections;
95 static int test_configuration;
100 static int monitor_connects;
105 static int monitor_connections;
110 static int try_connect;
118 * Global return value (0 success).
123 * Current number of connections in monitor mode
125 static int monitor_connect_counter;
128 * Number of bytes of traffic we received so far.
130 static unsigned long long traffic_received;
133 * Number of bytes of traffic we sent so far.
135 static unsigned long long traffic_sent;
138 * Starting time of transmitting/receiving data.
140 static struct GNUNET_TIME_Absolute start_time;
143 * Handle for current transmission request.
145 static struct GNUNET_TRANSPORT_TransmitHandle *th;
150 struct GNUNET_TRANSPORT_PeerIterateContext *pic;
153 * Identity of the peer we transmit to / connect to.
154 * (equivalent to 'cpid' string).
156 static struct GNUNET_PeerIdentity pid;
159 * Task scheduled for cleanup / termination of the process.
161 static GNUNET_SCHEDULER_TaskIdentifier end;
164 * Task for operation timeout
166 static GNUNET_SCHEDULER_TaskIdentifier op_timeout;
170 * Selected level of verbosity.
172 static int verbosity;
175 * Resolver process handle.
177 struct GNUNET_OS_Process *resolver;
180 * Number of tasks running that still need the resolver.
182 static unsigned int resolver_users;
185 * Number of address resolutions pending
187 static unsigned int address_resolutions;
190 * Address resolutions pending in progress
192 static unsigned int address_resolution_in_progress;
195 * Context for a plugin test.
201 * Handle to the active NAT test.
203 struct GNUNET_NAT_Test *tst;
206 * Task identifier for the timeout.
208 GNUNET_SCHEDULER_TaskIdentifier tsk;
211 * Name of plugin under test.
219 * Task run in monitor mode when the user presses CTRL-C to abort.
220 * Stops monitoring activity.
222 * @param cls the 'struct GNUNET_TRANSPORT_PeerIterateContext *'
223 * @param tc scheduler context
226 shutdown_task (void *cls,
227 const struct GNUNET_SCHEDULER_TaskContext *tc)
229 struct GNUNET_TIME_Relative duration;
230 end = GNUNET_SCHEDULER_NO_TASK;
231 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
233 GNUNET_SCHEDULER_cancel (op_timeout);
234 op_timeout = GNUNET_SCHEDULER_NO_TASK;
236 if (NULL != tc_handle)
238 GNUNET_TRANSPORT_try_connect_cancel (tc_handle);
243 GNUNET_TRANSPORT_peer_get_active_addresses_cancel (pic);
248 GNUNET_TRANSPORT_notify_transmit_ready_cancel(th);
253 GNUNET_TRANSPORT_disconnect(handle);
258 duration = GNUNET_TIME_absolute_get_duration (start_time);
259 FPRINTF (stdout, _("Transmitted %llu bytes/s (%llu bytes in %s)\n"),
260 1000LL * 1000LL * traffic_sent / (1 + duration.rel_value_us), traffic_sent,
261 GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
263 if (benchmark_receive)
265 duration = GNUNET_TIME_absolute_get_duration (start_time);
266 FPRINTF (stdout, _("Received %llu bytes/s (%llu bytes in %s)\n"),
267 1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us),
269 GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
273 struct ResolutionContext *rc_head;
274 struct ResolutionContext *rc_tail;
276 struct ResolutionContext
278 struct ResolutionContext *next;
279 struct ResolutionContext *prev;
280 struct GNUNET_HELLO_Address *addrcp;
281 struct GNUNET_TRANSPORT_AddressToStringContext *asc;
287 operation_timeout (void *cls,
288 const struct GNUNET_SCHEDULER_TaskContext *tc)
290 struct ResolutionContext *cur;
291 struct ResolutionContext *next;
292 op_timeout = GNUNET_SCHEDULER_NO_TASK;
293 if ((try_connect) || (benchmark_send) ||
296 FPRINTF (stdout, _("Failed to connect to `%s'\n"), GNUNET_i2s_full (&pid));
297 if (GNUNET_SCHEDULER_NO_TASK != end)
298 GNUNET_SCHEDULER_cancel (end);
299 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
303 if (iterate_connections)
306 while (NULL != (cur = next))
309 FPRINTF (stdout, _("Failed to resolve address for peer `%s'\n"),
310 GNUNET_i2s (&cur->addrcp->peer));
312 GNUNET_CONTAINER_DLL_remove (rc_head, rc_tail, cur);
313 GNUNET_TRANSPORT_address_to_string_cancel (cur->asc);
314 GNUNET_free (cur->addrcp);
318 FPRINTF (stdout, "%s", _("Failed to list connections, timeout occured\n"));
319 if (GNUNET_SCHEDULER_NO_TASK != end)
320 GNUNET_SCHEDULER_cancel (end);
321 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
331 * Display the result of the test.
333 * @param tc test context
334 * @param result GNUNET_YES on success
337 display_test_result (struct TestContext *tc, int result)
339 if (GNUNET_YES != result)
341 FPRINTF (stderr, "Configuration for plugin `%s' did not work!\n", tc->name);
345 FPRINTF (stderr, "Configuration for plugin `%s' is working!\n", tc->name);
347 if (GNUNET_SCHEDULER_NO_TASK != tc->tsk)
349 GNUNET_SCHEDULER_cancel (tc->tsk);
350 tc->tsk = GNUNET_SCHEDULER_NO_TASK;
354 GNUNET_NAT_test_stop (tc->tst);
359 if ((0 == resolver_users) && (NULL != resolver))
361 GNUNET_break (0 == GNUNET_OS_process_kill (resolver, SIGTERM));
362 GNUNET_OS_process_destroy (resolver);
369 * Function called by NAT on success.
370 * Clean up and update GUI (with success).
372 * @param cls test context
373 * @param success currently always GNUNET_OK
376 result_callback (void *cls, int success)
378 struct TestContext *tc = cls;
380 display_test_result (tc, success);
385 * Function called if NAT failed to confirm success.
386 * Clean up and update GUI (with failure).
388 * @param cls test context
389 * @param tc scheduler callback
392 fail_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
394 struct TestContext *tstc = cls;
396 tstc->tsk = GNUNET_SCHEDULER_NO_TASK;
397 display_test_result (tstc, GNUNET_NO);
402 * Test our plugin's configuration (NAT traversal, etc.).
404 * @param cfg configuration to test
407 do_test_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg)
411 unsigned long long bnd_port;
412 unsigned long long adv_port;
413 struct TestContext *tc;
416 GNUNET_CONFIGURATION_get_value_string (cfg, "transport", "plugins",
422 ("No transport plugins configured, peer will never communicate\n"));
426 for (tok = strtok (plugins, " "); tok != NULL; tok = strtok (NULL, " "))
428 char section[12 + strlen (tok)];
430 GNUNET_snprintf (section, sizeof (section), "transport-%s", tok);
432 GNUNET_CONFIGURATION_get_value_number (cfg, section, "PORT", &bnd_port))
435 _("No port configured for plugin `%s', cannot test it\n"), tok);
439 GNUNET_CONFIGURATION_get_value_number (cfg, section, "ADVERTISED_PORT",
442 if (NULL == resolver)
444 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-resolver",
445 "gnunet-service-resolver", NULL);
447 GNUNET_RESOLVER_connect (cfg);
448 tc = GNUNET_malloc (sizeof (struct TestContext));
449 tc->name = GNUNET_strdup (tok);
451 GNUNET_NAT_test_start (cfg,
454 "udp")) ? GNUNET_NO : GNUNET_YES,
455 (uint16_t) bnd_port, (uint16_t) adv_port,
456 &result_callback, tc);
459 display_test_result (tc, GNUNET_SYSERR);
462 tc->tsk = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &fail_timeout, tc);
464 GNUNET_free (plugins);
468 * Function called to notify a client about the socket
469 * begin ready to queue more data. "buf" will be
470 * NULL and "size" zero if the socket was closed for
471 * writing in the meantime.
474 * @param size number of bytes available in buf
475 * @param buf where the callee should write the message
476 * @return number of bytes written to buf
479 transmit_data (void *cls, size_t size, void *buf)
481 struct GNUNET_MessageHeader *m = buf;
483 if ((NULL == buf) && (0 == size))
489 GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
490 GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
491 m->size = ntohs (size);
492 m->type = ntohs (GNUNET_MESSAGE_TYPE_DUMMY);
493 memset (&m[1], 52, size - sizeof (struct GNUNET_MessageHeader));
494 traffic_sent += size;
495 th = GNUNET_TRANSPORT_notify_transmit_ready (handle, &pid, BLOCKSIZE * 1024, 0,
496 GNUNET_TIME_UNIT_FOREVER_REL,
497 &transmit_data, NULL);
499 FPRINTF (stdout, _("Transmitting %u bytes to %s\n"), (unsigned int) size,
506 * Function called to notify transport users that another
507 * peer connected to us.
510 * @param peer the peer that connected
513 notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
515 if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity)))
520 /* all done, terminate instantly */
522 _("Successfully connected to `%s'\n"),
523 GNUNET_i2s_full (peer));
526 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
528 GNUNET_SCHEDULER_cancel (op_timeout);
529 op_timeout = GNUNET_SCHEDULER_NO_TASK;
532 if (GNUNET_SCHEDULER_NO_TASK != end)
533 GNUNET_SCHEDULER_cancel (end);
534 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
539 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
541 GNUNET_SCHEDULER_cancel (op_timeout);
542 op_timeout = GNUNET_SCHEDULER_NO_TASK;
545 FPRINTF (stdout, _("Successfully connected to `%s', starting to send benchmark data in %u Kb blocks\n"),
546 GNUNET_i2s (&pid), BLOCKSIZE);
547 start_time = GNUNET_TIME_absolute_get ();
549 th = GNUNET_TRANSPORT_notify_transmit_ready (handle, peer,
551 GNUNET_TIME_UNIT_FOREVER_REL,
552 &transmit_data, NULL);
561 * Function called to notify transport users that another
562 * peer disconnected from us.
565 * @param peer the peer that disconnected
568 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
570 if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity)))
575 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
580 FPRINTF (stdout, _("Disconnected from peer `%s' while benchmarking\n"), GNUNET_i2s (&pid));
581 if (GNUNET_SCHEDULER_NO_TASK != end)
582 GNUNET_SCHEDULER_cancel (end);
588 * Function called to notify transport users that another
589 * peer connected to us.
592 * @param peer the peer that connected
595 monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
597 monitor_connect_counter ++;
598 struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get();
599 const char *now_str = GNUNET_STRINGS_absolute_time_to_string (now);
601 FPRINTF (stdout, _("%24s: %-17s %4s (%u connections in total)\n"),
605 monitor_connect_counter);
610 * Function called to notify transport users that another
611 * peer disconnected from us.
614 * @param peer the peer that disconnected
617 monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
619 struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get();
620 const char *now_str = GNUNET_STRINGS_absolute_time_to_string (now);
622 GNUNET_assert (monitor_connect_counter > 0);
623 monitor_connect_counter --;
625 FPRINTF (stdout, _("%24s: %-17s %4s (%u connections in total)\n"),
627 _("Disconnected from"),
629 monitor_connect_counter);
635 * Function called by the transport for each received message.
638 * @param peer (claimed) identity of the other peer
639 * @param message the message
642 notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
643 const struct GNUNET_MessageHeader *message)
645 if (benchmark_receive)
647 if (GNUNET_MESSAGE_TYPE_DUMMY != ntohs (message->type))
650 FPRINTF (stdout, _("Received %u bytes from %s\n"),
651 (unsigned int) ntohs (message->size), GNUNET_i2s (peer));
653 if (traffic_received == 0)
654 start_time = GNUNET_TIME_absolute_get ();
655 traffic_received += ntohs (message->size);
661 static void resolve_address (const struct GNUNET_HELLO_Address *address,
666 process_string (void *cls, const char *address)
668 struct ResolutionContext *rc = cls;
669 struct GNUNET_HELLO_Address *addrcp = rc->addrcp;
673 FPRINTF (stdout, _("Peer `%s': %s %s\n"), GNUNET_i2s (&addrcp->peer), addrcp->transport_name, address);
674 rc->printed = GNUNET_YES;
679 GNUNET_assert (address_resolutions > 0);
680 address_resolutions --;
681 if (GNUNET_NO == rc->printed)
683 if (numeric == GNUNET_NO)
685 resolve_address (rc->addrcp, GNUNET_YES ); /* Failed to resolve address, try numeric lookup */
688 FPRINTF (stdout, _("Peer `%s': %s <unable to resolve address>\n"), GNUNET_i2s (&addrcp->peer), addrcp->transport_name);
690 GNUNET_free (rc->addrcp);
691 GNUNET_CONTAINER_DLL_remove (rc_head, rc_tail, rc);
693 if ((0 == address_resolutions) && (iterate_connections))
695 if (GNUNET_SCHEDULER_NO_TASK != end)
697 GNUNET_SCHEDULER_cancel (end);
698 end = GNUNET_SCHEDULER_NO_TASK;
700 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
702 GNUNET_SCHEDULER_cancel (op_timeout);
703 op_timeout = GNUNET_SCHEDULER_NO_TASK;
706 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
711 static void resolve_address (const struct GNUNET_HELLO_Address *address,
714 struct ResolutionContext *rc;
716 rc = GNUNET_malloc(sizeof (struct ResolutionContext));
717 GNUNET_assert (NULL != rc);
718 GNUNET_CONTAINER_DLL_insert (rc_head, rc_tail, rc);
719 address_resolutions ++;
721 rc->addrcp = GNUNET_HELLO_address_copy(address);
722 rc->printed = GNUNET_NO;
723 /* Resolve address to string */
724 rc->asc = GNUNET_TRANSPORT_address_to_string (cfg, address, numeric,
725 RESOLUTION_TIMEOUT, &process_string,
730 * Function to call with a binary address
733 * @param peer identity of the peer
734 * @param address binary address (NULL on disconnect)
737 process_address (void *cls, const struct GNUNET_PeerIdentity *peer,
738 const struct GNUNET_HELLO_Address *address)
743 address_resolution_in_progress = GNUNET_NO;
745 if (GNUNET_SCHEDULER_NO_TASK != end)
746 GNUNET_SCHEDULER_cancel (end);
747 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
752 FPRINTF (stdout, _("Peer `%s' disconnected\n"), GNUNET_i2s (peer));
756 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
757 GNUNET_SCHEDULER_cancel (op_timeout);
758 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
759 &operation_timeout, NULL);
761 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received address for peer `%s': %s\n",
762 GNUNET_i2s (peer), address->transport_name);
763 resolve_address (address, numeric);
766 void try_connect_cb (void *cls,
769 static int retries = 0;
770 if (GNUNET_OK == result)
777 tc_handle = GNUNET_TRANSPORT_try_connect (handle, &pid, try_connect_cb, NULL);
780 FPRINTF (stderr, "%s", _("Failed to send connect request to transport service\n"));
781 if (GNUNET_SCHEDULER_NO_TASK != end)
782 GNUNET_SCHEDULER_cancel (end);
784 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
791 * Function called with the result of the check if the 'transport'
792 * service is running.
794 * @param cls closure with our configuration
795 * @param result GNUNET_YES if transport is running
798 testservice_task (void *cls,
804 if (GNUNET_YES != result)
807 _("Service `%s' is not running\n"), "transport");
811 if ( (NULL != cpid) &&
812 (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (cpid,
816 FPRINTF (stderr, _("Failed to parse peer identity `%s'\n"), cpid);
820 counter = benchmark_send + benchmark_receive + iterate_connections +
821 monitor_connections + monitor_connects + try_connect;
825 FPRINTF (stderr, _("Multiple operations given. Please choose only one operation: %s, %s, %s, %s, %s, %s\n"),
826 "connect", "benchmark send", "benchmark receive", "information", "monitor", "events");
831 FPRINTF (stderr, _("No operation given. Please choose one operation: %s, %s, %s, %s, %s, %s\n"),
832 "connect", "benchmark send", "benchmark receive", "information", "monitor", "events");
836 if (try_connect) /* -C: Connect to peer */
840 FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
845 handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL,
851 FPRINTF (stderr, "%s", _("Failed to connect to transport service\n"));
855 tc_handle = GNUNET_TRANSPORT_try_connect (handle, &pid, try_connect_cb, NULL);
856 if (NULL == tc_handle)
858 FPRINTF (stderr, "%s", _("Failed to send request to transport service\n"));
862 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
863 &operation_timeout, NULL);
866 else if (benchmark_send) /* -s: Benchmark sending */
870 FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
875 handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL,
881 FPRINTF (stderr, "%s", _("Failed to connect to transport service\n"));
885 tc_handle = GNUNET_TRANSPORT_try_connect (handle, &pid, try_connect_cb, NULL);
886 if (NULL == tc_handle)
888 FPRINTF (stderr, "%s", _("Failed to send request to transport service\n"));
892 start_time = GNUNET_TIME_absolute_get ();
893 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
894 &operation_timeout, NULL);
896 else if (benchmark_receive) /* -b: Benchmark receiving */
899 GNUNET_TRANSPORT_connect (cfg, NULL, NULL, ¬ify_receive,
903 FPRINTF (stderr, "%s", _("Failed to connect to transport service\n"));
908 FPRINTF (stdout, "%s", _("Starting to receive benchmark data\n"));
909 start_time = GNUNET_TIME_absolute_get ();
912 else if (iterate_connections) /* -i: List all active addresses once */
914 address_resolution_in_progress = GNUNET_YES;
915 pic = GNUNET_TRANSPORT_peer_get_active_addresses (cfg,
916 (NULL == cpid) ? NULL : &pid,
919 &process_address, (void *) cfg);
920 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
921 &operation_timeout, NULL);
923 else if (monitor_connections) /* -m: List all active addresses continously */
925 address_resolution_in_progress = GNUNET_YES;
926 pic = GNUNET_TRANSPORT_peer_get_active_addresses (cfg,
927 (NULL == cpid) ? NULL : &pid,
930 &process_address, (void *) cfg);
932 else if (monitor_connects) /* -e : Monitor (dis)connect events continously */
934 monitor_connect_counter = 0;
935 handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL, NULL,
936 &monitor_notify_connect,
937 &monitor_notify_disconnect);
940 FPRINTF (stderr, "%s", _("Failed to connect to transport service\n"));
952 end = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
960 * Main function that will be run by the scheduler.
963 * @param args remaining command-line arguments
964 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
965 * @param mycfg configuration
968 run (void *cls, char *const *args, const char *cfgfile,
969 const struct GNUNET_CONFIGURATION_Handle *mycfg)
971 cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg;
972 if (test_configuration)
974 do_test_configuration (cfg);
977 GNUNET_CLIENT_service_test ("transport", cfg,
978 GNUNET_TIME_UNIT_SECONDS,
985 main (int argc, char *const *argv)
988 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
989 {'b', "benchmark", NULL,
990 gettext_noop ("measure how fast we are receiving data from all peers (until CTRL-C)"),
991 0, &GNUNET_GETOPT_set_one, &benchmark_receive},
992 {'C', "connect", NULL,
993 gettext_noop ("connect to a peer"),
994 0, &GNUNET_GETOPT_set_one, &try_connect},
995 {'i', "information", NULL,
996 gettext_noop ("provide information about all current connections (once)"),
997 0, &GNUNET_GETOPT_set_one, &iterate_connections},
998 {'m', "monitor", NULL,
999 gettext_noop ("provide information about all current connections (continuously)"),
1000 0, &GNUNET_GETOPT_set_one, &monitor_connections},
1001 {'e', "events", NULL,
1002 gettext_noop ("provide information about all connects and disconnect events (continuously)"),
1003 0, &GNUNET_GETOPT_set_one, &monitor_connects},
1004 {'n', "numeric", NULL,
1005 gettext_noop ("do not resolve hostnames"),
1006 0, &GNUNET_GETOPT_set_one, &numeric},
1007 {'p', "peer", "PEER",
1008 gettext_noop ("peer identity"),
1009 1, &GNUNET_GETOPT_set_string, &cpid},
1012 ("send data for benchmarking to the other peer (until CTRL-C)"),
1013 0, &GNUNET_GETOPT_set_one, &benchmark_send},
1015 gettext_noop ("test transport configuration (involves external server)"),
1016 0, &GNUNET_GETOPT_set_one, &test_configuration},
1017 GNUNET_GETOPT_OPTION_VERBOSE (&verbosity),
1018 GNUNET_GETOPT_OPTION_END
1021 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
1024 res = GNUNET_PROGRAM_run (argc, argv, "gnunet-transport",
1026 ("Direct access to transport service."), options,
1028 GNUNET_free ((void *) argv);
1029 if (GNUNET_OK == res)
1035 /* end of gnunet-transport.c */