aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-08-23 14:37:24 +0000
committerBart Polot <bart@net.in.tum.de>2012-08-23 14:37:24 +0000
commit5e471d41364b2139abf8c252fedb97d79b0e8e86 (patch)
treeb3a4b975306e86d6035fef117ee59a781e040d8f /src/mesh/gnunet-service-mesh.c
parent6365ce24924e83519b4acca2512a62c4044e63eb (diff)
downloadgnunet-5e471d41364b2139abf8c252fedb97d79b0e8e86.tar.gz
gnunet-5e471d41364b2139abf8c252fedb97d79b0e8e86.zip
- refactor wip
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r--src/mesh/gnunet-service-mesh.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 57ea55b6d..933ce492a 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -4355,6 +4355,45 @@ queue_destroy (struct MeshPeerQueue *queue, int clear_cls)
4355 4355
4356 4356
4357/** 4357/**
4358 * @brief Get the next transmittable message from the queue.
4359 *
4360 * This will be the head, expect in the case of being a data packet
4361 * not allowed by the destination peer.
4362 *
4363 * @param peer Destination peer.
4364 *
4365 * @return The next viable MeshPeerQueue element to send to that peer.
4366 * NULL when there are no transmittable messages.
4367 */
4368struct MeshPeerQueue *
4369queue_get_next (static struct MeshPeerInfo *peer)
4370{
4371 struct MeshPeerQueue *q;
4372 struct MeshTunnel *t;
4373 struct MeshTransmissionDescriptor *info;
4374
4375 for (q = peer->queue_head; NULL != q; q = q->next)
4376 {
4377 t = q->tunnel;
4378 switch (q->type)
4379 {
4380 case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
4381 info = q->cls;
4382 break;
4383 case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
4384 break;
4385 case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
4386 break;
4387 default:
4388 return q;
4389 }
4390 }
4391 // FIXME fc WIP
4392 return NULL;
4393}
4394
4395
4396/**
4358 * Core callback to write a queued packet to core buffer 4397 * Core callback to write a queued packet to core buffer
4359 * 4398 *
4360 * @param cls Closure (peer info). 4399 * @param cls Closure (peer info).