diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-01-13 23:51:23 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-01-13 23:51:23 +0000 |
commit | e37fb97ec361c33e29d89945e68444dcfb9d692b (patch) | |
tree | cb89eec626495710cfbd414d7de6295f6503fd40 /src/mesh/gnunet-service-mesh_local.c | |
parent | 13c1d3cddb12daf5667a673b2d169087952c8616 (diff) | |
download | gnunet-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.c | 14 |
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, | |||
654 | static void | 654 | static void |
655 | iter_connection (void *cls, struct MeshConnection *c) | 655 | iter_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 | ||
659 | static void | 664 | static void |
660 | iter_channel (void *cls, struct MeshChannel *ch) | 665 | iter_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, |