30 #define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply ( \ 31 GNUNET_TIME_UNIT_SECONDS, 30) 109 "Sending message from peer %u (`%s') -> peer %u (`%s') !\n",
117 msize -
sizeof(*test),
119 test->
num = htonl (num);
122 msize -
sizeof(*test));
Handle for a request to connect two peers.
int global_ret
Result from the main function, set to GNUNET_OK on success.
size_t(* get_size_cb)(unsigned int n)
Function that returns the desired message size.
struct GNUNET_MQ_Handle * mq
Message queue for sending from p1 to p2.
struct GNUNET_PeerIdentity id
Peer identity.
void * cont_cls
Closure for cont.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
Closure that must be passed to GNUNET_TRANSPORT_TESTING_connect_check.
Context for a single peer.
static int ret
Return value of the commandline.
unsigned int no
An unique number to identify the peer.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
void GNUNET_TRANSPORT_TESTING_find_connecting_context(struct GNUNET_TRANSPORT_TESTING_PeerContext *p1, struct GNUNET_TRANSPORT_TESTING_PeerContext *p2, GNUNET_TRANSPORT_TESTING_ConnectContextCallback cb, void *cb_cls)
Find any connecting context matching the given pair of peers.
uint32_t num
Monotonically increasing counter throughout the test.
static void find_cr(void *cls, struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cx)
Return cx in cls.
void GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
Call a callback once the envelope has been sent, that is, sending it can not be canceled anymore...
struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext * ccc
Context for the transmission.
unsigned int num_messages
Number of messages to be transmitted in a loop.
int GNUNET_TRANSPORT_TESTING_send(struct GNUNET_TRANSPORT_TESTING_PeerContext *sender, struct GNUNET_TRANSPORT_TESTING_PeerContext *receiver, uint16_t mtype, uint16_t msize, uint32_t num, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Send a test message of type mtype and size msize from peer sender to peer receiver.
static unsigned int size
Size of the "table".
int connected
GNUNET_YES if both p1_c and p2_c are GNUNET_YES.
struct GNUNET_MQ_Envelope * env
static struct GNUNET_FS_SearchContext * sc
GNUNET_SCHEDULER_TaskCallback cont
Function to call after all transmissions, can be NULL.
void receiver(void *cls, const void *buf, size_t available, const struct sockaddr *addr, socklen_t addrlen, int errCode)
Callback to read from the SOCKS5 proxy.
static void do_send(struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext *ccc, uint16_t size, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Task that sends a test message from the first peer to the second peer.
struct GNUNET_TRANSPORT_TESTING_PeerContext ** p
Array with num_peers entries.
#define GNUNET_log(kind,...)
Type of the closure argument to pass to GNUNET_TRANSPORT_TESTING_simple_send() and GNUNET_TRANSPORT_T...
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
uint32_t send_num_gen
Generator for the num field in test messages.
void GNUNET_TRANSPORT_TESTING_large_send(void *cls)
Task that sends a large test message from the first peer to the second peer.
#define GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE
Message type used by GNUNET_TRANSPORT_TESTING_simple_send().
testing lib for transport service
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
void GNUNET_TRANSPORT_TESTING_simple_send(void *cls)
Task that sends a minimalistic test message from the first peer to the second peer.
#define GNUNET_free(ptr)
Wrapper around free.