37#define LOG(kind, ...) \
38 GNUNET_log_from (kind, "testing-core-send", __VA_ARGS__)
91 uint64_t channel_index = 0;
94 "Going to send %" PRIu64
" messages\n",
101 NULL != channel_iter;
102 channel_iter = channel_iter->
next)
107 "Going to send message (type %u) %" PRIu64
", %s (channel %" PRIu64
") to %s\n",
121 "Sent message %" PRIu64
" (channel %" PRIu64
")\n",
180 connect_cb_struct->
cls = send_state;
200 uint64_t num_messages,
struct GNUNET_MQ_Handle * mq
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
static char * peer_id
Option –peer.
static struct GNUNET_TESTING_Interpreter * is
Core service; the main API for encrypted P2P communications.
#define MTYPE
API for cmds working with core sub system provided by libgnunetcoretesting.
enum GNUNET_GenericReturnValue GNUNET_CORE_TESTING_get_trait_connect(const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TESTING_CORE_ConnectState **ret)
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
#define GNUNET_TESTING_command_new(cls, label, run, cleanup, traits)
Create a new command.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#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_array_append(arr, len, element)
Append an element to an array (growing the array by one).
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Handle to a message queue.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_MQ_Handle * mq
struct GNUNET_TESTING_CORE_ConnectState * connect_state
struct GNUNET_PeerIdentity peer_id
struct GNUNET_TESTING_CORE_Channel * next
GNUNET_TESTING_CORE_connect_cb callback
struct GNUNET_TESTING_CORE_ConnectCb * connect_cbs
Connect callback TODO we probably only need a single one.
struct GNUNET_TESTING_CORE_Channel * channels_head
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.
State for the 'send' command.
const struct GNUNET_TESTING_CORE_ConnectState * connect_state
enum GNUNET_GenericReturnValue await_new_connection
static void cleanup_callbacks(struct SendState *send_state)
static void exec_send_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
const struct GNUNET_TESTING_Command GNUNET_TESTING_CORE_cmd_send(const char *label, uint64_t num_messages, enum GNUNET_GenericReturnValue await_new_connection)
static void exec_send_cleanup(void *cls)
static void * connect_cb(void *cls, const struct GNUNET_PeerIdentity *peer_id, struct GNUNET_MQ_Handle *mq)
#define LOG(kind,...)
Generic logging shortcut.
static void send_messages(struct SendState *send_state)