aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-04-01 00:16:19 +0000
committerBart Polot <bart@net.in.tum.de>2014-04-01 00:16:19 +0000
commit1fdcd4fa20f76fa8266e77567d12ce4b627c3d71 (patch)
tree75ff8c73c20b78aa3b020be7f85cbaa35761db66 /src
parentaad8fa6aece707ebc88ca3d5b5345fa106813815 (diff)
downloadgnunet-1fdcd4fa20f76fa8266e77567d12ce4b627c3d71.tar.gz
gnunet-1fdcd4fa20f76fa8266e77567d12ce4b627c3d71.zip
- use small mesh hashes for info api
Diffstat (limited to 'src')
-rw-r--r--src/mesh/gnunet-mesh.c11
-rw-r--r--src/mesh/gnunet-service-mesh_local.c2
-rw-r--r--src/mesh/mesh_api.c6
3 files changed, 10 insertions, 9 deletions
diff --git a/src/mesh/gnunet-mesh.c b/src/mesh/gnunet-mesh.c
index a502ab5fb..7677b244f 100644
--- a/src/mesh/gnunet-mesh.c
+++ b/src/mesh/gnunet-mesh.c
@@ -26,6 +26,7 @@
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_mesh_service.h" 28#include "gnunet_mesh_service.h"
29#include "mesh.h"
29 30
30 31
31/** 32/**
@@ -510,7 +511,7 @@ tunnel_callback (void *cls,
510 unsigned int n_channels, 511 unsigned int n_channels,
511 unsigned int n_connections, 512 unsigned int n_connections,
512 uint32_t *channels, 513 uint32_t *channels,
513 struct GNUNET_HashCode *connections, 514 struct GNUNET_MeshHash *connections,
514 unsigned int estate, 515 unsigned int estate,
515 unsigned int cstate) 516 unsigned int cstate)
516{ 517{
@@ -524,7 +525,7 @@ tunnel_callback (void *cls,
524 FPRINTF (stdout, " %u\n", channels[i]); 525 FPRINTF (stdout, " %u\n", channels[i]);
525 FPRINTF (stdout, "- %u connections\n", n_connections); 526 FPRINTF (stdout, "- %u connections\n", n_connections);
526 for (i = 0; i < n_connections; i++) 527 for (i = 0; i < n_connections; i++)
527 FPRINTF (stdout, " %s\n", GNUNET_h2s_full (&connections[i])); 528 FPRINTF (stdout, " %s\n", GM_h2s (&connections[i]));
528 FPRINTF (stdout, "- enc state: %u\n", estate); 529 FPRINTF (stdout, "- enc state: %u\n", estate);
529 FPRINTF (stdout, "- con state: %u\n", cstate); 530 FPRINTF (stdout, "- con state: %u\n", cstate);
530 } 531 }
@@ -740,9 +741,9 @@ main (int argc, char *const *argv)
740// {'a', "channel", "TUNNEL_ID:CHANNEL_ID", 741// {'a', "channel", "TUNNEL_ID:CHANNEL_ID",
741// gettext_noop ("provide information about a particular channel"), 742// gettext_noop ("provide information about a particular channel"),
742// GNUNET_YES, &GNUNET_GETOPT_set_string, &channel_id}, 743// GNUNET_YES, &GNUNET_GETOPT_set_string, &channel_id},
743// {'b', "connection", "TUNNEL_ID:CONNECTION_ID", 744 {'C', "connection", "CONNECTION_ID",
744// gettext_noop ("provide information about a particular connection"), 745 gettext_noop ("provide information about a particular connection"),
745// GNUNET_YES, &GNUNET_GETOPT_set_string, &conn_id}, 746 GNUNET_YES, &GNUNET_GETOPT_set_string, &conn_id},
746 {'e', "echo", NULL, 747 {'e', "echo", NULL,
747 gettext_noop ("activate echo mode"), 748 gettext_noop ("activate echo mode"),
748 GNUNET_NO, &GNUNET_GETOPT_set_one, &echo}, 749 GNUNET_NO, &GNUNET_GETOPT_set_one, &echo},
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c
index 84adb7d0e..8970571a4 100644
--- a/src/mesh/gnunet-service-mesh_local.c
+++ b/src/mesh/gnunet-service-mesh_local.c
@@ -805,7 +805,7 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
805 c_n = GMT_count_connections (t); 805 c_n = GMT_count_connections (t);
806 806
807 size = sizeof (struct GNUNET_MESH_LocalInfoTunnel); 807 size = sizeof (struct GNUNET_MESH_LocalInfoTunnel);
808 size += c_n * sizeof (struct GNUNET_HashCode); 808 size += c_n * sizeof (struct GNUNET_MeshHash);
809 size += ch_n * sizeof (MESH_ChannelNumber); 809 size += ch_n * sizeof (MESH_ChannelNumber);
810 810
811 resp = GNUNET_malloc (size); 811 resp = GNUNET_malloc (size);
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index ec5ddcf71..ff755c1ac 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -1108,7 +1108,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h,
1108 size_t msize; 1108 size_t msize;
1109 unsigned int ch_n; 1109 unsigned int ch_n;
1110 unsigned int c_n; 1110 unsigned int c_n;
1111 struct GNUNET_HashCode *conns; 1111 struct GNUNET_MeshHash *conns;
1112 MESH_ChannelNumber *chns; 1112 MESH_ChannelNumber *chns;
1113 1113
1114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Get Tunnel messasge received\n"); 1114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Get Tunnel messasge received\n");
@@ -1131,7 +1131,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h,
1131 ch_n = ntohl (msg->channels); 1131 ch_n = ntohl (msg->channels);
1132 c_n = ntohl (msg->connections); 1132 c_n = ntohl (msg->connections);
1133 esize += ch_n * sizeof (MESH_ChannelNumber); 1133 esize += ch_n * sizeof (MESH_ChannelNumber);
1134 esize += c_n * sizeof (struct GNUNET_HashCode); 1134 esize += c_n * sizeof (struct GNUNET_MeshHash);
1135 if (msize != esize) 1135 if (msize != esize)
1136 { 1136 {
1137 GNUNET_break_op (0); 1137 GNUNET_break_op (0);
@@ -1145,7 +1145,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h,
1145 } 1145 }
1146 1146
1147 /* Call Callback with tunnel info. */ 1147 /* Call Callback with tunnel info. */
1148 conns = (struct GNUNET_HashCode *) &msg[1]; 1148 conns = (struct GNUNET_MeshHash *) &msg[1];
1149 chns = (MESH_ChannelNumber *) &conns[c_n]; 1149 chns = (MESH_ChannelNumber *) &conns[c_n];
1150 h->info_cb.tunnel_cb (h->info_cls, &msg->destination, 1150 h->info_cb.tunnel_cb (h->info_cls, &msg->destination,
1151 ch_n, c_n, chns, conns, 1151 ch_n, c_n, chns, conns,