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;
169 * Selected level of verbosity.
171 static int verbosity;
174 * Resolver process handle.
176 struct GNUNET_OS_Process *resolver;
179 * Number of tasks running that still need the resolver.
181 static unsigned int resolver_users;
184 * Number of address resolutions pending
186 static unsigned int address_resolutions;
189 * Address resolutions pending in progress
191 static unsigned int address_resolution_in_progress;
194 * Context for a plugin test.
200 * Handle to the active NAT test.
202 struct GNUNET_NAT_Test *tst;
205 * Task identifier for the timeout.
207 GNUNET_SCHEDULER_TaskIdentifier tsk;
210 * Name of plugin under test.
218 * Task run in monitor mode when the user presses CTRL-C to abort.
219 * Stops monitoring activity.
221 * @param cls the 'struct GNUNET_TRANSPORT_PeerIterateContext *'
222 * @param tc scheduler context
225 shutdown_task (void *cls,
226 const struct GNUNET_SCHEDULER_TaskContext *tc)
228 struct GNUNET_TIME_Relative duration;
229 end = GNUNET_SCHEDULER_NO_TASK;
230 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
232 GNUNET_SCHEDULER_cancel (op_timeout);
233 op_timeout = GNUNET_SCHEDULER_NO_TASK;
235 if (NULL != tc_handle)
237 GNUNET_TRANSPORT_try_connect_cancel (tc_handle);
242 GNUNET_TRANSPORT_peer_get_active_addresses_cancel (pic);
247 GNUNET_TRANSPORT_notify_transmit_ready_cancel(th);
252 GNUNET_TRANSPORT_disconnect(handle);
257 duration = GNUNET_TIME_absolute_get_duration (start_time);
258 FPRINTF (stdout, _("Transmitted %llu bytes/s (%llu bytes in %s)\n"),
259 1000LL * 1000LL * traffic_sent / (1 + duration.rel_value_us), traffic_sent,
260 GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
262 if (benchmark_receive)
264 duration = GNUNET_TIME_absolute_get_duration (start_time);
265 FPRINTF (stdout, _("Received %llu bytes/s (%llu bytes in %s)\n"),
266 1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us),
268 GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
273 static struct ResolutionContext *rc_head;
274 static 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, GNUNET_TERM_SIG));
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
374 * @param emsg error message, NULL on success
377 result_callback (void *cls,
381 struct TestContext *tc = cls;
383 display_test_result (tc, success);
388 * Function called if NAT failed to confirm success.
389 * Clean up and update GUI (with failure).
391 * @param cls test context
392 * @param tc scheduler callback
395 fail_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
397 struct TestContext *tstc = cls;
399 tstc->tsk = GNUNET_SCHEDULER_NO_TASK;
400 display_test_result (tstc, GNUNET_NO);
405 * Test our plugin's configuration (NAT traversal, etc.).
407 * @param cfg configuration to test
410 do_test_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg)
414 unsigned long long bnd_port;
415 unsigned long long adv_port;
416 struct TestContext *tc;
420 GNUNET_CONFIGURATION_get_value_string (cfg, "transport", "plugins",
426 ("No transport plugins configured, peer will never communicate\n"));
430 for (tok = strtok (plugins, " "); tok != NULL; tok = strtok (NULL, " "))
432 char section[12 + strlen (tok)];
434 GNUNET_snprintf (section, sizeof (section), "transport-%s", tok);
436 GNUNET_CONFIGURATION_get_value_number (cfg, section, "PORT", &bnd_port))
439 _("No port configured for plugin `%s', cannot test it\n"), tok);
443 GNUNET_CONFIGURATION_get_value_number (cfg, section, "ADVERTISED_PORT",
446 if (NULL == resolver)
448 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
450 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL,
452 "gnunet-service-resolver", NULL);
453 GNUNET_free (binary);
456 GNUNET_RESOLVER_connect (cfg);
457 tc = GNUNET_new (struct TestContext);
458 tc->name = GNUNET_strdup (tok);
460 GNUNET_NAT_test_start (cfg,
463 "udp")) ? GNUNET_NO : GNUNET_YES,
464 (uint16_t) bnd_port, (uint16_t) adv_port,
465 &result_callback, tc);
468 display_test_result (tc, GNUNET_SYSERR);
471 tc->tsk = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &fail_timeout, tc);
473 GNUNET_free (plugins);
478 * Function called to notify a client about the socket
479 * begin ready to queue more data. @a buf will be
480 * NULL and @a size zero if the socket was closed for
481 * writing in the meantime.
484 * @param size number of bytes available in @a buf
485 * @param buf where the callee should write the message
486 * @return number of bytes written to @a buf
489 transmit_data (void *cls, size_t size, void *buf)
491 struct GNUNET_MessageHeader *m = buf;
493 if ((NULL == buf) || (0 == size))
499 GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
500 GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
501 m->size = ntohs (size);
502 m->type = ntohs (GNUNET_MESSAGE_TYPE_DUMMY);
503 memset (&m[1], 52, size - sizeof (struct GNUNET_MessageHeader));
504 traffic_sent += size;
505 th = GNUNET_TRANSPORT_notify_transmit_ready (handle, &pid, BLOCKSIZE * 1024, 0,
506 GNUNET_TIME_UNIT_FOREVER_REL,
507 &transmit_data, NULL);
509 FPRINTF (stdout, _("Transmitting %u bytes to %s\n"), (unsigned int) size,
516 * Function called to notify transport users that another
517 * peer connected to us.
520 * @param peer the peer that connected
523 notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
525 if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity)))
530 /* all done, terminate instantly */
532 _("Successfully connected to `%s'\n"),
533 GNUNET_i2s_full (peer));
536 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
538 GNUNET_SCHEDULER_cancel (op_timeout);
539 op_timeout = GNUNET_SCHEDULER_NO_TASK;
542 if (GNUNET_SCHEDULER_NO_TASK != end)
543 GNUNET_SCHEDULER_cancel (end);
544 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
549 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
551 GNUNET_SCHEDULER_cancel (op_timeout);
552 op_timeout = GNUNET_SCHEDULER_NO_TASK;
555 FPRINTF (stdout, _("Successfully connected to `%s', starting to send benchmark data in %u Kb blocks\n"),
556 GNUNET_i2s (&pid), BLOCKSIZE);
557 start_time = GNUNET_TIME_absolute_get ();
559 th = GNUNET_TRANSPORT_notify_transmit_ready (handle, peer,
561 GNUNET_TIME_UNIT_FOREVER_REL,
562 &transmit_data, NULL);
571 * Function called to notify transport users that another
572 * peer disconnected from us.
575 * @param peer the peer that disconnected
578 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
580 if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity)))
585 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
590 FPRINTF (stdout, _("Disconnected from peer `%s' while benchmarking\n"), GNUNET_i2s (&pid));
591 if (GNUNET_SCHEDULER_NO_TASK != end)
592 GNUNET_SCHEDULER_cancel (end);
598 * Function called to notify transport users that another
599 * peer connected to us.
602 * @param peer the peer that connected
605 monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
607 monitor_connect_counter ++;
608 struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get();
609 const char *now_str = GNUNET_STRINGS_absolute_time_to_string (now);
612 _("%24s: %-17s %4s (%u connections in total)\n"),
616 monitor_connect_counter);
621 * Function called to notify transport users that another
622 * peer disconnected from us.
625 * @param peer the peer that disconnected
628 monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
630 struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get();
631 const char *now_str = GNUNET_STRINGS_absolute_time_to_string (now);
633 GNUNET_assert (monitor_connect_counter > 0);
634 monitor_connect_counter --;
637 _("%24s: %-17s %4s (%u connections in total)\n"),
639 _("Disconnected from"),
641 monitor_connect_counter);
647 * Function called by the transport for each received message.
650 * @param peer (claimed) identity of the other peer
651 * @param message the message
654 notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
655 const struct GNUNET_MessageHeader *message)
657 if (benchmark_receive)
659 if (GNUNET_MESSAGE_TYPE_DUMMY != ntohs (message->type))
663 _("Received %u bytes from %s\n"),
664 (unsigned int) ntohs (message->size), GNUNET_i2s (peer));
666 if (traffic_received == 0)
667 start_time = GNUNET_TIME_absolute_get ();
668 traffic_received += ntohs (message->size);
675 resolve_address (const struct GNUNET_HELLO_Address *address,
680 process_string (void *cls, const char *address)
682 struct ResolutionContext *rc = cls;
683 struct GNUNET_HELLO_Address *addrcp = rc->addrcp;
688 _("Peer `%s': %s %s\n"),
689 GNUNET_i2s (&addrcp->peer),
690 addrcp->transport_name,
692 rc->printed = GNUNET_YES;
697 GNUNET_assert (address_resolutions > 0);
698 address_resolutions --;
699 if (GNUNET_NO == rc->printed)
701 if (numeric == GNUNET_NO)
703 resolve_address (rc->addrcp, GNUNET_YES ); /* Failed to resolve address, try numeric lookup */
707 _("Peer `%s': %s <unable to resolve address>\n"),
708 GNUNET_i2s (&addrcp->peer),
709 addrcp->transport_name);
711 GNUNET_free (rc->addrcp);
712 GNUNET_CONTAINER_DLL_remove (rc_head, rc_tail, rc);
714 if ((0 == address_resolutions) && (iterate_connections))
716 if (GNUNET_SCHEDULER_NO_TASK != end)
718 GNUNET_SCHEDULER_cancel (end);
719 end = GNUNET_SCHEDULER_NO_TASK;
721 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
723 GNUNET_SCHEDULER_cancel (op_timeout);
724 op_timeout = GNUNET_SCHEDULER_NO_TASK;
727 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
734 resolve_address (const struct GNUNET_HELLO_Address *address,
737 struct ResolutionContext *rc;
739 rc = GNUNET_new (struct ResolutionContext);
740 GNUNET_assert (NULL != rc);
741 GNUNET_CONTAINER_DLL_insert (rc_head, rc_tail, rc);
742 address_resolutions ++;
744 rc->addrcp = GNUNET_HELLO_address_copy(address);
745 rc->printed = GNUNET_NO;
746 /* Resolve address to string */
747 rc->asc = GNUNET_TRANSPORT_address_to_string (cfg, address, numeric,
748 RESOLUTION_TIMEOUT, &process_string,
753 * Function to call with a binary address
756 * @param peer identity of the peer
757 * @param address binary address (NULL on disconnect)
760 process_address (void *cls, const struct GNUNET_PeerIdentity *peer,
761 const struct GNUNET_HELLO_Address *address)
766 address_resolution_in_progress = GNUNET_NO;
768 if (GNUNET_SCHEDULER_NO_TASK != end)
769 GNUNET_SCHEDULER_cancel (end);
770 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
775 FPRINTF (stdout, _("Peer `%s' disconnected\n"), GNUNET_i2s (peer));
779 if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
780 GNUNET_SCHEDULER_cancel (op_timeout);
781 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
782 &operation_timeout, NULL);
784 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received address for peer `%s': %s\n",
785 GNUNET_i2s (peer), address->transport_name);
786 resolve_address (address, numeric);
791 try_connect_cb (void *cls,
794 static int retries = 0;
795 if (GNUNET_OK == result)
802 tc_handle = GNUNET_TRANSPORT_try_connect (handle, &pid, try_connect_cb, NULL);
805 FPRINTF (stderr, "%s", _("Failed to send connect request to transport service\n"));
806 if (GNUNET_SCHEDULER_NO_TASK != end)
807 GNUNET_SCHEDULER_cancel (end);
809 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
816 * Function called with the result of the check if the 'transport'
817 * service is running.
819 * @param cls closure with our configuration
820 * @param result #GNUNET_YES if transport is running
823 testservice_task (void *cls,
829 if (GNUNET_YES != result)
832 _("Service `%s' is not running\n"), "transport");
836 if ( (NULL != cpid) &&
837 (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (cpid,
841 FPRINTF (stderr, _("Failed to parse peer identity `%s'\n"), cpid);
845 counter = benchmark_send + benchmark_receive + iterate_connections +
846 monitor_connections + monitor_connects + try_connect;
851 _("Multiple operations given. Please choose only one operation: %s, %s, %s, %s, %s, %s\n"),
852 "connect", "benchmark send", "benchmark receive", "information", "monitor", "events");
858 _("No operation given. Please choose one operation: %s, %s, %s, %s, %s, %s\n"),
859 "connect", "benchmark send", "benchmark receive", "information", "monitor", "events");
863 if (try_connect) /* -C: Connect to peer */
868 _("Option `%s' makes no sense without option `%s'.\n"),
873 handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL,
881 _("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)
890 _("Failed to send request to transport service\n"));
894 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
895 &operation_timeout, NULL);
898 else if (benchmark_send) /* -s: Benchmark sending */
902 FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
907 handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL,
913 FPRINTF (stderr, "%s", _("Failed to connect to transport service\n"));
917 tc_handle = GNUNET_TRANSPORT_try_connect (handle, &pid, try_connect_cb, NULL);
918 if (NULL == tc_handle)
920 FPRINTF (stderr, "%s", _("Failed to send request to transport service\n"));
924 start_time = GNUNET_TIME_absolute_get ();
925 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
926 &operation_timeout, NULL);
928 else if (benchmark_receive) /* -b: Benchmark receiving */
931 GNUNET_TRANSPORT_connect (cfg, NULL, NULL, ¬ify_receive,
935 FPRINTF (stderr, "%s", _("Failed to connect to transport service\n"));
940 FPRINTF (stdout, "%s", _("Starting to receive benchmark data\n"));
941 start_time = GNUNET_TIME_absolute_get ();
944 else if (iterate_connections) /* -i: List all active addresses once */
946 address_resolution_in_progress = GNUNET_YES;
947 pic = GNUNET_TRANSPORT_peer_get_active_addresses (cfg,
948 (NULL == cpid) ? NULL : &pid,
951 &process_address, (void *) cfg);
952 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
953 &operation_timeout, NULL);
955 else if (monitor_connections) /* -m: List all active addresses continously */
957 address_resolution_in_progress = GNUNET_YES;
958 pic = GNUNET_TRANSPORT_peer_get_active_addresses (cfg,
959 (NULL == cpid) ? NULL : &pid,
962 &process_address, (void *) cfg);
964 else if (monitor_connects) /* -e : Monitor (dis)connect events continously */
966 monitor_connect_counter = 0;
967 handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL, NULL,
968 &monitor_notify_connect,
969 &monitor_notify_disconnect);
972 FPRINTF (stderr, "%s", _("Failed to connect to transport service\n"));
984 end = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
992 * Main function that will be run by the scheduler.
995 * @param args remaining command-line arguments
996 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
997 * @param mycfg configuration
1000 run (void *cls, char *const *args, const char *cfgfile,
1001 const struct GNUNET_CONFIGURATION_Handle *mycfg)
1003 cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg;
1004 if (test_configuration)
1006 do_test_configuration (cfg);
1009 GNUNET_CLIENT_service_test ("transport", cfg,
1010 GNUNET_TIME_UNIT_SECONDS,
1017 main (int argc, char *const *argv)
1020 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
1021 {'b', "benchmark", NULL,
1022 gettext_noop ("measure how fast we are receiving data from all peers (until CTRL-C)"),
1023 0, &GNUNET_GETOPT_set_one, &benchmark_receive},
1024 {'C', "connect", NULL,
1025 gettext_noop ("connect to a peer"),
1026 0, &GNUNET_GETOPT_set_one, &try_connect},
1027 {'i', "information", NULL,
1028 gettext_noop ("provide information about all current connections (once)"),
1029 0, &GNUNET_GETOPT_set_one, &iterate_connections},
1030 {'m', "monitor", NULL,
1031 gettext_noop ("provide information about all current connections (continuously)"),
1032 0, &GNUNET_GETOPT_set_one, &monitor_connections},
1033 {'e', "events", NULL,
1034 gettext_noop ("provide information about all connects and disconnect events (continuously)"),
1035 0, &GNUNET_GETOPT_set_one, &monitor_connects},
1036 {'n', "numeric", NULL,
1037 gettext_noop ("do not resolve hostnames"),
1038 0, &GNUNET_GETOPT_set_one, &numeric},
1039 {'p', "peer", "PEER",
1040 gettext_noop ("peer identity"),
1041 1, &GNUNET_GETOPT_set_string, &cpid},
1044 ("send data for benchmarking to the other peer (until CTRL-C)"),
1045 0, &GNUNET_GETOPT_set_one, &benchmark_send},
1047 gettext_noop ("test transport configuration (involves external server)"),
1048 0, &GNUNET_GETOPT_set_one, &test_configuration},
1049 GNUNET_GETOPT_OPTION_VERBOSE (&verbosity),
1050 GNUNET_GETOPT_OPTION_END
1053 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
1056 res = GNUNET_PROGRAM_run (argc, argv, "gnunet-transport",
1058 ("Direct access to transport service."), options,
1060 GNUNET_free ((void *) argv);
1061 if (GNUNET_OK == res)
1067 /* end of gnunet-transport.c */