29#include "gnunet_testing_ng_lib.h"
30#include "gnunet_testing_netjail_lib.h"
37#define LOG(kind, ...) GNUNET_log_from (kind, "udp-backchannel",__VA_ARGS__)
44#define MAX_LINE_LENGTH 1024
166 for (
int i = 0; i < cs->
con_num; i++)
177 if (NULL != strstr (
line,
184 "received_backchannel_msgs %u con_num %u\n",
190 "search finished %lu %lu %u\n",
193 "Delivering backchannel message from 4TTC to F7B5 of type 1460 to udp"),
195 "Delivering backchannel message from 4TTC to F7B5 of type 1460 to udp",
205 "read_from_log end\n");
304 pos_connection = pos_connection->
next)
307 "connect via udp %u %u %u %u\n",
340 char *part_one =
"Delivering backchannel message from ";
341 char *part_two =
" to ";
342 char *part_three =
" of type 1460 to udp";
360 "us: %s cs->num %d\n",
425 GNUNET_TESTING_get_trait_test_system (system_cmd,
447 "namespace_n %u node_n %u\n",
477 "namespace_n %u node_n %u\n",
530 const char *start_peer_label,
531 const char *create_label,
534 unsigned int namespace_n,
static int ret
Final status code.
static char * peer_id
Option –peer.
static struct GNUNET_TESTING_Interpreter * is
static char * line
Desired phone line (string to be converted to a hash).
static struct GNUNET_NAT_AUTO_AutoHandle * ah
Handle to ongoing autoconfiguration.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
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.
void GNUNET_TESTING_async_finish(struct GNUNET_TESTING_AsyncContext *ac)
The asynchronous command of ac has finished.
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
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.
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_TESTING_get_trait_application_handle(const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TRANSPORT_ApplicationHandle **ret)
Bandwidth allocation API for applications to interact with.
struct GNUNET_DISK_FileHandle * GNUNET_DISK_file_open(const char *fn, enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm)
Open a file.
@ GNUNET_DISK_OPEN_READ
Open the file for reading.
@ GNUNET_DISK_PERM_USER_READ
Owner can read.
struct GNUNET_CONTAINER_MultiShortmapIterator * GNUNET_CONTAINER_multishortmap_iterator_create(const struct GNUNET_CONTAINER_MultiShortmap *map)
Create an iterator for a multihashmap.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multishortmap_iterator_next(struct GNUNET_CONTAINER_MultiShortmapIterator *iter, struct GNUNET_ShortHashCode *key, const void **value)
Retrieve the next element from the hash map at the iterator's position.
#define GNUNET_log(kind,...)
GNUNET_GenericReturnValue
Named constants for return values.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_array_append(arr, len, element)
Append an element to an array (growing the array by one).
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
#define GNUNET_TIME_UNIT_MINUTES
One minute.
Struct to store information needed in callbacks.
unsigned int con_num
Number of connections.
char ** search_string
Array with search strings.
FILE * stream
Stream to read log file lines.
const char * start_peer_label
Label of the cmd to start a peer.
struct GNUNET_TESTING_NodeConnection * node_connections_head
Connections to other peers.
unsigned int received_backchannel_msgs
Number of received backchannel messages.
uint32_t num
Number globally identifying the node.
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
const char * create_label
unsigned int node_n
The number of the node in a network namespace.
struct GNUNET_SCHEDULER_Task * task
Task which handles the reading.
const struct GNUNET_TESTBED_System * tl_system
The testing system of this node.
unsigned int namespace_n
The number of the network namespace.
struct GNUNET_DISK_FileHandle * fh
File handle for log file.
struct GNUNET_TESTING_NetjailTopology * topology
The topology of the test setup.
Cursor into a multishortmap.
Handle used to access files (and pipes).
int fd
File handle on Unix-like systems.
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
Protocol address prefix für a connection between nodes.
struct GNUNET_TESTING_AddressPrefix * next
Pointer to the next prefix in the DLL.
char * address_prefix
The address prefix.
State each asynchronous command must have in its closure.
A command to be run by the interpreter.
struct GNUNET_TESTING_CommandLabel label
Label for the command.
Global state of the interpreter, used by a command to access information about other commands.
Node in the netjail topology.
unsigned int namespace_n
The number of the subnet this node is running in.
struct GNUNET_TESTING_NodeConnection * node_connections_head
Head of the DLL with the connections which shall be established to other nodes.
unsigned int node_n
The number of this node in the subnet.
Toplogy of our netjail setup.
struct GNUNET_CONTAINER_MultiShortmap * map_globals
Hash map containing the global known nodes which are not natted.
unsigned int nodes_m
Number of nodes per subnet.
unsigned int nodes_x
Number of global known nodes.
struct GNUNET_CONTAINER_MultiShortmap * map_namespaces
Hash map containing the subnets (for natted nodes) of the topology.
Connection to another node.
struct GNUNET_TESTING_NodeConnection * next
Pointer to the next connection in the DLL.
unsigned int node_n
The number of the node this connection points to.
unsigned int namespace_n
The number of the subnet of the node this connection points to.
struct GNUNET_TESTING_AddressPrefix * address_prefixes_head
Head of the DLL with the address prefixes for the protocols this node is reachable.
Handle to the TRANSPORT subsystem for application management.
struct GNUNET_TESTING_NodeConnection * GNUNET_TESTING_get_connections(unsigned int num, const struct GNUNET_TESTING_NetjailTopology *topology)
Get the connections to other nodes for a specific node.
static void add_search_string(struct CheckState *cs, const struct GNUNET_TESTING_NetjailNode *node)
static enum GNUNET_GenericReturnValue will_the_other_node_connect_via_udp(struct CheckState *cs, const struct GNUNET_TESTING_NetjailNode *node)
static void backchannel_check_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static void read_from_log(void *cls)
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.
static void backchannel_check_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will connect to peers.
#define LOG(kind,...)
Generic logging shortcut.
static int backchannel_check_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Trait function of this cmd does nothing.
#define MAX_LINE_LENGTH
Maximum length allowed for line input.