trying to make KX logic slightly more readable
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet_channel.h
index fb71b95bed0cfbd328990d15fd1411f11c449189..9d4893269737b98cf3adbe9fa8aaaf27a4932545 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -69,9 +69,10 @@ GCCH_destroy (struct CadetChannel *ch);
  *
  * @return ID used to identify the channel with the remote peer.
  */
-CADET_ChannelNumber
+struct GNUNET_CADET_ChannelTunnelNumber
 GCCH_get_id (const struct CadetChannel *ch);
 
+
 /**
  * Get the channel tunnel.
  *
@@ -82,6 +83,7 @@ GCCH_get_id (const struct CadetChannel *ch);
 struct CadetTunnel *
 GCCH_get_tunnel (const struct CadetChannel *ch);
 
+
 /**
  * Get free buffer space towards the client on a specific channel.
  *
@@ -160,9 +162,10 @@ GCCH_allow_client (struct CadetChannel *ch, int fwd);
  * Log channel info.
  *
  * @param ch Channel.
+ * @param level Debug level to use.
  */
 void
-GCCH_debug (struct CadetChannel *ch);
+GCCH_debug (struct CadetChannel *ch, enum GNUNET_ErrorType level);
 
 /**
  * Handle an ACK given by a client.
@@ -210,6 +213,7 @@ GCCH_handle_local_destroy (struct CadetChannel *ch,
                            struct CadetClient *c,
                            int is_root);
 
+
 /**
  * Handle a channel create requested by a client.
  *
@@ -218,11 +222,11 @@ GCCH_handle_local_destroy (struct CadetChannel *ch,
  * @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.
+ * @return #GNUNET_OK if everything went fine, #GNUNET_SYSERR otherwise.
  */
 int
 GCCH_handle_local_create (struct CadetClient *c,
-                          struct GNUNET_CADET_ChannelMessage *msg);
+                          struct GNUNET_CADET_LocalChannelCreateMessage *msg);
 
 /**
  * Handler for cadet network payload traffic.
@@ -236,9 +240,10 @@ GCCH_handle_local_create (struct CadetClient *c,
  */
 void
 GCCH_handle_data (struct CadetChannel *ch,
-                  const struct GNUNET_CADET_Data *msg,
+                  const struct GNUNET_CADET_ChannelAppDataMessage *msg,
                   int fwd);
 
+
 /**
  * Handler for cadet network traffic end-to-end ACKs.
  *
@@ -251,9 +256,10 @@ GCCH_handle_data (struct CadetChannel *ch,
  */
 void
 GCCH_handle_data_ack (struct CadetChannel *ch,
-                      const struct GNUNET_CADET_DataACK *msg,
+                      const struct GNUNET_CADET_ChannelDataAckMessage *msg,
                       int fwd);
 
+
 /**
  * Handler for channel create messages.
  *
@@ -264,7 +270,8 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
  */
 struct CadetChannel *
 GCCH_handle_create (struct CadetTunnel *t,
-                    const struct GNUNET_CADET_ChannelCreate *msg);
+                    const struct GNUNET_CADET_ChannelOpenMessage *msg);
+
 
 /**
  * Handler for channel NACK messages.
@@ -276,6 +283,7 @@ GCCH_handle_create (struct CadetTunnel *t,
 void
 GCCH_handle_nack (struct CadetChannel *ch);
 
+
 /**
  * Handler for channel ack messages.
  *
@@ -288,9 +296,10 @@ GCCH_handle_nack (struct CadetChannel *ch);
  */
 void
 GCCH_handle_ack (struct CadetChannel *ch,
-                 const struct GNUNET_CADET_ChannelManage *msg,
+                 const struct GNUNET_CADET_ChannelManageMessage *msg,
                  int fwd);
 
+
 /**
  * Handler for channel destroy messages.
  *
@@ -303,9 +312,10 @@ GCCH_handle_ack (struct CadetChannel *ch,
  */
 void
 GCCH_handle_destroy (struct CadetChannel *ch,
-                     const struct GNUNET_CADET_ChannelManage *msg,
+                     const struct GNUNET_CADET_ChannelManageMessage *msg,
                      int fwd);
 
+
 /**
  * Sends an already built message on a channel.
  *
@@ -327,6 +337,7 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
                             struct CadetChannel *ch, int fwd,
                             void *existing_copy);
 
+
 /**
  * Get the static string for identification of the channel.
  *
@@ -338,6 +349,8 @@ const char *
 GCCH_2s (const struct CadetChannel *ch);
 
 
+
+
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif