GNUnet 0.21.0
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
32
33
38// FIXME: breaks naming conventions! Needed public?
40{
45
47
52
53 // Label of the cmd which started the test system.
54 const char *create_label;
55
60 uint32_t num;
61
66 const char *start_peer_label;
67
72
77
79
83 unsigned int con_num;
84
88 unsigned int additional_connects;
89
93 unsigned int con_num_notified;
94
99
103 unsigned int wait_for_connect;
104};
105
106
107
108typedef void *
109(*GNUNET_TRANSPORT_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is,
110 const struct GNUNET_PeerIdentity *peer);
111
112
113
115{
121
126
131 char *testdir;
132
137 char *cfgname;
138
143};
144
145
161 const char *system_label,
162 uint32_t no,
163 const char *node_ip,
165 const char *cfgname,
168 unsigned int broadcast);
169
170
173 const char *start_label);
174
175
189 const char *label,
190 const char *start_peer_label,
191 const char *create_label,
192 uint32_t num,
193 struct GNUNET_TESTING_NetjailTopology *topology,
194 unsigned int additional_connects,
195 unsigned int wait_for_connect);
196
197
210 const char *start_peer_label,
211 const char *create_label,
212 uint32_t num,
214 topology);
215
230 const char *start_peer_label,
231 const char *create_label,
232 uint32_t num,
233 int size,
234 int max_send,
236 topology);
237
238
253 const char *start_peer_label,
254 const char *create_label,
255 uint32_t num,
256 unsigned int node_n,
257 unsigned int namespace_n,
259 topology);
260
261
262
266#define GNUNET_TRANSPORT_SIMPLE_TRAITS(op, prefix) \
267 op (prefix, connect_peer_state, const struct ConnectPeersState)
268
270
271
272#endif
273/* end of transport_testing.h */
struct GNUNET_MQ_MessageHandlers handlers[]
Definition: 003.c:1
struct GNUNET_TESTING_Interpreter * is
static void * notify_connect(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
Function called to notify transport users that another peer connected to us.
#define GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(prefix, name, type)
Create headers for a trait with name name for statically allocated data of type type.
void(* GNUNET_TESTING_cmd_helper_finish_cb)()
Callback function which writes a message from the helper process running on a netjail node to the mas...
void(* GNUNET_TESTING_cmd_helper_write_cb)(struct GNUNET_MessageHeader *message, size_t msg_length)
Callback function to write messages from the helper process running on a netjail node to the master p...
void *(* GNUNET_TESTING_notify_connect_cb)(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer)
static unsigned int size
Size of the "table".
Definition: peer.c:68
Struct to store information needed in callbacks.
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
unsigned int con_num
Number of connections.
uint32_t num
Number globally identifying the node.
unsigned int additional_connects_notified
Number of additional connects this cmd will wait for not triggered by this cmd we already have a noti...
GNUNET_TESTING_notify_connect_cb notify_connect
struct GNUNET_TESTING_Interpreter * is
struct GNUNET_TESTING_NodeConnection * node_connections_head
Connections to other peers.
struct GNUNET_TESTING_NetjailTopology * topology
The topology of the test setup.
const struct GNUNET_TESTING_System * tl_system
The testing system of this node.
unsigned int wait_for_connect
Flag indicating, whether the command is waiting for peers to connect that are configured to connect.
unsigned int con_num_notified
Number of connections we already have a notification for.
const char * start_peer_label
Label of the cmd to start a peer.
unsigned int additional_connects
Number of additional connects this cmd will wait for not triggered by this cmd.
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).
State each asynchronous command must have in its closure.
A command to be run by the interpreter.
struct GNUNET_TESTING_CommandLabel label
Label for the command.
Global state of the interpreter, used by a command to access information about other commands.
unsigned int additional_connects
Additional connects we do expect, beside the connects which are configured in the topology.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
Definition: testing.c:122
char * cfgname
The name for the configuration file of the specific node.
GNUNET_TESTING_cmd_helper_write_cb write_message
Callback to write messages to the master loop.
GNUNET_TESTING_cmd_helper_finish_cb finished_cb
Callback to notify the helper test case has finished.
char * testdir
The name for a specific test environment directory.
struct GNUNET_TESTING_NetjailTopology * topology
The complete topology information.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_send_simple_performance(const char *label, const char *start_peer_label, const char *create_label, uint32_t num, int size, int max_send, struct GNUNET_TESTING_NetjailTopology *topology)
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_connect_peers(const char *label, const char *start_peer_label, const char *create_label, uint32_t num, struct GNUNET_TESTING_NetjailTopology *topology, unsigned int additional_connects, unsigned int wait_for_connect)
Create command.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_backchannel_check(const char *label, const char *start_peer_label, const char *create_label, uint32_t num, unsigned int node_n, unsigned int namespace_n, struct GNUNET_TESTING_NetjailTopology *topology)
Create command.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_send_simple(const char *label, const char *start_peer_label, const char *create_label, uint32_t num, struct GNUNET_TESTING_NetjailTopology *topology)
Create command.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_start_peer(const char *label, const char *system_label, uint32_t no, const char *node_ip, struct GNUNET_MQ_MessageHandler *handlers, const char *cfgname, GNUNET_TRANSPORT_notify_connect_cb notify_connect, unsigned int broadcast)
Create command.
#define GNUNET_TRANSPORT_SIMPLE_TRAITS(op, prefix)
Call op on all simple traits.
void *(* GNUNET_TRANSPORT_notify_connect_cb)(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer)