-static int
-core_handle_ping (void *cls, const struct GNUNET_PeerIdentity *other,
- const struct GNUNET_MessageHeader *message)
-{
- struct BenchmarkPeer *me = cls;
- struct BenchmarkPeer *remote;
- struct PendingMessages *pm;
-
- remote = find_peer (other);
-
- if (NULL == remote)
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
-
- if (NULL != me->cth)
- {
- pm = GNUNET_malloc (sizeof (struct PendingMessages));
- pm->target = (*other);
- GNUNET_CONTAINER_DLL_insert_tail (me->p_head, me->p_tail, pm);
- return GNUNET_OK;
- }
-
- if (GNUNET_NO == remote->master)
- {
- GNUNET_break (0);
- return GNUNET_OK;
- }
-
- me->messages_received ++;
- /* send echo */
- me->cth = GNUNET_CORE_notify_transmit_ready (me->ch,
- GNUNET_NO, 0, GNUNET_TIME_UNIT_MINUTES,
- &remote->id,
- TEST_MESSAGE_SIZE, &core_send_echo_ready, me);
- return GNUNET_OK;
-}
-
-static int
-core_handle_pong (void *cls, const struct GNUNET_PeerIdentity *other,
- const struct GNUNET_MessageHeader *message)
-{
- struct BenchmarkPeer *me = cls;
- struct BenchmarkPeer *remote;
- struct BenchmarkPeer *next;
-
- remote = find_peer (other);
-
- if (NULL == remote)
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
-
- if (NULL != me->cth)
- {
- GNUNET_break (0);
- return GNUNET_OK;
- }
-
- if (GNUNET_YES == remote->master)
- {
- GNUNET_break (0);
- return GNUNET_OK;
- }
- me->messages_received ++;
- next = get_next (me);
- if (0 == memcmp(&remote->id, &me->destination->id, sizeof (struct GNUNET_PeerIdentity)))
- me->partner_msg = GNUNET_YES;
- me->cth = GNUNET_CORE_notify_transmit_ready (me->ch,
- GNUNET_NO, 0, GNUNET_TIME_UNIT_MINUTES,
- &next->id,
- TEST_MESSAGE_SIZE, &core_send_ready, me);
-
- return GNUNET_OK;