-bump name to 97
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_channel.h
index 4886e4a09368712dc70e9565c5d9138302f6572a..5eadd60bd96daf9fac55c03dcf864d71afebb74d 100644 (file)
@@ -37,6 +37,7 @@ extern "C"
 #endif
 #endif
 
+#include "platform.h"
 #include "gnunet_util_lib.h"
 
 /**
@@ -44,6 +45,14 @@ extern "C"
  */
 struct MeshChannel;
 
+/**
+ * Count channels in a DLL.
+ * 
+ * @param head Head of the DLL.
+ */
+unsigned int
+GMCH_count (const struct MeshChannel *head);
+
 /**
  * Send an end-to-end ACK message for the most recent in-sequence payload.
  *
@@ -57,7 +66,7 @@ GMCH_send_ack (struct MeshChannel *ch, int fwd);
 
 /**
  * Send data on a channel.
- * 
+ *
  * If the destination is local, send it to client, otherwise encrypt and
  * send to next hop.
  *
@@ -76,7 +85,7 @@ GMCH_send_data (struct MeshChannel *ch,
  * @param ch Channel that was created.
  */
 void
-GMCH_send_channel_create (struct MeshChannel *ch);
+GMCH_send_create (struct MeshChannel *ch);
 
 
 /**
@@ -86,7 +95,7 @@ GMCH_send_channel_create (struct MeshChannel *ch);
  * @param fwd Forward notification (owner->dest)?
  */
 void
-GMCH_send_channel_destroy (struct MeshChannel *ch, int fwd);
+GMCH_send_destroy (struct MeshChannel *ch, int fwd);
 
 
 /**
@@ -97,6 +106,74 @@ GMCH_send_channel_destroy (struct MeshChannel *ch, int fwd);
 void
 GMCH_debug (struct MeshChannel *ch);
 
+
+/**
+ * Handler for mesh network payload traffic.
+ *
+ * @param t Tunnel on which we got this message.
+ * @param message Unencryted data message.
+ * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
+ */
+void
+GMCH_handle_data (struct MeshTunnel2 *t,
+                  const struct GNUNET_MESH_Data *msg,
+                  int fwd);
+
+
+/**
+ * Handler for mesh network traffic end-to-end ACKs.
+ *
+ * @param t Tunnel on which we got this message.
+ * @param message Data message.
+ * @param fwd Is this a fwd ACK? (dest->orig)
+ */
+void
+GMCH_handle_data_ack (struct MeshTunnel2 *t,
+                      const struct GNUNET_MESH_DataACK *msg,
+                      int fwd);
+
+
+/**
+ * Handler for channel create messages.
+ *
+ * @param t Tunnel this channel is to be created in.
+ * @param msg Message.
+ * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
+ */
+void
+GMCH_handle_create (struct MeshTunnel2 *t,
+                    struct GNUNET_MESH_ChannelCreate *msg,
+                    int fwd);
+
+
+/**
+ * Handler for channel ack messages.
+ *
+ * @param t Tunnel this channel is to be created in.
+ * @param msg Message.
+ * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
+ */
+void
+GMCH_handle_ack (struct MeshTunnel2 *t,
+                 struct GNUNET_MESH_ChannelManage *msg,
+                 int fwd);
+
+
+/**
+ * Handler for channel destroy messages.
+ *
+ * @param t Tunnel this channel is to be destroyed of.
+ * @param msg Message.
+ * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
+ */
+void
+GMCH_handle_destroy (struct MeshTunnel2 *t,
+                     struct GNUNET_MESH_ChannelManage *msg,
+                     int fwd);
+
+
+
+
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif