34#define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__)
121 for (
unsigned int i = 0; i<barrier->
cnt_waiting; i++)
175 const char *barrier_label)
static int ret
Final status code.
static struct GNUNET_TESTING_Interpreter * is
struct GNUNET_TESTING_Command GNUNET_TESTING_command_new_ac(void *cls, const char *label, GNUNET_TESTING_CommandRunRoutine run, GNUNET_TESTING_CommandCleanupRoutine cleanup, GNUNET_TESTING_CommandGetTraits traits, struct GNUNET_TESTING_AsyncContext *ac)
Create a new command that may be asynchronous.
void GNUNET_TESTING_async_finish(struct GNUNET_TESTING_AsyncContext *ac)
The asynchronous command of ac has finished.
void GNUNET_TESTING_async_fail(struct GNUNET_TESTING_AsyncContext *ac)
The asynchronous command of ac has failed.
struct GNUNET_TESTING_Trait GNUNET_TESTING_trait_end(void)
"end" of traits array.
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait(const struct GNUNET_TESTING_Trait *traits, const void **ret, const char *trait, unsigned int index)
Obtain value of a trait from a command.
#define GNUNET_log(kind,...)
GNUNET_GenericReturnValue
Named constants for return values.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
@ GNUNET_ERROR_TYPE_ERROR
#define GNUNET_array_grow(arr, size, tsize)
Grow a well-typed (!) array.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_array_append(arr, len, element)
Append an element to an array (growing the array by one).
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_REACHED
#define GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_CROSSABLE
Struct with information for callbacks.
const char * barrier_name
The name of the barrier this commands wait (if finishing asynchronous) for or/and reaches.
const char * label
The label of this command.
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
State each asynchronous command must have in its closure.
An entry for a barrier list.
bool inherited
Did we inherit the barrier from our parent loop?
unsigned int reached
Number of times the barrier has been reached.
unsigned int expected_reaches
Number of total commands expected to be reached by the barrier.
struct GNUNET_TESTING_AsyncContext ** waiting
Context of barrier reached commands of our local interpreter that are currently blocked on this barri...
unsigned int cnt_waiting
Length of the waiting array.
bool satisfied
Did we reach expected_reaches? Used in particular if inherited is true and we cannot compute locally.
Child to parent: I reached the given barrier, increment the counter (or pass to grandparent).
struct GNUNET_ShortHashCode barrier_key
struct GNUNET_MessageHeader header
Parent to child: this barrier was satisfied.
struct GNUNET_MessageHeader header
struct GNUNET_ShortHashCode barrier_key
A command to be run by the interpreter.
struct GNUNET_TESTING_CommandLabel label
Label for the command.
Global state of the interpreter, used by a command to access information about other commands.
A struct GNUNET_TESTING_Trait can be used to exchange data between cmds.
unsigned int index
Index number associated with the trait.
void GNUNET_TESTING_barrier_name_hash_(const char *barrier_name, struct GNUNET_ShortHashCode *bkey)
static void barrier_reached_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
Run the command.
static enum GNUNET_GenericReturnValue barrier_reached_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Offer internal data from a "batch" CMD, to other commands.
static void barrier_reached_cleanup(void *cls)
Cleanup the state from a "barrier reached" CMD, and possibly cancel a pending operation thereof.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_reached(const char *label, const char *barrier_label)
If this command is executed the the process is signaling the master process that it reached a barrier...
static enum GNUNET_GenericReturnValue traits(void *cls, const void **ret, const char *trait, unsigned int index)
This function prepares an array with traits.
struct GNUNET_TESTING_Barrier * GNUNET_TESTING_get_barrier_(struct GNUNET_TESTING_Interpreter *is, const char *barrier_name)
void GNUNET_TESTING_loop_notify_parent_(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_MessageHeader *hdr)
Send message to our parent.
void GNUNET_TESTING_loop_notify_children_(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_MessageHeader *hdr)
Send message to all netjail children (if there are any).
Message formats for communication between testing cmds helper and testcase plugins.