aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_local.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-01-06 04:47:44 +0000
committerBart Polot <bart@net.in.tum.de>2014-01-06 04:47:44 +0000
commit532ac9a55e3f2f6eaea7f6b6c38cd6a7bdbb3e6a (patch)
tree9936b1433a77faaa7aebc1f8d496a2376e165efc /src/mesh/gnunet-service-mesh_local.c
parentd6f811a963eb257548fbf82a807b234e08bb8eea (diff)
downloadgnunet-532ac9a55e3f2f6eaea7f6b6c38cd6a7bdbb3e6a.tar.gz
gnunet-532ac9a55e3f2f6eaea7f6b6c38cd6a7bdbb3e6a.zip
- refactor channel nack
Diffstat (limited to 'src/mesh/gnunet-service-mesh_local.c')
-rw-r--r--src/mesh/gnunet-service-mesh_local.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c
index f6b4b8149..8fc01f929 100644
--- a/src/mesh/gnunet-service-mesh_local.c
+++ b/src/mesh/gnunet-service-mesh_local.c
@@ -990,31 +990,6 @@ GML_send_ack (struct MeshClient *c, MESH_ChannelNumber id)
990} 990}
991 991
992 992
993/**
994 * Build a local channel NACK message and send it to a local client.
995 *
996 * @param c Client to whom send the NACK.
997 * @param id Channel ID to use
998 */
999void
1000GML_send_nack (struct MeshClient *c, MESH_ChannelNumber id)
1001{
1002 struct GNUNET_MESH_LocalAck msg;
1003
1004 LOG (GNUNET_ERROR_TYPE_DEBUG,
1005 "send local nack on %X towards %p\n",
1006 id, c);
1007
1008 msg.header.size = htons (sizeof (msg));
1009 msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_NACK);
1010 msg.channel_id = htonl (id);
1011 GNUNET_SERVER_notification_context_unicast (nc,
1012 c->handle,
1013 &msg.header,
1014 GNUNET_NO);
1015
1016}
1017
1018 993
1019/** 994/**
1020 * Notify the client that a new incoming channel was created. 995 * Notify the client that a new incoming channel was created.
@@ -1044,6 +1019,31 @@ GML_send_channel_create (struct MeshClient *c,
1044 1019
1045 1020
1046/** 1021/**
1022 * Build a local channel NACK message and send it to a local client.
1023 *
1024 * @param c Client to whom send the NACK.
1025 * @param id Channel ID to use
1026 */
1027void
1028GML_send_channel_nack (struct MeshClient *c, MESH_ChannelNumber id)
1029{
1030 struct GNUNET_MESH_LocalAck msg;
1031
1032 LOG (GNUNET_ERROR_TYPE_DEBUG,
1033 "send local nack on %X towards %p\n",
1034 id, c);
1035
1036 msg.header.size = htons (sizeof (msg));
1037 msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CHANNEL_NACK);
1038 msg.channel_id = htonl (id);
1039 GNUNET_SERVER_notification_context_unicast (nc,
1040 c->handle,
1041 &msg.header,
1042 GNUNET_NO);
1043
1044}
1045
1046/**
1047 * Notify a client that a channel is no longer valid. 1047 * Notify a client that a channel is no longer valid.
1048 * 1048 *
1049 * @param c Client. 1049 * @param c Client.