aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-03-30 12:26:58 +0000
committerBart Polot <bart@net.in.tum.de>2011-03-30 12:26:58 +0000
commit3612f20a379ee4b9e477e9990b47333aaba882de (patch)
tree15a2e42d8517ec26f02d3ef43aca20e881017681
parentb65a354ccaaa682b861c69f5899669e70cba69cc (diff)
downloadgnunet-3612f20a379ee4b9e477e9990b47333aaba882de.tar.gz
gnunet-3612f20a379ee4b9e477e9990b47333aaba882de.zip
Changes to integrate mesh application_type re-definition
-rw-r--r--src/include/gnunet_mesh_service.h2
-rw-r--r--src/mesh/mesh_api.c11
-rw-r--r--src/vpn/gnunet-daemon-exit.c3
-rw-r--r--src/vpn/gnunet-daemon-vpn.c3
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,
139 void *cls, 139 void *cls,
140 GNUNET_MESH_TunnelEndHandler cleaner, 140 GNUNET_MESH_TunnelEndHandler cleaner,
141 const struct GNUNET_MESH_MessageHandler *handlers, 141 const struct GNUNET_MESH_MessageHandler *handlers,
142 const GNUNET_MESH_ServiceType *stypes); 142 const GNUNET_MESH_ApplicationType *stypes);
143 143
144/** 144/**
145 * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise 145 * 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
95 unsigned int num_types; 95 unsigned int num_types;
96 96
97 /* array of message-types */ 97 /* array of message-types */
98 uint16_t *types; 98 GNUNET_MESH_ApplicationType *types;
99 99
100 struct GNUNET_TRANSPORT_ATS_Information atsi; 100 struct GNUNET_TRANSPORT_ATS_Information atsi;
101 struct peer_list_element *next, *prev; 101 struct peer_list_element *next, *prev;
@@ -314,10 +314,10 @@ receive_hello (void *cls,
314 } 314 }
315 315
316 element->num_types = *num; 316 element->num_types = *num;
317 element->types = GNUNET_malloc (*num * sizeof (uint16_t)); 317 element->types = GNUNET_malloc (*num * sizeof (GNUNET_MESH_ApplicationType));
318 318
319 for (i = 0; i < *num; i++) 319 for (i = 0; i < *num; i++)
320 element->types[i] = ntohs (ports[i]); 320 element->types[i] = (GNUNET_MESH_ApplicationType)ntohs (ports[i]);
321 321
322 struct tunnel_list_element *tunnel = handle->pending_by_type_tunnels.head; 322 struct tunnel_list_element *tunnel = handle->pending_by_type_tunnels.head;
323 while (tunnel != NULL) 323 while (tunnel != NULL)
@@ -423,7 +423,7 @@ core_receive (void *cls,
423struct GNUNET_MESH_Tunnel * 423struct GNUNET_MESH_Tunnel *
424GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *handle, 424GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *handle,
425 struct GNUNET_TIME_Relative timeout, 425 struct GNUNET_TIME_Relative timeout,
426 uint16_t message_type, 426 GNUNET_MESH_ApplicationType message_type,
427 GNUNET_MESH_TunnelConnectHandler 427 GNUNET_MESH_TunnelConnectHandler
428 connect_handler, 428 connect_handler,
429 GNUNET_MESH_TunnelDisconnectHandler 429 GNUNET_MESH_TunnelDisconnectHandler
@@ -632,7 +632,8 @@ GNUNET_MESH_connect (const struct
632 *cfg, void *cls, 632 *cfg, void *cls,
633 GNUNET_MESH_TunnelEndHandler 633 GNUNET_MESH_TunnelEndHandler
634 cleaner, 634 cleaner,
635 const struct GNUNET_MESH_MessageHandler *handlers) 635 const struct GNUNET_MESH_MessageHandler *handlers,
636 const GNUNET_MESH_ApplicationType *stypes)
636{ 637{
637 struct GNUNET_MESH_Handle *ret = 638 struct GNUNET_MESH_Handle *ret =
638 GNUNET_malloc (sizeof (struct GNUNET_MESH_Handle)); 639 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,
946 mesh_handle = GNUNET_MESH_connect(cfg_, 946 mesh_handle = GNUNET_MESH_connect(cfg_,
947 NULL, 947 NULL,
948 NULL, 948 NULL,
949 handlers); 949 handlers,
950 NULL);
950 951
951 cfg = cfg_; 952 cfg = cfg_;
952 udp_connections = GNUNET_CONTAINER_multihashmap_create(65536); 953 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,
584 mesh_handle = GNUNET_MESH_connect(cfg_, 584 mesh_handle = GNUNET_MESH_connect(cfg_,
585 NULL, 585 NULL,
586 NULL, 586 NULL,
587 handlers); 587 handlers,
588 NULL);
588 cfg = cfg_; 589 cfg = cfg_;
589 restart_hijack = 0; 590 restart_hijack = 0;
590 hashmap = GNUNET_CONTAINER_multihashmap_create(65536); 591 hashmap = GNUNET_CONTAINER_multihashmap_create(65536);