Go to the source code of this file.
Data Structures | |
struct | GNUNET_TESTING_NetjailRouter |
API for writing an interpreter to test GNUnet components. More... | |
struct | GNUNET_TESTING_AddressPrefix |
Protocol address prefix für a connection between nodes. More... | |
struct | GNUNET_TESTING_NodeConnection |
Connection to another node. More... | |
struct | GNUNET_TESTING_NetjailNode |
Node in the netjail topology. More... | |
struct | GNUNET_TESTING_NetjailNamespace |
Subnet in a topology. More... | |
struct | GNUNET_TESTING_NetjailBackbonePeer |
Backbone peer. More... | |
struct | GNUNET_TESTING_NetjailCarrierPeer |
Backbone peer. More... | |
struct | GNUNET_TESTING_NetjailCarrier |
Carrier. More... | |
struct | GNUNET_TESTING_NetjailSubnet |
Carrier subnet. More... | |
struct | GNUNET_TESTING_NetjailSubnetPeer |
Subnet peer. More... | |
struct | GNUNET_TESTING_NetjailTopology |
Toplogy of our netjail setup. More... | |
Macros | |
#define | GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS(op, prefix) |
Call op on all simple traits. More... | |
Enumerations | |
enum | GNUNET_TESTING_NodeType { GNUNET_TESTING_SUBNET_NODE , GNUNET_TESTING_GLOBAL_NODE } |
Enum for the different types of nodes. More... | |
Functions | |
struct GNUNET_TESTING_NetjailTopology * | GNUNET_TESTING_get_topo_from_string_ (const char *data) |
Parse the topology data. More... | |
unsigned int | GNUNET_TESTING_get_additional_connects (unsigned int num, struct GNUNET_TESTING_NetjailTopology *topology) |
Get the number of unintentional additional connections the node waits for. More... | |
struct GNUNET_TESTING_NetjailNode * | GNUNET_TESTING_get_node (unsigned int num, struct GNUNET_TESTING_NetjailTopology *topology) |
Get a node from the topology. More... | |
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. More... | |
char * | GNUNET_TESTING_get_address (struct GNUNET_TESTING_NodeConnection *connection, const char *prefix) |
Get the address for a specific communicator from a connection. More... | |
char * | GNUNET_TESTING_get_plugin_from_topo (struct GNUNET_TESTING_NetjailTopology *njt, const char *my_node_id) |
Get the global plugin name form the topology file. More... | |
void | GNUNET_TESTING_free_topology (struct GNUNET_TESTING_NetjailTopology *topology) |
Deallocate memory of the struct GNUNET_TESTING_NetjailTopology. More... | |
unsigned int | GNUNET_TESTING_calculate_num (struct GNUNET_TESTING_NodeConnection *node_connection, struct GNUNET_TESTING_NetjailTopology *topology) |
Calculate the unique id identifying a node from a given connection. More... | |
GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT (GNUNET_TESTING, topology, const struct GNUNET_TESTING_NetjailTopology) GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(GNUNET_TESTING | |
const char | GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT (GNUNET_TESTING, async_context, struct GNUNET_TESTING_AsyncContext) GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(GNUNET_TESTING |
Variables | |
topology_string | |
const char | helper_handles |
Call op on all simple traits.
Definition at line 484 of file testing_api_topology.h.
Enum for the different types of nodes.
Enumerator | |
---|---|
GNUNET_TESTING_SUBNET_NODE | Node in a subnet. |
GNUNET_TESTING_GLOBAL_NODE | Global known node. |
Definition at line 54 of file testing_api_topology.h.
struct GNUNET_TESTING_NetjailTopology * GNUNET_TESTING_get_topo_from_string_ | ( | const char * | data | ) |
Parse the topology data.
data | The topology data. |
Definition at line 649 of file testing_api_topology.c.
References _, GNUNET_TESTING_NetjailTopology::backbone_peers, GNUNET_TESTING_NetjailTopology::carriers, cfg, create_peers(), create_subnets(), GNUNET_TESTING_NetjailTopology::default_carrier_peers, GNUNET_TESTING_NetjailTopology::default_subnet_peers, GNUNET_TESTING_NetjailTopology::default_subnets, GNUNET_asprintf(), GNUNET_assert, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_deserialize(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multishortmap_create(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_OK, LOG, GNUNET_TESTING_NetjailTopology::num_backbone_peers, GNUNET_TESTING_NetjailTopology::num_carriers, GNUNET_TESTING_NetjailBackbonePeer::number, GNUNET_TESTING_NetjailCarrier::number, GNUNET_TESTING_NetjailCarrier::number_peers, GNUNET_TESTING_NetjailCarrier::number_subnets, GNUNET_TESTING_NetjailTopology::plugin, and GNUNET_TESTING_NetjailTopology::total.
Referenced by handle_helper_init(), netjail_exec_run(), and run().
unsigned int GNUNET_TESTING_get_additional_connects | ( | unsigned int | num, |
struct GNUNET_TESTING_NetjailTopology * | topology | ||
) |
Get the number of unintentional additional connections the node waits for.
num | The specific node we want the additional connects for. |
Definition at line 506 of file testing_api_topology.c.
References GNUNET_TESTING_NetjailNode::additional_connects, get_node_info(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, and LOG.
Referenced by GNUNET_CORE_cmd_connect_peers(), and GNUNET_TRANSPORT_cmd_connect_peers().
struct GNUNET_TESTING_NetjailNode * GNUNET_TESTING_get_node | ( | unsigned int | num, |
struct GNUNET_TESTING_NetjailTopology * | topology | ||
) |
Get a node from the topology.
num | The specific node we want the connections for. |
topology | The topology we get the connections from. |
Definition at line 240 of file testing_api_topology.c.
References get_node_info(), and GNUNET_TESTING_NodeConnection::node.
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.
num | The specific node we want the connections for. |
topology | The topology we get the connections from. |
Definition at line 262 of file testing_api_topology.c.
References get_node_info(), GNUNET_ERROR_TYPE_DEBUG, LOG, and GNUNET_TESTING_NodeConnection::node.
Referenced by backchannel_check_run(), and connect_peers_run().
char * GNUNET_TESTING_get_address | ( | struct GNUNET_TESTING_NodeConnection * | connection, |
const char * | prefix | ||
) |
Get the address for a specific communicator from a connection.
connection | The connection we like to have the address from. |
prefix | The communicator protocol prefix. |
Definition at line 446 of file testing_api_topology.c.
References CONNECT_ADDRESS_TEMPLATE, GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, KNOWN_CONNECT_ADDRESS_TEMPLATE, LOG, GNUNET_TESTING_NodeConnection::namespace_n, GNUNET_TESTING_NetjailNode::namespace_n, GNUNET_TESTING_NodeConnection::node, GNUNET_TESTING_NodeConnection::node_n, GNUNET_TESTING_NetjailNode::node_n, prefix, PREFIX_TCP, PREFIX_TCP_NATTED, PREFIX_UDP, PREFIX_UDP_NATTED, and ROUTER_CONNECT_ADDRESS_TEMPLATE.
Referenced by connect_peers_run().
char * GNUNET_TESTING_get_plugin_from_topo | ( | struct GNUNET_TESTING_NetjailTopology * | njt, |
const char * | my_node_id | ||
) |
Get the global plugin name form the topology file.
Definition at line 536 of file testing_api_topology.c.
References njt, and GNUNET_TESTING_NetjailTopology::plugin.
Referenced by handle_helper_init().
void GNUNET_TESTING_free_topology | ( | struct GNUNET_TESTING_NetjailTopology * | topology | ) |
Deallocate memory of the struct GNUNET_TESTING_NetjailTopology.
[in] | topology | The GNUNET_TESTING_NetjailTopology to be deallocated. |
topology | The GNUNET_TESTING_NetjailTopology to be deallocated. |
Definition at line 385 of file testing_api_topology.c.
References GNUNET_TESTING_NetjailTopology::backbone_peers, GNUNET_TESTING_NetjailTopology::carriers, free_carriers_cb(), free_value_cb(), GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_free, and GNUNET_TESTING_NetjailTopology::plugin.
Referenced by cleanup(), do_shutdown(), and netjail_exec_run().
unsigned int GNUNET_TESTING_calculate_num | ( | struct GNUNET_TESTING_NodeConnection * | node_connection, |
struct GNUNET_TESTING_NetjailTopology * | topology | ||
) |
Calculate the unique id identifying a node from a given connection.
node_connection | The connection we calculate the id from. |
topology | The topology we get all needed information from. |
Calculate the unique id identifying a node from a given connection.
topology | The GNUNET_TESTING_NetjailTopology to be deallocated. |
void GNUNET_TESTING_free_topology (struct GNUNET_TESTING_NetjailTopology *topology) { GNUNET_CONTAINER_multishortmap_iterate (topology->map_namespaces, &free_namespaces_cb, NULL); GNUNET_CONTAINER_multishortmap_destroy (topology->map_namespaces); GNUNET_CONTAINER_multishortmap_iterate (topology->map_globals, &free_nodes_cb, NULL); GNUNET_CONTAINER_multishortmap_destroy (topology->map_globals); GNUNET_free (topology->plugin); GNUNET_free (topology); }
Definition at line 420 of file testing_api_topology.c.
References m, GNUNET_TESTING_NodeConnection::namespace_n, GNUNET_TESTING_NodeConnection::node_n, GNUNET_TESTING_NetjailTopology::nodes_m, and GNUNET_TESTING_NetjailTopology::nodes_x.
Referenced by connect_peers_run(), and notify_connect().
GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT | ( | GNUNET_TESTING | , |
topology | , | ||
const struct GNUNET_TESTING_NetjailTopology | |||
) |
const char GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT | ( | GNUNET_TESTING | , |
async_context | , | ||
struct GNUNET_TESTING_AsyncContext | |||
) |
topology_string |
Definition at line 491 of file testing_api_topology.h.
Referenced by GNUNET_TESTING_cmd_load_topology_from_string().
const char helper_handles |
Definition at line 491 of file testing_api_topology.h.