diff options
author | t3sserakt <t3ss@posteo.de> | 2021-10-14 16:39:24 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2021-10-14 16:39:24 +0200 |
commit | d64ac269856744b9bab170964e1d6f36896ecc55 (patch) | |
tree | ed5aa79b91fe3cf9388433a5611581b7ce3b846c /src/transport/transport-testing-cmds.h | |
parent | 003910fc614cd347919707d1bf3c37a939978459 (diff) | |
download | gnunet-d64ac269856744b9bab170964e1d6f36896ecc55.tar.gz gnunet-d64ac269856744b9bab170964e1d6f36896ecc55.zip |
removed versioned artefacts with v2 and v3. changes to reflect the changes in testing_api_loop.c
Diffstat (limited to 'src/transport/transport-testing-cmds.h')
-rw-r--r-- | src/transport/transport-testing-cmds.h | 201 |
1 files changed, 66 insertions, 135 deletions
diff --git a/src/transport/transport-testing-cmds.h b/src/transport/transport-testing-cmds.h index ecdabd35f..f6e34df62 100644 --- a/src/transport/transport-testing-cmds.h +++ b/src/transport/transport-testing-cmds.h | |||
@@ -29,92 +29,71 @@ | |||
29 | #include "gnunet_testing_lib.h" | 29 | #include "gnunet_testing_lib.h" |
30 | 30 | ||
31 | 31 | ||
32 | struct StartPeerState_v2 | 32 | /** |
33 | * Struct to store information needed in callbacks. | ||
34 | * | ||
35 | */ | ||
36 | struct ConnectPeersState | ||
33 | { | 37 | { |
34 | /** | 38 | /** |
35 | * The ip of a node. | 39 | * Context for our asynchronous completion. |
36 | */ | ||
37 | char *node_ip; | ||
38 | |||
39 | /** | ||
40 | * Receive callback | ||
41 | */ | 40 | */ |
42 | struct GNUNET_MQ_MessageHandler *handlers; | 41 | struct GNUNET_TESTING_AsyncContext ac; |
43 | 42 | ||
44 | const char *cfgname; | 43 | GNUNET_TRANSPORT_NotifyConnect notify_connect; |
45 | 44 | ||
46 | /** | 45 | /** |
47 | * Peer's configuration | 46 | * The testing system of this node. |
48 | */ | 47 | */ |
49 | struct GNUNET_CONFIGURATION_Handle *cfg; | 48 | struct GNUNET_TESTING_System *tl_system; |
50 | |||
51 | struct GNUNET_TESTING_Peer *peer; | ||
52 | 49 | ||
53 | /** | 50 | // Label of the cmd which started the test system. |
54 | * Peer identity | 51 | const char *create_label; |
55 | */ | ||
56 | struct GNUNET_PeerIdentity id; | ||
57 | 52 | ||
58 | /** | 53 | /** |
59 | * Peer's transport service handle | 54 | * Number globally identifying the node. |
55 | * | ||
60 | */ | 56 | */ |
61 | struct GNUNET_TRANSPORT_CoreHandle *th; | 57 | uint32_t num; |
62 | 58 | ||
63 | /** | 59 | /** |
64 | * Application handle | 60 | * Label of the cmd to start a peer. |
61 | * | ||
65 | */ | 62 | */ |
66 | struct GNUNET_TRANSPORT_ApplicationHandle *ah; | 63 | const char *start_peer_label; |
67 | 64 | ||
68 | /** | 65 | /** |
69 | * Peer's PEERSTORE Handle | 66 | * The peer identity of this peer. |
67 | * | ||
70 | */ | 68 | */ |
71 | struct GNUNET_PEERSTORE_Handle *ph; | 69 | struct GNUNET_PeerIdentity *id; |
72 | 70 | ||
73 | /** | 71 | /** |
74 | * Hello get task | 72 | * The topology of the test setup. |
75 | */ | 73 | */ |
76 | struct GNUNET_SCHEDULER_Task *rh_task; | 74 | struct GNUNET_TESTING_NetjailTopology *topology; |
77 | 75 | ||
78 | /** | 76 | /** |
79 | * Peer's transport get hello handle to retrieve peer's HELLO message | 77 | * Connections to other peers. |
80 | */ | 78 | */ |
81 | struct GNUNET_PEERSTORE_IterateContext *pic; | 79 | struct GNUNET_TESTING_NodeConnection *node_connections_head; |
82 | 80 | ||
83 | /** | 81 | struct GNUNET_TESTING_Interpreter *is; |
84 | * Hello | ||
85 | */ | ||
86 | char *hello; | ||
87 | 82 | ||
88 | /** | 83 | /** |
89 | * Hello size | 84 | * Number of connections. |
90 | */ | 85 | */ |
91 | size_t hello_size; | 86 | unsigned int con_num; |
92 | |||
93 | char *m; | ||
94 | |||
95 | char *n; | ||
96 | |||
97 | char *local_m; | ||
98 | |||
99 | unsigned int finished; | ||
100 | |||
101 | const char *system_label; | ||
102 | |||
103 | /** | ||
104 | * An unique number to identify the peer | ||
105 | */ | ||
106 | unsigned int no; | ||
107 | |||
108 | struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map; | ||
109 | |||
110 | struct GNUNET_TESTING_System *tl_system; | ||
111 | |||
112 | }; | 87 | }; |
113 | 88 | ||
114 | |||
115 | struct StartPeerState | 89 | struct StartPeerState |
116 | { | 90 | { |
117 | /** | 91 | /** |
92 | * Context for our asynchronous completion. | ||
93 | */ | ||
94 | struct GNUNET_TESTING_AsyncContext ac; | ||
95 | |||
96 | /** | ||
118 | * The ip of a node. | 97 | * The ip of a node. |
119 | */ | 98 | */ |
120 | char *node_ip; | 99 | char *node_ip; |
@@ -179,8 +158,6 @@ struct StartPeerState | |||
179 | 158 | ||
180 | char *local_m; | 159 | char *local_m; |
181 | 160 | ||
182 | unsigned int finished; | ||
183 | |||
184 | const char *system_label; | 161 | const char *system_label; |
185 | 162 | ||
186 | /** | 163 | /** |
@@ -192,9 +169,24 @@ struct StartPeerState | |||
192 | 169 | ||
193 | struct GNUNET_TESTING_System *tl_system; | 170 | struct GNUNET_TESTING_System *tl_system; |
194 | 171 | ||
172 | GNUNET_TRANSPORT_NotifyConnect notify_connect; | ||
173 | |||
195 | }; | 174 | }; |
196 | 175 | ||
197 | 176 | ||
177 | /** | ||
178 | * Function to get the trait with the struct ConnectPeersState. | ||
179 | * | ||
180 | * @param[out] sps struct ConnectPeersState. | ||
181 | * @return #GNUNET_OK if no error occurred, #GNUNET_SYSERR otherwise. | ||
182 | * | ||
183 | */ | ||
184 | int | ||
185 | GNUNET_TESTING_get_trait_connect_peer_state ( | ||
186 | const struct GNUNET_TESTING_Command *cmd, | ||
187 | struct ConnectPeersState **cps); | ||
188 | |||
189 | |||
198 | int | 190 | int |
199 | GNUNET_TRANSPORT_get_trait_state (const struct | 191 | GNUNET_TRANSPORT_get_trait_state (const struct |
200 | GNUNET_TESTING_Command | 192 | GNUNET_TESTING_Command |
@@ -203,61 +195,28 @@ GNUNET_TRANSPORT_get_trait_state (const struct | |||
203 | 195 | ||
204 | 196 | ||
205 | struct GNUNET_TESTING_Command | 197 | struct GNUNET_TESTING_Command |
206 | GNUNET_TRANSPORT_cmd_start_peer_v2 (const char *label, | ||
207 | const char *system_label, | ||
208 | uint32_t no, | ||
209 | char *node_ip, | ||
210 | struct GNUNET_MQ_MessageHandler *handlers, | ||
211 | const char *cfgname); | ||
212 | |||
213 | struct GNUNET_TESTING_Command | ||
214 | GNUNET_TRANSPORT_cmd_start_peer_v3 (const char *label, | ||
215 | const char *system_label, | ||
216 | uint32_t no, | ||
217 | char *node_ip, | ||
218 | struct GNUNET_MQ_MessageHandler *handlers, | ||
219 | const char *cfgname); | ||
220 | |||
221 | struct GNUNET_TESTING_Command | ||
222 | GNUNET_TRANSPORT_cmd_start_peer (const char *label, | 198 | GNUNET_TRANSPORT_cmd_start_peer (const char *label, |
223 | const char *system_label, | 199 | const char *system_label, |
224 | char *m, | 200 | uint32_t no, |
225 | char *n, | ||
226 | char *local_m, | ||
227 | char *node_ip, | 201 | char *node_ip, |
228 | struct GNUNET_MQ_MessageHandler *handlers, | 202 | struct GNUNET_MQ_MessageHandler *handlers, |
229 | const char *cfgname); | 203 | const char *cfgname, |
204 | GNUNET_TRANSPORT_NotifyConnect notify_connect); | ||
205 | |||
230 | 206 | ||
231 | struct GNUNET_TESTING_Command | 207 | struct GNUNET_TESTING_Command |
232 | GNUNET_TRANSPORT_cmd_stop_peer (const char *label, | 208 | GNUNET_TRANSPORT_cmd_stop_peer (const char *label, |
233 | const char *start_label); | 209 | const char *start_label); |
234 | 210 | ||
211 | |||
235 | struct GNUNET_TESTING_Command | 212 | struct GNUNET_TESTING_Command |
236 | GNUNET_TRANSPORT_cmd_connect_peers (const char *label, | 213 | GNUNET_TRANSPORT_cmd_connect_peers (const char *label, |
237 | const char *start_peer_label, | 214 | const char *start_peer_label, |
238 | const char *create_label, | 215 | const char *create_label, |
239 | uint32_t num); | 216 | uint32_t num, |
240 | 217 | struct GNUNET_TESTING_NetjailTopology * | |
241 | struct GNUNET_TESTING_Command | 218 | topology); |
242 | GNUNET_TRANSPORT_cmd_connect_peers_v2 (const char *label, | ||
243 | const char *start_peer_label, | ||
244 | const char *create_label, | ||
245 | uint32_t num); | ||
246 | |||
247 | struct GNUNET_TESTING_Command | ||
248 | GNUNET_TRANSPORT_cmd_connect_peers_v3 (const char *label, | ||
249 | const char *start_peer_label, | ||
250 | const char *create_label, | ||
251 | uint32_t num, | ||
252 | struct GNUNET_TESTING_NetjailTopology * | ||
253 | topology); | ||
254 | 219 | ||
255 | struct GNUNET_TESTING_Command | ||
256 | GNUNET_TRANSPORT_cmd_send_simple (const char *label, | ||
257 | char *m, | ||
258 | char *n, | ||
259 | uint32_t num, | ||
260 | const char *start_peer_label); | ||
261 | 220 | ||
262 | /** | 221 | /** |
263 | * Create command. | 222 | * Create command. |
@@ -270,43 +229,29 @@ GNUNET_TRANSPORT_cmd_send_simple (const char *label, | |||
270 | * @return command. | 229 | * @return command. |
271 | */ | 230 | */ |
272 | struct GNUNET_TESTING_Command | 231 | struct GNUNET_TESTING_Command |
273 | GNUNET_TRANSPORT_cmd_send_simple_v2 (const char *label, | 232 | GNUNET_TRANSPORT_cmd_send_simple (const char *label, |
274 | const char *start_peer_label, | 233 | const char *start_peer_label, |
275 | uint32_t num); | 234 | uint32_t num); |
235 | |||
236 | |||
237 | |||
238 | |||
276 | 239 | ||
277 | int | 240 | int |
278 | GNUNET_TRANSPORT_get_trait_peer_id (const struct | 241 | GNUNET_TRANSPORT_get_trait_peer_id (const struct |
279 | GNUNET_TESTING_Command *cmd, | 242 | GNUNET_TESTING_Command *cmd, |
280 | struct GNUNET_PeerIdentity **id); | 243 | struct GNUNET_PeerIdentity **id); |
281 | 244 | ||
245 | |||
282 | int | 246 | int |
283 | GNUNET_TRANSPORT_get_trait_connected_peers_map (const struct | 247 | GNUNET_TRANSPORT_get_trait_connected_peers_map (const struct |
284 | GNUNET_TESTING_Command | 248 | GNUNET_TESTING_Command |
285 | *cmd, | 249 | *cmd, |
286 | struct | 250 | struct |
287 | GNUNET_CONTAINER_MultiShortmap * | 251 | GNUNET_CONTAINER_MultiShortmap |
252 | * | ||
288 | * | 253 | * |
289 | connected_peers_map); | 254 | connected_peers_map); |
290 | |||
291 | int | ||
292 | GNUNET_TRANSPORT_get_trait_connected_peers_map_v2 (const struct | ||
293 | GNUNET_TESTING_Command | ||
294 | *cmd, | ||
295 | struct | ||
296 | GNUNET_CONTAINER_MultiShortmap | ||
297 | * | ||
298 | * | ||
299 | connected_peers_map); | ||
300 | |||
301 | int | ||
302 | GNUNET_TRANSPORT_get_trait_connected_peers_map_v3 (const struct | ||
303 | GNUNET_TESTING_Command | ||
304 | *cmd, | ||
305 | struct | ||
306 | GNUNET_CONTAINER_MultiShortmap | ||
307 | * | ||
308 | * | ||
309 | connected_peers_map); | ||
310 | int | 255 | int |
311 | GNUNET_TRANSPORT_get_trait_hello_size (const struct | 256 | GNUNET_TRANSPORT_get_trait_hello_size (const struct |
312 | GNUNET_TESTING_Command | 257 | GNUNET_TESTING_Command |
@@ -327,19 +272,5 @@ GNUNET_TRANSPORT_get_trait_application_handle (const struct | |||
327 | GNUNET_TRANSPORT_ApplicationHandle | 272 | GNUNET_TRANSPORT_ApplicationHandle |
328 | **ah); | 273 | **ah); |
329 | 274 | ||
330 | int | ||
331 | GNUNET_TRANSPORT_get_trait_application_handle_v2 (const struct | ||
332 | GNUNET_TESTING_Command *cmd, | ||
333 | struct | ||
334 | GNUNET_TRANSPORT_ApplicationHandle | ||
335 | **ah); | ||
336 | |||
337 | int | ||
338 | GNUNET_TRANSPORT_get_trait_application_handle_v3 (const struct | ||
339 | GNUNET_TESTING_Command *cmd, | ||
340 | struct | ||
341 | GNUNET_TRANSPORT_ApplicationHandle | ||
342 | **ah); | ||
343 | |||
344 | #endif | 275 | #endif |
345 | /* end of transport_testing.h */ | 276 | /* end of transport_testing.h */ |