gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r23384 - gnunet/src/mesh
Date: Thu, 23 Aug 2012 16:37:24 +0200

Author: bartpolot
Date: 2012-08-23 16:37:24 +0200 (Thu, 23 Aug 2012)
New Revision: 23384

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- refactor wip

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-08-23 14:18:32 UTC (rev 
23383)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-08-23 14:37:24 UTC (rev 
23384)
@@ -4355,6 +4355,45 @@
 
 
 /**
+ * @brief Get the next transmittable message from the queue.
+ *
+ * This will be the head, expect in the case of being a data packet
+ * not allowed by the destination peer.
+ *
+ * @param peer Destination peer.
+ *
+ * @return The next viable MeshPeerQueue element to send to that peer.
+ *         NULL when there are no transmittable messages.
+ */
+struct MeshPeerQueue *
+queue_get_next (static struct MeshPeerInfo *peer)
+{
+  struct MeshPeerQueue *q;
+  struct MeshTunnel *t;
+  struct MeshTransmissionDescriptor *info;
+
+  for (q = peer->queue_head; NULL != q; q = q->next)
+  {
+    t = q->tunnel;
+    switch (q->type)
+    {
+      case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
+        info = q->cls;
+        break;
+      case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
+        break;
+      case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
+        break;
+      default:
+        return q;
+    }
+  }
+  // FIXME fc WIP
+  return NULL;
+}
+
+
+/**
   * Core callback to write a queued packet to core buffer
   *
   * @param cls Closure (peer info).




reply via email to

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