- debug
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_channel.h
index e8d10255a6ab4cf9af5e350b36eb35405bc332f3..82d85e5bed41583e08edd22f4818f10aa3c702c0 100644 (file)
@@ -106,17 +106,6 @@ GMCH_is_origin (struct MeshChannel *ch, int fwd);
 int
 GMCH_is_terminal (struct MeshChannel *ch, int fwd);
 
-/**
- * Send an end-to-end ACK message for the most recent in-sequence payload.
- *
- * If channel is not reliable, do nothing.
- *
- * @param ch Channel this is about.
- * @param fwd Is for FWD traffic? (ACK dest->owner)
- */
-void
-GMCH_send_ack (struct MeshChannel *ch, int fwd);
-
 /**
  * Send data on a channel.
  *
@@ -132,6 +121,17 @@ GMCH_send_data (struct MeshChannel *ch,
                 const struct GNUNET_MESH_Data *msg,
                 int fwd);
 
+/**
+ * Send an end-to-end ACK message for the most recent in-sequence payload.
+ *
+ * If channel is not reliable, do nothing.
+ *
+ * @param ch Channel this is about.
+ * @param fwd Is for FWD traffic? (ACK dest->owner)
+ */
+void
+GMCH_send_data_ack (struct MeshChannel *ch, int fwd);
+
 /**
  * Notify the destination client that a new incoming channel was created.
  *
@@ -192,12 +192,24 @@ GMCH_handle_local_data (struct MeshChannel *ch,
  *
  * @param ch Channel.
  * @param c Client that requested the destruction (to avoid notifying him).
- * @param chid Channel ID used.
  */
 void
 GMCH_handle_local_destroy (struct MeshChannel *ch,
-                           struct MeshClient *c,
-                           MESH_ChannelNumber chid);
+                           struct MeshClient *c);
+
+/**
+ * Handle a channel create requested by a client.
+ *
+ * Create the channel and the tunnel in case this was the first0 channel.
+ *
+ * @param c Client that requested the creation (will be the root).
+ * @param msg Create Channel message.
+ *
+ * @return GNUNET_OK if everything went fine, GNUNET_SYSERR otherwise.
+ */
+int
+GMCH_handle_local_create (struct MeshClient *c,
+                          struct GNUNET_MESH_ChannelMessage *msg);
 
 /**
  * Handler for mesh network payload traffic.
@@ -226,12 +238,13 @@ GMCH_handle_data_ack (struct MeshChannel *ch,
 /**
  * Handler for channel create messages.
  *
- * @param t Tunnel this channel is to be created in.
+ * @param t Tunnel this channel will be in.
  * @param msg Message.
  * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
  */
 struct MeshChannel *
-GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg,
+GMCH_handle_create (struct MeshTunnel3 *t,
+                    const struct GNUNET_MESH_ChannelCreate *msg,
                     int fwd);
 
 /**
@@ -275,6 +288,16 @@ void
 GMCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
                             struct MeshChannel *ch, int fwd);
 
+/**
+ * Get the static string for identification of the channel.
+ *
+ * @param ch Channel.
+ *
+ * @return Static string with the channel IDs.
+ */
+const char *
+GMCH_2s (const struct MeshChannel *ch);
+
 
 #if 0                           /* keep Emacsens' auto-indent happy */
 {