refactor DHT for new service API
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet_channel.h
index a472669c5b5ab9b9ee7a61963c51db24ba9dcf16..eeea02712f098311440c1a9cd783d03590e85628 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.
 */
 
 /**
@@ -79,7 +79,7 @@ GCCH_get_id (const struct CadetChannel *ch);
  *
  * @return tunnel of the channel.
  */
-struct CadetTunnel3 *
+struct CadetTunnel *
 GCCH_get_tunnel (const struct CadetChannel *ch);
 
 /**
@@ -160,9 +160,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.
@@ -184,16 +185,17 @@ GCCH_handle_local_ack (struct CadetChannel *ch, int fwd);
  *
  * @param ch Channel.
  * @param c Client which sent the data.
- * @param message Message.
  * @param fwd Is this a FWD data?
+ * @param message Data message.
+ * @param size Size of data.
  *
  * @return GNUNET_OK if everything goes well, GNUNET_SYSERR in case of en error.
  */
 int
 GCCH_handle_local_data (struct CadetChannel *ch,
-                        struct CadetClient *c,
-                        struct GNUNET_MessageHeader *message,
-                        int fwd);
+                        struct CadetClient *c, int fwd,
+                        const struct GNUNET_MessageHeader *message,
+                        size_t size);
 
 /**
  * Handle a channel destroy requested by a client.
@@ -209,6 +211,7 @@ GCCH_handle_local_destroy (struct CadetChannel *ch,
                            struct CadetClient *c,
                            int is_root);
 
+
 /**
  * Handle a channel create requested by a client.
  *
@@ -217,11 +220,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_ChannelCreateMessage *msg);
 
 /**
  * Handler for cadet network payload traffic.
@@ -238,6 +241,7 @@ GCCH_handle_data (struct CadetChannel *ch,
                   const struct GNUNET_CADET_Data *msg,
                   int fwd);
 
+
 /**
  * Handler for cadet network traffic end-to-end ACKs.
  *
@@ -253,6 +257,7 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
                       const struct GNUNET_CADET_DataACK *msg,
                       int fwd);
 
+
 /**
  * Handler for channel create messages.
  *
@@ -262,9 +267,10 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
  * @param msg Channel crate message.
  */
 struct CadetChannel *
-GCCH_handle_create (struct CadetTunnel3 *t,
+GCCH_handle_create (struct CadetTunnel *t,
                     const struct GNUNET_CADET_ChannelCreate *msg);
 
+
 /**
  * Handler for channel NACK messages.
  *
@@ -275,6 +281,7 @@ GCCH_handle_create (struct CadetTunnel3 *t,
 void
 GCCH_handle_nack (struct CadetChannel *ch);
 
+
 /**
  * Handler for channel ack messages.
  *
@@ -290,6 +297,7 @@ GCCH_handle_ack (struct CadetChannel *ch,
                  const struct GNUNET_CADET_ChannelManage *msg,
                  int fwd);
 
+
 /**
  * Handler for channel destroy messages.
  *
@@ -305,6 +313,7 @@ GCCH_handle_destroy (struct CadetChannel *ch,
                      const struct GNUNET_CADET_ChannelManage *msg,
                      int fwd);
 
+
 /**
  * Sends an already built message on a channel.
  *
@@ -326,6 +335,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.
  *