GNUnet  0.11.x
transport-testing-cmds.h
Go to the documentation of this file.
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 
27 #ifndef TRANSPORT_TESTING_CMDS_H
28 #define TRANSPORT_TESTING_CMDS_H
29 #include "gnunet_testing_lib.h"
30 
31 
33 {
37  char *node_ip;
38 
43 
44  const char *cfgname;
45 
50 
52 
56  struct GNUNET_PeerIdentity id;
57 
62 
67 
72 
77 
82 
86  char *hello;
87 
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 
106  unsigned int no;
107 
109 
111 
112 };
113 
114 
116 {
120  char *node_ip;
121 
126 
127  const char *cfgname;
128 
133 
135 
139  struct GNUNET_PeerIdentity id;
140 
145 
150 
155 
160 
165 
169  char *hello;
170 
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 
189  unsigned int no;
190 
192 
194 
195 };
196 
197 
198 int
201  *cmd,
202  struct StartPeerState **sps);
203 
204 
207  const char *system_label,
208  uint32_t no,
209  char *node_ip,
211  const char *cfgname);
212 
215  const char *system_label,
216  char *m,
217  char *n,
218  char *local_m,
219  char *node_ip,
221  const char *cfgname);
222 
225  const char *start_label);
226 
229  const char *start_peer_label,
230  const char *create_label,
231  uint32_t num);
232 
235  const char *start_peer_label,
236  const char *create_label,
237  uint32_t num);
238 
241  char *m,
242  char *n,
243  uint32_t num,
244  const char *start_peer_label);
245 
258  const char *start_peer_label,
259  uint32_t num);
260 
261 int
264  struct GNUNET_PeerIdentity **id);
265 
266 int
269  *cmd,
270  struct
272  *
273  connected_peers_map);
274 
275 int
278  *cmd,
279  struct
281  *
282  *
283  connected_peers_map);
284 int
287  *cmd,
288  size_t **hello_size);
289 
290 int
293  *cmd,
294  char **hello);
295 
296 
297 int
300  struct
302  **ah);
303 
304 int
307  struct
309  **ah);
310 
311 #endif
312 /* end of transport_testing.h */
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:104
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
static struct GNUNET_NAT_AUTO_AutoHandle * ah
Handle to ongoing autoconfiguration.
Internal representation of the hash map.
Message handler for a specific message type.
Handle to the PEERSTORE service.
Definition: peerstore_api.c:41
Context for a iterate request.
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.
Definition: scheduler.c:135
A command to be run by the interpreter.
const char * label
Label for the command.
Handle for a GNUnet peer controlled by testing.
Definition: testing.c:166
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
Definition: testing.c:93
Handle to the TRANSPORT subsystem for application management.
Handle for the transport service (includes all of the state for the transport service).
unsigned int no
An unique number to identify the peer.
struct GNUNET_PeerIdentity id
Peer identity.
struct GNUNET_TESTING_Peer * peer
struct GNUNET_CONFIGURATION_Handle * cfg
Peer's configuration.
size_t hello_size
Hello size.
struct GNUNET_TRANSPORT_ApplicationHandle * ah
Application handle.
struct GNUNET_TESTING_System * tl_system
struct GNUNET_CONTAINER_MultiShortmap * connected_peers_map
char * node_ip
The ip of a node.
struct GNUNET_PEERSTORE_Handle * ph
Peer's PEERSTORE Handle.
struct GNUNET_PEERSTORE_IterateContext * pic
Peer's transport get hello handle to retrieve peer's HELLO message.
struct GNUNET_TRANSPORT_CoreHandle * th
Peer's transport service handle.
struct GNUNET_MQ_MessageHandler * handlers
Receive callback.
struct GNUNET_SCHEDULER_Task * rh_task
Hello get task.
unsigned int no
An unique number to identify the peer.
struct GNUNET_PeerIdentity id
Peer identity.
struct GNUNET_TESTING_System * tl_system
char * node_ip
The ip of a node.
struct GNUNET_MQ_MessageHandler * handlers
Receive callback.
struct GNUNET_CONFIGURATION_Handle * cfg
Peer's configuration.
struct GNUNET_PEERSTORE_Handle * ph
Peer's PEERSTORE Handle.
struct GNUNET_SCHEDULER_Task * rh_task
Hello get task.
struct GNUNET_PEERSTORE_IterateContext * pic
Peer's transport get hello handle to retrieve peer's HELLO message.
struct GNUNET_CONTAINER_MultiShortmap * connected_peers_map
struct GNUNET_TESTING_Peer * peer
size_t hello_size
Hello size.
struct GNUNET_TRANSPORT_CoreHandle * th
Peer's transport service handle.
struct GNUNET_TRANSPORT_ApplicationHandle * ah
Application handle.
int GNUNET_TRANSPORT_get_trait_connected_peers_map(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_CONTAINER_MultiShortmap **connected_peers_map)
Function to get the trait with the map of connected peers.
int GNUNET_TRANSPORT_get_trait_hello_size(const struct GNUNET_TESTING_Command *cmd, size_t **hello_size)
Function to get the trait with the size of the hello.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_send_simple(const char *label, char *m, char *n, uint32_t num, const char *start_peer_label)
Create command.
int GNUNET_TRANSPORT_get_trait_hello(const struct GNUNET_TESTING_Command *cmd, char **hello)
Function to get the trait with the hello.
int GNUNET_TRANSPORT_get_trait_peer_id(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_PeerIdentity **id)
Function to get the trait with the peer id.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_start_peer(const char *label, const char *system_label, char *m, char *n, char *local_m, char *node_ip, struct GNUNET_MQ_MessageHandler *handlers, const char *cfgname)
Create command.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_stop_peer(const char *label, const char *start_label)
Create command.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_send_simple_v2(const char *label, const char *start_peer_label, uint32_t num)
Create command.
int GNUNET_TRANSPORT_get_trait_application_handle_v2(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_TRANSPORT_ApplicationHandle **ah)
Function to get the trait with the transport application handle.
int GNUNET_TRANSPORT_get_trait_connected_peers_map_v2(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_CONTAINER_MultiShortmap **connected_peers_map)
Function to get the trait with the map of connected peers.
int GNUNET_TRANSPORT_get_trait_application_handle(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_TRANSPORT_ApplicationHandle **ah)
Function to get the trait with the transport application handle.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_connect_peers(const char *label, const char *start_peer_label, const char *create_label, uint32_t num)
Create command.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_start_peer_v2(const char *label, const char *system_label, uint32_t no, char *node_ip, struct GNUNET_MQ_MessageHandler *handlers, const char *cfgname)
Create command.
int GNUNET_TRANSPORT_get_trait_state(const struct GNUNET_TESTING_Command *cmd, struct StartPeerState **sps)
Function to get the trait with the struct StartPeerState.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_connect_peers_v2(const char *label, const char *start_peer_label, const char *create_label, uint32_t num)
Create command.