GNUnet  0.17.6
Data Structures | Macros | Enumerations | Functions
gnunet_testing_netjail_lib.h File Reference
#include "gnunet_util_lib.h"
#include "gnunet_testing_plugin.h"
#include "gnunet_testing_ng_lib.h"
Include dependency graph for gnunet_testing_netjail_lib.h:
This graph shows which files directly or indirectly include this file:

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_NetjailTopology
 Toplogy of our netjail setup. More...
 
struct  BlockState
 Struct with information for callbacks. More...
 
struct  LocalPreparedState
 Struct to hold information for callbacks. More...
 

Macros

#define GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS(op)
 Call op on all simple traits. More...
 

Enumerations

enum  GNUNET_TESTING_NODE_TYPE { GNUNET_TESTING_SUBNET_NODE , GNUNET_TESTING_GLOBAL_NODE }
 Enum for the different types of nodes. More...
 

Functions

struct GNUNET_TESTING_NetjailTopologyGNUNET_TESTING_get_topo_from_file (const char *filename)
 Getting the topology from file. More...
 
struct GNUNET_TESTING_NetjailTopologyGNUNET_TESTING_get_topo_from_string (char *data)
 Parse the topology data. More...
 
struct GNUNET_TESTING_NodeConnectionGNUNET_TESTING_get_connections (unsigned int num, 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, char *prefix)
 Get the address for a specific communicator from a connection. 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...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_system_destroy (const char *label, const char *create_label)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_system_create (const char *label, const char *testdir)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_start (const char *label, char *topology_config, unsigned int *read_file)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_stop (const char *label, char *topology_config, unsigned int *read_file)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_start_testing_system (const char *label, struct GNUNET_TESTING_NetjailTopology *topology, unsigned int *read_file, char *topology_data, struct GNUNET_TIME_Relative timeout)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_testing_system (const char *label, const char *helper_start_label, struct GNUNET_TESTING_NetjailTopology *topology)
 Create command. More...
 
struct GNUNET_MessageHeaderGNUNET_TESTING_send_local_test_finished_msg (enum GNUNET_GenericReturnValue rv)
 Create a GNUNET_CMDS_LOCAL_FINISHED message. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_create (const char *label)
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_setup_finished (const char *label)
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_reached (const char *label, const char *barrier_label)
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label, unsigned int *all_peers_started)
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_block_until_external_trigger (const char *label)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_send_peer_ready (const char *label, TESTING_CMD_HELPER_write_cb write_message)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_local_test_finished (const char *label, TESTING_CMD_HELPER_write_cb write_message)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_local_test_prepared (const char *label, TESTING_CMD_HELPER_write_cb write_message)
 Create command. More...
 
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_test_system (const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TESTING_System **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_test_system (const struct GNUNET_TESTING_System *value)
 
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_async_context (const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TESTING_AsyncContext **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_async_context (const struct GNUNET_TESTING_AsyncContext *value)
 
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_helper_handles (const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_HELPER_Handle ***ret)
 
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_helper_handles (const struct GNUNET_HELPER_Handle **value)
 
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_local_prepared_state (const struct GNUNET_TESTING_Command *cmd, const struct LocalPreparedState **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_local_prepared_state (const struct LocalPreparedState *value)
 
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_block_state (const struct GNUNET_TESTING_Command *cmd, const struct BlockState **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_block_state (const struct BlockState *value)
 

Macro Definition Documentation

◆ GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS

#define GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS (   op)
Value:
op (async_context, const struct GNUNET_TESTING_AsyncContext) \
op (helper_handles, const struct GNUNET_HELPER_Handle *) \
op (local_prepared_state, const struct LocalPreparedState) \
op (block_state, const struct BlockState)
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
static struct GNUNET_TESTING_System * test_system
Handle to the testing system.
Struct with information for callbacks.
The handle to a helper process.
Definition: helper.c:79
State each asynchronous command must have in its closure.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
Definition: testing.c:103
Struct to hold information for callbacks.

Call op on all simple traits.

Definition at line 506 of file gnunet_testing_netjail_lib.h.

Enumeration Type Documentation

◆ GNUNET_TESTING_NODE_TYPE

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 55 of file gnunet_testing_netjail_lib.h.

56 {
61 
66 };
@ GNUNET_TESTING_SUBNET_NODE
Node in a subnet.
@ GNUNET_TESTING_GLOBAL_NODE
Global known node.

Function Documentation

◆ GNUNET_TESTING_get_topo_from_file()

struct GNUNET_TESTING_NetjailTopology* GNUNET_TESTING_get_topo_from_file ( const char *  filename)

Getting the topology from file.

Parameters
filenameThe name of the topology file.
Returns
The GNUNET_TESTING_NetjailTopology

Definition at line 2642 of file testing.c.

2643 {
2644  uint64_t fs;
2645  char *data;
2646  struct GNUNET_TESTING_NetjailTopology *topo;
2647 
2649  {
2651  _ ("Topology file %s not found\n"),
2652  filename);
2653  return NULL;
2654  }
2655  if (GNUNET_OK !=
2657  {
2659  _ ("Topology file %s has no data\n"),
2660  filename);
2661  return NULL;
2662  }
2663  data = GNUNET_malloc (fs + 1);
2664  if (fs != GNUNET_DISK_fn_read (filename, data, fs))
2665  {
2667  _ ("Topology file %s cannot be read\n"),
2668  filename);
2669  GNUNET_free (data);
2670  return NULL;
2671  }
2672 
2674  "file length %lu\n",
2675  fs);
2676  data[fs] = '\0';
2677 
2679 
2680  GNUNET_free (data);
2681 
2682  return topo;
2683 }
static char * filename
static struct GNUNET_FS_Handle * fs
Handle to FS service.
Definition: gnunet-fs.c:36
uint32_t data
The data value.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_test(const char *fil)
Check that fil corresponds to a filename (of a file that exists and that is not a directory).
Definition: disk.c:482
enum GNUNET_GenericReturnValue GNUNET_DISK_file_size(const char *filename, uint64_t *size, int include_symbolic_links, int single_file_mode)
Get the size of the file (or directory) of the given file (in bytes).
Definition: disk.c:222
ssize_t GNUNET_DISK_fn_read(const char *fn, void *result, size_t len)
Read the contents of a binary file into a buffer.
Definition: disk.c:664
@ GNUNET_OK
Definition: gnunet_common.h:99
@ GNUNET_YES
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
#define _(String)
GNU gettext support macro.
Definition: platform.h:177
struct GNUNET_TESTING_NetjailTopology * GNUNET_TESTING_get_topo_from_string(char *data)
Parse the topology data.
Definition: testing.c:2378
#define LOG(kind,...)
Definition: testing.c:39

References _, data, filename, fs, GNUNET_DISK_file_size(), GNUNET_DISK_file_test(), GNUNET_DISK_fn_read(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_malloc, GNUNET_OK, GNUNET_TESTING_get_topo_from_string(), GNUNET_YES, and LOG.

Here is the call graph for this function:

◆ GNUNET_TESTING_get_topo_from_string()

struct GNUNET_TESTING_NetjailTopology* GNUNET_TESTING_get_topo_from_string ( char *  data)

Parse the topology data.

Parameters
dataThe topology data.
Returns
The GNUNET_TESTING_NetjailTopology

Definition at line 2378 of file testing.c.

2379 {
2380  char *token;
2381  char *key = NULL;
2382  unsigned int out;
2383  char *rest = NULL;
2384  char *value = NULL;
2385  char *value2;
2386  int ret;
2387  struct GNUNET_TESTING_NetjailTopology *topo;
2388  struct GNUNET_TESTING_NetjailNode *node;
2389  struct GNUNET_TESTING_NetjailRouter *router;
2390  struct GNUNET_TESTING_NetjailNamespace *namespace;
2391  struct GNUNET_ShortHashCode *hkey;
2392  struct GNUNET_HashCode hc;
2393 
2394  token = strtok_r (data, "\n", &rest);
2396  topo->map_namespaces =
2398  topo->map_globals =
2400 
2401  while (NULL != token)
2402  {
2403  if (NULL != key)
2404  free (key);
2405  key = get_key (token);
2407  "In the loop with token: %s beginning with %s\n",
2408  token,
2409  key);
2410  if (0 == strcmp (key, "M"))
2411  {
2413  "Get first Value for M.\n");
2414  out = get_first_value (token);
2416  "M: %u\n",
2417  out);
2418  topo->nodes_m = out;
2419  }
2420  else if (0 == strcmp (key, "N"))
2421  {
2423  "Get first Value for N.\n");
2424  out = get_first_value (token);
2426  "N: %u\n",
2427  out);
2428  topo->namespaces_n = out;
2429  }
2430  else if (0 == strcmp (key, "X"))
2431  {
2433  "Get first Value for X.\n");
2434  out = get_first_value (token);
2436  "X: %u\n",
2437  out);
2438  topo->nodes_x = out;
2439  }
2440  else if (0 == strcmp (key, "AC"))
2441  {
2443  "Get first Value for AC.\n");
2444  out = get_first_value (token);
2446  "AC: %u\n",
2447  out);
2448  topo->additional_connects = out;
2449  }
2450  else if (0 == strcmp (key, "T"))
2451  {
2453  "Get first string value for T.\n");
2454  value = get_first_string_value (token);
2456  "value: %s\n",
2457  value);
2458  topo->plugin = value;
2459  }
2460  else if (0 == strcmp (key, "K"))
2461  {
2462  hkey = GNUNET_new (struct GNUNET_ShortHashCode);
2463  node = GNUNET_new (struct GNUNET_TESTING_NetjailNode);
2464 
2466  "Get first Value for K.\n");
2467  out = get_first_value (token);
2469  "K: %u\n",
2470  out);
2471  node->node_n = out;
2472  GNUNET_CRYPTO_hash (&out, sizeof(out), &hc);
2473  memcpy (hkey,
2474  &hc,
2475  sizeof (*hkey));
2476  node->is_global = GNUNET_YES;
2477 
2479  topo->map_globals,
2480  hkey))
2481  GNUNET_break (0);
2482  else
2484  hkey,
2485  node,
2488  "Get value for key value on K.\n");
2489  value = get_value ("plugin", token);
2491  "value: %s\n",
2492  value);
2493  node->plugin = value;
2494  node_connections (token, node);
2495  }
2496  else if (0 == strcmp (key, "R"))
2497  {
2498  hkey = GNUNET_new (struct GNUNET_ShortHashCode);
2499  router = GNUNET_new (struct GNUNET_TESTING_NetjailRouter);
2500  node = GNUNET_new (struct GNUNET_TESTING_NetjailNode);
2501 
2503  "Get first Value for R.\n");
2504  out = get_first_value (token);
2506  "R: %u\n",
2507  out);
2508  node->node_n = out;
2509  GNUNET_CRYPTO_hash (&out, sizeof(out), &hc);
2510  memcpy (hkey,
2511  &hc,
2512  sizeof (*hkey));
2514  "Get value for key tcp_port on R.\n");
2515  value = get_value ("tcp_port", token);
2517  "tcp_port: %s\n",
2518  value);
2519  ret = sscanf (value, "%u", &(router->tcp_port));
2520 
2521  GNUNET_break (0 != ret && 1 >= router->tcp_port);
2522 
2524  "Get value for key udp_port on R.\n");
2525  value2 = get_value ("udp_port", token);
2526  ret = sscanf (value2, "%u", &(router->udp_port));
2527  GNUNET_break (0 != ret && 1 >= router->udp_port);
2529  "udp_port: %s\n",
2530  value2);
2531 
2533  topo->map_namespaces,
2534  hkey))
2535  {
2536  namespace = GNUNET_CONTAINER_multishortmap_get (topo->map_namespaces,
2537  hkey);
2538  }
2539  else
2540  {
2541  namespace = GNUNET_new (struct GNUNET_TESTING_NetjailNamespace);
2542  namespace->namespace_n = out;
2543  namespace->nodes = GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO);
2545  hkey,
2546  namespace,
2548  }
2549  namespace->router = router;
2550 
2551  }
2552  else if (0 == strcmp (key, "P"))
2553  {
2554  hkey = GNUNET_new (struct GNUNET_ShortHashCode);
2555  node = GNUNET_new (struct GNUNET_TESTING_NetjailNode);
2556 
2558  "Get first Value for P.\n");
2559  out = get_first_value (token);
2561  "P: %u\n",
2562  out);
2563  GNUNET_CRYPTO_hash (&out, sizeof(out), &hc);
2564  memcpy (hkey,
2565  &hc,
2566  sizeof (*hkey));
2567 
2569  topo->map_namespaces,
2570  hkey))
2571  {
2572  namespace = GNUNET_CONTAINER_multishortmap_get (topo->map_namespaces,
2573  hkey);
2574  }
2575  else
2576  {
2577  namespace = GNUNET_new (struct GNUNET_TESTING_NetjailNamespace);
2578  namespace->nodes = GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO);
2579  namespace->namespace_n = out;
2581  hkey,
2582  namespace,
2584  }
2586  "Get second Value for P.\n");
2587  out = get_second_value (token);
2589  "P: %u\n",
2590  out);
2591  GNUNET_CRYPTO_hash (&out, sizeof(out), &hc);
2592  memcpy (hkey,
2593  &hc,
2594  sizeof (*hkey));
2596  namespace->nodes,
2597  hkey))
2598  {
2599  GNUNET_break (0);
2600  }
2601  else
2602  {
2603  node = GNUNET_new (struct GNUNET_TESTING_NetjailNode);
2604  GNUNET_CONTAINER_multishortmap_put (namespace->nodes,
2605  hkey,
2606  node,
2609  "Get value for key plugin on P.\n");
2610  value = get_value ("plugin", token);
2612  "plugin: %s\n",
2613  value);
2614  node->plugin = value;
2615  node->node_n = out;
2616  node->namespace_n = namespace->namespace_n;
2617  }
2618  node_connections (token, node);
2619  }
2620  token = strtok_r (NULL, "\n", &rest);
2621  if (NULL != token)
2623  "Next token %s\n",
2624  token);
2625  }
2626  if (NULL != key)
2627  GNUNET_free (key);
2628  /*if (NULL != value)
2629  GNUNET_free (value);*/
2630 
2631  return topo;
2632 }
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
struct GNUNET_HashCode key
The key used in the DHT.
static char * value
Value of the record to add/remove.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:41
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multishortmap_put(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
struct GNUNET_CONTAINER_MultiShortmap * GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
void * GNUNET_CONTAINER_multishortmap_get(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Given a key find a value in the map matching the key.
int GNUNET_CONTAINER_multishortmap_contains(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_NO
Definition: gnunet_common.h:98
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
A 512-bit hashcode.
A 256-bit hashcode.
Node in the netjail topology.
unsigned int namespace_n
The number of the subnet this node is running in.
unsigned int is_global
Flag indicating if this node is a global known node.
char * plugin
Plugin for the test case to be run on this node.
unsigned int node_n
The number of this node in the subnet.
API for writing an interpreter to test GNUnet components.
unsigned int tcp_port
Will tcp be forwarded?
unsigned int udp_port
Will udp be forwarded?
struct GNUNET_CONTAINER_MultiShortmap * map_globals
Hash map containing the global known nodes which are not natted.
char * plugin
Default plugin for the test case to be run on nodes.
unsigned int nodes_m
Number of nodes per subnet.
unsigned int nodes_x
Number of global known nodes.
unsigned int namespaces_n
Number of subnets.
struct GNUNET_CONTAINER_MultiShortmap * map_namespaces
Hash map containing the subnets (for natted nodes) of the topology.
unsigned int additional_connects
Additional connects we do expect, beside the connects which are configured in the topology.
static char * get_value(char *key, char *line)
Definition: testing.c:1874
static void node_connections(char *line, struct GNUNET_TESTING_NetjailNode *node)
Definition: testing.c:1984
static unsigned int get_second_value(char *line)
Definition: testing.c:1853
static unsigned int get_first_value(char *line)
Definition: testing.c:1788
static char * get_key(char *line)
Definition: testing.c:1808
static char * get_first_string_value(char *line)
Definition: testing.c:1828

References GNUNET_TESTING_NetjailTopology::additional_connects, data, get_first_string_value(), get_first_value(), get_key(), get_second_value(), get_value(), GNUNET_break, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multishortmap_contains(), GNUNET_CONTAINER_multishortmap_create(), GNUNET_CONTAINER_multishortmap_get(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_new, GNUNET_NO, GNUNET_YES, GNUNET_TESTING_NetjailNode::is_global, key, LOG, GNUNET_TESTING_NetjailTopology::map_globals, GNUNET_TESTING_NetjailTopology::map_namespaces, GNUNET_TESTING_NetjailNode::namespace_n, GNUNET_TESTING_NetjailTopology::namespaces_n, node_connections(), GNUNET_TESTING_NetjailNode::node_n, GNUNET_TESTING_NetjailTopology::nodes_m, GNUNET_TESTING_NetjailTopology::nodes_x, GNUNET_TESTING_NetjailNode::plugin, GNUNET_TESTING_NetjailTopology::plugin, ret, GNUNET_TESTING_NetjailRouter::tcp_port, GNUNET_TESTING_NetjailRouter::udp_port, and value.

Referenced by GNUNET_TESTING_get_topo_from_file().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_TESTING_get_connections()

struct GNUNET_TESTING_NodeConnection* GNUNET_TESTING_get_connections ( unsigned int  num,
struct GNUNET_TESTING_NetjailTopology topology 
)

Get the connections to other nodes for a specific node.

Parameters
numThe specific node we want the connections for.
topologyThe topology we get the connections from.
Returns
The connections of the node.

Definition at line 2097 of file testing.c.

2099 {
2100  struct GNUNET_TESTING_NetjailNode *node;
2101  struct GNUNET_ShortHashCode *hkey;
2102  struct GNUNET_HashCode hc;
2103  struct GNUNET_TESTING_NetjailNamespace *namespace;
2104  unsigned int namespace_n, node_m;
2106 
2108  "gaga 1\n");
2109  log_topo (topology);
2111  "gaga 2\n");
2112  hkey = GNUNET_new (struct GNUNET_ShortHashCode);
2114  "num: %u \n",
2115  num);
2116  if (topology->nodes_x >= num)
2117  {
2118 
2119  GNUNET_CRYPTO_hash (&num, sizeof(num), &hc);
2120  memcpy (hkey,
2121  &hc,
2122  sizeof (*hkey));
2124  hkey);
2125  if (NULL != node)
2127  }
2128  else
2129  {
2130  namespace_n = (unsigned int) ceil ((double) (num - topology->nodes_x)
2131  / topology->nodes_m);
2133  "ceil num: %u nodes_x: %u nodes_m: %u namespace_n: %u\n",
2134  num,
2135  topology->nodes_x,
2136  topology->nodes_m,
2137  namespace_n);
2138  hkey = GNUNET_new (struct GNUNET_ShortHashCode);
2139  GNUNET_CRYPTO_hash (&namespace_n, sizeof(namespace_n), &hc);
2140  memcpy (hkey,
2141  &hc,
2142  sizeof (*hkey));
2143  namespace = GNUNET_CONTAINER_multishortmap_get (topology->map_namespaces,
2144  hkey);
2145  if (NULL == namespace)
2146  return NULL;
2147  node_m = num - topology->nodes_x - topology->nodes_m * (namespace_n - 1);
2148  hkey = GNUNET_new (struct GNUNET_ShortHashCode);
2149  GNUNET_CRYPTO_hash (&node_m, sizeof(node_m), &hc);
2150  memcpy (hkey,
2151  &hc,
2152  sizeof (*hkey));
2153  node = GNUNET_CONTAINER_multishortmap_get (namespace->nodes,
2154  hkey);
2155  if (NULL != node)
2157  }
2158 
2159  GNUNET_free (hkey);
2160  return node_connections;
2161 }
enum GNUNET_TESTBED_TopologyOption topology
The topology to generate.
unsigned int namespace_n
The number of the subnet.
struct GNUNET_TESTING_NodeConnection * node_connections_head
Head of the DLL with the connections which shall be established to other nodes.
struct GNUNET_TESTING_NetjailNode * node
The node which establish the connection.
unsigned int namespace_n
The number of the subnet of the node this connection points to.
static int log_topo(struct GNUNET_TESTING_NetjailTopology *topology)
Definition: testing.c:2072

References GNUNET_CONTAINER_multishortmap_get(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_new, consensus-simulation::int, LOG, log_topo(), GNUNET_TESTING_NodeConnection::namespace_n, GNUNET_TESTING_NetjailNamespace::namespace_n, GNUNET_TESTING_NodeConnection::node, node_connections(), GNUNET_TESTING_NetjailNode::node_connections_head, and topology.

Referenced by backchannel_check_run(), connect_peers_run(), and send_simple_run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_TESTING_get_address()

char* GNUNET_TESTING_get_address ( struct GNUNET_TESTING_NodeConnection connection,
char *  prefix 
)

Get the address for a specific communicator from a connection.

Parameters
connectionThe connection we like to have the address from.
prefixThe communicator protocol prefix.
Returns
The address of the communicator.

Definition at line 2289 of file testing.c.

2291 {
2292  struct GNUNET_TESTING_NetjailNode *node;
2293  char *addr;
2294  char *template;
2295  unsigned int node_n;
2296 
2298  "node_n: %u\n",
2299  connection->node_n);
2300 
2301  node = connection->node;
2302  if (connection->namespace_n == node->namespace_n)
2303  {
2304  template = CONNECT_ADDRESS_TEMPLATE;
2305  node_n = connection->node_n;
2306  }
2307  else if (0 == connection->namespace_n)
2308  {
2309  template = KNOWN_CONNECT_ADDRESS_TEMPLATE;
2310  node_n = connection->node_n;
2311  }
2312  else if (1 == connection->node_n)
2313  {
2315  node_n = connection->namespace_n;
2316  }
2317  else
2318  {
2319  return NULL;
2320  }
2321 
2322  if (0 == strcmp (PREFIX_TCP, prefix))
2323  {
2324 
2325  GNUNET_asprintf (&addr,
2326  template,
2327  prefix,
2328  node_n);
2329  }
2330  else if (0 == strcmp (PREFIX_UDP, prefix))
2331  {
2332  GNUNET_asprintf (&addr,
2333  template,
2334  prefix,
2335  node_n);
2336  }
2337  else
2338  {
2339  GNUNET_assert (0);
2340  }
2341 
2342  return addr;
2343 }
static int prefix
If printing the value of PREFIX has been requested.
Definition: gnunet-config.c:58
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
unsigned int node_n
The number of the node this connection points to.
#define PREFIX_TCP
Definition: testing.c:47
#define CONNECT_ADDRESS_TEMPLATE
Definition: testing.c:41
#define PREFIX_UDP
Definition: testing.c:49
#define KNOWN_CONNECT_ADDRESS_TEMPLATE
Definition: testing.c:45
#define ROUTER_CONNECT_ADDRESS_TEMPLATE
Definition: testing.c:43

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_UDP, and ROUTER_CONNECT_ADDRESS_TEMPLATE.

Referenced by connect_peers_run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_TESTING_free_topology()

void GNUNET_TESTING_free_topology ( struct GNUNET_TESTING_NetjailTopology topology)

Deallocate memory of the struct GNUNET_TESTING_NetjailTopology.

Parameters
topologyThe GNUNET_TESTING_NetjailTopology to be deallocated.

Definition at line 2249 of file testing.c.

2250 {
2252  free_namespaces_cb, NULL);
2255  NULL);
2257  GNUNET_free (topology->plugin);
2259 }
int GNUNET_CONTAINER_multishortmap_iterate(struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
int free_nodes_cb(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
Definition: testing.c:2195
int free_namespaces_cb(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
Definition: testing.c:2228

References free_namespaces_cb(), free_nodes_cb(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_free, and topology.

Here is the call graph for this function:

◆ GNUNET_TESTING_calculate_num()

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.

Parameters
node_connectionThe connection we calculate the id from.
topologyThe topology we get all needed information from.
Returns
The unique id of the node from the connection.

Definition at line 2263 of file testing.c.

2266 {
2267  unsigned int n, m, num;
2268 
2269  n = node_connection->namespace_n;
2270  m = node_connection->node_n;
2271 
2272  if (0 == n)
2273  num = m;
2274  else
2275  num = (n - 1) * topology->nodes_m + m + topology->nodes_x;
2276 
2277  return num;
2278 }
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:104

References m, GNUNET_TESTING_NodeConnection::namespace_n, GNUNET_TESTING_NodeConnection::node_n, and topology.

Referenced by connect_peers_run(), and notify_connect().

Here is the caller graph for this function:

◆ GNUNET_TESTING_cmd_system_destroy()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_system_destroy ( const char *  label,
const char *  create_label 
)

Create command.

Parameters
labelname for command.
create_labelLabel of the cmd which started the test system.
Returns
command.

Definition at line 70 of file testing_api_cmd_system_destroy.c.

102 {
103  struct TestSystemState *tss;
104 
105  tss = GNUNET_new (struct TestSystemState);
106  tss->create_label = create_label;
107  {
108  struct GNUNET_TESTING_Command cmd = {
109  .cls = tss,
110  .label = label,
111  .run = &system_destroy_run,
112  .cleanup = &system_destroy_cleanup,
113  .traits = &system_destroy_traits
114  };
115 
116  return cmd;
117  }
118 }
A command to be run by the interpreter.
const char * label
Label for the command.
void * cls
Closure for all commands with command-specific context information.
Struct to hold information for callbacks.
static void system_destroy_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static void system_destroy_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will remove the test environment for a node.
static enum GNUNET_GenericReturnValue system_destroy_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Trait function of this cmd does nothing.

◆ GNUNET_TESTING_cmd_system_create()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_system_create ( const char *  label,
const char *  testdir 
)

Create command.

Parameters
labelname for command.
labelname for the test environment directory.
Returns
command.

Definition at line 96 of file testing_api_cmd_system_create.c.

114 {
115  struct TestSystemState *tss;
116 
117  tss = GNUNET_new (struct TestSystemState);
118  tss->testdir = testdir;
119 
120  struct GNUNET_TESTING_Command cmd = {
121  .cls = tss,
122  .label = label,
123  .run = &system_create_run,
124  .cleanup = &system_create_cleanup,
125  .traits = &system_create_traits
126  };
127 
128  return cmd;
129 }
static void system_create_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will setup a test environment for a node.
static int system_create_traits(void *cls, const void **ret, const char *trait, unsigned int index)
This function prepares an array with traits.
static void system_create_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.

◆ GNUNET_TESTING_cmd_netjail_start()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_start ( const char *  label,
char *  topology_config,
unsigned int *  read_file 
)

Create command.

Parameters
labelname for command.
topology_configConfiguration file for the test topology.
read_fileFlag indicating if the the name of the topology file is send to the helper, or a string with the topology data.
Returns
command.
Parameters
labelname for command.
topology_configConfiguration file for the test topology.
Returns
command.

Definition at line 136 of file testing_api_cmd_netjail_start.c.

219 {
220  struct NetJailState *ns;
221 
222  ns = GNUNET_new (struct NetJailState);
223  ns->topology_config = topology_config;
224  ns->read_file = read_file;
225  {
226  struct GNUNET_TESTING_Command cmd = {
227  .cls = ns,
228  .label = label,
229  .run = &netjail_start_run,
230  .ac = &ns->ac,
231  .cleanup = &netjail_start_cleanup
232  };
233 
234  return cmd;
235  }
236 }
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
Definition: gnunet-abd.c:41
enum GNUNET_GenericReturnValue read_file(char const *const filename, char **buffer)
Definition: pabc_helper.c:70
Struct to hold information for callbacks.
char * topology_config
Configuration file for the test topology.
static void netjail_start_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method starts the script which setup the network namespaces.
static void netjail_start_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.

◆ GNUNET_TESTING_cmd_netjail_stop()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_stop ( const char *  label,
char *  topology_config,
unsigned int *  read_file 
)

Create command.

Parameters
labelname for command.
topology_configConfiguration file for the test topology.
read_fileFlag indicating if the the name of the topology file is send to the helper, or a string with the topology data.
Returns
command.

Definition at line 126 of file testing_api_cmd_netjail_stop.c.

186 {
187  struct NetJailState *ns;
188 
189  ns = GNUNET_new (struct NetJailState);
190  ns->topology_config = topology_config;
191  ns->read_file = read_file;
192  {
193  struct GNUNET_TESTING_Command cmd = {
194  .cls = ns,
195  .label = label,
196  .run = &netjail_stop_run,
197  .ac = &ns->ac,
198  .cleanup = &netjail_stop_cleanup
199  };
200 
201  return cmd;
202  }
203 }
static void netjail_stop_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static void netjail_stop_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method starts the script which deletes the network namespaces.

◆ GNUNET_TESTING_cmd_netjail_start_testing_system()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_start_testing_system ( const char *  label,
struct GNUNET_TESTING_NetjailTopology topology,
unsigned int *  read_file,
char *  topology_data,
struct GNUNET_TIME_Relative  timeout 
)

Create command.

Parameters
labelName for the command.
topologyThe complete topology information.
read_fileFlag indicating if the the name of the topology file is send to the helper, or a string with the topology data.
topology_dataIf read_file is GNUNET_NO, topology_data holds the string with the topology.
timeoutBefore this timeout is reached this cmd MUST finish.
Returns
command.

Definition at line 739 of file testing_api_cmd_netjail_start_testsystem.c.

788 {
789  struct NetJailState *ns;
790 
791  ns = GNUNET_new (struct NetJailState);
792  ns->local_m = topology->nodes_m;
793  ns->global_n = topology->namespaces_n;
794  ns->known = topology->nodes_x;
795  ns->plugin_name = topology->plugin;
796  ns->topology = topology;
797  ns->read_file = read_file;
798  ns->topology_data = topology_data;
800 
801  struct GNUNET_TESTING_Command cmd = {
802  .cls = ns,
803  .label = label,
804  .run = &netjail_exec_run,
805  .ac = &ns->ac,
806  .cleanup = &netjail_exec_cleanup,
807  .traits = &netjail_exec_traits
808  };
809 
810  return cmd;
811 }
static struct GNUNET_TIME_Relative timeout
Desired timeout for the lookup (default is no timeout).
Definition: gnunet-abd.c:61
struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Subtract relative timestamp from the other.
Definition: time.c:602
char * topology_data
String with topology data or name of topology file.
static void netjail_exec_cleanup(void *cls)
Code to clean up resource this cmd used.
static void netjail_exec_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
This function starts a helper process for each node.
static enum GNUNET_GenericReturnValue netjail_exec_traits(void *cls, const void **ret, const char *trait, unsigned int index)
This function prepares an array with traits.

◆ GNUNET_TESTING_cmd_stop_testing_system()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_testing_system ( const char *  label,
const char *  helper_start_label,
struct GNUNET_TESTING_NetjailTopology topology 
)

Create command.

Parameters
labelname for command.
helper_start_labellabel of the cmd to start the test system.
topologyThe complete topology information.
Returns
command.

Definition at line 85 of file testing_api_cmd_netjail_stop_testsystem.c.

140 {
141  struct StopHelperState *shs;
142 
143  shs = GNUNET_new (struct StopHelperState);
145  shs->local_m = topology->nodes_m;
146  shs->global_n = topology->namespaces_n;
147  shs->known = topology->nodes_x;
148  shs->topology = topology;
149 
150  struct GNUNET_TESTING_Command cmd = {
151  .cls = shs,
152  .label = label,
153  .run = &stop_testing_system_run,
154  .cleanup = &stop_testing_system_cleanup,
155  };
156 
157  return cmd;
158 }
Struct to store information handed over to callbacks.
unsigned int known
Number of global known nodes.
struct GNUNET_TESTING_NetjailTopology * topology
The complete topology information.
static void stop_testing_system_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
This function stops the helper process for each node.
static void stop_testing_system_cleanup(void *cls)
Code to clean up resource this cmd used.

◆ GNUNET_TESTING_send_local_test_finished_msg()

struct GNUNET_MessageHeader* GNUNET_TESTING_send_local_test_finished_msg ( enum GNUNET_GenericReturnValue  rv)

Create a GNUNET_CMDS_LOCAL_FINISHED message.

Parameters
rvThe result of the local test as GNUNET_GenericReturnValue.
Returns
The GNUNET_CMDS_LOCAL_FINISHED message.

Definition at line 2353 of file testing.c.

2354 {
2355  struct GNUNET_CMDS_LOCAL_FINISHED *reply;
2356  size_t msg_length;
2357 
2359  "Local test exits with status %d\n",
2360  rv);
2361  msg_length = sizeof(struct GNUNET_CMDS_LOCAL_FINISHED);
2362  reply = GNUNET_new (struct GNUNET_CMDS_LOCAL_FINISHED);
2364  reply->header.size = htons ((uint16_t) msg_length);
2365  reply->result = htons (rv);
2366 
2367  return (struct GNUNET_MessageHeader *) reply;
2368 }
#define GNUNET_log(kind,...)
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED.
Definition: testing_cmds.h:85
enum GNUNET_GenericReturnValue result
Definition: testing_cmds.h:87
Header for all communications.
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.

References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED, GNUNET_new, GNUNET_CMDS_LOCAL_FINISHED::header, GNUNET_CMDS_LOCAL_FINISHED::result, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.

◆ GNUNET_TESTING_cmd_barrier_create()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_create ( const char *  label)

◆ GNUNET_TESTING_cmd_barrier_setup_finished()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_setup_finished ( const char *  label)

◆ GNUNET_TESTING_cmd_barrier_reached()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_reached ( const char *  label,
const char *  barrier_label 
)

◆ GNUNET_TESTING_cmd_block_until_all_peers_started()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_block_until_all_peers_started ( const char *  label,
unsigned int *  all_peers_started 
)

◆ GNUNET_TESTING_cmd_block_until_external_trigger()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_block_until_external_trigger ( const char *  label)

Create command.

Parameters
labelname for command.
all_peers_startedFlag which will be set from outside.
asynchronous_finishIf GNUNET_YES this command will not block.
Returns
command.
Parameters
labelname for command.
all_peers_startedFlag which will be set from outside.
asynchronous_finishIf GNUNET_YES this command will not block. Can be NULL.
Returns
command.

Definition at line 75 of file testing_api_cmd_block_until_external_trigger.c.

107 {
108  struct BlockState *bs;
109 
110  bs = GNUNET_new (struct BlockState);
111  bs->label = label;
113  {
114  struct GNUNET_TESTING_Command cmd = {
115  .cls = bs,
116  .label = label,
118  .ac = &bs->ac,
121  };
122 
123  return cmd;
124  }
125 }
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
unsigned int asynchronous_finish
If this command will block.
const char * label
The label of this command.
static void block_until_all_peers_started_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static int block_until_external_trigger_traits(void *cls, const void **ret, const char *trait, unsigned int index)
static void block_until_all_peers_started_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
This function does nothing but to start the cmd.

◆ GNUNET_TESTING_cmd_send_peer_ready()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_send_peer_ready ( const char *  label,
TESTING_CMD_HELPER_write_cb  write_message 
)

Create command.

Parameters
labelname for command.
write_messageCallback to write messages to the master loop.
Returns
command.

Definition at line 85 of file testing_api_cmd_send_peer_ready.c.

111 {
112  struct SendPeerReadyState *sprs;
113 
114  sprs = GNUNET_new (struct SendPeerReadyState);
116  {
117  struct GNUNET_TESTING_Command cmd = {
118  .cls = sprs,
119  .label = label,
120  .run = &send_peer_ready_run,
121  .cleanup = &send_peer_ready_cleanup,
122  .traits = &send_peer_ready_traits
123  };
124 
125  return cmd;
126  }
127 }
static int write_message(uint16_t message_type, const char *data, size_t data_length)
Write message to the master process.
Struct to hold information for callbacks.
TESTING_CMD_HELPER_write_cb write_message
Callback to write messages to the master loop.
static void send_peer_ready_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
This function sends a GNUNET_MESSAGE_TYPE_CMDS_HELPER_PEER_STARTED message to the master loop.
static void send_peer_ready_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static enum GNUNET_GenericReturnValue send_peer_ready_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Trait function of this cmd does nothing.

◆ GNUNET_TESTING_cmd_local_test_finished()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_local_test_finished ( const char *  label,
TESTING_CMD_HELPER_write_cb  write_message 
)

Create command.

Parameters
labelname for command.
write_messageCallback to write messages to the master loop.
Returns
command.

Definition at line 77 of file testing_api_cmd_local_test_finished.c.

105 {
106  struct LocalFinishedState *lfs;
107 
108  lfs = GNUNET_new (struct LocalFinishedState);
110  {
111  struct GNUNET_TESTING_Command cmd = {
112  .cls = lfs,
113  .label = label,
114  .run = &local_test_finished_run,
115  .cleanup = &local_test_finished_cleanup,
116  };
117 
118  return cmd;
119  }
120 }
Struct to hold information for callbacks.
TESTING_CMD_HELPER_write_cb write_message
Callback to write messages to the master loop.
static void local_test_finished_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
This function sends a GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED message to the master loop.
static void local_test_finished_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.

◆ GNUNET_TESTING_cmd_local_test_prepared()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_local_test_prepared ( const char *  label,
TESTING_CMD_HELPER_write_cb  write_message 
)

Create command.

Parameters
labelname for command.
write_messageCallback to write messages to the master loop.
all_local_tests_preparedFlag which will be set from outside.
Returns
command.

Definition at line 78 of file testing_api_cmd_local_test_prepared.c.

107 {
108  struct LocalPreparedState *lfs;
109 
110  lfs = GNUNET_new (struct LocalPreparedState);
112 
113  struct GNUNET_TESTING_Command cmd = {
114  .cls = lfs,
115  .label = label,
116  .run = &local_test_prepared_run,
117  .ac = &lfs->ac,
118  .cleanup = &local_test_prepared_cleanup,
119  .traits = &local_test_prepared_traits
120  };
121 
122  return cmd;
123 }
TESTING_CMD_HELPER_write_cb write_message
Callback to write messages to the master loop.
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
static void local_test_prepared_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
This function sends a GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_TESTS_PREPARED message to the master loop...
enum GNUNET_GenericReturnValue local_test_prepared_traits(void *cls, const void **ret, const char *trait, unsigned int index)
This function prepares an array with traits.
static void local_test_prepared_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.

◆ GNUNET_TESTING_get_trait_test_system()

enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_test_system ( const struct GNUNET_TESTING_Command cmd,
const struct GNUNET_TESTING_System **  ret 
)

Referenced by backchannel_check_run(), connect_peers_run(), send_simple_run(), start_peer_run(), and system_destroy_run().

Here is the caller graph for this function:

◆ GNUNET_TESTING_make_trait_test_system()

struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_test_system ( const struct GNUNET_TESTING_System value)

Referenced by system_create_traits().

Here is the caller graph for this function:

◆ GNUNET_TESTING_get_trait_async_context()

enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_async_context ( const struct GNUNET_TESTING_Command cmd,
const struct GNUNET_TESTING_AsyncContext **  ret 
)

◆ GNUNET_TESTING_make_trait_async_context()

struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_async_context ( const struct GNUNET_TESTING_AsyncContext value)

Referenced by block_until_external_trigger_traits().

Here is the caller graph for this function:

◆ GNUNET_TESTING_get_trait_helper_handles()

enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_helper_handles ( const struct GNUNET_TESTING_Command cmd,
const struct GNUNET_HELPER_Handle ***  ret 
)

Referenced by stop_testing_system_run().

Here is the caller graph for this function:

◆ GNUNET_TESTING_make_trait_helper_handles()

struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_helper_handles ( const struct GNUNET_HELPER_Handle **  value)

◆ GNUNET_TESTING_get_trait_local_prepared_state()

enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_local_prepared_state ( const struct GNUNET_TESTING_Command cmd,
const struct LocalPreparedState **  ret 
)

◆ GNUNET_TESTING_make_trait_local_prepared_state()

struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_local_prepared_state ( const struct LocalPreparedState value)

◆ GNUNET_TESTING_get_trait_block_state()

enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_block_state ( const struct GNUNET_TESTING_Command cmd,
const struct BlockState **  ret 
)

◆ GNUNET_TESTING_make_trait_block_state()

struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_block_state ( const struct BlockState value)

Referenced by block_until_external_trigger_traits().

Here is the caller graph for this function: