From 3612f20a379ee4b9e477e9990b47333aaba882de Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 30 Mar 2011 12:26:58 +0000 Subject: [PATCH] Changes to integrate mesh application_type re-definition --- src/include/gnunet_mesh_service.h | 2 +- src/mesh/mesh_api.c | 11 ++++++----- src/vpn/gnunet-daemon-exit.c | 3 ++- src/vpn/gnunet-daemon-vpn.c | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index 0c90f2105..2835d0abd 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h @@ -139,7 +139,7 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, GNUNET_MESH_TunnelEndHandler cleaner, const struct GNUNET_MESH_MessageHandler *handlers, - const GNUNET_MESH_ServiceType *stypes); + const GNUNET_MESH_ApplicationType *stypes); /** * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index d030f9f8f..12759f2a7 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -95,7 +95,7 @@ struct peer_list_element unsigned int num_types; /* array of message-types */ - uint16_t *types; + GNUNET_MESH_ApplicationType *types; struct GNUNET_TRANSPORT_ATS_Information atsi; struct peer_list_element *next, *prev; @@ -314,10 +314,10 @@ receive_hello (void *cls, } element->num_types = *num; - element->types = GNUNET_malloc (*num * sizeof (uint16_t)); + element->types = GNUNET_malloc (*num * sizeof (GNUNET_MESH_ApplicationType)); for (i = 0; i < *num; i++) - element->types[i] = ntohs (ports[i]); + element->types[i] = (GNUNET_MESH_ApplicationType)ntohs (ports[i]); struct tunnel_list_element *tunnel = handle->pending_by_type_tunnels.head; while (tunnel != NULL) @@ -423,7 +423,7 @@ core_receive (void *cls, struct GNUNET_MESH_Tunnel * GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *handle, struct GNUNET_TIME_Relative timeout, - uint16_t message_type, + GNUNET_MESH_ApplicationType message_type, GNUNET_MESH_TunnelConnectHandler connect_handler, GNUNET_MESH_TunnelDisconnectHandler @@ -632,7 +632,8 @@ GNUNET_MESH_connect (const struct *cfg, void *cls, GNUNET_MESH_TunnelEndHandler cleaner, - const struct GNUNET_MESH_MessageHandler *handlers) + const struct GNUNET_MESH_MessageHandler *handlers, + const GNUNET_MESH_ApplicationType *stypes) { struct GNUNET_MESH_Handle *ret = GNUNET_malloc (sizeof (struct GNUNET_MESH_Handle)); diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c index c5bbf98a3..ee1080fca 100644 --- a/src/vpn/gnunet-daemon-exit.c +++ b/src/vpn/gnunet-daemon-exit.c @@ -946,7 +946,8 @@ run (void *cls, mesh_handle = GNUNET_MESH_connect(cfg_, NULL, NULL, - handlers); + handlers, + NULL); cfg = cfg_; udp_connections = GNUNET_CONTAINER_multihashmap_create(65536); diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index f759e35cf..a3b4e6c49 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c @@ -584,7 +584,8 @@ run (void *cls, mesh_handle = GNUNET_MESH_connect(cfg_, NULL, NULL, - handlers); + handlers, + NULL); cfg = cfg_; restart_hijack = 0; hashmap = GNUNET_CONTAINER_multihashmap_create(65536); -- 2.25.1