pass only CadetTunnelAxolotl if it suffices, preparation for having ambiguous KX...
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet-new_tunnels.h
index 78c3cb6bb9acb981fcd04dfb0dd543ffae8ba73c..463780686b9000d1b47b41958e0758ef94068f06 100644 (file)
@@ -98,19 +98,40 @@ struct CadetTunnel *
 GCT_create_tunnel (struct CadetPeer *destination);
 
 
+/**
+ * Destroys the tunnel @a t now, without delay. Used during shutdown.
+ *
+ * @param t tunnel to destroy
+ */
+void
+GCT_destroy_tunnel_now (struct CadetTunnel *t);
+
+
 /**
  * Add a @a connection to the @a tunnel.
  *
  * @param t a tunnel
  * @param cid connection identifer to use for the connection
  * @param path path to use for the connection
+ * @return #GNUNET_OK on success,
+ *         #GNUNET_SYSERR on failure (duplicate connection)
  */
-void
+int
 GCT_add_inbound_connection (struct CadetTunnel *t,
                             const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid,
                             struct CadetPeerPath *path);
 
 
+/**
+ * We lost a connection, remove it from our list and clean up
+ * the connection object itself.
+ *
+ * @param ct binding of connection to tunnel of the connection that was lost.
+ */
+void
+GCT_connection_lost (struct CadetTConnection *ct);
+
+
 /**
  * Return the peer to which this tunnel goes.
  *
@@ -152,23 +173,23 @@ GCT_add_channel (struct CadetTunnel *t,
  *
  * @param t Tunnel.
  * @param ch Channel
- * @param gid unique number identifying @a ch within @a t
+ * @param ctn unique number identifying @a ch within @a t
  */
 void
 GCT_remove_channel (struct CadetTunnel *t,
                     struct CadetChannel *ch,
-                    struct GNUNET_CADET_ChannelTunnelNumber gid);
+                    struct GNUNET_CADET_ChannelTunnelNumber ctn);
 
 
 /**
  * Send a DESTROY message via the tunnel.
  *
  * @param t the tunnel to transmit over
- * @param chid ID of the channel to destroy
+ * @param ctn ID of the channel to destroy
  */
 void
 GCT_send_channel_destroy (struct CadetTunnel *t,
-                          struct GNUNET_CADET_ChannelTunnelNumber chid);
+                          struct GNUNET_CADET_ChannelTunnelNumber ctn);
 
 
 /**