pass only CadetTunnelAxolotl if it suffices, preparation for having ambiguous KX...
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet_local.h
index 6ca79c90da5e63090e9515d03664d1e2cefc3227..113c2f489c3f8285067b549f1bad31bdd4076b8d 100644 (file)
@@ -75,35 +75,36 @@ GML_shutdown (void);
  * Get a channel from a client.
  *
  * @param c Client to check.
- * @param chid Channel ID, must be local (> 0x800...).
+ * @param ccn Channel ID, must be local (> 0x800...).
  *
  * @return non-NULL if channel exists in the clients lists
  */
 struct CadetChannel *
-GML_channel_get (struct CadetClient *c, uint32_t chid);
+GML_channel_get (struct CadetClient *c,
+                 struct GNUNET_CADET_ClientChannelNumber ccn);
 
 /**
  * Add a channel to a client
  *
  * @param client Client.
- * @param chid Channel ID.
+ * @param ccn Channel ID.
  * @param ch Channel.
  */
 void
 GML_channel_add (struct CadetClient *client,
-                 uint32_t chid,
+                 struct GNUNET_CADET_ClientChannelNumber ccn,
                  struct CadetChannel *ch);
 
 /**
  * Remove a channel from a client
  *
  * @param client Client.
- * @param chid Channel ID.
+ * @param ccn Channel ID.
  * @param ch Channel.
  */
 void
 GML_channel_remove (struct CadetClient *client,
-                    uint32_t chid,
+                    struct GNUNET_CADET_ClientChannelNumber ccn,
                     struct CadetChannel *ch);
 
 /**
@@ -113,8 +114,8 @@ GML_channel_remove (struct CadetClient *client,
  *
  * @return LID of a channel free to use.
  */
-CADET_ChannelNumber
-GML_get_next_chid (struct CadetClient *c);
+struct GNUNET_CADET_ClientChannelNumber
+GML_get_next_ccn (struct CadetClient *c);
 
 /**
  * Check if client has registered with the service and has not disconnected
@@ -134,7 +135,7 @@ GML_client_get (struct GNUNET_SERVER_Client *client);
  * @return non-NULL if a client has the port.
  */
 struct CadetClient *
-GML_client_get_by_port (uint32_t port);
+GML_client_get_by_port (const struct GNUNET_HashCode *port);
 
 /**
  * Deletes a tunnel from a client (either owner or destination).
@@ -146,7 +147,7 @@ GML_client_get_by_port (uint32_t port);
 void
 GML_client_delete_channel (struct CadetClient *c,
                            struct CadetChannel *ch,
-                           CADET_ChannelNumber id);
+                           struct GNUNET_CADET_ClientChannelNumber id);
 
 /**
  * Build a local ACK message and send it to a local client, if needed.
@@ -157,7 +158,8 @@ GML_client_delete_channel (struct CadetClient *c,
  * @param id Channel ID to use
  */
 void
-GML_send_ack (struct CadetClient *c, CADET_ChannelNumber id);
+GML_send_ack (struct CadetClient *c,
+              struct GNUNET_CADET_ClientChannelNumber id);
 
 /**
  * Notify the appropriate client that a new incoming channel was created.
@@ -170,7 +172,9 @@ GML_send_ack (struct CadetClient *c, CADET_ChannelNumber id);
  */
 void
 GML_send_channel_create (struct CadetClient *c,
-                         uint32_t id, uint32_t port, uint32_t opt,
+                         struct GNUNET_CADET_ClientChannelNumber id,
+                         const struct GNUNET_HashCode *port,
+                         uint32_t opt,
                          const struct GNUNET_PeerIdentity *peer);
 
 /**
@@ -180,7 +184,9 @@ GML_send_channel_create (struct CadetClient *c,
  * @param id Channel ID to use
  */
 void
-GML_send_channel_nack (struct CadetClient *c, CADET_ChannelNumber id);
+GML_send_channel_nack (struct CadetClient *c,
+                       struct GNUNET_CADET_ClientChannelNumber id);
+
 
 /**
  * Notify a client that a channel is no longer valid.
@@ -189,7 +195,9 @@ GML_send_channel_nack (struct CadetClient *c, CADET_ChannelNumber id);
  * @param id ID of the channel that is destroyed.
  */
 void
-GML_send_channel_destroy (struct CadetClient *c, uint32_t id);
+GML_send_channel_destroy (struct CadetClient *c,
+                          struct GNUNET_CADET_ClientChannelNumber id);
+
 
 /**
  * Modify the cadet message ID from global to local and send to client.
@@ -200,8 +208,8 @@ GML_send_channel_destroy (struct CadetClient *c, uint32_t id);
  */
 void
 GML_send_data (struct CadetClient *c,
-               const struct GNUNET_CADET_Data *msg,
-               CADET_ChannelNumber id);
+               const struct GNUNET_CADET_ChannelAppDataMessage *msg,
+               struct GNUNET_CADET_ClientChannelNumber id);
 
 /**
  * Get the static string to represent a client.