#include "platform.h"
#include "gnunet_common.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_ng_lib.h"
#include "gnunet_testing_netjail_lib.h"
#include "gnunet_transport_application_service.h"
#include "transport-testing-cmds.h"
Go to the source code of this file.
Data Structures | |
struct | CheckState |
Struct to store information needed in callbacks. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "udp-backchannel",__VA_ARGS__) |
Generic logging shortcut. More... | |
#define | UDP "udp" |
#define | MAX_LINE_LENGTH 1024 |
Maximum length allowed for line input. More... | |
Functions | |
static void | read_from_log (void *cls) |
static enum GNUNET_GenericReturnValue | will_the_other_node_connect_via_udp (struct CheckState *cs, const struct GNUNET_TESTING_NetjailNode *node) |
static void | add_search_string (struct CheckState *cs, const struct GNUNET_TESTING_NetjailNode *node) |
static void | backchannel_check_run (void *cls, struct GNUNET_TESTING_Interpreter *is) |
The run method of this cmd will connect to peers. More... | |
static int | backchannel_check_traits (void *cls, const void **ret, const char *trait, unsigned int index) |
Trait function of this cmd does nothing. More... | |
static void | backchannel_check_cleanup (void *cls) |
The cleanup function of this cmd frees resources the cmd allocated. More... | |
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. More... | |
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "udp-backchannel",__VA_ARGS__) |
Generic logging shortcut.
Definition at line 37 of file transport_api_cmd_backchannel_check.c.
#define UDP "udp" |
Definition at line 39 of file transport_api_cmd_backchannel_check.c.
#define MAX_LINE_LENGTH 1024 |
Maximum length allowed for line input.
Definition at line 44 of file transport_api_cmd_backchannel_check.c.
|
static |
cls | The cmd state CheckState. |
Definition at line 133 of file transport_api_cmd_backchannel_check.c.
References CheckState::ac, CheckState::con_num, GNUNET_DISK_FileHandle::fd, CheckState::fh, GNUNET_DISK_file_open(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_USER_READ, GNUNET_ERROR_TYPE_DEBUG, GNUNET_SCHEDULER_add_delayed(), GNUNET_TESTING_async_finish(), GNUNET_TIME_UNIT_MINUTES, line, LOG, MAX_LINE_LENGTH, read_from_log(), CheckState::received_backchannel_msgs, CheckState::search_string, CheckState::stream, and CheckState::task.
Referenced by backchannel_check_run(), and read_from_log().
|
static |
Definition at line 232 of file transport_api_cmd_backchannel_check.c.
References GNUNET_TESTING_AddressPrefix::address_prefix, GNUNET_TESTING_NodeConnection::address_prefixes_head, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_YES, GNUNET_TESTING_NodeConnection::namespace_n, GNUNET_TESTING_NetjailNode::namespace_n, CheckState::namespace_n, GNUNET_TESTING_AddressPrefix::next, GNUNET_TESTING_NodeConnection::next, GNUNET_TESTING_NetjailNode::node_connections_head, GNUNET_TESTING_NodeConnection::node_n, GNUNET_TESTING_NetjailNode::node_n, CheckState::node_n, and UDP.
Referenced by backchannel_check_run().
|
static |
Definition at line 333 of file transport_api_cmd_backchannel_check.c.
References CheckState::con_num, GNUNET_array_append, GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_TESTING_get_peer(), LOG, GNUNET_TESTING_NetjailNode::namespace_n, GNUNET_TESTING_NetjailNode::node_n, GNUNET_TESTING_NetjailTopology::nodes_m, GNUNET_TESTING_NetjailTopology::nodes_x, CheckState::num, peer_id, CheckState::search_string, CheckState::tl_system, and CheckState::topology.
Referenced by backchannel_check_run().
|
static |
The run method of this cmd will connect to peers.
Definition at line 400 of file transport_api_cmd_backchannel_check.c.
References CheckState::ac, add_search_string(), ah, CheckState::con_num, CheckState::create_label, GNUNET_CONTAINER_multishortmap_iterator_create(), GNUNET_CONTAINER_multishortmap_iterator_next(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_SCHEDULER_add_now(), GNUNET_TESTING_async_finish(), GNUNET_TESTING_get_connections(), GNUNET_TESTING_interpreter_lookup_command(), GNUNET_TRANSPORT_TESTING_get_trait_application_handle(), GNUNET_YES, is, LOG, GNUNET_TESTING_NetjailTopology::map_globals, GNUNET_TESTING_NetjailTopology::map_namespaces, GNUNET_TESTING_NetjailNode::namespace_n, CheckState::node_connections_head, GNUNET_TESTING_NetjailNode::node_n, CheckState::num, read_from_log(), CheckState::start_peer_label, CheckState::task, CheckState::tl_system, CheckState::topology, and will_the_other_node_connect_via_udp().
Referenced by GNUNET_TRANSPORT_cmd_backchannel_check().
|
static |
Trait function of this cmd does nothing.
Definition at line 506 of file transport_api_cmd_backchannel_check.c.
References GNUNET_OK.
Referenced by GNUNET_TRANSPORT_cmd_backchannel_check().
|
static |
The cleanup function of this cmd frees resources the cmd allocated.
Definition at line 520 of file transport_api_cmd_backchannel_check.c.
References GNUNET_free.
Referenced by GNUNET_TRANSPORT_cmd_backchannel_check().
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.
label | name for command. |
start_peer_label | Label of the cmd to start a peer. |
create_label | Label of the cmd to create the testing system. |
num | Number globally identifying the node. |
node_n | The number of the node in a network namespace. |
namespace_n | The number of the network namespace. |
topology | The topology for the test setup. |
Definition at line 529 of file transport_api_cmd_backchannel_check.c.
References CheckState::ac, backchannel_check_cleanup(), backchannel_check_run(), backchannel_check_traits(), CheckState::create_label, GNUNET_new, GNUNET_TESTING_command_new_ac(), CheckState::namespace_n, CheckState::node_n, CheckState::num, CheckState::start_peer_label, and CheckState::topology.