diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-04-01 00:16:13 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-04-01 00:16:13 +0000 |
commit | ced5eff310943fb2eb4a541a49e5bb40b049572b (patch) | |
tree | ef90cb723ed5c9fbcec937b2ab837a94c453b012 /src | |
parent | 8a3f9a770be5cc80cf53c50b371055e4d52c5e96 (diff) | |
download | gnunet-ced5eff310943fb2eb4a541a49e5bb40b049572b.tar.gz gnunet-ced5eff310943fb2eb4a541a49e5bb40b049572b.zip |
- move mesh hash to public api
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_mesh_service.h | 11 | ||||
-rw-r--r-- | src/mesh/mesh.h | 18 |
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 | */ |
55 | struct GNUNET_MESH_Channel; | 55 | struct 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 | */ | ||
62 | struct 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 | */ | ||
97 | struct 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 | */ |
106 | struct GNUNET_MESH_ChannelMessage | 95 | struct GNUNET_MESH_ChannelMessage |
@@ -333,6 +322,13 @@ const struct GNUNET_HashCode * | |||
333 | GM_h2hc (const struct GNUNET_MeshHash *id); | 322 | GM_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 | */ | ||
328 | const char * | ||
329 | GM_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]+)" |