#include "gnunet-service-mesh_channel.h"
#include "gnunet-service-mesh_connection.h"
+#include "gnunet-service-mesh_peer.h"
/******************************************************************************/
struct MeshChannel *
GMT_get_channel (struct MeshTunnel3 *t, MESH_ChannelNumber chid);
+/**
+ * Decrypt and demultiplex by message type. Call appropriate handler
+ * for a message
+ * towards a channel of a local tunnel.
+ *
+ * @param t Tunnel this message came on.
+ * @param msgh Message header.
+ * @param fwd Is this message fwd?
+ */
+void
+GMT_handle_encrypted (struct MeshTunnel3 *t,
+ const struct GNUNET_MESH_Encrypted *msg,
+ int fwd);
/**
* Cache a message to be sent once tunnel is online.
MESH_ChannelNumber
GMT_get_next_chid (struct MeshTunnel3 *t);
+/**
+ * Send ACK on one or more connections due to buffer space to the client.
+ *
+ * Iterates all connections of the tunnel and sends ACKs appropriately.
+ *
+ * @param ch Channel which has some free buffer space.
+ * @param fwd Is this in for FWD traffic? (ACK goes dest->root)
+ */
+void
+GMT_send_acks (struct MeshTunnel3 *t, unsigned int buffer, int fwd);
+
/**
* Sends an already built message on a tunnel, encrypting it and
* choosing the best connection.
int
GMT_is_path_used (const struct MeshTunnel3 *t, const struct MeshPeerPath *p);
+/**
+ * Get a cost of a path for a tunnel considering existing connections.
+ *
+ * @param t Tunnel.
+ * @param path Candidate path.
+ *
+ * @return Cost of the path (path length + number of overlapping nodes)
+ */
+unsigned int
+GMT_get_path_cost (const struct MeshTunnel3 *t,
+ const struct MeshPeerPath *path);
+
/**
* Get the static string for the peer this tunnel is directed.
*