From 76dcc3351564146f788e8a354cb3c42025db21cc Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 5 May 2011 22:21:31 +0000 Subject: WiP --- src/include/gnunet_mesh_service.h | 1 + src/mesh/mesh.h | 19 ++++++++++++++++++- src/mesh/mesh_api_new.c | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index 2835d0abd..2a288a3a5 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h @@ -131,6 +131,7 @@ typedef uint32_t GNUNET_MESH_ApplicationType; * note that the mesh is allowed to drop notifications about inbound * messages if the client does not process them fast enough (for this * notification type, a bounded queue is used) + * @param stypes Application Types the client claims to offer * @return handle to the mesh service * NULL on error (in this case, init is never called) */ diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h index c40f08325..dc90f781a 100644 --- a/src/mesh/mesh.h +++ b/src/mesh/mesh.h @@ -39,7 +39,7 @@ * * API CALL (GNUNET_MESH_*) MESSAGE USED * ------------------------ ------------ - * connect None (Header + [types]) + * connect GNUNET_MESH_ClientConnect * disconnect None (network level disconnect) * * tunnel_create GNUNET_MESH_TunnelMessage @@ -64,6 +64,23 @@ * peer disconnects from a tunnel GNUNET_MESH_PeerControl */ +/** + * Message for a client to register to the service + */ +struct GNUNET_MESH_ClientConnect { + /** + * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT + * + * Size: sizeof(struct GNUNET_MESH_ClientConnect) + + * sizeof(uint16_t) * types + + * sizeof(MESH_ApplicationType) * applications + */ + struct GNUNET_MessageHeader header; + uint16_t types; + uint16_t applications; +}; + + /** * Type for tunnel numbering. * - Local tunnel numbers are >= 0x80000000 diff --git a/src/mesh/mesh_api_new.c b/src/mesh/mesh_api_new.c index 5cb50b0d1..f63b0a221 100644 --- a/src/mesh/mesh_api_new.c +++ b/src/mesh/mesh_api_new.c @@ -72,6 +72,7 @@ struct GNUNET_MESH_Tunnel { * note that the mesh is allowed to drop notifications about * inbound messages if the client does not process them fast * enough (for this notification type, a bounded queue is used) + * @param stypes Application Types the client claims to offer * @return handle to the mesh service * NULL on error (in this case, init is never called) */ @@ -79,7 +80,7 @@ struct GNUNET_MESH_Handle * GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, GNUNET_MESH_TunnelEndHandler cleaner, - const struct GNUNET_MESH_MessageHandler *handlers, + const struct GNUNET_MESH_MessageHandler *handlers, const GNUNET_MESH_ApplicationType *stypes) { GNUNET_MESH_Handle *h; struct GNUNET_MESH_MessageHandler *aux; -- cgit v1.2.3