/*
This file is part of GNUnet.
- Copyright (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
*/
enum CadetTunnelCState
{
- /**
- * Uninitialized status, should never appear in operation.
- */
+ /**
+ * Uninitialized status, should never appear in operation.
+ */
CADET_TUNNEL_NEW,
- /**
- * No path to the peer known yet.
- */
+ /**
+ * No path to the peer known yet.
+ */
CADET_TUNNEL_SEARCHING,
- /**
- * Request sent, not yet answered.
- */
+ /**
+ * Request sent, not yet answered.
+ */
CADET_TUNNEL_WAITING,
- /**
- * Peer connected and ready to accept data.
- */
+ /**
+ * Peer connected and ready to accept data.
+ */
CADET_TUNNEL_READY,
/**
CADET_TUNNEL_KEY_SENT,
/**
- * New ephemeral key and ping sent, waiting for pong.
+ * In OTR: New ephemeral key and ping sent, waiting for pong.
+ *
* This means that we DO have the peer's ephemeral key, otherwise the
* state would be KEY_SENT. We DO NOT have a valid session key (either no
* previous key or previous key expired).
+ *
+ *
+ * In Axolotl: Key sent and received but no deciphered traffic yet.
+ *
+ * This means that we can send traffic (otherwise we would never complete
+ * the handshake), but we don't have complete confirmation. Since the first
+ * traffic MUST be a complete channel creation 3-way handshake, no payload
+ * will be sent before confirmation.
*/
CADET_TUNNEL_KEY_PING,
* @param type Type of message sent.
* @param size Size of the message.
*/
-typedef void (*GCT_sent) (void *cls,
- struct CadetTunnel *t,
- struct CadetTunnelQueue *q,
- uint16_t type, size_t size);
+typedef void
+(*GCT_sent) (void *cls,
+ struct CadetTunnel *t,
+ struct CadetTunnelQueue *q,
+ uint16_t type, size_t size);
+
+typedef void
+(*GCT_conn_iter) (void *cls, struct CadetConnection *c);
-typedef void (*GCT_conn_iter) (void *cls, struct CadetConnection *c);
-typedef void (*GCT_chan_iter) (void *cls, struct CadetChannel *ch);
+
+typedef void
+(*GCT_chan_iter) (void *cls, struct CadetChannel *ch);
/******************************************************************************/
GCT_cancel (struct CadetTunnelQueue *q);
+/**
+ * Check if the tunnel has queued traffic.
+ *
+ * @param t Tunnel to check.
+ *
+ * @return #GNUNET_YES if there is queued traffic
+ * #GNUNET_NO otherwise
+ */
+int
+GCT_has_queued_traffic (struct CadetTunnel *t);
+
/**
* Sends an already built message on a tunnel, encrypting it and
* choosing the best connection.
GCT_send_ax_kx (struct CadetTunnel *t, int force_reply);
-/**
- * Sends an already built and encrypted message on a tunnel, choosing the best
- * connection. Useful for re-queueing messages queued on a destroyed connection.
- *
- * @param message Message to send. Function modifies it.
- * @param t Tunnel on which this message is transmitted.
- */
-void
-GCT_resend_message (const struct GNUNET_MessageHeader *message,
- struct CadetTunnel *t);
-
-
/**
* Is the tunnel directed towards the local peer?
*