gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31891 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r31891 - gnunet/src/mesh
Date: Tue, 14 Jan 2014 00:51:23 +0100

Author: bartpolot
Date: 2014-01-14 00:51:23 +0100 (Tue, 14 Jan 2014)
New Revision: 31891

Modified:
   gnunet/src/mesh/gnunet-service-mesh_local.c
Log:
- complete tunnel info gathering


Modified: gnunet/src/mesh/gnunet-service-mesh_local.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_local.c 2014-01-13 21:10:15 UTC (rev 
31890)
+++ gnunet/src/mesh/gnunet-service-mesh_local.c 2014-01-13 23:51:23 UTC (rev 
31891)
@@ -654,11 +654,22 @@
 static void
 iter_connection (void *cls, struct MeshConnection *c)
 {
+  struct GNUNET_MESH_LocalInfoTunnel *msg = cls;
+  struct GNUNET_HashCode *h = (struct GNUNET_HashCode *) &msg[1];
+
+  h[msg->connections] = *(GMC_get_id (c));
+  msg->connections++;
 }
 
 static void
 iter_channel (void *cls, struct MeshChannel *ch)
 {
+  struct GNUNET_MESH_LocalInfoTunnel *msg = cls;
+  struct GNUNET_HashCode *h = (struct GNUNET_HashCode *) &msg[1];
+  MESH_ChannelNumber *chn = (MESH_ChannelNumber *) &h[msg->connections];
+
+  chn[msg->channels] = GMCH_get_id (ch);
+  msg->channels++;
 }
 
 
@@ -728,6 +739,9 @@
   resp->header.size = htons (size);
   GMT_iterate_connections (t, &iter_connection, resp);
   GMT_iterate_channels (t, &iter_channel, resp);
+  /* Do not interleave with iterators, iter_channel needs conn in HBO */
+  resp->connections = htonl (resp->connections);
+  resp->channels = htonl (resp->channels);
   resp->cstate = htons (GMT_get_cstate (t));
   resp->estate = htons (GMT_get_estate (t));
   GNUNET_SERVER_notification_context_unicast (nc, c->handle,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]