cmd to start a peer. More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "transport-testing-cmds.h"
#include "gnunet_testing_ng_lib.h"
#include "gnunet_transport_testing_ng_lib.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 | start_peer_run (void *cls, struct GNUNET_TESTING_Interpreter *is) |
The run method of this cmd will start all services of a peer to test the transport service. More... | |
static void | start_peer_cleanup (void *cls) |
The cleanup function of this cmd frees resources the cmd allocated. More... | |
static int | start_peer_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_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... | |
cmd to start a peer.
Definition in file testing_api_cmd_start_peer.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut.
Definition at line 36 of file testing_api_cmd_start_peer.c.
|
static |
The run method of this cmd will start all services of a peer to test the transport service.
Definition at line 44 of file testing_api_cmd_start_peer.c.
References GNUNET_TESTING_StartPeerState::broadcast, GNUNET_TESTING_StartPeerState::cfg, GNUNET_TESTING_StartPeerState::cfgname, dummy, GNUNET_asprintf(), GNUNET_assert, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_load(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_DISK_file_test(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_i2s_full(), GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, GNUNET_TESTING_configuration_create(), GNUNET_TESTING_get_trait_test_system(), GNUNET_TESTING_interpreter_fail(), GNUNET_TESTING_interpreter_lookup_command(), GNUNET_TESTING_peer_configure(), GNUNET_TESTING_peer_get_identity(), GNUNET_TESTING_peer_start(), GNUNET_YES, GNUNET_TESTING_StartPeerState::id, is, LOG, GNUNET_TESTING_StartPeerState::no, GNUNET_TESTING_StartPeerState::node_ip, GNUNET_TESTING_StartPeerState::peer, GNUNET_TESTING_StartPeerState::system_label, and GNUNET_TESTING_StartPeerState::tl_system.
Referenced by GNUNET_TESTING_cmd_start_peer().
|
static |
The cleanup function of this cmd frees resources the cmd allocated.
Definition at line 214 of file testing_api_cmd_start_peer.c.
References GNUNET_TESTING_StartPeerState::cfgname, GNUNET_TESTING_StartPeerState::connected_peers_map, GNUNET_free, GNUNET_TESTING_StartPeerState::hello, GNUNET_TESTING_StartPeerState::node_ip, and GNUNET_TESTING_StartPeerState::system_label.
Referenced by GNUNET_TESTING_cmd_start_peer().
|
static |
This function prepares an array with traits.
Definition at line 238 of file testing_api_cmd_start_peer.c.
References ah, GNUNET_TESTING_StartPeerState::ah, GNUNET_TESTING_StartPeerState::connected_peers_map, GNUNET_TESTING_get_trait(), GNUNET_TESTING_trait_end(), GNUNET_TRANSPORT_TESTING_make_trait_application_handle(), GNUNET_TRANSPORT_TESTING_make_trait_broadcast(), GNUNET_TRANSPORT_TESTING_make_trait_connected_peers_map(), GNUNET_TRANSPORT_TESTING_make_trait_hello(), GNUNET_TRANSPORT_TESTING_make_trait_hello_size(), GNUNET_TRANSPORT_TESTING_make_trait_peer_id(), GNUNET_TRANSPORT_TESTING_make_trait_state(), GNUNET_TESTING_StartPeerState::hello, GNUNET_TESTING_StartPeerState::hello_size, GNUNET_TESTING_StartPeerState::id, GNUNET_TESTING_Trait::index, and ret.
Referenced by 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.
label | name for command. |
system_label | Label of the cmd to setup a test environment. |
no | Decimal number representing the last byte of the IP address of this peer. |
node_ip | The IP address of this node. |
cfgname | Configuration file name for this peer. |
broadcast | Flag indicating, if broadcast should be switched on. |
Definition at line 271 of file testing_api_cmd_start_peer.c.
References GNUNET_TESTING_StartPeerState::broadcast, GNUNET_TESTING_StartPeerState::cfgname, GNUNET_TESTING_StartPeerState::connected_peers_map, GNUNET_CONTAINER_multishortmap_create(), GNUNET_new, GNUNET_NO, GNUNET_strdup, GNUNET_TESTING_command_new(), GNUNET_TESTING_StartPeerState::no, GNUNET_TESTING_StartPeerState::node_ip, start_peer_cleanup(), start_peer_run(), start_peer_traits(), and GNUNET_TESTING_StartPeerState::system_label.