aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-04-01 00:16:13 +0000
committerBart Polot <bart@net.in.tum.de>2014-04-01 00:16:13 +0000
commitced5eff310943fb2eb4a541a49e5bb40b049572b (patch)
treeef90cb723ed5c9fbcec937b2ab837a94c453b012 /src
parent8a3f9a770be5cc80cf53c50b371055e4d52c5e96 (diff)
downloadgnunet-ced5eff310943fb2eb4a541a49e5bb40b049572b.tar.gz
gnunet-ced5eff310943fb2eb4a541a49e5bb40b049572b.zip
- move mesh hash to public api
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_mesh_service.h11
-rw-r--r--src/mesh/mesh.h18
2 files changed, 17 insertions, 12 deletions
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h
index 21a51b7b2..7f108683f 100644
--- a/src/include/gnunet_mesh_service.h
+++ b/src/include/gnunet_mesh_service.h
@@ -54,6 +54,15 @@ struct GNUNET_MESH_Handle;
54 */ 54 */
55struct GNUNET_MESH_Channel; 55struct GNUNET_MESH_Channel;
56 56
57/**
58 * Hash to be used in Mesh communication. Only 256 bits needed,
59 * instead of the 512 from @c GNUNET_HashCode.
60 *
61 */
62struct GNUNET_MeshHash
63{
64 unsigned char bits[256 / 8];
65};
57 66
58/** 67/**
59 * Channel options. 68 * Channel options.
@@ -442,7 +451,7 @@ typedef void (*GNUNET_MESH_TunnelCB) (void *cls,
442 unsigned int n_channels, 451 unsigned int n_channels,
443 unsigned int n_connections, 452 unsigned int n_connections,
444 uint32_t *channels, 453 uint32_t *channels,
445 struct GNUNET_HashCode *connections, 454 struct GNUNET_MeshHash *connections,
446 unsigned int estate, 455 unsigned int estate,
447 unsigned int cstate); 456 unsigned int cstate);
448 457
diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h
index 42d3e6462..02bf96ee6 100644
--- a/src/mesh/mesh.h
+++ b/src/mesh/mesh.h
@@ -90,17 +90,6 @@ typedef uint32_t MESH_ChannelNumber;
90 90
91 91
92/** 92/**
93 * Hash to be used in Mesh communication. Only 256 bits needed,
94 * instead of the 512 from @c GNUNET_HashCode.
95 *
96 */
97struct GNUNET_MeshHash
98{
99 unsigned char bits[256 / 8];
100};
101
102
103/**
104 * Message for a client to create and destroy channels. 93 * Message for a client to create and destroy channels.
105 */ 94 */
106struct GNUNET_MESH_ChannelMessage 95struct GNUNET_MESH_ChannelMessage
@@ -333,6 +322,13 @@ const struct GNUNET_HashCode *
333GM_h2hc (const struct GNUNET_MeshHash *id); 322GM_h2hc (const struct GNUNET_MeshHash *id);
334 323
335/** 324/**
325 * Get a string from a Mesh Hash (256 bits).
326 * WARNING: Not reentrant (based on GNUNET_h2s).
327 */
328const char *
329GM_h2s (const struct GNUNET_MeshHash *id);
330
331/**
336 * Convert a message type into a string to help debug 332 * Convert a message type into a string to help debug
337 * Generated with: 333 * Generated with:
338 * FIND: "#define ([^ ]+)[ ]*([0-9]+)" 334 * FIND: "#define ([^ ]+)[ ]*([0-9]+)"