aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_local.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-10-09 08:57:48 +0000
committerBart Polot <bart@net.in.tum.de>2013-10-09 08:57:48 +0000
commit3e1aab2cd192e4f8d3853b2841254080359e3c12 (patch)
treeb1262f17f2d26f22fb8b51e19d7eac2b770f1097 /src/mesh/gnunet-service-mesh_local.c
parent09e50aa17f458bc9ea5d2e7c787bce962f778d7c (diff)
downloadgnunet-3e1aab2cd192e4f8d3853b2841254080359e3c12.tar.gz
gnunet-3e1aab2cd192e4f8d3853b2841254080359e3c12.zip
- move get channel to local
Diffstat (limited to 'src/mesh/gnunet-service-mesh_local.c')
-rw-r--r--src/mesh/gnunet-service-mesh_local.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c
index e7a30df0f..9d7db28bc 100644
--- a/src/mesh/gnunet-service-mesh_local.c
+++ b/src/mesh/gnunet-service-mesh_local.c
@@ -848,6 +848,27 @@ GML_shutdown (void)
848 } 848 }
849} 849}
850 850
851/**
852 * Get a chennel from a client
853 *
854 * @param c the client to check
855 * @param chid Channel ID, must be local (> 0x800...)
856 *
857 * @return non-NULL if channel exists in the clients lists
858 */
859struct MeshChannel *
860GML_channel_get (struct MeshClient *c, MESH_ChannelNumber chid)
861{
862 if (0 == (chid & GNUNET_MESH_LOCAL_CHANNEL_ID_CLI))
863 {
864 GNUNET_break_op (0);
865 LOG (GNUNET_ERROR_TYPE_DEBUG, "CHID %X not a local chid\n", chid);
866 return NULL;
867 }
868 if (chid >= GNUNET_MESH_LOCAL_CHANNEL_ID_SERV)
869 return GNUNET_CONTAINER_multihashmap32_get (c->incoming_channels, chid);
870 return GNUNET_CONTAINER_multihashmap32_get (c->own_channels, chid);
871}
851 872
852/** 873/**
853 * Check if client has registered with the service and has not disconnected 874 * Check if client has registered with the service and has not disconnected