2 This file is part of GNUnet.
3 (C) 2013 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file mesh/gnunet-service-mesh_channel.h
23 * @brief mesh service; dealing with end-to-end channels
24 * @author Bartlomiej Polot
26 * All functions in this file should use the prefix GMCH (Gnunet Mesh CHannel)
29 #ifndef GNUNET_SERVICE_MESH_CHANNEL_H
30 #define GNUNET_SERVICE_MESH_CHANNEL_H
35 #if 0 /* keep Emacsens' auto-indent happy */
41 #include "gnunet_util_lib.h"
44 * Struct containing all information regarding a channel to a remote client.
49 * Send an end-to-end ACK message for the most recent in-sequence payload.
51 * If channel is not reliable, do nothing.
53 * @param ch Channel this is about.
54 * @param fwd Is for FWD traffic? (ACK dest->owner)
57 GMCH_send_ack (struct MeshChannel *ch, int fwd);
60 * Send data on a channel.
62 * If the destination is local, send it to client, otherwise encrypt and
67 * @param fwd Is this a fwd (root->dest) message?
70 GMCH_send_data (struct MeshChannel *ch,
71 const struct GNUNET_MESH_Data *msg,
75 * Notify the destination client that a new incoming channel was created.
77 * @param ch Channel that was created.
80 GMCH_send_create (struct MeshChannel *ch);
84 * Notify a client that the channel is no longer valid.
86 * @param ch Channel that is destroyed.
87 * @param fwd Forward notification (owner->dest)?
90 GMCH_send_destroy (struct MeshChannel *ch, int fwd);
99 GMCH_debug (struct MeshChannel *ch);
103 * Handler for mesh network payload traffic.
105 * @param t Tunnel on which we got this message.
106 * @param message Unencryted data message.
107 * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
110 GMCH_handle_data (struct MeshTunnel2 *t,
111 const struct GNUNET_MESH_Data *msg,
116 * Handler for mesh network traffic end-to-end ACKs.
118 * @param t Tunnel on which we got this message.
119 * @param message Data message.
120 * @param fwd Is this a fwd ACK? (dest->orig)
123 GMCH_handle_data_ack (struct MeshTunnel2 *t,
124 const struct GNUNET_MESH_DataACK *msg,
129 * Handler for channel create messages.
131 * @param t Tunnel this channel is to be created in.
132 * @param msg Message.
133 * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
136 GMCH_handle_create (struct MeshTunnel2 *t,
137 struct GNUNET_MESH_ChannelCreate *msg,
142 * Handler for channel ack messages.
144 * @param t Tunnel this channel is to be created in.
145 * @param msg Message.
146 * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
149 GMCH_handle_ack (struct MeshTunnel2 *t,
150 struct GNUNET_MESH_ChannelManage *msg,
155 * Handler for channel destroy messages.
157 * @param t Tunnel this channel is to be destroyed of.
158 * @param msg Message.
159 * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
162 GMCH_handle_destroy (struct MeshTunnel2 *t,
163 struct GNUNET_MESH_ChannelManage *msg,
169 #if 0 /* keep Emacsens' auto-indent happy */
176 /* ifndef GNUNET_SERVICE_MESH_CHANNEL_H */
178 /* end of gnunet-service-mesh_channel.h */