GNUnet  0.20.0
gnunet_testing_barrier.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2022 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 
27 #ifndef GNUNET_TESTING_BARRIER_LIB_H
28 #define GNUNET_TESTING_BARRIER_LIB_H
29 
30 #include "gnunet_testing_plugin.h"
31 
32 #define GNUNET_TESTING_BARRIER_MAX 32
33 
38 {
39  /* DLL */
41 
42  /* DLL */
44 
45  /* The barrier name*/
46  char *barrier_name;
47 
51  unsigned int expected_reaches;
52  };
53 
58 {
61 
64 };
65 
66 
86  const char *label,
87  double percentage_to_be_reached,
88  unsigned int number_to_be_reached);
89 
107  const char *label,
108  const char *barrier_label,
109  unsigned int asynchronous_finish,
110  unsigned int node_number,
111  unsigned int running_on_master,
113 
114 #endif
115 /* end of testing_barrier.h */
static int write_message(uint16_t message_type, const char *data, size_t data_length)
Write message to the master process.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_create(const char *label, double percentage_to_be_reached, unsigned int number_to_be_reached)
Command to create a barrier.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_reached(const char *label, const char *barrier_label, unsigned int asynchronous_finish, unsigned int node_number, unsigned int running_on_master, GNUNET_TESTING_cmd_helper_write_cb write_message)
If this command is executed the the process is signaling the master process that it reached a barrier...
void(* GNUNET_TESTING_cmd_helper_write_cb)(struct GNUNET_MessageHeader *message, size_t msg_length)
Callback function to write messages from the helper process running on a netjail node to the master p...
An entry for a barrier list.
struct GNUNET_TESTING_BarrierListEntry * prev
unsigned int expected_reaches
Number of commands attached to the barrier.
struct GNUNET_TESTING_BarrierListEntry * next
A list to hold barriers provided by plugins.
struct GNUNET_TESTING_BarrierListEntry * tail
List tail.
struct GNUNET_TESTING_BarrierListEntry * head
List head.
A command to be run by the interpreter.
char label[127+1]
Label for the command.
bool asynchronous_finish
If "true", the interpreter should not immediately call finish, even if finish is non-NULL.