#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_core_lib.h"
#include "gnunet_testing_transport_lib.h"
#include "gnunet_transport_application_service.h"
#include "gnunet_transport_core_service.h"
Go to the source code of this file.
Macros | |
#define | LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut. More... | |
Functions | |
static void | connect_peers_run (void *cls, struct GNUNET_TESTING_Interpreter *is) |
The run method of this cmd will connect to peers. More... | |
static void | connect_peers_cleanup (void *cls) |
The cleanup function of this cmd frees resources the cmd allocated. More... | |
enum GNUNET_GenericReturnValue | connect_peers_traits (void *cls, const void **ret, const char *trait, unsigned int index) |
This function prepares an array with traits. More... | |
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. More... | |
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut.
Definition at line 36 of file testing_core_cmd_connecting_peers.c.
|
static |
The run method of this cmd will connect to peers.
Definition at line 44 of file testing_core_cmd_connecting_peers.c.
References address, GNUNET_TESTING_AddressPrefix::address_prefix, GNUNET_TESTING_NodeConnection::address_prefixes_head, GNUNET_TESTING_ConnectPeersState::ah, GNUNET_TESTING_StartPeerState::cfg, GNUNET_TESTING_StartPeerState::cfgname, GNUNET_TESTING_ConnectPeersState::con_num, GNUNET_TESTING_ConnectPeersState::create_label, GNUNET_asprintf(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_memcmp, GNUNET_TESTING_calculate_num(), GNUNET_TESTING_get_address(), GNUNET_TESTING_get_connections(), GNUNET_TESTING_get_peer(), GNUNET_TESTING_interpreter_fail(), GNUNET_TESTING_interpreter_lookup_command(), GNUNET_TRANSPORT_application_init(), GNUNET_TRANSPORT_application_validate(), GNUNET_TRANSPORT_TESTING_get_trait_broadcast(), GNUNET_TRANSPORT_TESTING_get_trait_state(), GNUNET_YES, GNUNET_TESTING_ConnectPeersState::is, is, LOG, GNUNET_TESTING_AddressPrefix::next, GNUNET_TESTING_NodeConnection::next, GNUNET_TESTING_ConnectPeersState::node_connections_head, nt, GNUNET_TESTING_ConnectPeersState::num, prefix, GNUNET_TESTING_ConnectPeersState::start_peer_label, GNUNET_TESTING_ConnectPeersState::tl_system, and GNUNET_TESTING_ConnectPeersState::topology.
Referenced by GNUNET_CORE_cmd_connect_peers().
|
static |
The cleanup function of this cmd frees resources the cmd allocated.
Definition at line 180 of file testing_core_cmd_connecting_peers.c.
References GNUNET_TESTING_ConnectPeersState::connected_peers_map, and GNUNET_free.
Referenced by GNUNET_CORE_cmd_connect_peers().
enum GNUNET_GenericReturnValue connect_peers_traits | ( | void * | cls, |
const void ** | ret, | ||
const char * | trait, | ||
unsigned int | index | ||
) |
This function prepares an array with traits.
Definition at line 194 of file testing_core_cmd_connecting_peers.c.
References GNUNET_CORE_TESTING_make_trait_connect_peer_state(), GNUNET_TESTING_get_trait(), GNUNET_TESTING_trait_end(), GNUNET_TESTING_Trait::index, ret, and traits().
Referenced by GNUNET_CORE_cmd_connect_peers().
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.
label | name for command |
start_peer_label | Label of the cmd to start a peer. |
create_label | Label of the cmd which started the test system. |
num | Number globally identifying the node. |
topology | The topology for the test setup. |
additional_connects | Number of additional connects this cmd will wait for not triggered by this cmd. |
Definition at line 212 of file testing_core_cmd_connecting_peers.c.
References GNUNET_TESTING_ConnectPeersState::ac, GNUNET_TESTING_ConnectPeersState::additional_connects, connect_peers_cleanup(), connect_peers_run(), connect_peers_traits(), GNUNET_TESTING_ConnectPeersState::connected_peers_map, GNUNET_TESTING_ConnectPeersState::create_label, GNUNET_CONTAINER_multishortmap_create(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_memcpy, GNUNET_new, GNUNET_new_array, GNUNET_NO, GNUNET_TESTING_command_new, GNUNET_TESTING_command_new_ac(), GNUNET_TESTING_get_additional_connects(), GNUNET_YES, handlers, GNUNET_TESTING_ConnectPeersState::handlers, LOG, GNUNET_TESTING_ConnectPeersState::num, GNUNET_TESTING_ConnectPeersState::start_peer_label, GNUNET_TESTING_ConnectPeersState::topology, and GNUNET_TESTING_ConnectPeersState::wait_for_connect.