gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit ced5eff310943fb2eb4a541a49e5bb40b049572b
parent 8a3f9a770be5cc80cf53c50b371055e4d52c5e96
Author: Bart Polot <bart@net.in.tum.de>
Date:   Tue,  1 Apr 2014 00:16:13 +0000

- move mesh hash to public api

Diffstat:
Msrc/include/gnunet_mesh_service.h | 11++++++++++-
Msrc/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 @@ -54,6 +54,15 @@ struct GNUNET_MESH_Handle; */ struct GNUNET_MESH_Channel; +/** + * Hash to be used in Mesh communication. Only 256 bits needed, + * instead of the 512 from @c GNUNET_HashCode. + * + */ +struct GNUNET_MeshHash +{ + unsigned char bits[256 / 8]; +}; /** * Channel options. @@ -442,7 +451,7 @@ typedef void (*GNUNET_MESH_TunnelCB) (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); diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h @@ -90,17 +90,6 @@ typedef uint32_t MESH_ChannelNumber; /** - * Hash to be used in Mesh communication. Only 256 bits needed, - * instead of the 512 from @c GNUNET_HashCode. - * - */ -struct GNUNET_MeshHash -{ - unsigned char bits[256 / 8]; -}; - - -/** * Message for a client to create and destroy channels. */ struct GNUNET_MESH_ChannelMessage @@ -333,6 +322,13 @@ const struct GNUNET_HashCode * GM_h2hc (const struct GNUNET_MeshHash *id); /** + * Get a string from a Mesh Hash (256 bits). + * WARNING: Not reentrant (based on GNUNET_h2s). + */ +const char * +GM_h2s (const struct GNUNET_MeshHash *id); + +/** * Convert a message type into a string to help debug * Generated with: * FIND: "#define ([^ ]+)[ ]*([0-9]+)"