31#define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply ( \
32 GNUNET_TIME_UNIT_SECONDS, 30)
110 "Sending message from peer %u (`%s') -> peer %u (`%s') !\n",
118 msize -
sizeof(*test),
123 msize -
sizeof(*test));
184 if (0 <
sc->num_messages)
187 done = (0 ==
sc->num_messages);
194 if (NULL !=
sc->get_size_cb)
195 msize =
sc->get_size_cb (
sc->num_messages);
201 done ?
sc->cont_cls :
sc);
220 if (0 <
sc->num_messages)
223 done = (0 ==
sc->num_messages);
230 if (NULL !=
sc->get_size_cb)
231 msize =
sc->get_size_cb (
sc->num_messages);
237 done ?
sc->cont_cls :
sc);
struct GNUNET_MQ_Envelope * env
static int ret
Final status code.
static struct GNUNET_FS_SearchContext * sc
#define GNUNET_log(kind,...)
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.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#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_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
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.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
static unsigned int size
Size of the "table".
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.
Closure that must be passed to GNUNET_TRANSPORT_TESTING_connect_check.
int global_ret
Result from the main function, set to GNUNET_OK on success.
struct GNUNET_TRANSPORT_TESTING_PeerContext ** p
Array with num_peers entries.
uint32_t send_num_gen
Generator for the num field in test messages.
Handle for a request to connect two peers.
int connected
GNUNET_YES if both p1_c and p2_c are GNUNET_YES.
struct GNUNET_MQ_Handle * mq
Message queue for sending from p1 to p2.
Context for a single peer.
unsigned int no
An unique number to identify the peer.
struct GNUNET_PeerIdentity id
Peer identity.
Type of the closure argument to pass to GNUNET_TRANSPORT_TESTING_simple_send() and GNUNET_TRANSPORT_T...
uint32_t num
Monotonically increasing counter throughout the test.
void GNUNET_TRANSPORT_TESTING_large_send(void *cls)
Task that sends a large test message from the first peer to the second peer.
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.
static void find_cr(void *cls, struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cx)
Return cx in cls.
void GNUNET_TRANSPORT_TESTING_simple_send(void *cls)
Task that sends a minimalistic test message from the first peer to the second peer.
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.
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.
#define GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE
Message type used by GNUNET_TRANSPORT_TESTING_simple_send().