GNUnet  0.19.2
gnunet-cmds-helper.c
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2021 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
39 #include "platform.h"
40 #include "gnunet_util_lib.h"
41 #include "gnunet_testing_lib.h"
42 #include "gnunet_testing_ng_lib.h"
43 #include "gnunet_testing_plugin.h"
45 #include "testing.h"
46 #include "testing_cmds.h"
47 #include "gnunet_testing_plugin.h"
48 #include "gnunet_testing_barrier.h"
49 #include <zlib.h>
50 
51 
55 #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__)
56 
60 #define LOG_DEBUG(...) LOG (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
61 
62 #define NODE_BASE_IP "192.168.15."
63 
64 #define KNOWN_BASE_IP "92.68.151."
65 
66 #define ROUTER_BASE_IP "92.68.150."
67 
68 /* Use the IP addresses below instead of the public ones,
69  * if the start script was not started from within a new namespace
70  * created by unshare. The UPNP test case needs public IP
71  * addresse for miniupnpd to function.
72  * FIXME We should introduce a switch indicating if public
73  * addresses should be used or not. This info has to be
74  * propagated from the start script to the c code.
75 #define KNOWN_BASE_IP "172.16.151."
76 
77 #define ROUTER_BASE_IP "172.16.150."
78 */
79 
81 
83 
89 {
94  char *n;
95 
100  char *m;
101 
106  char *global_n;
107 
112  char *local_m;
113 
117  unsigned int *read_file;
118 
123 };
124 
128 struct WriteContext
129 {
133  void *data;
134 
138  size_t length;
139 
143  size_t pos;
144 };
145 
155 
160 
165 
170 
175 
180 
185 
189 static int done_reading;
190 
194 static int status;
195 
196 
202 static void
203 do_shutdown (void *cls)
204 {
205 
206  LOG_DEBUG ("Shutting down.\n");
207 
208  if (NULL != read_task_id)
209  {
211  read_task_id = NULL;
212  }
213  if (NULL != write_task_id)
214  {
215  struct WriteContext *wc;
216 
218  write_task_id = NULL;
219  GNUNET_free (wc->data);
220  GNUNET_free (wc);
221  }
222  if (NULL != stdin_fd)
224  if (NULL != stdout_fd)
227  tokenizer = NULL;
229  NULL);
231 }
232 
233 
239 static void
240 write_task (void *cls)
241 {
242  struct WriteContext *wc = cls;
243  ssize_t bytes_wrote;
244 
245  GNUNET_assert (NULL != wc);
246  write_task_id = NULL;
247  bytes_wrote = GNUNET_DISK_file_write (stdout_fd,
248  wc->data + wc->pos,
249  wc->length - wc->pos);
251  "message send to master loop\n");
252  if (GNUNET_SYSERR == bytes_wrote)
253  {
255  "Cannot reply back successful initialization\n");
256  GNUNET_free (wc->data);
257  GNUNET_free (wc);
258  return;
259  }
260  wc->pos += bytes_wrote;
261  if (wc->pos == wc->length)
262  {
263  GNUNET_free (wc->data);
264  GNUNET_free (wc);
265  return;
266  }
268  stdout_fd,
269  &write_task,
270  wc);
271 }
272 
273 
278 static void
279 write_message (struct GNUNET_MessageHeader *message, size_t msg_length)
280 {
281  struct WriteContext *wc;
282 
284  "write message to master loop\n");
285  wc = GNUNET_new (struct WriteContext);
286  wc->length = msg_length;
287  wc->data = message;
290  stdout_fd,
291  &write_task,
292  wc);
293 }
294 
295 static void
297 {
299  "doing shutdown after delay\n");
301 }
302 
303 
304 struct GNUNET_MessageHeader *
306 {
308  size_t msg_length;
309 
310  msg_length = sizeof(struct GNUNET_TESTING_CommandLocalFinished);
313  reply->header.size = htons ((uint16_t) msg_length);
314 
315  return (struct GNUNET_MessageHeader *) reply;
316 }
317 
318 
319 static void
321 {
323  size_t msg_length;
324 
325  msg_length = sizeof(struct GNUNET_TESTING_CommandLocalFinished);
328  reply->header.size = htons ((uint16_t) msg_length);
329  reply->rv = rv;
330 
332  "message prepared\n");
333  write_message ((struct GNUNET_MessageHeader *) reply, msg_length);
335  "message send\n");
336 
338  "delaying shutdown\n");
341  NULL);
342 }
343 
344 
357 static int
358 tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message)
359 {
360 
361  struct NodeIdentifier *ni = cls;
363  struct GNUNET_TESTING_CommandHelperReply *reply;
364  char *binary;
365  char *plugin_name;
366  size_t plugin_name_size;
367  uint16_t msize;
368  uint16_t type;
369  size_t msg_length;
370  char *router_ip;
371  char *node_ip;
372  unsigned int namespace_n;
373 
374  type = ntohs (message->type);
375  msize = ntohs (message->size);
377  "Received message type %u and size %u\n",
378  type,
379  msize);
380  if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT == ntohs (message->type))
381  {
382  msg = (const struct GNUNET_TESTING_CommandHelperInit *) message;
383  plugin_name_size = ntohs (msg->plugin_name_size);
384  if ((sizeof(struct GNUNET_TESTING_CommandHelperInit) + plugin_name_size) > msize)
385  {
386  GNUNET_break (0);
388  "Received unexpected message -- exiting\n");
389  goto error;
390  }
393  ((char *) &msg[1]),
394  plugin_name_size + 1);
395 
396  binary = GNUNET_OS_get_libexec_binary_path ("gnunet-cmd");
397 
398  plugin = GNUNET_new (struct TestcasePlugin);
400  NULL);
402 
403  plugin->global_n = ni->global_n;
404  plugin->local_m = ni->local_m;
405  plugin->n = ni->n;
406  plugin->m = ni->m;
407 
408  router_ip = GNUNET_malloc (strlen (ROUTER_BASE_IP) + strlen (plugin->n)
409  + 1);
410  strcpy (router_ip, ROUTER_BASE_IP);
411  strcat (router_ip, plugin->n);
412 
413  sscanf (plugin->n, "%u", &namespace_n);
414 
415  if (0 == namespace_n)
416  {
418  "known node n: %s\n",
419  plugin->n);
420  node_ip = GNUNET_malloc (strlen (KNOWN_BASE_IP) + strlen (plugin->m) + 1);
421  strcat (node_ip, KNOWN_BASE_IP);
422  }
423  else
424  {
426  "subnet node n: %s\n",
427  plugin->n);
428  node_ip = GNUNET_malloc (strlen (NODE_BASE_IP) + strlen (plugin->m) + 1);
429  strcat (node_ip, NODE_BASE_IP);
430  }
431  strcat (node_ip, plugin->m);
432 
433  is = plugin->api->start_testcase (&write_message, router_ip, node_ip, plugin->m,
434 
436  ni->read_file, &finished_cb);
437  GNUNET_free (node_ip);
438  GNUNET_free (binary);
439  GNUNET_free (router_ip);
441 
442  msg_length = sizeof(struct GNUNET_TESTING_CommandHelperReply);
445  reply->header.size = htons ((uint16_t) msg_length);
446 
447  write_message ((struct GNUNET_MessageHeader *) reply, msg_length);
448 
449  return GNUNET_OK;
450  }
452  message->type))
453  {
454  const char *barrier_name;
455  struct CommandBarrierCrossable *adm = (struct CommandBarrierCrossable *) message;
456 
457  barrier_name = (const char *) &adm[1];
459  "cross barrier %s\n",
460  barrier_name);
462  return GNUNET_OK;
463  }
465  message->type))
466  {
468  "all peers started\n");
470  return GNUNET_OK;
471  }
473  message->type))
474  {
476  "all local tests prepared\n");
478  return GNUNET_OK;
479  }
480  else
481  {
482  LOG (GNUNET_ERROR_TYPE_WARNING, "Received unexpected message -- exiting\n");
483  goto error;
484  }
485 
486 
487  error:
490  "tokenizer shutting down!\n");
492  return GNUNET_SYSERR;
493 }
494 
495 
501 static void
502 read_task (void *cls)
503 {
505  ssize_t sread;
506 
507  read_task_id = NULL;
508  sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof(buf));
509  if ((GNUNET_SYSERR == sread) || (0 == sread))
510  {
511  LOG_DEBUG ("STDIN closed\n");
513  return;
514  }
515  if (GNUNET_YES == done_reading)
516  {
517  /* didn't expect any more data! */
518  GNUNET_break_op (0);
520  "tokenizer shutting down during reading, didn't expect any more data!\n");
522  return;
523  }
524  LOG_DEBUG ("Read %u bytes\n", (unsigned int) sread);
525  /* FIXME: could introduce a GNUNET_MST_read2 to read
526  directly from 'stdin_fd' and save a memcpy() here */
527  if (GNUNET_OK !=
529  {
530  GNUNET_break (0);
532  "tokenizer shutting down during reading, writing to buffer failed!\n");
534  return;
535  }
536  read_task_id /* No timeout while reading */
538  stdin_fd,
539  &read_task,
540  NULL);
541 }
542 
543 
552 static void
553 run (void *cls,
554  char *const *args,
555  const char *cfgfile,
556  const struct GNUNET_CONFIGURATION_Handle *cfg)
557 {
558  struct NodeIdentifier *ni = cls;
559 
561  "Starting interpreter loop helper...\n");
562 
567  stdin_fd,
568  &read_task,
569  NULL);
572  "Interpreter loop helper started.\n");
573 }
574 
575 
579 static void
581 {
582  static char c;
583  int old_errno; /* back-up errno */
584 
585  old_errno = errno;
586  GNUNET_break (
587  1 ==
590  &c,
591  sizeof(c)));
592  errno = old_errno;
593 }
594 
595 
603 int
604 main (int argc, char **argv)
605 {
606  struct NodeIdentifier *ni;
610  int ret;
611  unsigned int sscanf_ret;
612  int i;
613  size_t topology_data_length = 0;
614  unsigned int read_file;
615  char cr[2] = "\n\0";
616 
617  GNUNET_log_setup ("gnunet-cmds-helper",
618  "DEBUG",
619  NULL);
620  ni = GNUNET_new (struct NodeIdentifier);
621  ni->global_n = argv[1];
622  ni->local_m = argv[2];
623  ni->m = argv[3];
624  ni->n = argv[4];
625 
626  errno = 0;
627  sscanf_ret = sscanf (argv[5], "%u", &read_file);
628 
629  if (errno != 0)
630  {
632  }
633  else if (1 == read_file)
634  ni->topology_data = argv[6];
635  else if (0 == read_file)
636  {
637  for (i = 6; i<argc; i++)
638  topology_data_length += strlen (argv[i]) + 1;
640  "topo data length %lu\n",
641  topology_data_length);
642  ni->topology_data = GNUNET_malloc (topology_data_length);
643  memset (ni->topology_data, '\0', topology_data_length);
644  for (i = 6; i<argc; i++)
645  {
646  strcat (ni->topology_data, argv[i]);
647  strcat (ni->topology_data, cr);
648  }
649  }
650  else
651  {
653  "Wrong input for the fourth argument\n");
654  }
655  GNUNET_assert (0 < sscanf_ret);
656  ni->read_file = &read_file;
657  ni->topology_data[topology_data_length - 1] = '\0';
659  "topo data %s\n",
660  ni->topology_data);
661 
662  status = GNUNET_OK;
663  if (NULL ==
665  {
666  GNUNET_break (0);
667  return 1;
668  }
669  shc_chld =
671 
672  ret = GNUNET_PROGRAM_run (argc,
673  argv,
674  "gnunet-cmds-helper",
675  "Helper for starting a local interpreter loop",
676  options,
677  &run,
678  ni);
679 
681  "Finishing helper\n");
683  shc_chld = NULL;
685  GNUNET_free (ni);
686  if (GNUNET_OK != ret)
687  return 1;
688  return (GNUNET_OK == status) ? 0 : 1;
689 }
690 
691 
692 /* end of gnunet-cmds-helper.c */
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static struct GNUNET_SIGNAL_Context * shc_chld
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
struct GNUNET_MessageHeader * GNUNET_TESTING_send_local_test_finished_msg()
static void write_message(struct GNUNET_MessageHeader *message, size_t msg_length)
Callback to write a message to the master loop.
struct GNUNET_MessageStreamTokenizer * tokenizer
Our message stream tokenizer.
static void finished_cb(enum GNUNET_GenericReturnValue rv)
static void read_task(void *cls)
Task to read from stdin.
int main(int argc, char **argv)
Main function.
struct TestcasePlugin * plugin
The process handle to the testbed service.
static struct GNUNET_DISK_FileHandle * stdout_fd
Disk handle for stdout.
static int status
Result to return in case we fail.
static int tokenizer_cb(void *cls, const struct GNUNET_MessageHeader *message)
Functions with this signature are called whenever a complete message is received by the tokenizer.
#define LOG_DEBUG(...)
Debug logging shorthand.
static void do_shutdown(void *cls)
Task to shut down cleanly.
static struct GNUNET_DISK_PipeHandle * sigpipe
Pipe used to communicate shutdown via signal.
static void sighandler_child_death()
Signal handler called for SIGCHLD.
struct GNUNET_SCHEDULER_Task * finished_task
#define NODE_BASE_IP
static struct GNUNET_SCHEDULER_Task * read_task_id
Task identifier for the read task.
#define ROUTER_BASE_IP
static void write_task(void *cls)
Task to write to the standard out.
#define KNOWN_BASE_IP
struct GNUNET_TESTING_Interpreter * is
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run.
#define LOG(kind,...)
Generic logging shortcut.
static struct GNUNET_SCHEDULER_Task * write_task_id
Task identifier for the write task.
static struct GNUNET_DISK_FileHandle * stdin_fd
Disk handle from stdin.
static int done_reading
Are we done reading messages from stdin?
static void delay_shutdown_cb()
static char * plugin_name
Name of our plugin.
static char buf[2048]
API to manage barriers.
Convenience API for writing testcases for GNUnet.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message,...
struct GNUNET_DISK_FileHandle * GNUNET_DISK_get_handle_from_native(FILE *fd)
Get a handle from a native FD.
Definition: disk.c:1343
ssize_t GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, const void *buffer, size_t n)
Write a buffer to a file.
Definition: disk.c:685
enum GNUNET_GenericReturnValue GNUNET_DISK_pipe_close(struct GNUNET_DISK_PipeHandle *p)
Closes an interprocess channel.
Definition: disk.c:1584
enum GNUNET_GenericReturnValue GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h)
Close an open file.
Definition: disk.c:1305
ssize_t GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, void *result, size_t len)
Read the contents of a binary file into a buffer.
Definition: disk.c:621
const struct GNUNET_DISK_FileHandle * GNUNET_DISK_pipe_handle(const struct GNUNET_DISK_PipeHandle *p, enum GNUNET_DISK_PipeEnd n)
Get the handle to a particular pipe end.
Definition: disk.c:1615
struct GNUNET_DISK_PipeHandle * GNUNET_DISK_pipe(enum GNUNET_DISK_PipeFlags pf)
Creates an interprocess channel.
Definition: disk.c:1441
@ GNUNET_DISK_PF_NONE
No special options, use non-blocking read/write operations.
@ GNUNET_DISK_PIPE_END_WRITE
The writing-end of a pipe.
#define GNUNET_log(kind,...)
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
@ GNUNET_SYSERR
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
int GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile)
Setup logging.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_log_strerror(level, cmd)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
char * GNUNET_OS_get_libexec_binary_path(const char *progname)
Given the name of a gnunet-helper, gnunet-service or gnunet-daemon binary, try to prefix it with the ...
void * GNUNET_PLUGIN_unload(const char *library_name, void *arg)
Unload plugin (runs the "done" callback and returns whatever "done" returned).
Definition: plugin.c:242
void * GNUNET_PLUGIN_load(const char *library_name, void *arg)
Setup plugin (runs the "init" callback and returns whatever "init" returned).
Definition: plugin.c:198
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
Definition: program.c:400
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_PEERS_STARTED
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_LOCAL_TESTS_PREPARED
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_CROSSABLE
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_REPLY
The reply message from gnunet-cmds-helper.
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT
The initialization message towards gnunet-cmds-helper.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:534
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_read_file(struct GNUNET_TIME_Relative delay, const struct GNUNET_DISK_FileHandle *rfd, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay or when the specified file descriptor is ready f...
Definition: scheduler.c:1625
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_write_file(struct GNUNET_TIME_Relative delay, const struct GNUNET_DISK_FileHandle *wfd, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay or when the specified file descriptor is ready f...
Definition: scheduler.c:1658
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
Definition: scheduler.c:1303
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:944
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:1241
enum GNUNET_GenericReturnValue GNUNET_MST_from_buffer(struct GNUNET_MessageStreamTokenizer *mst, const char *buf, size_t size, int purge, int one_shot)
Add incoming data to the receive buffer and call the callback for all complete messages.
Definition: mst.c:101
void GNUNET_MST_destroy(struct GNUNET_MessageStreamTokenizer *mst)
Destroys a tokenizer.
Definition: mst.c:404
struct GNUNET_MessageStreamTokenizer * GNUNET_MST_create(GNUNET_MessageTokenizerCallback cb, void *cb_cls)
Create a message stream tokenizer.
Definition: mst.c:86
struct GNUNET_SIGNAL_Context * GNUNET_SIGNAL_handler_install(int signal, GNUNET_SIGNAL_Handler handler)
Install a signal handler that will be run if the given signal is received.
Definition: signal.c:52
void GNUNET_SIGNAL_handler_uninstall(struct GNUNET_SIGNAL_Context *ctx)
Uninstall a previously installed signal handler.
Definition: signal.c:78
size_t GNUNET_strlcpy(char *dst, const char *src, size_t n)
Like strlcpy but portable.
Definition: strings.c:138
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
#define GNUNET_TIME_UNIT_SECONDS
One second.
enum GNUNET_GenericReturnValue read_file(char const *const filename, char **buffer)
Definition: pabc_helper.c:71
#define GNUNET_SIGCHLD
Definition: platform.h:42
Message send to a child loop to inform the child loop about a barrier being advanced.
Definition: testing.h:35
Handle used to access files (and pipes).
Handle used to manage a pipe.
Definition: disk.c:68
Definition of a command line option.
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.
Handle to a message stream tokenizer.
Definition: mst.c:45
Entry in list of pending tasks.
Definition: scheduler.c:136
Initialization message for gnunet-cmds-testbed to start cmd binary.
Definition: testing_cmds.h:39
Reply message from cmds helper process.
Definition: testing_cmds.h:58
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_REPLY.
Definition: testing_cmds.h:62
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED.
Definition: testing_cmds.h:86
enum GNUNET_GenericReturnValue rv
The exit status local test return with.
Definition: testing_cmds.h:91
Global state of the interpreter, used by a command to access information about other commands.
GNUNET_TESTING_PLUGIN_ALL_LOCAL_TESTS_PREPARED all_local_tests_prepared
GNUNET_TESTING_PLUGIN_ALL_PEERS_STARTED all_peers_started
GNUNET_TESTING_PLUGIN_StartTestCase start_testcase
Struct with information about a specific node and the whole network namespace setup.
unsigned int * read_file
Shall we read the topology from file, or from a string.
char * topology_data
String with topology data or name of topology file.
char * m
The number of the node in the namespace.
char * n
The number of the namespace this node is in.
char * local_m
The number of local nodes per namespace.
char * global_n
The number of namespaces.
Handle for a plugin.
Definition: testing.h:94
char * global_n
The number of namespaces.
Definition: testing.h:121
char * local_m
The number of local nodes per namespace.
Definition: testing.h:127
char * n
The number of the namespace this node is in.
Definition: testing.h:133
char * m
The number of the node in the namespace.
Definition: testing.h:139
char * library_name
Name of the shared library.
Definition: testing.h:98
struct GNUNET_TESTING_PluginFunctions * api
Plugin API.
Definition: testing.h:103
Context for a single write on a chunk of memory.
size_t pos
The current position from where the write operation should begin.
size_t length
The length of the data.
void * data
The data to write.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
void TST_interpreter_finish_attached_cmds(struct GNUNET_TESTING_Interpreter *is, const char *barrier_name)
Finish all "barrier reached" comands attached to this barrier.
Message formats for communication between testing cmds helper and testcase plugins.