GNUnet 0.22.1
gnunet_testing_core_lib.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2021-2023 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
25#ifndef GNUNET_TESTING_CORE_LIB_H
26#define GNUNET_TESTING_CORE_LIB_H
27
28
29#include "gnunet_util_lib.h"
30#include "gnunet_testing_lib.h"
31
32
36// FIXME: breaks naming conventions
38{
43
49
54
59
64
68 const struct GNUNET_TESTING_System *tl_system;
69
70 // Label of the cmd which started the test system.
71 const char *create_label;
72
77 uint32_t num;
78
83 const char *start_peer_label;
84
89
94
96
100 unsigned int con_num;
101
106
110 unsigned int con_num_notified;
111
116
120 unsigned int wait_for_connect;
121};
122
123
138 const char *label,
139 const char *start_peer_label,
140 const char *create_label,
141 uint32_t num,
142 struct GNUNET_TESTING_NetjailTopology *topology,
143 unsigned int additional_connects,
144 unsigned int wait_for_connect,
146
147
151#define GNUNET_CORE_TESTING_SIMPLE_TRAITS(op, prefix) \
152 op (prefix, connect_peer_state, const struct \
153 GNUNET_TESTING_ConnectPeersState)
154
156 GNUNET_CORE_TESTING)
157
158
159#endif
struct GNUNET_MQ_MessageHandlers handlers[]
Definition: 003.c:1
struct GNUNET_TESTING_Command GNUNET_CORE_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, struct GNUNET_MQ_MessageHandler *handlers)
FIXME: document properly! Create command.
#define GNUNET_CORE_TESTING_SIMPLE_TRAITS(op, prefix)
Call op on all simple traits.
#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.
Internal representation of the hash map.
Message handler for a specific message type.
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.
API for cmds working with core sub system provided by libgnunetcoretesting.
uint32_t num
Number globally identifying the node.
unsigned int con_num_notified
Number of connections we already have a notification for.
const struct GNUNET_TESTING_System * tl_system
The testing system of this node.
unsigned int additional_connects
Number of additional connects this cmd will wait for not triggered by this cmd.
struct GNUNET_TESTING_Interpreter * is
unsigned int wait_for_connect
Flag indicating, whether the command is waiting for peers to connect that are configured to connect.
struct GNUNET_CONTAINER_MultiShortmap * connected_peers_map
A map with struct GNUNET_MQ_Handle values for each peer this peer is connected to.
struct GNUNET_MQ_MessageHandler * handlers
Receive callback.
unsigned int additional_connects_notified
Number of additional connects this cmd will wait for not triggered by this cmd we already have a noti...
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
unsigned int con_num
Number of connections.
const char * start_peer_label
Label of the cmd to start a peer.
struct GNUNET_TRANSPORT_ApplicationHandle * ah
Handle for transport.
struct GNUNET_TESTING_NodeConnection * node_connections_head
Connections to other peers.
struct GNUNET_TRANSPORT_CoreHandle * th
Core handle.
struct GNUNET_TESTING_NetjailTopology * topology
The topology of the test setup.
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.
Handle to the TRANSPORT subsystem for application management.
Handle for the transport service (includes all of the state for the transport service).