gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31074 - in gnunet/src: conversation exit fs include mesh p


From: gnunet
Subject: [GNUnet-SVN] r31074 - in gnunet/src: conversation exit fs include mesh pt scalarproduct set vpn
Date: Thu, 5 Dec 2013 15:15:25 +0100

Author: bartpolot
Date: 2013-12-05 15:15:25 +0100 (Thu, 05 Dec 2013)
New Revision: 31074

Modified:
   gnunet/src/conversation/gnunet-service-conversation.c
   gnunet/src/exit/gnunet-daemon-exit.c
   gnunet/src/fs/gnunet-service-fs_mesh_client.c
   gnunet/src/fs/gnunet-service-fs_mesh_server.c
   gnunet/src/include/gnunet_mesh_service.h
   gnunet/src/mesh/mesh_api.c
   gnunet/src/mesh/test_mesh_local.c
   gnunet/src/mesh/test_mesh_single.c
   gnunet/src/mesh/test_mesh_small.c
   gnunet/src/pt/gnunet-daemon-pt.c
   gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
   gnunet/src/set/gnunet-service-set.c
   gnunet/src/vpn/gnunet-service-vpn.c
Log:
- change mesh channel creation/notification API


Modified: gnunet/src/conversation/gnunet-service-conversation.c
===================================================================
--- gnunet/src/conversation/gnunet-service-conversation.c       2013-12-05 
14:01:04 UTC (rev 31073)
+++ gnunet/src/conversation/gnunet-service-conversation.c       2013-12-05 
14:15:25 UTC (rev 31074)
@@ -701,8 +701,7 @@
                                                      ch,
                                                      &msg->target,
                                                      
GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL,
-                                                     GNUNET_NO,
-                                                     GNUNET_YES);
+                                                     
GNUNET_MESH_OPTION_RELIABLE);
   ch->reliable_mq = GNUNET_MESH_mq_create (ch->channel_reliable);
   e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING);
   ring->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING);
@@ -1073,8 +1072,7 @@
                                                        ch,
                                                        &ch->target,
                                                        
GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO,
-                                                       GNUNET_YES,
-                                                       GNUNET_NO);
+                                                       
GNUNET_MESH_OPTION_DEFAULT);
   if (NULL == ch->channel_unreliable)
   {
     GNUNET_break (0);

Modified: gnunet/src/exit/gnunet-daemon-exit.c
===================================================================
--- gnunet/src/exit/gnunet-daemon-exit.c        2013-12-05 14:01:04 UTC (rev 
31073)
+++ gnunet/src/exit/gnunet-daemon-exit.c        2013-12-05 14:15:25 UTC (rev 
31074)
@@ -3008,13 +3008,14 @@
  * @param channel new handle to the channel
  * @param initiator peer that started the channel
  * @param port destination port
+ * @param options channel options flags
  * @return initial channel context for the channel
  */
 static void *
 new_channel (void *cls,
             struct GNUNET_MESH_Channel *channel,
             const struct GNUNET_PeerIdentity *initiator,
-            uint32_t port)
+            uint32_t port, enum MeshOption options)
 {
   struct ChannelState *s = GNUNET_new (struct ChannelState);
 

Modified: gnunet/src/fs/gnunet-service-fs_mesh_client.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_mesh_client.c       2013-12-05 14:01:04 UTC 
(rev 31073)
+++ gnunet/src/fs/gnunet-service-fs_mesh_client.c       2013-12-05 14:15:25 UTC 
(rev 31074)
@@ -228,8 +228,7 @@
                                          mh,
                                          &mh->target,
                                          
GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
-                                         GNUNET_NO,
-                                         GNUNET_YES);
+                                         GNUNET_MESH_OPTION_RELIABLE);
   transmit_pending (mh);
 }
 
@@ -543,8 +542,7 @@
                                             mh,
                                             &mh->target,
                                             
GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
-                                            GNUNET_NO,
-                                            GNUNET_YES);
+                                            GNUNET_MESH_OPTION_RELIABLE);
   GNUNET_assert (mh ==
                  GNUNET_CONTAINER_multipeermap_get (mesh_map,
                                                     target));

Modified: gnunet/src/fs/gnunet-service-fs_mesh_server.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_mesh_server.c       2013-12-05 14:01:04 UTC 
(rev 31073)
+++ gnunet/src/fs/gnunet-service-fs_mesh_server.c       2013-12-05 14:15:25 UTC 
(rev 31074)
@@ -458,13 +458,14 @@
  * @param initiator the identity of the peer who wants to establish a mesh
  *            with us; NULL on binding error
  * @param port mesh port used for the incoming connection
+ * @param options channel option flags
  * @return initial channel context (our 'struct MeshClient')
  */
 static void *
 accept_cb (void *cls,
           struct GNUNET_MESH_Channel *channel,
           const struct GNUNET_PeerIdentity *initiator,
-          uint32_t port)
+          uint32_t port, enum MeshOption options)
 {
   struct MeshClient *sc;
 

Modified: gnunet/src/include/gnunet_mesh_service.h
===================================================================
--- gnunet/src/include/gnunet_mesh_service.h    2013-12-05 14:01:04 UTC (rev 
31073)
+++ gnunet/src/include/gnunet_mesh_service.h    2013-12-05 14:15:25 UTC (rev 
31074)
@@ -62,6 +62,11 @@
 enum MeshOption
 {
   /**
+   * Default options: unreliable, default buffering, not out of order.
+   */
+  GNUNET_MESH_OPTION_DEFAULT    = 0x0,
+
+  /**
    * Disable buffering on intermediate nodes (for minimum latency).
    * Yes/No.
    */
@@ -81,6 +86,7 @@
 
   /**
    * Who is the peer at the other end of the channel.
+   * Only for use in @c GNUNET_MESH_channel_get_info
    * struct GNUNET_PeerIdentity *peer
    */
   GNUNET_MESH_OPTION_PEER       = 0x8
@@ -146,6 +152,8 @@
  * @param channel new handle to the channel
  * @param initiator peer that started the channel
  * @param port Port this channel is for.
+ * @param options MeshOption flag field, with all active option bits set to 1.
+ *
  * @return initial channel context for the channel
  *         (can be NULL -- that's not an error)
  */
@@ -156,7 +164,9 @@
                                                                const struct
                                                                
GNUNET_PeerIdentity
                                                                * initiator,
-                                                               uint32_t port);
+                                                               uint32_t port,
+                                                               enum MeshOption
+                                                               options);
 
 
 /**
@@ -229,8 +239,8 @@
  * @param channel_ctx client's channel context to associate with the channel
  * @param peer peer identity the channel should go to
  * @param port Port number.
- * @param nobuffer Flag for disabling buffering on relay nodes.
- * @param reliable Flag for end-to-end reliability.
+ * @param options MeshOption flag field, with all desired option bits set to 1.
+ *
  * @return handle to the channel
  */
 struct GNUNET_MESH_Channel *
@@ -238,8 +248,7 @@
                             void *channel_ctx,
                             const struct GNUNET_PeerIdentity *peer,
                             uint32_t port,
-                            int nobuffer,
-                            int reliable);
+                            enum MeshOption options);
 
 
 /**

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2013-12-05 14:01:04 UTC (rev 31073)
+++ gnunet/src/mesh/mesh_api.c  2013-12-05 14:15:25 UTC (rev 31074)
@@ -277,21 +277,11 @@
   unsigned int packet_size;
 
     /**
-     * Is the channel allowed to buffer?
+     * Channel options: reliability, etc.
      */
-  int nobuffer;
+  enum MeshOption options;
 
     /**
-     * Is the channel realiable?
-     */
-  int reliable;
-
-    /**
-     * If reliable, is the channel out of order?
-     */
-  int ooorder;
-
-    /**
      * Are we allowed to send to the service?
      */
   int allow_send;
@@ -439,7 +429,6 @@
     ch->chid = chid;
   }
   ch->allow_send = GNUNET_NO;
-  ch->nobuffer = GNUNET_NO;
   return ch;
 }
 
@@ -782,24 +771,10 @@
     ch->mesh = h;
     ch->chid = chid;
     ch->port = port;
-    if (0 != (msg->opt & GNUNET_MESH_OPTION_NOBUFFER))
-      ch->nobuffer = GNUNET_YES;
-    else
-      ch->nobuffer = GNUNET_NO;
+    ch->options = ntohl (msg->opt);
 
-    if (0 != (msg->opt & GNUNET_MESH_OPTION_RELIABLE))
-      ch->reliable = GNUNET_YES;
-    else
-      ch->reliable = GNUNET_NO;
-
-    if (GNUNET_YES == ch->reliable &&
-        0 != (msg->opt & GNUNET_MESH_OPTION_OOORDER))
-      ch->ooorder = GNUNET_YES;
-    else
-      ch->ooorder = GNUNET_NO;
-
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  created channel %p\n", ch);
-    ctx = h->new_channel (h->cls, ch, &msg->peer, ch->port);
+    ctx = h->new_channel (h->cls, ch, &msg->peer, ch->port, ch->options);
     if (NULL != ctx)
       ch->ctx = ctx;
     LOG (GNUNET_ERROR_TYPE_DEBUG, "User notified\n");
@@ -1398,18 +1373,16 @@
  * @param channel_ctx client's channel context to associate with the channel
  * @param peer peer identity the channel should go to
  * @param port Port number.
- * @param nobuffer Flag for disabling buffering on relay nodes.
- * @param reliable Flag for end-to-end reliability.
+ * @param options MeshOption flag field, with all desired option bits set to 1.
  *
  * @return handle to the channel
  */
 struct GNUNET_MESH_Channel *
 GNUNET_MESH_channel_create (struct GNUNET_MESH_Handle *h,
-                           void *channel_ctx,
-                           const struct GNUNET_PeerIdentity *peer,
-                           uint32_t port,
-                           int nobuffer,
-                           int reliable)
+                            void *channel_ctx,
+                            const struct GNUNET_PeerIdentity *peer,
+                            uint32_t port,
+                            enum MeshOption options)
 {
   struct GNUNET_MESH_Channel *ch;
   struct GNUNET_MESH_ChannelMessage msg;
@@ -1427,12 +1400,7 @@
   msg.channel_id = htonl (ch->chid);
   msg.port = htonl (port);
   msg.peer = *peer;
-  msg.opt = 0;
-  if (GNUNET_YES == reliable)
-    msg.opt |= GNUNET_MESH_OPTION_RELIABLE;
-  if (GNUNET_YES == nobuffer)
-    msg.opt |= GNUNET_MESH_OPTION_NOBUFFER;
-  msg.opt = htonl (msg.opt);
+  msg.opt = htonl (options);
   ch->allow_send = 0;
   send_packet (h, &msg.header, ch);
   return ch;
@@ -1489,20 +1457,21 @@
  */
 const union GNUNET_MESH_ChannelInfo *
 GNUNET_MESH_channel_get_info (struct GNUNET_MESH_Channel *channel,
-                             enum MeshOption option, ...)
+                              enum MeshOption option, ...)
 {
+  static int bool_flag;
   const union GNUNET_MESH_ChannelInfo *ret;
 
   switch (option)
   {
     case GNUNET_MESH_OPTION_NOBUFFER:
-      ret = (const union GNUNET_MESH_ChannelInfo *) &channel->nobuffer;
-      break;
     case GNUNET_MESH_OPTION_RELIABLE:
-      ret = (const union GNUNET_MESH_ChannelInfo *) &channel->reliable;
-      break;
     case GNUNET_MESH_OPTION_OOORDER:
-      ret = (const union GNUNET_MESH_ChannelInfo *) &channel->ooorder;
+      if (0 != (option & channel->options))
+        bool_flag = GNUNET_YES;
+      else
+        bool_flag = GNUNET_NO;
+      ret = (const union GNUNET_MESH_ChannelInfo *) &bool_flag;
       break;
     case GNUNET_MESH_OPTION_PEER:
       ret = (const union GNUNET_MESH_ChannelInfo *) GNUNET_PEER_resolve2 
(channel->peer);

Modified: gnunet/src/mesh/test_mesh_local.c
===================================================================
--- gnunet/src/mesh/test_mesh_local.c   2013-12-05 14:01:04 UTC (rev 31073)
+++ gnunet/src/mesh/test_mesh_local.c   2013-12-05 14:15:25 UTC (rev 31074)
@@ -141,13 +141,14 @@
  * @param channel new handle to the channel
  * @param initiator peer that started the channel
  * @param port port number
+ * @param options channel options
  * @return initial channel context for the channel
  *         (can be NULL -- that's not an error)
  */
 static void *
 inbound_channel (void *cls, struct GNUNET_MESH_Channel *channel,
                 const struct GNUNET_PeerIdentity *initiator,
-                uint32_t port)
+                uint32_t port, enum MeshOption options)
 {
   long id = (long) cls;
 
@@ -256,7 +257,7 @@
   GNUNET_TESTING_peer_get_identity (me, &id);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "CONNECT BY PORT\n");
   ch = GNUNET_MESH_channel_create (mesh_peer_1, NULL, &id, 1,
-                                  GNUNET_YES, GNUNET_NO);
+                                   GNUNET_MESH_OPTION_DEFAULT);
   mth = GNUNET_MESH_notify_transmit_ready (ch, GNUNET_NO,
                                            GNUNET_TIME_UNIT_FOREVER_REL,
                                            sizeof (struct 
GNUNET_MessageHeader),

Modified: gnunet/src/mesh/test_mesh_single.c
===================================================================
--- gnunet/src/mesh/test_mesh_single.c  2013-12-05 14:01:04 UTC (rev 31073)
+++ gnunet/src/mesh/test_mesh_single.c  2013-12-05 14:15:25 UTC (rev 31074)
@@ -162,13 +162,14 @@
  * @param channel new handle to the channel
  * @param initiator peer that started the channel
  * @param port port number
+ * @param options channel option flags
  * @return initial channel context for the channel
  *         (can be NULL -- that's not an error)
  */
 static void *
 inbound_channel (void *cls, struct GNUNET_MESH_Channel *channel,
                 const struct GNUNET_PeerIdentity *initiator,
-                uint32_t port)
+                uint32_t port, enum MeshOption options)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "received incoming channel on port %u\n",
@@ -256,7 +257,8 @@
 
   GNUNET_TESTING_peer_get_identity (me, &id);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "CONNECT BY PORT\n");
-  ch1 = GNUNET_MESH_channel_create (mesh, NULL, &id, 1, GNUNET_YES, GNUNET_NO);
+  ch1 = GNUNET_MESH_channel_create (mesh, NULL, &id, 1,
+                                    GNUNET_MESH_OPTION_DEFAULT);
   GNUNET_MESH_notify_transmit_ready (ch1, GNUNET_NO,
                                      GNUNET_TIME_UNIT_FOREVER_REL,
                                      size, &do_send, NULL);

Modified: gnunet/src/mesh/test_mesh_small.c
===================================================================
--- gnunet/src/mesh/test_mesh_small.c   2013-12-05 14:01:04 UTC (rev 31073)
+++ gnunet/src/mesh/test_mesh_small.c   2013-12-05 14:15:25 UTC (rev 31074)
@@ -536,13 +536,14 @@
  * @param channel New handle to the channel.
  * @param initiator Peer that started the channel.
  * @param port Port this channel is connected to.
+ * @param options channel option flags
  * @return Initial channel context for the channel
  *         (can be NULL -- that's not an error).
  */
 static void *
 incoming_channel (void *cls, struct GNUNET_MESH_Channel *channel,
                  const struct GNUNET_PeerIdentity *initiator,
-                 uint32_t port)
+                 uint32_t port, enum MeshOption options)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Incoming channel from %s to peer %d\n",
@@ -629,7 +630,7 @@
 static void
 do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  int rel;
+  enum MeshOption flags;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test_task\n");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "add peer 2\n");
@@ -641,14 +642,13 @@
     GNUNET_SCHEDULER_cancel (disconnect_task);
   }
 
+  flags = GNUNET_MESH_OPTION_DEFAULT;
   if (SPEED_REL == test)
   {
     test = SPEED;
-    rel = GNUNET_YES;
+    flags |= GNUNET_MESH_OPTION_RELIABLE;
   }
-  else
-    rel = GNUNET_NO;
-  ch = GNUNET_MESH_channel_create (h1, NULL, p_id[1], 1, GNUNET_NO, rel);
+  ch = GNUNET_MESH_channel_create (h1, NULL, p_id[1], 1, flags);
 
   disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME,
                                                   &disconnect_mesh_peers,

Modified: gnunet/src/pt/gnunet-daemon-pt.c
===================================================================
--- gnunet/src/pt/gnunet-daemon-pt.c    2013-12-05 14:01:04 UTC (rev 31073)
+++ gnunet/src/pt/gnunet-daemon-pt.c    2013-12-05 14:15:25 UTC (rev 31074)
@@ -352,8 +352,7 @@
                                                      pos,
                                                      &pos->peer,
                                                      
GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER,
-                                                     GNUNET_YES /* no buffer 
*/,
-                                                     GNUNET_NO /* reliable */);
+                                                     
GNUNET_MESH_OPTION_DEFAULT);
        if (NULL == pos->mesh_channel)
        {
          GNUNET_break (0);

Modified: gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
===================================================================
--- gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2013-12-05 
14:01:04 UTC (rev 31073)
+++ gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2013-12-05 
14:15:25 UTC (rev 31074)
@@ -226,9 +226,9 @@
  * Send a multi part chunk of a service request from alice to bob.
  * This element only contains a part of the elements-vector (session->a[]),
  * mask and public key set have to be contained within the first message
- * 
+ *
  * This allows a ~32kbit key length while using 32000 elements or 62000 
elements per request.
- * 
+ *
  * @param cls the associated service session
  */
 static void
@@ -237,7 +237,7 @@
 /**
  * Send a multi part chunk of a service response from bob to alice.
  * This element only contains the two permutations of R, R'.
- * 
+ *
  * @param cls the associated service session
  */
 static void
@@ -657,7 +657,7 @@
 /**
  * Finds a not terminated client/service session in the
  * given DLL based on session key, element count and state.
- * 
+ *
  * @param tail - the tail of the DLL
  * @param key - the key we want to search for
  * @param element_count - the total element count of the dataset 
(session->total)
@@ -694,7 +694,7 @@
 
 /**
  * Safely frees ALL memory areas referenced by a session.
- * 
+ *
  * @param session - the session to free elements from
  */
 static void
@@ -769,7 +769,7 @@
                           struct GNUNET_SERVER_Client *client)
 {
   struct ServiceSession *session;
-  
+
   if (NULL != client)
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               _ ("Client (%p) disconnected from us.\n"), client);
@@ -851,7 +851,7 @@
   }
   else
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, _ ("Sending session-end notification 
to client (%p) for session %s\n"), &session->client, GNUNET_h2s 
(&session->key));
-  
+
   free_session_variables (session);
 }
 
@@ -953,7 +953,7 @@
 /**
  * Send a multipart chunk of a service response from bob to alice.
  * This element only contains the two permutations of R, R'.
- * 
+ *
  * @param cls the associated service session
  */
 static void
@@ -1396,9 +1396,9 @@
  * Send a multi part chunk of a service request from alice to bob.
  * This element only contains a part of the elements-vector (session->a[]),
  * mask and public key set have to be contained within the first message
- * 
+ *
  * This allows a ~32kbit key length while using 32000 elements or 62000 
elements per request.
- * 
+ *
  * @param cls the associated service session
  */
 static void
@@ -1751,8 +1751,7 @@
     session->channel = GNUNET_MESH_channel_create (my_mesh, session,
                                                  &session->peer,
                                                  
GNUNET_APPLICATION_TYPE_SCALARPRODUCT,
-                                                 GNUNET_NO,
-                                                 GNUNET_YES);
+                                                 GNUNET_MESH_OPTION_RELIABLE);
     //prepare_service_request, channel_peer_disconnect_handler,
     if (!session->channel) {
       GNUNET_break (0);
@@ -1815,18 +1814,20 @@
  * @param channel new handle to the channel
  * @param initiator peer that started the channel
  * @param port unused
+ * @param options unused
+ *
  * @return session associated with the channel
  */
 static void *
 channel_incoming_handler (void *cls,
                          struct GNUNET_MESH_Channel *channel,
                          const struct GNUNET_PeerIdentity *initiator,
-                         uint32_t port)
+                         uint32_t port, enum MeshOption options)
 {
   struct ServiceSession * c = GNUNET_new (struct ServiceSession);
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _ ("New incoming channel from peer 
%s.\n"), GNUNET_i2s (initiator));
-  
+
   c->peer = *initiator;
   c->channel = channel;
   c->role = BOB;
@@ -1861,7 +1862,7 @@
               GNUNET_i2s (&session->peer));
   if (ALICE == session->role) {
     // as we have only one peer connected in each session, just remove the 
session
-    
+
     if ((SERVICE_RESPONSE_RECEIVED > session->state) && (!do_shutdown)) {
       session->channel = NULL;
       // if this happened before we received the answer, we must terminate the 
session
@@ -2288,7 +2289,7 @@
     return GNUNET_OK;
   session->state = SERVICE_RESPONSE_RECEIVED;
   session->product = compute_scalar_product (session); //never NULL
-  
+
 invalid_msg:
   GNUNET_break_op (NULL != session->product);
 
@@ -2342,7 +2343,7 @@
   //we need at least a full message without elements attached
   msg_size = ntohs (msg->header.size);
   required_size = sizeof (struct GNUNET_SCALARPRODUCT_service_response) + 2 * 
PAILLIER_ELEMENT_LENGTH;
-  
+
   if (required_size > msg_size) {
     goto invalid_msg;
   }
@@ -2393,7 +2394,7 @@
 
   session->state = SERVICE_RESPONSE_RECEIVED;
   session->product = compute_scalar_product (session); //never NULL
-  
+
 invalid_msg:
   GNUNET_break_op (NULL != session->product);
   // send message with product to client

Modified: gnunet/src/set/gnunet-service-set.c
===================================================================
--- gnunet/src/set/gnunet-service-set.c 2013-12-05 14:01:04 UTC (rev 31073)
+++ gnunet/src/set/gnunet-service-set.c 2013-12-05 14:15:25 UTC (rev 31074)
@@ -237,7 +237,7 @@
  * Collect and destroy elements that are not needed anymore, because
  * their lifetime (as determined by their generation) does not overlap with 
any active
  * set operation.
- * 
+ *
  * We hereby replace the old element hashmap with a new one, instead of 
removing elements.
  */
 void
@@ -252,7 +252,7 @@
   new_elements = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_NO);
   iter = GNUNET_CONTAINER_multihashmap_iterator_create (set->elements);
   while (GNUNET_OK ==
-         (res = GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, 
(const void **) &ee))) 
+         (res = GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, 
(const void **) &ee)))
   {
     if (GNUNET_NO == ee->removed)
       goto still_needed;
@@ -449,7 +449,7 @@
 
 /**
  * remove & free state of the operation from the incoming list
- * 
+ *
  * @param incoming the element to remove
  */
 
@@ -510,7 +510,7 @@
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != incoming->state->timeout_task);
   GNUNET_SCHEDULER_cancel (incoming->state->timeout_task);
   incoming->state->timeout_task = GNUNET_SCHEDULER_NO_TASK;
-  
+
   mqm = GNUNET_MQ_msg_nested_mh (cmsg, GNUNET_MESSAGE_TYPE_SET_REQUEST,
                                  incoming->spec->context_msg);
   GNUNET_assert (NULL != mqm);
@@ -524,9 +524,9 @@
 
 /**
  * Handle a request for a set operation from
- * another peer. 
- * 
- * This msg is expected as the first and only msg handled through the 
+ * another peer.
+ *
+ * This msg is expected as the first and only msg handled through the
  * non-operation bound virtual table, acceptance of this operation replaces
  * our virtual table and subsequent msgs would be routed differently.
  *
@@ -685,7 +685,7 @@
               ntohs (msg->operation));
 
   // max. one set per client!
-  if (NULL != set_get (client)) 
+  if (NULL != set_get (client))
   {
     GNUNET_break (0);
     GNUNET_SERVER_client_disconnect (client);
@@ -742,7 +742,7 @@
     GNUNET_SERVER_client_disconnect (client);
     return;
   }
-  
+
   listener = GNUNET_new (struct Listener);
   listener->client = client;
   listener->client_mq = GNUNET_MQ_queue_for_server_client (client);
@@ -751,7 +751,7 @@
   GNUNET_CONTAINER_DLL_insert_tail (listeners_head, listeners_tail, listener);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "new listener created (op %u, app 
%s)\n",
               listener->operation, GNUNET_h2s (&listener->app_id));
-  
+
   /* check for incoming requests the listener is interested in */
   for (op = incoming_head; NULL != op; op = op->next)
   {
@@ -805,7 +805,7 @@
     return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "peer request rejected by client\n");
-  
+
   GNUNET_MESH_channel_destroy (incoming->channel);
   //channel destruction handler called immediately upon destruction
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@ -925,7 +925,7 @@
   spec->result_mode = ntohs (msg->result_mode);
   spec->client_request_id = ntohl (msg->request_id);
   spec->context_msg = GNUNET_MQ_extract_nested_mh (msg);
-  
+
   // for simplicity we just backup the context msg instead of rebuilding it 
later on
   if (NULL != spec->context_msg)
     spec->context_msg = GNUNET_copy_message (spec->context_msg);
@@ -938,8 +938,7 @@
 
   op->channel = GNUNET_MESH_channel_create (mesh, op, &msg->target_peer,
                                           GNUNET_APPLICATION_TYPE_SET,
-                                          GNUNET_YES,
-                                          GNUNET_YES);
+                                          GNUNET_MESH_OPTION_RELIABLE);
 
   op->mq = GNUNET_MESH_mq_create (op->channel);
 
@@ -950,7 +949,7 @@
 
 /**
  * Handle an ack from a client, and send the next element.
- * 
+ *
  * @param cls unused
  * @param client the client
  * @param m the message
@@ -1027,7 +1026,7 @@
     GNUNET_SERVER_client_disconnect (client);
     return;
   }
-  
+
   _GSS_operation_destroy (op);
 }
 
@@ -1036,7 +1035,7 @@
  * Handle a request from the client to accept
  * a set operation that came from a remote peer.
  * We forward the accept to the associated operation for handling
- * 
+ *
  * @param cls unused
  * @param client the client
  * @param mh the message
@@ -1066,7 +1065,7 @@
 
   // client without a set requested an operation
   set = set_get (client);
-  
+
   if (NULL == set)
   {
     GNUNET_break (0);
@@ -1126,7 +1125,7 @@
 
 /**
  * Timeout happens iff:
- *  - we suggested an operation to our listener, 
+ *  - we suggested an operation to our listener,
  *    but did not receive a response in time
  *  - we got the channel from a peer but no 
GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST
  *  - shutdown (obviously)
@@ -1152,14 +1151,14 @@
 /**
  * Terminates an incoming operation in case we have not yet received an
  * operation request. Called by the channel destruction handler.
- * 
+ *
  * @param op the channel context
  */
 static void
 handle_incoming_disconnect (struct Operation *op)
 {
   GNUNET_assert (GNUNET_YES == op->is_incoming);
-  
+
   if (NULL == op->channel)
     return;
 
@@ -1171,16 +1170,17 @@
  * Method called whenever another peer has added us to a channel
  * the other peer initiated.
  * Only called (once) upon reception of data with a message type which was
- * subscribed to in GNUNET_MESH_connect. 
- * 
+ * subscribed to in GNUNET_MESH_connect.
+ *
  * The channel context represents the operation itself and gets added to a DLL,
- * from where it gets looked up when our local listener client responds 
+ * from where it gets looked up when our local listener client responds
  * to a proposed/suggested operation or connects and associates with this 
operation.
  *
  * @param cls closure
  * @param channel new handle to the channel
  * @param initiator peer that started the channel
  * @param port Port this channel is for.
+ * @param options Unused.
  * @return initial channel context for the channel
  *         (can be NULL -- that's not an error)
  */
@@ -1188,7 +1188,7 @@
 channel_new_cb (void *cls,
                struct GNUNET_MESH_Channel *channel,
                const struct GNUNET_PeerIdentity *initiator,
-               uint32_t port)
+               uint32_t port, enum MeshOption options)
 {
   struct Operation *incoming;
   static const struct SetVT incoming_vt = {
@@ -1202,7 +1202,7 @@
   {
     GNUNET_break (0);
     GNUNET_MESH_channel_destroy (channel);
-    return;
+    return NULL;
   }
 
   incoming = GNUNET_new (struct Operation);
@@ -1225,12 +1225,12 @@
  * any associated state.
  * GNUNET_MESH_channel_destroy. It must NOT call GNUNET_MESH_channel_destroy on
  * the channel.
- * 
- * The peer_disconnect function is part of a a virtual table set initially 
either 
+ *
+ * The peer_disconnect function is part of a a virtual table set initially 
either
  * when a peer creates a new channel with us (channel_new_cb), or once we 
create
- * a new channel ourselves (evaluate). 
- * 
- * Once we know the exact type of operation (union/intersection), the vt is 
+ * a new channel ourselves (evaluate).
+ *
+ * Once we know the exact type of operation (union/intersection), the vt is
  * replaced with an operation specific instance (_GSS_[op]_vt).
  *
  * @param cls closure (set from GNUNET_MESH_connect)
@@ -1259,11 +1259,11 @@
  * Functions with this signature are called whenever any message is
  * received via the mesh channel.
  *
- * The msg_handler is a virtual table set in initially either when a peer 
- * creates a new channel with us (channel_new_cb), or once we create a new 
channel 
- * ourselves (evaluate). 
- * 
- * Once we know the exact type of operation (union/intersection), the vt is 
+ * The msg_handler is a virtual table set in initially either when a peer
+ * creates a new channel with us (channel_new_cb), or once we create a new 
channel
+ * ourselves (evaluate).
+ *
+ * Once we know the exact type of operation (union/intersection), the vt is
  * replaced with an operation specific instance (_GSS_[op]_vt).
  *
  * @param cls Closure (set from GNUNET_MESH_connect).

Modified: gnunet/src/vpn/gnunet-service-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-service-vpn.c 2013-12-05 14:01:04 UTC (rev 31073)
+++ gnunet/src/vpn/gnunet-service-vpn.c 2013-12-05 14:15:25 UTC (rev 31074)
@@ -731,8 +731,7 @@
                                           ts,
                                           id,
                                           apptype,
-                                          GNUNET_YES,
-                                          GNUNET_NO);
+                                          GNUNET_MESH_OPTION_DEFAULT);
 }
 
 
@@ -778,8 +777,7 @@
                                            ts,
                                            
&dt->destination->details.service_destination.target,
                                            apptype,
-                                           GNUNET_YES,
-                                           GNUNET_NO);
+                                           GNUNET_MESH_OPTION_DEFAULT);
     if (NULL == ts->channel)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -815,7 +813,7 @@
       char address[GNUNET_TUN_IPV6_REGEXLEN];
 
       GNUNET_TUN_ipv6toregexsearch 
(&dt->destination->details.exit_destination.ip.v6,
-                                   dt->destination_port, 
+                                   dt->destination_port,
                                     address);
       GNUNET_asprintf (&policy, "%s%s",
                        GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]