GNUnet 0.21.1
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
31
32
34
35
36#define GNUNET_TESTING_BARRIER_MAX 32
37
43{
44 /* DLL */
46
47 /* DLL */
49
50 /* The barrier name*/
52
56 unsigned int expected_reaches;
57 };
58
64{
67
70};
71
72
92 const char *label,
93 double percentage_to_be_reached,
94 unsigned int number_to_be_reached);
95
96
114 const char *label,
115 const char *barrier_label,
116 unsigned int asynchronous_finish, /* FIXME: why not a bool? */
117 unsigned int node_number,
118 unsigned int running_on_master, /* FIXME: why not a bool? */
119 GNUNET_TESTING_cmd_helper_write_cb write_message); /* FIXME: no 'cls' closure argument!? */
120
121#endif
122/* 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 FIXME: why is this in the public API!??!
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 FIXME: why is this in the public API!?...
struct GNUNET_TESTING_BarrierListEntry * tail
List tail.
struct GNUNET_TESTING_BarrierListEntry * head
List head.
A command to be run by the interpreter.
struct GNUNET_TESTING_CommandLabel label
Label for the command.
bool asynchronous_finish
If "true", the interpreter should not immediately call finish, even if finish is non-NULL.