GNUnet  0.11.x
Data Structures | Macros | Functions
transport_api_cmd_backchannel_check.c File Reference
#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 "gnunet_hello_lib.h"
#include "gnunet_transport_service.h"
#include "transport-testing-cmds.h"
Include dependency graph for transport_api_cmd_backchannel_check.c:

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 (kind, __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...
 

Macro Definition Documentation

◆ LOG

#define LOG (   kind,
  ... 
)    GNUNET_log (kind, __VA_ARGS__)

Generic logging shortcut.

Definition at line 39 of file transport_api_cmd_backchannel_check.c.

◆ UDP

#define UDP   "udp"

Definition at line 41 of file transport_api_cmd_backchannel_check.c.

◆ MAX_LINE_LENGTH

#define MAX_LINE_LENGTH   1024

Maximum length allowed for line input.

Definition at line 46 of file transport_api_cmd_backchannel_check.c.

Function Documentation

◆ read_from_log()

static void read_from_log ( void *  cls)
static
Parameters
clsThe cmd state CheckState.

Definition at line 135 of file transport_api_cmd_backchannel_check.c.

136 {
137  struct CheckState *cs = cls;
138  char line[MAX_LINE_LENGTH + 1];
139  char *search_string;
140 
141 
143  "read_from_log\n");
144 
145  cs->fh = GNUNET_DISK_file_open ("test.out",
148 
149  cs->task = NULL;
150 
151  /* read message from line and handle it */
152  cs->stream = fdopen (cs->fh->fd, "r");
153  memset (line, 0, MAX_LINE_LENGTH + 1);
154 
155  // fgets (line, MAX_LINE_LENGTH, cs->stream);
156  // while (NULL != line && 0 != strcmp (line, ""))// '\0' != line[0])
157  while (NULL != fgets (line, MAX_LINE_LENGTH, cs->stream))
158  {
159  /*LOG (GNUNET_ERROR_TYPE_DEBUG,
160  "cs->received_backchannel_msgs: %u\n",
161  cs->received_backchannel_msgs);*/
162  /*if (NULL == strstr (line, "line"))
163  LOG (GNUNET_ERROR_TYPE_DEBUG,
164  "line: %s",
165  line);*/
166 
167 
168  for (int i = 0; i < cs->con_num; i++)
169  {
170  search_string = cs->search_string[i];
171  /*LOG (GNUNET_ERROR_TYPE_DEBUG,
172  "search %u %u: %s %p\n",
173  i,
174  cs->con_num,
175  cs->search_string[i],
176  cs->search_string);
177  fprintf (stderr,
178  line);*/
179  if (NULL != strstr (line,
180  search_string))
181  // "Delivering backchannel message from 4TTC to F7B5 of type 1460 to udp"))
182  // cs->search_string[i]))
183  {
186  "received_backchannel_msgs %u con_num %u\n",
188  cs->con_num);
189  if (cs->received_backchannel_msgs == cs->con_num)
190  {
192  "search finished %lu %lu %u\n",
193  strlen (cs->search_string[i]),
194  strlen (
195  "Delivering backchannel message from 4TTC to F7B5 of type 1460 to udp"),
196  strcmp (
197  "Delivering backchannel message from 4TTC to F7B5 of type 1460 to udp",
198  cs->search_string[i]));
200  fclose (cs->stream);
201  return;
202  }
203  }
204  }
205  }
207  "read_from_log end\n");
208  fclose (cs->stream);
210  &read_from_log,
211  cs);
212  /*if (NULL == fgets (line, MAX_LINE_LENGTH, cs->stream))
213  {
214  LOG (GNUNET_ERROR_TYPE_DEBUG,
215  "read null\n");
216  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
217  &read_from_log,
218  cs);
219  return;
220  }*/
221  /*else {
222  cs->task =
223  GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
224  cs->fh,
225  &read_from_log,
226  cs);
227 
228 
229  }*/
230 }
static char * line
Desired phone line (string to be converted to a hash).
void GNUNET_TESTING_async_finish(struct GNUNET_TESTING_AsyncContext *ac)
The asynchronous command of ac has finished.
struct GNUNET_DISK_FileHandle * GNUNET_DISK_file_open(const char *fn, enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm)
Open a file.
Definition: disk.c:1235
@ GNUNET_DISK_OPEN_READ
Open the file for reading.
@ GNUNET_DISK_PERM_USER_READ
Owner can read.
@ GNUNET_ERROR_TYPE_DEBUG
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.
Definition: scheduler.c:1269
#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.
unsigned int received_backchannel_msgs
Number of received backchannel messages.
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
struct GNUNET_SCHEDULER_Task * task
Task which handles the reading.
struct GNUNET_DISK_FileHandle * fh
File handle for log file.
int fd
File handle on Unix-like systems.
static void read_from_log(void *cls)
#define LOG(kind,...)
Generic logging shortcut.
#define MAX_LINE_LENGTH
Maximum length allowed for line input.

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, CheckState::received_backchannel_msgs, CheckState::search_string, CheckState::stream, and CheckState::task.

Referenced by backchannel_check_run().

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

◆ will_the_other_node_connect_via_udp()

static enum GNUNET_GenericReturnValue will_the_other_node_connect_via_udp ( struct CheckState cs,
const struct GNUNET_TESTING_NetjailNode node 
)
static

Definition at line 135 of file transport_api_cmd_backchannel_check.c.

238 {
239  // struct GNUNET_TESTING_NetjailTopology *topology = cs->topology;
240  // unsigned int node_n = connection->node_n;
241  // unsigned int namespace_n = connection->namespace_n;
242  // struct GNUNET_HashCode hc;
243  // struct GNUNET_ShortHashCode *key = GNUNET_new (struct GNUNET_ShortHashCode);
244  // struct GNUNET_HashCode hc_namespace;
245  /*struct GNUNET_ShortHashCode *key_namespace = GNUNET_new (struct
246  GNUNET_ShortHashCode);*/
247  // struct GNUNET_TESTING_NetjailNode *node;
248  struct GNUNET_TESTING_NodeConnection *pos_connection;
249  struct GNUNET_TESTING_AddressPrefix *pos_prefix;
250  // struct GNUNET_TESTING_NetjailNamespace *namespace;
251  // struct GNUNET_CONTAINER_MultiShortmap *map;
252 
253  /* if (0 == connection->namespace_n) */
254  /* { */
255  /* map = topology->map_globals; */
256  /* } */
257  /* else */
258  /* { */
259  /* GNUNET_CRYPTO_hash (&namespace_n, sizeof(namespace_n), &hc_namespace); */
260  /* memcpy (key_namespace, */
261  /* &hc_namespace, */
262  /* sizeof (*key_namespace)); */
263  /* if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( */
264  /* topology->map_namespaces, */
265  /* key_namespace)) */
266  /* { */
267  /* namespace = GNUNET_CONTAINER_multishortmap_get (topology->map_namespaces, */
268  /* key_namespace); */
269  /* map = namespace->nodes; */
270  /* } */
271  /* else */
272  /* GNUNET_assert (0); */
273  /* } */
274 
275  /* GNUNET_CRYPTO_hash (&node_n, sizeof(node_n), &hc); */
276  /* memcpy (key, */
277  /* &hc, */
278  /* sizeof (*key)); */
279  /* if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( */
280  /* map, */
281  /* key)) */
282  /* { */
283  /* node = GNUNET_CONTAINER_multishortmap_get (cs->topology->map_globals, */
284  /* key); */
285  /* for (pos_connection = node->node_connections_head; NULL != pos_connection; */
286  /* pos_connection = pos_connection->next) */
287  /* { */
288  /* if ((node->namespace_n == pos_connection->namespace_n) && */
289  /* (node->node_n == pos_connection->node_n) ) */
290  /* { */
291  /* for (pos_prefix = pos_connection->address_prefixes_head; NULL != */
292  /* pos_prefix; */
293  /* pos_prefix = */
294  /* pos_prefix->next) */
295  /* { */
296  /* if (0 == strcmp (UDP, pos_prefix->address_prefix)) */
297  /* { */
298  /* return GNUNET_YES; */
299  /* } */
300  /* } */
301  /* } */
302  /* } */
303  /* } */
304 
305  for (pos_connection = node->node_connections_head; NULL != pos_connection;
306  pos_connection = pos_connection->next)
307  {
309  "connect via udp %u %u %u %u\n",
310  node->namespace_n,
311  cs->namespace_n,
312  node->node_n,
313  cs->node_n);
314  if ((pos_connection->namespace_n == cs->namespace_n) &&
315  (pos_connection->node_n == cs->node_n) )
316  {
317  for (pos_prefix = pos_connection->address_prefixes_head; NULL !=
318  pos_prefix;
319  pos_prefix =
320  pos_prefix->next)
321  {
322  if (0 == strcmp (UDP, pos_prefix->address_prefix))
323  {
324  return GNUNET_YES;
325  }
326  }
327  }
328  }
329 
330  return GNUNET_NO;
331 }
#define GNUNET_log(kind,...)
@ GNUNET_YES
Definition: gnunet_common.h:97
@ GNUNET_NO
Definition: gnunet_common.h:94
unsigned int node_n
The number of the node in a network namespace.
unsigned int namespace_n
The number of the network namespace.
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.
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.
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 protocolls this node is reachable.

Referenced by backchannel_check_run().

Here is the caller graph for this function:

◆ add_search_string()

static void add_search_string ( struct CheckState cs,
const struct GNUNET_TESTING_NetjailNode node 
)
static

Definition at line 334 of file transport_api_cmd_backchannel_check.c.

336 {
337  unsigned int num;
338  struct GNUNET_PeerIdentity *peer;
339  struct GNUNET_PeerIdentity *us;
340  char *buf;
341  char *part_one = "Delivering backchannel message from ";
342  char *part_two = " to ";
343  char *part_three = " of type 1460 to udp";
344  char *peer_id;
345  char *us_id;
346 
347  if (0 == node->namespace_n)
348  num = node->node_n;
349  else
350  num = (node->namespace_n - 1) * cs->topology->nodes_m + node->node_n
351  + cs->topology->nodes_x;
352 
353  // num = GNUNET_TESTING_calculate_num (pos_connection, cs->topology);
356  "peer: %s num %u\n",
357  GNUNET_i2s (peer),
358  num);
359  us = GNUNET_TESTING_get_pub_key (cs->num, cs->tl_system);
361  "us: %s cs->num %d\n",
362  GNUNET_i2s (us),
363  cs->num);
364 
366  "%s",
367  GNUNET_i2s (peer));
368  GNUNET_asprintf (&us_id,
369  "%s",
370  GNUNET_i2s (us));
371 
372  if (0 < GNUNET_asprintf (&buf,
373  "%s%s%s%s%s",
374  part_one,
375  us_id,
376  part_two,
377  peer_id,
378  part_three))
379  {
381  cs->con_num,
382  buf);
383  /*LOG (GNUNET_ERROR_TYPE_DEBUG,
384  "con_num: %u search: %s %p\n",
385  cs->con_num,
386  cs->search_string[cs->con_num - 1],
387  cs->search_string);*/
388  }
389  else
390  GNUNET_assert (0);
391 }
static char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
static char buf[2048]
struct GNUNET_PeerIdentity * GNUNET_TESTING_get_pub_key(unsigned int num, const struct GNUNET_TESTING_System *tl_system)
Retrieve the public key from the test system with the unique node id.
Definition: testing.c:2172
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.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_array_append(arr, len, element)
Append an element to an array (growing the array by one).
uint32_t num
Number globally identifying the node.
const struct GNUNET_TESTING_System * tl_system
The testing system of this node.
struct GNUNET_TESTING_NetjailTopology * topology
The topology of the test setup.
The identity of the host (wraps the signing key of the peer).
unsigned int nodes_m
Number of nodes per subnet.
unsigned int nodes_x
Number of global known nodes.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.

References buf, CheckState::con_num, GNUNET_array_append, GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_TESTING_get_pub_key(), LOG, GNUNET_TESTING_NetjailNode::namespace_n, GNUNET_TESTING_NetjailNode::node_n, GNUNET_TESTING_NetjailTopology::nodes_m, GNUNET_TESTING_NetjailTopology::nodes_x, CheckState::num, peer, peer_id, CheckState::search_string, CheckState::tl_system, and CheckState::topology.

Referenced by backchannel_check_run().

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

◆ backchannel_check_run()

static void backchannel_check_run ( void *  cls,
struct GNUNET_TESTING_Interpreter is 
)
static

The run method of this cmd will connect to peers.

Definition at line 399 of file transport_api_cmd_backchannel_check.c.

401 {
402  struct CheckState *cs = cls;
403  // char *buf;
404  // char *part_one = "Delivering backchannel message from ";
405  // char *part_two = " of type 1460 to udp";
406  const struct GNUNET_TESTING_Command *system_cmd;
407  const struct GNUNET_TESTING_System *tl_system;
408  const struct GNUNET_TESTING_Command *peer1_cmd;
410  // struct GNUNET_PeerIdentity *peer;
411  // uint32_t num;
412  // struct GNUNET_TESTING_NodeConnection *pos_connection;
413  // unsigned int con_num = 0;
415  struct GNUNET_CONTAINER_MultiShortmapIterator *namespace_it;
416  struct GNUNET_ShortHashCode node_key;
417  struct GNUNET_ShortHashCode namespace_key;
418  const struct GNUNET_TESTING_NetjailNode *node;
419  const struct GNUNET_TESTING_NetjailNamespace *namespace;
420 
422  cs->start_peer_label);
424  &ah);
425 
427  cs->create_label);
429  &tl_system);
430 
431  cs->tl_system = tl_system;
432 
434  cs->topology);
435 
437  "check run\n");
438 
439 
441  cs->topology->map_globals);
442 
444  &node_key,
445  (const
446  void**) &
447  node))
448  {
450  "namespace_n %u node_n %u\n",
451  node->namespace_n,
452  node->node_n);
454  {
455  add_search_string (cs, node);
456  }
457  }
459  cs->topology->map_namespaces);
461  namespace_it,
462  &namespace_key,
463  (const
464  void**) &namespace))
465  {
467  "namespace_n %u\n",
468  node->namespace_n);
470  namespace->nodes);
472  &node_key,
473  (const
474  void**)
475  &node))
476  {
478  "namespace_n %u node_n %u\n",
479  node->namespace_n,
480  node->node_n);
482  {
483  add_search_string (cs, node);
484  }
485  }
486  }
487  /* for (pos_connection = cs->node_connections_head; NULL != pos_connection; */
488  /* pos_connection = pos_connection->next) */
489  /* { */
490 
491  /* if (GNUNET_YES == will_the_other_node_connect_via_udp (cs, node)) */
492  /* { */
493  /* num = GNUNET_TESTING_calculate_num (pos_connection, cs->topology); */
494  /* peer = GNUNET_TESTING_get_pub_key (num, tl_system); */
495  /* LOG (GNUNET_ERROR_TYPE_DEBUG, */
496  /* "peer: %s\n", */
497  /* GNUNET_i2s (peer)); */
498 
499  /* if (0 < GNUNET_asprintf (&buf, */
500  /* "%s%s%s", */
501  /* part_one, */
502  /* GNUNET_i2s (peer), */
503  /* part_two)) */
504  /* { */
505  /* GNUNET_array_append (cs->search_string, */
506  /* con_num, */
507  /* buf); */
508  /* /\*LOG (GNUNET_ERROR_TYPE_DEBUG, */
509  /* "con_num: %u search: %s %p\n", */
510  /* con_num, */
511  /* cs->search_string[con_num - 1], */
512  /* cs->search_string);*\/ */
513  /* } */
514  /* else */
515  /* GNUNET_assert (0); */
516  /* } */
517 
518 
519  /* } */
520  // cs->con_num = con_num;
521  if (0 != cs->con_num)
522  {
523  cs->task =
525  cs);
526  }
527  else
529 
530 }
static struct GNUNET_NT_InterfaceScanner * is
Network scanner to determine network types.
static struct GNUNET_NAT_AUTO_AutoHandle * ah
Handle to ongoing autoconfiguration.
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.
Definition: testing.c:2097
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_test_system(const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TESTING_System **ret)
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
int 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.
struct GNUNET_CONTAINER_MultiShortmapIterator * GNUNET_CONTAINER_multishortmap_iterator_create(const struct GNUNET_CONTAINER_MultiShortmap *map)
Create an iterator for a multihashmap.
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.
Definition: scheduler.c:1296
const char * start_peer_label
Label of the cmd to start a peer.
struct GNUNET_TESTING_NodeConnection * node_connections_head
Connections to other peers.
A 256-bit hashcode.
A command to be run by the interpreter.
Node in the netjail topology.
struct GNUNET_CONTAINER_MultiShortmap * map_globals
Hash map containing the global known nodes which are not natted.
struct GNUNET_CONTAINER_MultiShortmap * map_namespaces
Hash map containing the subnets (for natted nodes) of the topology.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
Definition: testing.c:103
Handle to the TRANSPORT subsystem for application management.
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_get_trait_application_handle(const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TRANSPORT_ApplicationHandle **ret)
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)

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_SCHEDULER_add_now(), GNUNET_TESTING_async_finish(), GNUNET_TESTING_get_connections(), GNUNET_TESTING_get_trait_test_system(), GNUNET_TESTING_interpreter_lookup_command(), GNUNET_TRANSPORT_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().

Here is the call graph for this function:

◆ backchannel_check_traits()

static int backchannel_check_traits ( void *  cls,
const void **  ret,
const char *  trait,
unsigned int  index 
)
static

Trait function of this cmd does nothing.

Definition at line 538 of file transport_api_cmd_backchannel_check.c.

542 {
543  return GNUNET_OK;
544 }
@ GNUNET_OK
Definition: gnunet_common.h:95

References GNUNET_OK.

◆ backchannel_check_cleanup()

static void backchannel_check_cleanup ( void *  cls)
static

The cleanup function of this cmd frees resources the cmd allocated.

Definition at line 552 of file transport_api_cmd_backchannel_check.c.

553 {
554  struct ConnectPeersState *cs = cls;
555 
556  GNUNET_free (cs);
557 }
#define GNUNET_free(ptr)
Wrapper around free.
Struct to store information needed in callbacks.

◆ 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.

Parameters
labelname for command.
start_peer_labelLabel of the cmd to start a peer.
create_labelLabel of the cmd to create the testing system.
numNumber globally identifying the node.
node_nThe number of the node in a network namespace.
namespace_nThe number of the network namespace.
Thetopology for the test setup.
Returns
command.

Definition at line 552 of file transport_api_cmd_backchannel_check.c.

581 {
582  struct CheckState *cs;
583 
584  cs = GNUNET_new (struct CheckState);
586  cs->num = num;
588  cs->topology = topology;
589  cs->node_n = node_n;
590  cs->namespace_n = namespace_n;
591 
592  struct GNUNET_TESTING_Command cmd = {
593  .cls = cs,
594  .label = label,
595  .run = &backchannel_check_run,
596  .ac = &cs->ac,
597  .cleanup = &backchannel_check_cleanup,
598  .traits = &backchannel_check_traits
599  };
600 
601  return cmd;
602 }
enum GNUNET_TESTBED_TopologyOption topology
The topology to generate.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
const char * label
Label for the command.
void * cls
Closure for all commands with command-specific context information.
static void backchannel_check_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static void backchannel_check_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will connect to peers.
static int backchannel_check_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Trait function of this cmd does nothing.