Changes to integrate mesh application_type re-definition
authorBart Polot <bart@net.in.tum.de>
Wed, 30 Mar 2011 12:26:58 +0000 (12:26 +0000)
committerBart Polot <bart@net.in.tum.de>
Wed, 30 Mar 2011 12:26:58 +0000 (12:26 +0000)
src/include/gnunet_mesh_service.h
src/mesh/mesh_api.c
src/vpn/gnunet-daemon-exit.c
src/vpn/gnunet-daemon-vpn.c

index 0c90f2105ebd523ed3a5330aa1a34b4b360369dc..2835d0abd7a71b40e1a87fa111bd05cff868e016 100644 (file)
@@ -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
index d030f9f8fcd354a7100304d5599cbcd1bb302278..12759f2a749dc7d04204fd179a0069d856fdfcc4 100644 (file)
@@ -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));
index c5bbf98a3401bae88f2b0eef4796df0889cf4bdb..ee1080fcada0bf87ce245228943d5b7833d98a96 100644 (file)
@@ -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);
index f759e35cfdfba2a6b51e7f4881a97014a355e4b2..a3b4e6c49d37cefa36b130de6138359229a0e063 100644 (file)
@@ -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);