diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-10-17 16:43:24 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-10-17 16:43:24 +0000 |
commit | 27f9286f3ad311c5aa0463fdbb87dd56fe09b03f (patch) | |
tree | f676aca9911355eb24a0b8bbb3f392aff5ea6556 /src/mesh/gnunet-service-mesh.c | |
parent | faae173a9a2190c3af44c5fe1f79937bfa9dd82d (diff) | |
download | gnunet-27f9286f3ad311c5aa0463fdbb87dd56fe09b03f.tar.gz gnunet-27f9286f3ad311c5aa0463fdbb87dd56fe09b03f.zip |
Added debug info for multicast
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 97f0f985b..d54a7022f 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -1635,6 +1635,8 @@ tunnel_send_multicast (struct MeshTunnel *t, | |||
1635 | size_t size; | 1635 | size_t size; |
1636 | void *data; | 1636 | void *data; |
1637 | 1637 | ||
1638 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1639 | "MESH: sending a multicast packet...\n"); | ||
1638 | size = ntohs (msg->size); | 1640 | size = ntohs (msg->size); |
1639 | GNUNET_assert (NULL != t->tree->me); | 1641 | GNUNET_assert (NULL != t->tree->me); |
1640 | n = t->tree->me->children_head; | 1642 | n = t->tree->me->children_head; |
@@ -1643,6 +1645,7 @@ tunnel_send_multicast (struct MeshTunnel *t, | |||
1643 | copies = GNUNET_malloc (sizeof (unsigned int)); | 1645 | copies = GNUNET_malloc (sizeof (unsigned int)); |
1644 | for (*copies = 0; NULL != n; n = n->next) | 1646 | for (*copies = 0; NULL != n; n = n->next) |
1645 | (*copies)++; | 1647 | (*copies)++; |
1648 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: (%u copies)\n", copies); | ||
1646 | n = t->tree->me->children_head; | 1649 | n = t->tree->me->children_head; |
1647 | data = GNUNET_malloc (size); | 1650 | data = GNUNET_malloc (size); |
1648 | memcpy (data, &msg, size); | 1651 | memcpy (data, &msg, size); |
@@ -1663,6 +1666,9 @@ tunnel_send_multicast (struct MeshTunnel *t, | |||
1663 | } | 1666 | } |
1664 | info->destination = n->peer; | 1667 | info->destination = n->peer; |
1665 | neighbor = path_get_first_hop(t->tree, n->peer); | 1668 | neighbor = path_get_first_hop(t->tree, n->peer); |
1669 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1670 | "MESH: sending to %s...\n", | ||
1671 | GNUNET_i2s (neighbor)); | ||
1666 | info->peer = peer_info_get(neighbor); | 1672 | info->peer = peer_info_get(neighbor); |
1667 | GNUNET_assert (NULL != info->peer); | 1673 | GNUNET_assert (NULL != info->peer); |
1668 | for (i = 0; NULL != info->peer->core_transmit[i]; i++) | 1674 | for (i = 0; NULL != info->peer->core_transmit[i]; i++) |
@@ -2360,6 +2366,9 @@ handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2360 | struct MeshTunnel *t; | 2366 | struct MeshTunnel *t; |
2361 | size_t size; | 2367 | size_t size; |
2362 | 2368 | ||
2369 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2370 | "MESH: got a multicast packet from %s\n", | ||
2371 | GNUNET_i2s (peer)); | ||
2363 | size = ntohs (message->size) - sizeof (struct GNUNET_MESH_Multicast); | 2372 | size = ntohs (message->size) - sizeof (struct GNUNET_MESH_Multicast); |
2364 | if (size < sizeof (struct GNUNET_MessageHeader)) | 2373 | if (size < sizeof (struct GNUNET_MessageHeader)) |
2365 | { | 2374 | { |
@@ -3540,6 +3549,9 @@ handle_local_multicast (void *cls, struct GNUNET_SERVER_Client *client, | |||
3540 | struct GNUNET_MESH_Multicast *data_msg; | 3549 | struct GNUNET_MESH_Multicast *data_msg; |
3541 | MESH_TunnelNumber tid; | 3550 | MESH_TunnelNumber tid; |
3542 | 3551 | ||
3552 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
3553 | "MESH: Got a multicast request from a client!\n"); | ||
3554 | |||
3543 | /* Sanity check for client registration */ | 3555 | /* Sanity check for client registration */ |
3544 | if (NULL == (c = client_get (client))) | 3556 | if (NULL == (c = client_get (client))) |
3545 | { | 3557 | { |
@@ -3582,10 +3594,12 @@ handle_local_multicast (void *cls, struct GNUNET_SERVER_Client *client, | |||
3582 | memcpy(buf, message, ntohs(message->size)); | 3594 | memcpy(buf, message, ntohs(message->size)); |
3583 | copy->oid = my_full_id; | 3595 | copy->oid = my_full_id; |
3584 | copy->tid = htonl(t->id.tid); | 3596 | copy->tid = htonl(t->id.tid); |
3597 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
3598 | "MESH: calling generic handler...\n"); | ||
3585 | handle_mesh_data_multicast(client, &my_full_id, ©->header, NULL); | 3599 | handle_mesh_data_multicast(client, &my_full_id, ©->header, NULL); |
3586 | } | 3600 | } |
3587 | 3601 | ||
3588 | /* receive done gets called when last copy is sent */ | 3602 | /* receive done gets called when last copy is sent to a neighbor */ |
3589 | return; | 3603 | return; |
3590 | } | 3604 | } |
3591 | 3605 | ||