gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31798 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r31798 - gnunet/src/mesh
Date: Mon, 6 Jan 2014 05:47:44 +0100

Author: bartpolot
Date: 2014-01-06 05:47:44 +0100 (Mon, 06 Jan 2014)
New Revision: 31798

Modified:
   gnunet/src/mesh/gnunet-service-mesh_channel.c
   gnunet/src/mesh/gnunet-service-mesh_local.c
   gnunet/src/mesh/gnunet-service-mesh_local.h
   gnunet/src/mesh/mesh_api.c
Log:
- refactor channel nack


Modified: gnunet/src/mesh/gnunet-service-mesh_channel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_channel.c       2014-01-06 04:47:18 UTC 
(rev 31797)
+++ gnunet/src/mesh/gnunet-service-mesh_channel.c       2014-01-06 04:47:44 UTC 
(rev 31798)
@@ -636,7 +636,7 @@
     GNUNET_break (0);
     return;
   }
-  GML_send_nack (ch->root, ch->lid_root);
+  GML_send_channel_nack (ch->root, ch->lid_root);
 }
 
 

Modified: gnunet/src/mesh/gnunet-service-mesh_local.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_local.c 2014-01-06 04:47:18 UTC (rev 
31797)
+++ gnunet/src/mesh/gnunet-service-mesh_local.c 2014-01-06 04:47:44 UTC (rev 
31798)
@@ -990,32 +990,7 @@
 }
 
 
-/**
- * Build a local channel NACK message and send it to a local client.
- *
- * @param c Client to whom send the NACK.
- * @param id Channel ID to use
- */
-void
-GML_send_nack (struct MeshClient *c, MESH_ChannelNumber id)
-{
-  struct GNUNET_MESH_LocalAck msg;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-              "send local nack on %X towards %p\n",
-              id, c);
-
-  msg.header.size = htons (sizeof (msg));
-  msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_NACK);
-  msg.channel_id = htonl (id);
-  GNUNET_SERVER_notification_context_unicast (nc,
-                                              c->handle,
-                                              &msg.header,
-                                              GNUNET_NO);
-
-}
-
-
 /**
  * Notify the client that a new incoming channel was created.
  *
@@ -1044,6 +1019,31 @@
 
 
 /**
+ * Build a local channel NACK message and send it to a local client.
+ *
+ * @param c Client to whom send the NACK.
+ * @param id Channel ID to use
+ */
+void
+GML_send_channel_nack (struct MeshClient *c, MESH_ChannelNumber id)
+{
+  struct GNUNET_MESH_LocalAck msg;
+
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "send local nack on %X towards %p\n",
+       id, c);
+
+  msg.header.size = htons (sizeof (msg));
+  msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CHANNEL_NACK);
+  msg.channel_id = htonl (id);
+  GNUNET_SERVER_notification_context_unicast (nc,
+                                              c->handle,
+                                              &msg.header,
+                                              GNUNET_NO);
+
+}
+
+/**
  * Notify a client that a channel is no longer valid.
  *
  * @param c Client.

Modified: gnunet/src/mesh/gnunet-service-mesh_local.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_local.h 2014-01-06 04:47:18 UTC (rev 
31797)
+++ gnunet/src/mesh/gnunet-service-mesh_local.h 2014-01-06 04:47:44 UTC (rev 
31798)
@@ -160,15 +160,6 @@
 GML_send_ack (struct MeshClient *c, MESH_ChannelNumber id);
 
 /**
- * Build a local channel NACK message and send it to a local client.
- *
- * @param c Client to whom send the NACK.
- * @param id Channel ID to use
- */
-void
-GML_send_nack (struct MeshClient *c, MESH_ChannelNumber id);
-
-/**
  * Notify the appropriate client that a new incoming channel was created.
  *
  * @param c Client to notify.
@@ -183,6 +174,15 @@
                          const struct GNUNET_PeerIdentity *peer);
 
 /**
+ * Build a local channel NACK message and send it to a local client.
+ *
+ * @param c Client to whom send the NACK.
+ * @param id Channel ID to use
+ */
+void
+GML_send_channel_nack (struct MeshClient *c, MESH_ChannelNumber id);
+
+/**
  * Notify a client that a channel is no longer valid.
  *
  * @param c Client.
@@ -223,4 +223,4 @@
 
 /* ifndef GNUNET_MESH_SERVICE_LOCAL_H */
 #endif
-/* end of gnunet-mesh-service_LOCAL.h */
\ No newline at end of file
+/* end of gnunet-mesh-service_LOCAL.h */

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2014-01-06 04:47:18 UTC (rev 31797)
+++ gnunet/src/mesh/mesh_api.c  2014-01-06 04:47:44 UTC (rev 31798)
@@ -1146,7 +1146,7 @@
     break;
     /* Notify of a channel disconnection */
   case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY: /* TODO separate(gid 
problem)*/
-  case GNUNET_MESSAGE_TYPE_MESH_LOCAL_NACK:
+  case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_NACK:
     process_channel_destroy (h, (struct GNUNET_MESH_ChannelMessage *) msg);
     break;
   case GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA:




reply via email to

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