gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit 19b2aa3faf0205fd880b0ce0d3a0988b9ae7ee59
parent 5516effa03143377dab7a839abc8580d249cca85
Author: Bart Polot <bart@net.in.tum.de>
Date:   Thu, 13 Mar 2014 15:01:42 +0000

-add info about traffic

Diffstat:
Msrc/mesh/mesh_profiler.c | 20++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/mesh/mesh_profiler.c b/src/mesh/mesh_profiler.c @@ -184,6 +184,21 @@ delay_ms_rnd (unsigned int max) return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, rnd); } + +/** + * Get the index of a peer in the peers array. + * + * @param peer Peer whose index to get. + * + * @return Index of peer in peers. + */ +static unsigned int +get_index (struct MeshPeer *peer) +{ + return peer - peers; +} + + /** * Show the results of the test (banwidth acheived) and log them to GAUGER */ @@ -566,7 +581,8 @@ static void ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct MeshPeer *peer = (struct MeshPeer *) cls; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending data initializer...\n"); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u -> %u\n", + get_index (peer), peer->dest); GNUNET_MESH_notify_transmit_ready (peer->ch, GNUNET_NO, GNUNET_TIME_UNIT_FOREVER_REL, @@ -608,7 +624,7 @@ do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) peers[i].ch = GNUNET_MESH_channel_create (peers[i].mesh, NULL, &peers[peers[i].dest].id, 1, flags); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u -> %u\n", i, peers[i].dest); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u => %u\n", i, peers[i].dest); peers[i].ping_task = GNUNET_SCHEDULER_add_delayed (delay_ms_rnd(2000), &ping, &peers[i]); }