27 #ifndef TRANSPORT_TESTING_CMDS_H
28 #define TRANSPORT_TESTING_CMDS_H
253 const char *system_label,
260 unsigned int broadcast);
265 const char *start_label);
282 const char *start_peer_label,
283 const char *create_label,
301 const char *start_peer_label,
302 const char *create_label,
321 const char *start_peer_label,
322 const char *create_label,
344 const char *start_peer_label,
345 const char *create_label,
348 unsigned int namespace_n,
357 #define GNUNET_TRANSPORT_MAKE_DECL_SIMPLE_TRAIT(name,type) \
358 enum GNUNET_GenericReturnValue \
359 GNUNET_TRANSPORT_get_trait_ ## name ( \
360 const struct GNUNET_TESTING_Command *cmd, \
362 struct GNUNET_TESTING_Trait \
363 GNUNET_TRANSPORT_make_trait_ ## name ( \
371 #define GNUNET_TRANSPORT_MAKE_IMPL_SIMPLE_TRAIT(name,type) \
372 enum GNUNET_GenericReturnValue \
373 GNUNET_TRANSPORT_get_trait_ ## name ( \
374 const struct GNUNET_TESTING_Command *cmd, \
377 if (NULL == cmd->traits) return GNUNET_SYSERR; \
378 return cmd->traits (cmd->cls, \
379 (const void **) ret, \
383 struct GNUNET_TESTING_Trait \
384 GNUNET_TRANSPORT_make_trait_ ## name ( \
387 struct GNUNET_TESTING_Trait ret = { \
388 .trait_name = GNUNET_S (name), \
389 .ptr = (const void *) value \
398 #define GNUNET_TRANSPORT_SIMPLE_TRAITS(op) \
399 op (peer_id, const struct GNUNET_PeerIdentity) \
400 op (connected_peers_map, const struct GNUNET_CONTAINER_MultiShortmap) \
401 op (hello_size, const size_t) \
402 op (hello, const char) \
403 op (application_handle, const struct GNUNET_TRANSPORT_ApplicationHandle) \
404 op (connect_peer_state, const struct ConnectPeersState) \
405 op (state, const struct StartPeerState) \
406 op (broadcast, const enum GNUNET_GenericReturnValue)
enum GNUNET_TESTBED_TopologyOption topology
The topology to generate.
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
struct GNUNET_TESTING_Interpreter * is
static void * notify_connect(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *m)
Function called to notify transport users that another peer connected to us.
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...
GNUNET_GenericReturnValue
Named constants for return values.
static unsigned int size
Size of the "table".
Internal representation of the hash map.
Message handler for a specific message type.
Handle to the PEERSTORE service.
Context for a iterate request.
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.
State each asynchronous command must have in its closure.
A command to be run by the interpreter.
char label[127+1]
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.
Handle for a GNUnet peer controlled by testing.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
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.
char * node_ip
The ip of a node.
enum GNUNET_GenericReturnValue broadcast
Flag indicating, if udp broadcast should be switched on.
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
A map with struct GNUNET_MQ_Handle values for each peer this peer is connected to.
struct GNUNET_TESTING_Peer * peer
struct GNUNET_TESTING_Peer returned by GNUNET_TESTING_peer_configure.
GNUNET_TRANSPORT_notify_connect_cb notify_connect
Callback which is called on neighbour connect events.
char * system_label
The label of the command which was started by calling GNUNET_TESTING_cmd_system_create.
size_t hello_size
Hello size.
struct GNUNET_TRANSPORT_CoreHandle * th
Peer's transport service handle.
char * cfgname
GNUnet configuration file used to start a peer.
struct GNUNET_TRANSPORT_ApplicationHandle * ah
Application handle.
const struct GNUNET_TESTING_System * tl_system
Test setup for this peer.
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
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_TESTBED_Peer * peer
The peer associated with this model.
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)
void *(* GNUNET_TRANSPORT_notify_connect_cb)(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer)
#define GNUNET_TRANSPORT_MAKE_DECL_SIMPLE_TRAIT(name, type)
Create headers for a trait with name name for statically allocated data of type type.
#define GNUNET_TRANSPORT_SIMPLE_TRAITS(op)
Call op on all simple traits.
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_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.
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)
Create command.