GNUnet 0.21.2
gnunet_testing_transport_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_TRANSPORT_TESTING_NG_LIB_H
26#define GNUNET_TRANSPORT_TESTING_NG_LIB_H
27
28
29#include "gnunet_util_lib.h"
30#include "gnunet_testing_lib.h"
31
36
37
38// FIXME: breaks naming conventions
39typedef void *
40(*GNUNET_TESTING_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is,
41 const struct GNUNET_PeerIdentity *peer);
42
43
44// FIXME: breaks naming conventions! Needed public?
46{
51
55 char *node_ip;
56
61
65 char *cfgname;
66
71
75 struct GNUNET_TESTING_Peer *peer;
76
81
86
91
96
101
106
110 char *hello;
111
116
121
125 unsigned int no;
126
132
136 const struct GNUNET_TESTING_System *tl_system;
137
142
147};
148
149
163 const char *system_label,
164 uint32_t no,
165 const char *node_ip,
166 const char *cfgname,
167 unsigned int broadcast);
168
169
172 const char *start_label);
173
174
182struct GNUNET_PeerIdentity *
183GNUNET_TESTING_get_peer (unsigned int num,
184 const struct GNUNET_TESTING_System *tl_system);
185
186
190#define GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS(op, prefix) \
191 op (prefix, connected_peers_map, const struct \
192 GNUNET_CONTAINER_MultiShortmap) \
193 op (prefix, peer_id, const struct GNUNET_PeerIdentity) \
194 op (prefix, hello_size, const size_t) \
195 op (prefix, hello, const char) \
196 op (prefix, application_handle, const struct \
197 GNUNET_TRANSPORT_ApplicationHandle) \
198 op (prefix, state, const struct GNUNET_TESTING_StartPeerState) \
199 op (prefix, broadcast, const enum GNUNET_GenericReturnValue)
200
201
203 GNUNET_TRANSPORT_TESTING)
204
205#endif
static struct GNUNET_TESTING_Interpreter * is
#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.
#define GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS(op, prefix)
Call op on all simple traits.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_peer(const char *label, const char *start_label)
Create command.
struct GNUNET_PeerIdentity * GNUNET_TESTING_get_peer(unsigned int num, const struct GNUNET_TESTING_System *tl_system)
Retrieve peer identity from the test system with the unique node id.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_start_peer(const char *label, const char *system_label, uint32_t no, const char *node_ip, const char *cfgname, unsigned int broadcast)
Create command.
void *(* GNUNET_TESTING_notify_connect_cb)(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer)
GNUNET_GenericReturnValue
Named constants for return values.
Internal representation of the hash map.
Message handler for a specific message type.
Handle to the PEERSTORE service.
Definition: peerstore_api.c:44
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:136
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.
Handle for a peer controlled via ARM.
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
struct GNUNET_PeerIdentity id
Peer identity.
struct GNUNET_PEERSTORE_IterateContext * pic
Peer's transport get hello handle to retrieve peer's HELLO message.
const struct GNUNET_TESTING_System * tl_system
Test setup for this peer.
struct GNUNET_TRANSPORT_ApplicationHandle * ah
Application handle.
struct GNUNET_MQ_MessageHandler * handlers
Receive callback.
char * system_label
The label of the command which was started by calling GNUNET_TESTING_cmd_system_create.
unsigned int no
An unique number to identify the peer.
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_PEERSTORE_Handle * ph
Peer's PEERSTORE Handle.
struct GNUNET_TESTING_Peer * peer
struct GNUNET_TESTING_Peer returned by GNUNET_TESTING_peer_configure.
GNUNET_TESTING_notify_connect_cb notify_connect
Callback which is called on neighbour connect events.
enum GNUNET_GenericReturnValue broadcast
Flag indicating, if udp broadcast should be switched on.
struct GNUNET_TRANSPORT_CoreHandle * th
Peer's transport service handle.
struct GNUNET_CONFIGURATION_Handle * cfg
Peer's configuration.
struct GNUNET_SCHEDULER_Task * rh_task
Hello get task.
char * cfgname
GNUnet configuration file used to start a peer.
Handle to the TRANSPORT subsystem for application management.
Handle for the transport service (includes all of the state for the transport service).