aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport-testing-cmds.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport-testing-cmds.h')
-rw-r--r--src/transport/transport-testing-cmds.h345
1 files changed, 0 insertions, 345 deletions
diff --git a/src/transport/transport-testing-cmds.h b/src/transport/transport-testing-cmds.h
deleted file mode 100644
index ecdabd35f..000000000
--- a/src/transport/transport-testing-cmds.h
+++ /dev/null
@@ -1,345 +0,0 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
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 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
21/**
22 * @file transport-testing.h
23 * @brief testing lib for transport service
24 * @author Matthias Wachs
25 * @author Christian Grothoff
26 */
27#ifndef TRANSPORT_TESTING_CMDS_H
28#define TRANSPORT_TESTING_CMDS_H
29#include "gnunet_testing_lib.h"
30
31
32struct StartPeerState_v2
33{
34 /**
35 * The ip of a node.
36 */
37 char *node_ip;
38
39 /**
40 * Receive callback
41 */
42 struct GNUNET_MQ_MessageHandler *handlers;
43
44 const char *cfgname;
45
46 /**
47 * Peer's configuration
48 */
49 struct GNUNET_CONFIGURATION_Handle *cfg;
50
51 struct GNUNET_TESTING_Peer *peer;
52
53 /**
54 * Peer identity
55 */
56 struct GNUNET_PeerIdentity id;
57
58 /**
59 * Peer's transport service handle
60 */
61 struct GNUNET_TRANSPORT_CoreHandle *th;
62
63 /**
64 * Application handle
65 */
66 struct GNUNET_TRANSPORT_ApplicationHandle *ah;
67
68 /**
69 * Peer's PEERSTORE Handle
70 */
71 struct GNUNET_PEERSTORE_Handle *ph;
72
73 /**
74 * Hello get task
75 */
76 struct GNUNET_SCHEDULER_Task *rh_task;
77
78 /**
79 * Peer's transport get hello handle to retrieve peer's HELLO message
80 */
81 struct GNUNET_PEERSTORE_IterateContext *pic;
82
83 /**
84 * Hello
85 */
86 char *hello;
87
88 /**
89 * Hello size
90 */
91 size_t hello_size;
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};
113
114
115struct StartPeerState
116{
117 /**
118 * The ip of a node.
119 */
120 char *node_ip;
121
122 /**
123 * Receive callback
124 */
125 struct GNUNET_MQ_MessageHandler *handlers;
126
127 const char *cfgname;
128
129 /**
130 * Peer's configuration
131 */
132 struct GNUNET_CONFIGURATION_Handle *cfg;
133
134 struct GNUNET_TESTING_Peer *peer;
135
136 /**
137 * Peer identity
138 */
139 struct GNUNET_PeerIdentity id;
140
141 /**
142 * Peer's transport service handle
143 */
144 struct GNUNET_TRANSPORT_CoreHandle *th;
145
146 /**
147 * Application handle
148 */
149 struct GNUNET_TRANSPORT_ApplicationHandle *ah;
150
151 /**
152 * Peer's PEERSTORE Handle
153 */
154 struct GNUNET_PEERSTORE_Handle *ph;
155
156 /**
157 * Hello get task
158 */
159 struct GNUNET_SCHEDULER_Task *rh_task;
160
161 /**
162 * Peer's transport get hello handle to retrieve peer's HELLO message
163 */
164 struct GNUNET_PEERSTORE_IterateContext *pic;
165
166 /**
167 * Hello
168 */
169 char *hello;
170
171 /**
172 * Hello size
173 */
174 size_t hello_size;
175
176 char *m;
177
178 char *n;
179
180 char *local_m;
181
182 unsigned int finished;
183
184 const char *system_label;
185
186 /**
187 * An unique number to identify the peer
188 */
189 unsigned int no;
190
191 struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map;
192
193 struct GNUNET_TESTING_System *tl_system;
194
195};
196
197
198int
199GNUNET_TRANSPORT_get_trait_state (const struct
200 GNUNET_TESTING_Command
201 *cmd,
202 struct StartPeerState **sps);
203
204
205struct GNUNET_TESTING_Command
206GNUNET_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
213struct GNUNET_TESTING_Command
214GNUNET_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
221struct GNUNET_TESTING_Command
222GNUNET_TRANSPORT_cmd_start_peer (const char *label,
223 const char *system_label,
224 char *m,
225 char *n,
226 char *local_m,
227 char *node_ip,
228 struct GNUNET_MQ_MessageHandler *handlers,
229 const char *cfgname);
230
231struct GNUNET_TESTING_Command
232GNUNET_TRANSPORT_cmd_stop_peer (const char *label,
233 const char *start_label);
234
235struct GNUNET_TESTING_Command
236GNUNET_TRANSPORT_cmd_connect_peers (const char *label,
237 const char *start_peer_label,
238 const char *create_label,
239 uint32_t num);
240
241struct GNUNET_TESTING_Command
242GNUNET_TRANSPORT_cmd_connect_peers_v2 (const char *label,
243 const char *start_peer_label,
244 const char *create_label,
245 uint32_t num);
246
247struct GNUNET_TESTING_Command
248GNUNET_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
255struct GNUNET_TESTING_Command
256GNUNET_TRANSPORT_cmd_send_simple (const char *label,
257 char *m,
258 char *n,
259 uint32_t num,
260 const char *start_peer_label);
261
262/**
263 * Create command.
264 *
265 * @param label name for command.
266 * @param m The number of the local node of the actual network namespace.
267 * @param n The number of the actual namespace.
268 * @param num Number globally identifying the node.
269 * @param start_peer_label Label of the cmd to start a peer.
270 * @return command.
271 */
272struct GNUNET_TESTING_Command
273GNUNET_TRANSPORT_cmd_send_simple_v2 (const char *label,
274 const char *start_peer_label,
275 uint32_t num);
276
277int
278GNUNET_TRANSPORT_get_trait_peer_id (const struct
279 GNUNET_TESTING_Command *cmd,
280 struct GNUNET_PeerIdentity **id);
281
282int
283GNUNET_TRANSPORT_get_trait_connected_peers_map (const struct
284 GNUNET_TESTING_Command
285 *cmd,
286 struct
287 GNUNET_CONTAINER_MultiShortmap *
288 *
289 connected_peers_map);
290
291int
292GNUNET_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
301int
302GNUNET_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);
310int
311GNUNET_TRANSPORT_get_trait_hello_size (const struct
312 GNUNET_TESTING_Command
313 *cmd,
314 size_t **hello_size);
315
316int
317GNUNET_TRANSPORT_get_trait_hello (const struct
318 GNUNET_TESTING_Command
319 *cmd,
320 char **hello);
321
322
323int
324GNUNET_TRANSPORT_get_trait_application_handle (const struct
325 GNUNET_TESTING_Command *cmd,
326 struct
327 GNUNET_TRANSPORT_ApplicationHandle
328 **ah);
329
330int
331GNUNET_TRANSPORT_get_trait_application_handle_v2 (const struct
332 GNUNET_TESTING_Command *cmd,
333 struct
334 GNUNET_TRANSPORT_ApplicationHandle
335 **ah);
336
337int
338GNUNET_TRANSPORT_get_trait_application_handle_v3 (const struct
339 GNUNET_TESTING_Command *cmd,
340 struct
341 GNUNET_TRANSPORT_ApplicationHandle
342 **ah);
343
344#endif
345/* end of transport_testing.h */