#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_lib.h"
#include "gnunet_testbed_lib.h"
#include "gnunet_transport_testing_ng_lib.h"
#include "transport-testing-cmds.h"
#include "gnunet_transport_application_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 * | notify_connect (struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer) |
Callback from start peer cmd for signaling a peer got connected. 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_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, unsigned int wait_for_connect) |
Create command. More... | |
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut.
Definition at line 37 of file transport_api_cmd_connecting_peers.c.
|
static |
The run method of this cmd will connect to peers.
Definition at line 44 of file transport_api_cmd_connecting_peers.c.
References address, GNUNET_TESTING_AddressPrefix::address_prefix, GNUNET_TESTING_NodeConnection::address_prefixes_head, ah, ConnectPeersState::con_num, ConnectPeersState::create_label, GNUNET_asprintf(), GNUNET_ERROR_TYPE_DEBUG, 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_lookup_command(), GNUNET_TRANSPORT_application_validate(), GNUNET_TRANSPORT_TESTING_get_trait_application_handle(), GNUNET_TRANSPORT_TESTING_get_trait_broadcast(), GNUNET_YES, is, ConnectPeersState::is, LOG, GNUNET_TESTING_AddressPrefix::next, GNUNET_TESTING_NodeConnection::next, ConnectPeersState::node_connections_head, nt, ConnectPeersState::num, prefix, ConnectPeersState::start_peer_label, ConnectPeersState::tl_system, ConnectPeersState::topology, and ConnectPeersState::wait_for_connect.
Referenced by GNUNET_TRANSPORT_cmd_connect_peers().
|
static |
Callback from start peer cmd for signaling a peer got connected.
Definition at line 181 of file transport_api_cmd_connecting_peers.c.
References ConnectPeersState::ac, ConnectPeersState::additional_connects, ConnectPeersState::additional_connects_notified, GNUNET_TESTING_Command::cls, ConnectPeersState::con_num, ConnectPeersState::con_num_notified, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_memcmp, GNUNET_TESTING_async_finish(), GNUNET_TESTING_calculate_num(), GNUNET_TESTING_get_peer(), is, GNUNET_TESTING_NodeConnection::next, ConnectPeersState::node_connections_head, ret, ConnectPeersState::tl_system, and ConnectPeersState::topology.
Referenced by GNUNET_TRANSPORT_cmd_connect_peers().
|
static |
The cleanup function of this cmd frees resources the cmd allocated.
Definition at line 233 of file transport_api_cmd_connecting_peers.c.
References GNUNET_free.
Referenced by GNUNET_TRANSPORT_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 246 of file transport_api_cmd_connecting_peers.c.
References GNUNET_TESTING_get_trait(), GNUNET_TESTING_trait_end(), GNUNET_TESTING_Trait::index, ret, and traits().
Referenced by GNUNET_TRANSPORT_cmd_connect_peers().
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, | ||
unsigned int | wait_for_connect | ||
) |
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 264 of file transport_api_cmd_connecting_peers.c.
References ConnectPeersState::ac, ConnectPeersState::additional_connects, connect_peers_cleanup(), connect_peers_run(), connect_peers_traits(), ConnectPeersState::create_label, GNUNET_ERROR_TYPE_DEBUG, GNUNET_new, GNUNET_TESTING_command_new, GNUNET_TESTING_command_new_ac(), GNUNET_TESTING_get_additional_connects(), GNUNET_YES, LOG, ConnectPeersState::notify_connect, notify_connect(), ConnectPeersState::num, ConnectPeersState::start_peer_label, ConnectPeersState::topology, and ConnectPeersState::wait_for_connect.