GNUnet 0.22.0
gnunet_testing_transport_lib.h File Reference
Include dependency graph for gnunet_testing_transport_lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_TESTING_StartPeerState
 Handle for a peer controlled via ARM. More...
 

Macros

#define GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS(op, prefix)
 Call op on all simple traits. More...
 

Typedefs

typedef void *(* GNUNET_TESTING_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer)
 

Functions

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. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_peer (const char *label, const char *start_label)
 Create command. More...
 
struct GNUNET_PeerIdentityGNUNET_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. More...
 
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_connected_peers_map (const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_CONTAINER_MultiShortmap **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_connected_peers_map (const struct GNUNET_CONTAINER_MultiShortmap *value)
 
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_peer_id (const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_PeerIdentity **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_peer_id (const struct GNUNET_PeerIdentity *value)
 
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_hello_size (const struct GNUNET_TESTING_Command *cmd, const size_t **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_hello_size (const size_t *value)
 
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_hello (const struct GNUNET_TESTING_Command *cmd, const char **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_hello (const char *value)
 
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_application_handle (const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TRANSPORT_ApplicationHandle **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_application_handle (const struct GNUNET_TRANSPORT_ApplicationHandle *value)
 
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_state (const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TESTING_StartPeerState **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_state (const struct GNUNET_TESTING_StartPeerState *value)
 
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_broadcast (const struct GNUNET_TESTING_Command *cmd, const enum GNUNET_GenericReturnValue **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_broadcast (const enum GNUNET_GenericReturnValue *value)
 

Macro Definition Documentation

◆ GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS

#define GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS (   op,
  prefix 
)
Value:
op (prefix, connected_peers_map, const struct \
op (prefix, peer_id, const struct GNUNET_PeerIdentity) \
op (prefix, hello_size, const size_t) \
op (prefix, hello, const char) \
op (prefix, application_handle, const struct \
op (prefix, broadcast, const enum GNUNET_GenericReturnValue)
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:143
static char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
static int prefix
If printing the value of PREFIX has been requested.
Definition: gnunet-config.c:66
enum State state
current state of profiling
GNUNET_GenericReturnValue
Named constants for return values.
Internal representation of the hash map.
The identity of the host (wraps the signing key of the peer).
Handle for a peer controlled via ARM.
Handle to the TRANSPORT subsystem for application management.

Call op on all simple traits.

Definition at line 235 of file gnunet_testing_transport_lib.h.

Typedef Documentation

◆ GNUNET_TESTING_notify_connect_cb

typedef void *(* GNUNET_TESTING_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer)

Definition at line 39 of file gnunet_testing_transport_lib.h.

Function Documentation

◆ GNUNET_TESTING_cmd_start_peer()

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.

Parameters
labelname for command.
system_labelLabel of the cmd to setup a test environment.
noDecimal number representing the last byte of the IP address of this peer.
node_ipThe IP address of this node.
cfgnameConfiguration file name for this peer.
broadcastFlag indicating, if broadcast should be switched on.
Returns
command.

◆ GNUNET_TESTING_cmd_stop_peer()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_peer ( const char *  label,
const char *  start_label 
)

Create command.

Parameters
labelname for command.
start_labelLabel of the cmd to start the peer.
Returns
command.

Definition at line 159 of file testing_arm_cmd_stop_peer.c.

161{
162 struct StopPeerState *sps;
163
164 sps = GNUNET_new (struct StopPeerState);
166 sps->label = label;
168 sps,
169 label,
173 &sps->ac);
174}
struct GNUNET_TESTING_Command GNUNET_TESTING_command_new_ac(void *cls, const char *label, GNUNET_TESTING_CommandRunRoutine run, GNUNET_TESTING_CommandCleanupRoutine cleanup, GNUNET_TESTING_CommandGetTraits traits, struct GNUNET_TESTING_AsyncContext *ac)
Create a new command that may be asynchronous.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Struct to hold information for callbacks.
const char * start_label
Label of the cmd to start the peer.
const char * label
Label of the cmd.
struct GNUNET_TESTING_AsyncContext ac
static int stop_peer_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Trait function of this cmd does nothing.
static void stop_peer_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static void stop_peer_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will stop all services of a peer which were used to test the transport ser...

◆ GNUNET_TESTING_get_peer()

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.

Parameters
numThe unique node id.
tl_systemThe test system.
Returns
The peer identity wrapping the public key.

Referenced by add_search_string(), connect_peers_run(), join_room_run(), and notify_connect().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_get_trait_connected_peers_map()

enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_connected_peers_map ( const struct GNUNET_TESTING_Command cmd,
const struct GNUNET_CONTAINER_MultiShortmap **  ret 
)

Referenced by send_simple_run().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_make_trait_connected_peers_map()

struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_connected_peers_map ( const struct GNUNET_CONTAINER_MultiShortmap value)

Referenced by start_peer_traits().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_get_trait_peer_id()

enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_peer_id ( const struct GNUNET_TESTING_Command cmd,
const struct GNUNET_PeerIdentity **  ret 
)

◆ GNUNET_TRANSPORT_TESTING_make_trait_peer_id()

struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_peer_id ( const struct GNUNET_PeerIdentity value)

Referenced by start_peer_traits().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_get_trait_hello_size()

enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_hello_size ( const struct GNUNET_TESTING_Command cmd,
const size_t **  ret 
)

◆ GNUNET_TRANSPORT_TESTING_make_trait_hello_size()

struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_hello_size ( const size_t *  value)

Referenced by start_peer_traits().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_get_trait_hello()

enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_hello ( const struct GNUNET_TESTING_Command cmd,
const char **  ret 
)

◆ GNUNET_TRANSPORT_TESTING_make_trait_hello()

struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_hello ( const char *  value)

Referenced by start_peer_traits().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_get_trait_application_handle()

enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_application_handle ( const struct GNUNET_TESTING_Command cmd,
const struct GNUNET_TRANSPORT_ApplicationHandle **  ret 
)

Referenced by backchannel_check_run(), and connect_peers_run().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_make_trait_application_handle()

struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_application_handle ( const struct GNUNET_TRANSPORT_ApplicationHandle value)

Referenced by start_peer_traits().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_get_trait_state()

enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_state ( const struct GNUNET_TESTING_Command cmd,
const struct GNUNET_TESTING_StartPeerState **  ret 
)

Referenced by connect_peers_run(), start_service_run(), and stop_peer_run().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_make_trait_state()

struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_state ( const struct GNUNET_TESTING_StartPeerState value)

Referenced by start_peer_traits().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_get_trait_broadcast()

enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_broadcast ( const struct GNUNET_TESTING_Command cmd,
const enum GNUNET_GenericReturnValue **  ret 
)

Referenced by connect_peers_run().

Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_make_trait_broadcast()

struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_TESTING_make_trait_broadcast ( const enum GNUNET_GenericReturnValue value)

Referenced by start_peer_traits().

Here is the caller graph for this function: