diff options
Diffstat (limited to 'src/transport/transport_api_cmd_send_simple.c')
-rw-r--r-- | src/transport/transport_api_cmd_send_simple.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/transport/transport_api_cmd_send_simple.c b/src/transport/transport_api_cmd_send_simple.c index 4a60f1a12..6e7b89497 100644 --- a/src/transport/transport_api_cmd_send_simple.c +++ b/src/transport/transport_api_cmd_send_simple.c | |||
@@ -26,7 +26,8 @@ | |||
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
28 | #include "gnunet_testing_ng_lib.h" | 28 | #include "gnunet_testing_ng_lib.h" |
29 | #include "transport-testing.h" | 29 | #include "transport-testing2.h" |
30 | #include "transport-testing-cmds.h" | ||
30 | 31 | ||
31 | struct SendSimpleState | 32 | struct SendSimpleState |
32 | { | 33 | { |
@@ -70,21 +71,26 @@ send_simple_run (void *cls, | |||
70 | struct GNUNET_MQ_Envelope *env; | 71 | struct GNUNET_MQ_Envelope *env; |
71 | struct GNUNET_TRANSPORT_TESTING_TestMessage *test; | 72 | struct GNUNET_TRANSPORT_TESTING_TestMessage *test; |
72 | struct GNUNET_MQ_Handle *mq; | 73 | struct GNUNET_MQ_Handle *mq; |
73 | struct GNUNET_CONTAINER_MultiPeerMap *connected_peers_map; | 74 | struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map; |
74 | struct GNUNET_PeerIdentity *id; | 75 | struct GNUNET_PeerIdentity *id; |
75 | const struct GNUNET_TESTING_Command *peer1_cmd; | 76 | const struct GNUNET_TESTING_Command *peer1_cmd; |
76 | const struct GNUNET_TESTING_Command *peer2_cmd; | 77 | const struct GNUNET_TESTING_Command *peer2_cmd; |
78 | struct GNUNET_ShortHashCode *key = GNUNET_new (struct GNUNET_ShortHashCode); | ||
79 | struct GNUNET_HashCode hc; | ||
80 | int node_number; | ||
77 | 81 | ||
78 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (sss->peer1_label); | 82 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (sss->peer1_label); |
79 | GNUNET_TRANSPORT_get_trait_connected_peers_map (peer1_cmd, | 83 | GNUNET_TRANSPORT_get_trait_connected_peers_map (peer1_cmd, |
80 | &connected_peers_map); | 84 | &connected_peers_map); |
81 | 85 | ||
82 | peer2_cmd = GNUNET_TESTING_interpreter_lookup_command (sss->peer2_label); | 86 | node_number = 1; |
83 | GNUNET_TRANSPORT_get_trait_peer_id (peer2_cmd, | 87 | GNUNET_CRYPTO_hash (&node_number, sizeof(node_number), &hc); |
84 | &id); | 88 | memcpy (key, |
85 | 89 | &hc, | |
86 | mq = GNUNET_CONTAINER_multipeermap_get (connected_peers_map, | 90 | sizeof (*key)); |
87 | id); | 91 | |
92 | mq = GNUNET_CONTAINER_multishortmap_get (connected_peers_map, | ||
93 | key); | ||
88 | 94 | ||
89 | env = GNUNET_MQ_msg_extra (test, | 95 | env = GNUNET_MQ_msg_extra (test, |
90 | 2600 - sizeof(*test), | 96 | 2600 - sizeof(*test), |
@@ -110,7 +116,7 @@ send_simple_run (void *cls, | |||
110 | * @return command. | 116 | * @return command. |
111 | */ | 117 | */ |
112 | struct GNUNET_TESTING_Command | 118 | struct GNUNET_TESTING_Command |
113 | GNUNET_TESTING_cmd_send_simple (const char *label, | 119 | GNUNET_TRANSPORT_cmd_send_simple (const char *label, |
114 | char *m, | 120 | char *m, |
115 | char *n, | 121 | char *n, |
116 | uint32_t num, | 122 | uint32_t num, |