/*
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
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.
*/
/**
* @param ch Channel to destroy.
*/
void
-GMCH_destroy (struct CadetChannel *ch);
+GCCH_destroy (struct CadetChannel *ch);
/**
* @return ID used to identify the channel with the remote peer.
*/
CADET_ChannelNumber
-GMCH_get_id (const struct CadetChannel *ch);
+GCCH_get_id (const struct CadetChannel *ch);
/**
* Get the channel tunnel.
*
* @return tunnel of the channel.
*/
-struct CadetTunnel3 *
-GMCH_get_tunnel (const struct CadetChannel *ch);
+struct CadetTunnel *
+GCCH_get_tunnel (const struct CadetChannel *ch);
/**
* Get free buffer space towards the client on a specific channel.
* @return Free buffer space [0 - 64]
*/
unsigned int
-GMCH_get_buffer (struct CadetChannel *ch, int fwd);
+GCCH_get_buffer (struct CadetChannel *ch, int fwd);
/**
* @return #GNUNET_YES if client is allowed to send us data.
*/
int
-GMCH_get_allowed (struct CadetChannel *ch, int fwd);
+GCCH_get_allowed (struct CadetChannel *ch, int fwd);
/**
* @return #GNUNET_YES in case it is.
*/
int
-GMCH_is_origin (struct CadetChannel *ch, int fwd);
+GCCH_is_origin (struct CadetChannel *ch, int fwd);
/**
* Is the destination client for this channel on this peer?
* @return #GNUNET_YES in case it is.
*/
int
-GMCH_is_terminal (struct CadetChannel *ch, int fwd);
+GCCH_is_terminal (struct CadetChannel *ch, int fwd);
/**
* Send an end-to-end ACK message for the most recent in-sequence payload.
* @param fwd Is for FWD traffic? (ACK dest->owner)
*/
void
-GMCH_send_data_ack (struct CadetChannel *ch, int fwd);
+GCCH_send_data_ack (struct CadetChannel *ch, int fwd);
/**
* Notify the destination client that a new incoming channel was created.
* @param ch Channel that was created.
*/
void
-GMCH_send_create (struct CadetChannel *ch);
+GCCH_send_create (struct CadetChannel *ch);
/**
* Allow a client to send us more data, in case it was choked.
* @param fwd Is this about FWD traffic? (Root client).
*/
void
-GMCH_allow_client (struct CadetChannel *ch, int fwd);
+GCCH_allow_client (struct CadetChannel *ch, int fwd);
/**
* Log channel info.
*
* @param ch Channel.
+ * @param level Debug level to use.
*/
void
-GMCH_debug (struct CadetChannel *ch);
+GCCH_debug (struct CadetChannel *ch, enum GNUNET_ErrorType level);
/**
* Handle an ACK given by a client.
* @param fwd Is this a "FWD ACK"? (FWD ACKs are sent by root and go BCK)
*/
void
-GMCH_handle_local_ack (struct CadetChannel *ch, int fwd);
+GCCH_handle_local_ack (struct CadetChannel *ch, int fwd);
/**
* Handle data given by a client.
*
* @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
-GMCH_handle_local_data (struct CadetChannel *ch,
- struct CadetClient *c,
- struct GNUNET_MessageHeader *message,
- int fwd);
+GCCH_handle_local_data (struct CadetChannel *ch,
+ struct CadetClient *c, int fwd,
+ const struct GNUNET_MessageHeader *message,
+ size_t size);
/**
* Handle a channel destroy requested by a client.
* @param is_root Is the request coming from root?
*/
void
-GMCH_handle_local_destroy (struct CadetChannel *ch,
+GCCH_handle_local_destroy (struct CadetChannel *ch,
struct CadetClient *c,
int is_root);
* @return GNUNET_OK if everything went fine, GNUNET_SYSERR otherwise.
*/
int
-GMCH_handle_local_create (struct CadetClient *c,
+GCCH_handle_local_create (struct CadetClient *c,
struct GNUNET_CADET_ChannelMessage *msg);
/**
* #GNUNET_SYSERR if message on a one-ended channel (remote)
*/
void
-GMCH_handle_data (struct CadetChannel *ch,
+GCCH_handle_data (struct CadetChannel *ch,
const struct GNUNET_CADET_Data *msg,
int fwd);
* #GNUNET_SYSERR if message on a one-ended channel (remote)
*/
void
-GMCH_handle_data_ack (struct CadetChannel *ch,
+GCCH_handle_data_ack (struct CadetChannel *ch,
const struct GNUNET_CADET_DataACK *msg,
int fwd);
* @param msg Channel crate message.
*/
struct CadetChannel *
-GMCH_handle_create (struct CadetTunnel3 *t,
+GCCH_handle_create (struct CadetTunnel *t,
const struct GNUNET_CADET_ChannelCreate *msg);
/**
* @param ch Channel.
*/
void
-GMCH_handle_nack (struct CadetChannel *ch);
+GCCH_handle_nack (struct CadetChannel *ch);
/**
* Handler for channel ack messages.
* #GNUNET_SYSERR if message on a one-ended channel (remote)
*/
void
-GMCH_handle_ack (struct CadetChannel *ch,
+GCCH_handle_ack (struct CadetChannel *ch,
const struct GNUNET_CADET_ChannelManage *msg,
int fwd);
* #GNUNET_SYSERR if message on a one-ended channel (remote)
*/
void
-GMCH_handle_destroy (struct CadetChannel *ch,
+GCCH_handle_destroy (struct CadetChannel *ch,
const struct GNUNET_CADET_ChannelManage *msg,
int fwd);
* @param existing_copy This is a retransmission, don't save a copy.
*/
void
-GMCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
+GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
struct CadetChannel *ch, int fwd,
void *existing_copy);
* @return Static string with the channel IDs.
*/
const char *
-GMCH_2s (const struct CadetChannel *ch);
+GCCH_2s (const struct CadetChannel *ch);
#if 0 /* keep Emacsens' auto-indent happy */