GNUnet 0.22.2
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
30#include "gnunet_testing_lib.h"
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
107typedef void *
108(*GNUNET_TRANSPORT_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is,
109 const struct GNUNET_PeerIdentity *peer);
110
111
113{
118 char *testdir;
119
124 char *cfgname;
125
130};
131
132
148 const char *system_label,
149 uint32_t no,
150 const char *node_ip,
152 const char *cfgname,
155 unsigned int broadcast);
156
157
160 const char *start_label);
161
162
176 const char *label,
177 const char *start_peer_label,
178 const char *create_label,
179 uint32_t num,
180 struct GNUNET_TESTING_NetjailTopology *topology,
181 unsigned int additional_connects,
182 unsigned int wait_for_connect);
183
184
197 const char *start_peer_label,
198 const char *create_label,
199 uint32_t num,
201 topology);
202
217 const char *start_peer_label,
218 const char *create_label,
219 uint32_t num,
220 int size,
221 int max_send,
222 struct
224 topology);
225
226
241 const char *start_peer_label,
242 const char *create_label,
243 uint32_t num,
244 unsigned int node_n,
245 unsigned int namespace_n,
247 topology);
248
249
253#define GNUNET_TRANSPORT_SIMPLE_TRAITS(op, prefix) \
254 op (prefix, connect_peer_state, const struct ConnectPeersState)
255
257 GNUNET_TRANSPORT_TESTING)
258
259
260#endif
261/* end of transport_testing.h */
struct GNUNET_MQ_MessageHandlers handlers[]
Definition: 003.c:1
static 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_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.
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 struct GNUNET_TESTBED_System * tl_system
The testing system of this node.
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).
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
Definition: testbed.c:54
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.
Toplogy of our netjail setup.
unsigned int additional_connects
Additional connects we do expect, beside the connects which are configured in the topology.
Connection to another node.
char * cfgname
The name for the configuration file of the specific node.
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)