diff options
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/Makefile.am | 5 | ||||
-rw-r--r-- | src/transport/plugin_cmd_simple_send.c | 38 | ||||
-rw-r--r-- | src/transport/transport_api_cmd_connecting_peers.c | 11 | ||||
-rw-r--r-- | src/transport/transport_api_cmd_start_peer.c | 23 |
4 files changed, 47 insertions, 30 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 9f680ad3b..255a7973f 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -398,15 +398,16 @@ plugin_LTLIBRARIES = \ | |||
398 | $(HTTPS_SERVER_PLUGIN_LA) \ | 398 | $(HTTPS_SERVER_PLUGIN_LA) \ |
399 | $(WLAN_PLUGIN_LA) \ | 399 | $(WLAN_PLUGIN_LA) \ |
400 | $(BT_PLUGIN_LA) | 400 | $(BT_PLUGIN_LA) |
401 | # libgnunet_plugin_simple_send.la | 401 | # libgnunet_plugin_cmd_simple_send.la |
402 | 402 | ||
403 | # libgnunet_plugin_cmd_simple_send_la_SOURCES = \ | 403 | # libgnunet_plugin_cmd_simple_send_la_SOURCES = \ |
404 | # plugin_cmd_simple_send.c | 404 | # plugin_cmd_simple_send.c |
405 | # libgnunet_plugin_cmd_simple_send_la_LIBADD = \ | 405 | # libgnunet_plugin_cmd_simple_send_la_LIBADD = \ |
406 | # $(top_builddir)/src/util/libgnunetutil.la \ | 406 | # $(top_builddir)/src/util/libgnunetutil.la \ |
407 | # $(top_builddir)/src/testing/libgnunettesting.la \ | 407 | # $(top_builddir)/src/testing/libgnunettesting.la \ |
408 | # $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 408 | # $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
409 | # $(top_builddir)/src/testbed/libgnunettestbed.la \ | 409 | # $(top_builddir)/src/testbed/libgnunettestbed.la \ |
410 | # libgnunettransport.la \ | ||
410 | # $(LTLIBINTL) | 411 | # $(LTLIBINTL) |
411 | # libgnunet_plugin_cmd_simple_send_la_LDFLAGS = \ | 412 | # libgnunet_plugin_cmd_simple_send_la_LDFLAGS = \ |
412 | # $(GN_PLUGIN_LDFLAGS) | 413 | # $(GN_PLUGIN_LDFLAGS) |
diff --git a/src/transport/plugin_cmd_simple_send.c b/src/transport/plugin_cmd_simple_send.c index ed3481c00..1fa2f1f03 100644 --- a/src/transport/plugin_cmd_simple_send.c +++ b/src/transport/plugin_cmd_simple_send.c | |||
@@ -26,8 +26,9 @@ | |||
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_testing_ng_lib.h" | 27 | #include "gnunet_testing_ng_lib.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "gnunet_transport_application_service.h" | ||
30 | #include "gnunet_transport_service.h" | ||
29 | #include "gnunet_testbed_ng_service.h" | 31 | #include "gnunet_testbed_ng_service.h" |
30 | |||
31 | /** | 32 | /** |
32 | * Generic logging shortcut | 33 | * Generic logging shortcut |
33 | */ | 34 | */ |
@@ -35,6 +36,20 @@ | |||
35 | 36 | ||
36 | #define BASE_DIR "testdir" | 37 | #define BASE_DIR "testdir" |
37 | 38 | ||
39 | struct GNUNET_MQ_MessageHandler *handlers; | ||
40 | |||
41 | const char *cfgname; | ||
42 | |||
43 | unsigned int are_all_peers_started; | ||
44 | |||
45 | static void | ||
46 | all_peers_started () | ||
47 | { | ||
48 | are_all_peers_started = GNUNET_YES; | ||
49 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
50 | "setting are_all_peers_started: %d\n", | ||
51 | are_all_peers_started); | ||
52 | } | ||
38 | 53 | ||
39 | static void | 54 | static void |
40 | start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, | 55 | start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, |
@@ -42,10 +57,9 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, | |||
42 | char *m, | 57 | char *m, |
43 | char *n) | 58 | char *n) |
44 | { | 59 | { |
45 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); | ||
46 | char *testdir; | 60 | char *testdir; |
47 | 61 | ||
48 | testdir = GNUNET_malloc (strlen (basedir) + strlen (m) + strlen (n) | 62 | testdir = GNUNET_malloc (strlen (BASE_DIR) + strlen (m) + strlen (n) |
49 | + 1); | 63 | + 1); |
50 | 64 | ||
51 | strcpy (testdir, BASE_DIR); | 65 | strcpy (testdir, BASE_DIR); |
@@ -55,19 +69,19 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, | |||
55 | struct GNUNET_TESTING_Command commands[] = { | 69 | struct GNUNET_TESTING_Command commands[] = { |
56 | GNUNET_TESTING_cmd_system_create ("system-create-1", | 70 | GNUNET_TESTING_cmd_system_create ("system-create-1", |
57 | testdir), | 71 | testdir), |
58 | GNUNET_TESTING_cmd_start_peer ("start-peer-1", | 72 | /*GNUNET_TRANSPORT_cmd_start_peer ("start-peer-1", |
59 | "system-create-1", | 73 | "system-create-1", |
60 | m, | 74 | m, |
61 | n, | 75 | n, |
62 | struct GNUNET_MQ_MessageHandler *handlers, | 76 | handlers, |
63 | const char *cfgname), | 77 | cfgname),*/ |
64 | GNUNET_TESTING_cmd_send_peer_ready ("send-peer-ready-1", | 78 | GNUNET_TESTING_cmd_send_peer_ready ("send-peer-ready-1", |
65 | write_message), | 79 | write_message), |
66 | GNUNET_TESTING_cmd_block_until_all_peers_started ("block-1", | 80 | GNUNET_TESTING_cmd_block_until_all_peers_started ("block-1", |
67 | &are_all_peers_started), | 81 | &are_all_peers_started), |
68 | GNUNET_TESTING_cmd_connect_peers ("connect-peers-1", | 82 | /*GNUNET_TRANSPORT_cmd_connect_peers ("connect-peers-1", |
69 | "start-peer-1", | 83 | "start-peer-1", |
70 | "this is useless"), | 84 | "this is useless"),*/ |
71 | /*GNUNET_TESTING_cmd_send_simple ("send-simple-1", | 85 | /*GNUNET_TESTING_cmd_send_simple ("send-simple-1", |
72 | char *m, | 86 | char *m, |
73 | char *n, | 87 | char *n, |
diff --git a/src/transport/transport_api_cmd_connecting_peers.c b/src/transport/transport_api_cmd_connecting_peers.c index 297b90864..06e2b8d61 100644 --- a/src/transport/transport_api_cmd_connecting_peers.c +++ b/src/transport/transport_api_cmd_connecting_peers.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "gnunet_testing_ng_lib.h" | 28 | #include "gnunet_testing_ng_lib.h" |
29 | #include "gnunet_transport_application_service.h" | 29 | #include "gnunet_transport_application_service.h" |
30 | #include "gnunet_hello_lib.h" | 30 | #include "gnunet_hello_lib.h" |
31 | #include "gnunet_transport_service.h" | ||
31 | 32 | ||
32 | /** | 33 | /** |
33 | * Generic logging shortcut | 34 | * Generic logging shortcut |
@@ -59,8 +60,8 @@ connect_peers_run (void *cls, | |||
59 | enum GNUNET_NetworkType nt = 0; | 60 | enum GNUNET_NetworkType nt = 0; |
60 | 61 | ||
61 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer1_label); | 62 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer1_label); |
62 | GNUNET_TESTING_get_trait_application_handle (peer1_cmd, | 63 | GNUNET_TRANSPORT_get_trait_application_handle (peer1_cmd, |
63 | &ah); | 64 | &ah); |
64 | 65 | ||
65 | GNUNET_TESTING_get_trait_hello (peer1_cmd, | 66 | GNUNET_TESTING_get_trait_hello (peer1_cmd, |
66 | &hello); | 67 | &hello); |
@@ -154,9 +155,9 @@ connect_peers_cleanup (void *cls, | |||
154 | * @return command. | 155 | * @return command. |
155 | */ | 156 | */ |
156 | struct GNUNET_TESTING_Command | 157 | struct GNUNET_TESTING_Command |
157 | GNUNET_TESTING_cmd_connect_peers (const char *label, | 158 | GNUNET_TRANSPORT_cmd_connect_peers (const char *label, |
158 | const char *peer1_label, | 159 | const char *peer1_label, |
159 | const char *peer2_label) | 160 | const char *peer2_label) |
160 | { | 161 | { |
161 | struct ConnectPeersState *cps; | 162 | struct ConnectPeersState *cps; |
162 | 163 | ||
diff --git a/src/transport/transport_api_cmd_start_peer.c b/src/transport/transport_api_cmd_start_peer.c index 4077b7561..0ad9f99af 100644 --- a/src/transport/transport_api_cmd_start_peer.c +++ b/src/transport/transport_api_cmd_start_peer.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "gnunet_testing_ng_lib.h" | 28 | #include "gnunet_testing_ng_lib.h" |
29 | #include "gnunet_peerstore_service.h" | 29 | #include "gnunet_peerstore_service.h" |
30 | #include "gnunet_transport_core_service.h" | 30 | #include "gnunet_transport_core_service.h" |
31 | #include "gnunet_transport_application_service.h" | ||
31 | 32 | ||
32 | /** | 33 | /** |
33 | * Generic logging shortcut | 34 | * Generic logging shortcut |
@@ -483,11 +484,11 @@ GNUNET_TESTING_get_trait_connected_peers_map (const struct | |||
483 | 484 | ||
484 | 485 | ||
485 | int | 486 | int |
486 | GNUNET_TESTING_get_trait_application_handle (const struct | 487 | GNUNET_TRANSPORT_get_trait_application_handle (const struct |
487 | GNUNET_TESTING_Command *cmd, | 488 | GNUNET_TESTING_Command *cmd, |
488 | struct | 489 | struct |
489 | GNUNET_TRANSPORT_ApplicationHandle | 490 | GNUNET_TRANSPORT_ApplicationHandle |
490 | **ah) | 491 | **ah) |
491 | { | 492 | { |
492 | return cmd->traits (cmd->cls, | 493 | return cmd->traits (cmd->cls, |
493 | (const void **) ah, | 494 | (const void **) ah, |
@@ -515,12 +516,12 @@ GNUNET_TESTING_get_trait_peer_id (const struct | |||
515 | * @return command. | 516 | * @return command. |
516 | */ | 517 | */ |
517 | struct GNUNET_TESTING_Command | 518 | struct GNUNET_TESTING_Command |
518 | GNUNET_TESTING_cmd_start_peer (const char *label, | 519 | GNUNET_TRANSPORT_cmd_start_peer (const char *label, |
519 | const char *system_label, | 520 | const char *system_label, |
520 | char *m, | 521 | char *m, |
521 | char *n, | 522 | char *n, |
522 | struct GNUNET_MQ_MessageHandler *handlers, | 523 | struct GNUNET_MQ_MessageHandler *handlers, |
523 | const char *cfgname) | 524 | const char *cfgname) |
524 | { | 525 | { |
525 | struct StartPeerState *sps; | 526 | struct StartPeerState *sps; |
526 | struct GNUNET_CONTAINER_MultiPeerMap *connected_peers_map = | 527 | struct GNUNET_CONTAINER_MultiPeerMap *connected_peers_map = |