aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_local.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-01-13 23:51:23 +0000
committerBart Polot <bart@net.in.tum.de>2014-01-13 23:51:23 +0000
commite37fb97ec361c33e29d89945e68444dcfb9d692b (patch)
treecb89eec626495710cfbd414d7de6295f6503fd40 /src/mesh/gnunet-service-mesh_local.c
parent13c1d3cddb12daf5667a673b2d169087952c8616 (diff)
downloadgnunet-e37fb97ec361c33e29d89945e68444dcfb9d692b.tar.gz
gnunet-e37fb97ec361c33e29d89945e68444dcfb9d692b.zip
- complete tunnel info gathering
Diffstat (limited to 'src/mesh/gnunet-service-mesh_local.c')
-rw-r--r--src/mesh/gnunet-service-mesh_local.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c
index 11812de79..98cd151a6 100644
--- a/src/mesh/gnunet-service-mesh_local.c
+++ b/src/mesh/gnunet-service-mesh_local.c
@@ -654,11 +654,22 @@ handle_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client,
654static void 654static void
655iter_connection (void *cls, struct MeshConnection *c) 655iter_connection (void *cls, struct MeshConnection *c)
656{ 656{
657 struct GNUNET_MESH_LocalInfoTunnel *msg = cls;
658 struct GNUNET_HashCode *h = (struct GNUNET_HashCode *) &msg[1];
659
660 h[msg->connections] = *(GMC_get_id (c));
661 msg->connections++;
657} 662}
658 663
659static void 664static void
660iter_channel (void *cls, struct MeshChannel *ch) 665iter_channel (void *cls, struct MeshChannel *ch)
661{ 666{
667 struct GNUNET_MESH_LocalInfoTunnel *msg = cls;
668 struct GNUNET_HashCode *h = (struct GNUNET_HashCode *) &msg[1];
669 MESH_ChannelNumber *chn = (MESH_ChannelNumber *) &h[msg->connections];
670
671 chn[msg->channels] = GMCH_get_id (ch);
672 msg->channels++;
662} 673}
663 674
664 675
@@ -728,6 +739,9 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
728 resp->header.size = htons (size); 739 resp->header.size = htons (size);
729 GMT_iterate_connections (t, &iter_connection, resp); 740 GMT_iterate_connections (t, &iter_connection, resp);
730 GMT_iterate_channels (t, &iter_channel, resp); 741 GMT_iterate_channels (t, &iter_channel, resp);
742 /* Do not interleave with iterators, iter_channel needs conn in HBO */
743 resp->connections = htonl (resp->connections);
744 resp->channels = htonl (resp->channels);
731 resp->cstate = htons (GMT_get_cstate (t)); 745 resp->cstate = htons (GMT_get_cstate (t));
732 resp->estate = htons (GMT_get_estate (t)); 746 resp->estate = htons (GMT_get_estate (t));
733 GNUNET_SERVER_notification_context_unicast (nc, c->handle, 747 GNUNET_SERVER_notification_context_unicast (nc, c->handle,