- use small mesh hashes for info api
authorBart Polot <bart@net.in.tum.de>
Tue, 1 Apr 2014 00:16:19 +0000 (00:16 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 1 Apr 2014 00:16:19 +0000 (00:16 +0000)
src/mesh/gnunet-mesh.c
src/mesh/gnunet-service-mesh_local.c
src/mesh/mesh_api.c

index a502ab5fbf9a3ca4900eac44c5aca1712045e482..7677b244f85e853b57e030e608a30a52625a51ce 100644 (file)
@@ -26,6 +26,7 @@
 #include "platform.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_mesh_service.h"
+#include "mesh.h"
 
 
 /**
@@ -510,7 +511,7 @@ tunnel_callback (void *cls,
                  unsigned int n_channels,
                  unsigned int n_connections,
                  uint32_t *channels,
-                 struct GNUNET_HashCode *connections,
+                 struct GNUNET_MeshHash *connections,
                  unsigned int estate,
                  unsigned int cstate)
 {
@@ -524,7 +525,7 @@ tunnel_callback (void *cls,
       FPRINTF (stdout, "   %u\n", channels[i]);
     FPRINTF (stdout, "- %u connections\n", n_connections);
     for (i = 0; i < n_connections; i++)
-      FPRINTF (stdout, "   %s\n", GNUNET_h2s_full (&connections[i]));
+      FPRINTF (stdout, "   %s\n", GM_h2s (&connections[i]));
     FPRINTF (stdout, "- enc state: %u\n", estate);
     FPRINTF (stdout, "- con state: %u\n", cstate);
   }
@@ -740,9 +741,9 @@ main (int argc, char *const *argv)
 //     {'a', "channel", "TUNNEL_ID:CHANNEL_ID",
 //      gettext_noop ("provide information about a particular channel"),
 //      GNUNET_YES, &GNUNET_GETOPT_set_string, &channel_id},
-//     {'b', "connection", "TUNNEL_ID:CONNECTION_ID",
-//      gettext_noop ("provide information about a particular connection"),
-//      GNUNET_YES, &GNUNET_GETOPT_set_string, &conn_id},
+    {'C', "connection", "CONNECTION_ID",
+     gettext_noop ("provide information about a particular connection"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &conn_id},
     {'e', "echo", NULL,
      gettext_noop ("activate echo mode"),
      GNUNET_NO, &GNUNET_GETOPT_set_one, &echo},
index 84adb7d0e6692405c84b430704be6d9b30733b17..8970571a4e48d8a2f4ab84f1911564fd97a55cbd 100644 (file)
@@ -805,7 +805,7 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
   c_n = GMT_count_connections (t);
 
   size = sizeof (struct GNUNET_MESH_LocalInfoTunnel);
-  size += c_n * sizeof (struct GNUNET_HashCode);
+  size += c_n * sizeof (struct GNUNET_MeshHash);
   size += ch_n * sizeof (MESH_ChannelNumber);
 
   resp = GNUNET_malloc (size);
index ec5ddcf71d17fd5a8c899383acff924abd09d0ea..ff755c1ac3ae6c782e0394d870dfcbcc81cd4622 100644 (file)
@@ -1108,7 +1108,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h,
   size_t msize;
   unsigned int ch_n;
   unsigned int c_n;
-  struct GNUNET_HashCode *conns;
+  struct GNUNET_MeshHash *conns;
   MESH_ChannelNumber *chns;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Get Tunnel messasge received\n");
@@ -1131,7 +1131,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h,
   ch_n = ntohl (msg->channels);
   c_n = ntohl (msg->connections);
   esize += ch_n * sizeof (MESH_ChannelNumber);
-  esize += c_n * sizeof (struct GNUNET_HashCode);
+  esize += c_n * sizeof (struct GNUNET_MeshHash);
   if (msize != esize)
   {
     GNUNET_break_op (0);
@@ -1145,7 +1145,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h,
   }
 
   /* Call Callback with tunnel info. */
-  conns = (struct GNUNET_HashCode *) &msg[1];
+  conns = (struct GNUNET_MeshHash *) &msg[1];
   chns = (MESH_ChannelNumber *) &conns[c_n];
   h->info_cb.tunnel_cb (h->info_cls, &msg->destination,
                 ch_n, c_n, chns, conns,