37#define LOG(kind, ...) \
38 GNUNET_log_from (kind, "testing-core-recv", __VA_ARGS__)
125 uint64_t num_messages_target;
135 channel_count = NULL;
141 if (NULL == channel_count_iter->
channel)
143 channel_count = channel_count_iter;
145 channel_count->
rs =
rs;
151 channel_count = channel_count_iter;
157 if (NULL == channel_count)
165 channel_count->
rs =
rs;
177 "Received %" PRIu64
" messages (of %" PRIu64
" on channel %" PRIu32
")\n",
253 uint64_t num_messages)
struct GNUNET_MessageHeader * msg
static int ret
Final status code.
static struct GNUNET_TESTING_Interpreter * is
Core service; the main API for encrypted P2P communications.
enum GNUNET_GenericReturnValue GNUNET_CORE_TESTING_get_trait_connect(const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TESTING_CORE_ConnectState **ret)
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.
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_DEBUG
#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_new_array(n, type)
Allocate a size n array with structs or unions 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.
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.
#define GNUNET_TIME_UNIT_MILLISECONDS
One millisecond.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
uint64_t num_messages_received
struct GNUNET_TESTING_CORE_Channel * channel
State each asynchronous command must have in its closure.
GNUNET_TESTING_CORE_handle_msg * recv_handlers
Receive callback.
uint32_t recv_handlers_len
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.
uint64_t num_messages_target
struct GNUNET_TESTING_CORE_ConnectState * connect_state
struct ChannelCount * channel_count
struct GNUNET_TESTING_AsyncContext ac
static void exec_recv_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
static void exec_recv_cleanup(void *cls)
const struct GNUNET_TESTING_Command GNUNET_TESTING_CORE_cmd_recv(const char *label, uint64_t num_messages)
#define LOG(kind,...)
Generic logging shortcut.
static void handle_msg_test(void *cls, struct GNUNET_TESTING_CORE_Channel *channel, const struct GNUNET_TESTING_CORE_Message *msg)
static void remove_recv_handler(struct GNUNET_TESTING_CORE_ConnectState *connect_state)
static void do_finish_cmd_delayed(void *cls)