- add underlay api implementation
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_peer.h
index f3082543f30edd0675ab3dbc309e0b983976c45b..58386c0aa0f71502a6aecab286883dde60f9be13 100644 (file)
@@ -45,6 +45,11 @@ extern "C"
  */
 struct MeshPeer;
 
+/**
+ * Struct containing info about a queued transmission to this peer
+ */
+struct MeshPeerQueue;
+
 #include "gnunet-service-mesh_connection.h"
 
 /**
@@ -114,6 +119,16 @@ GMP_get_short (const GNUNET_PEER_Id peer);
 void
 GMP_connect (struct MeshPeer *peer);
 
+/**
+ * Free a transmission that was already queued with all resources
+ * associated to the request.
+ *
+ * @param queue Queue handler to cancel.
+ * @param clear_cls Is it necessary to free associated cls?
+ */
+void
+GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls);
+
 /**
  * @brief Queue and pass message to core when possible.
  *
@@ -126,8 +141,11 @@ GMP_connect (struct MeshPeer *peer);
  * @param fwd Is this a message going root->dest? (FWD ACK are NOT FWD!)
  * @param cont Continuation to be called once CORE has taken the message.
  * @param cont_cls Closure for @c cont.
+ *
+ * @return Handle to cancel the message before it is sent. Once cont is called
+ *         message has been sent and therefore the handle is no longer valid.
  */
-void
+struct MeshPeerQueue *
 GMP_queue_add (struct MeshPeer *peer, void *cls, uint16_t type, size_t size,
                struct MeshConnection *c, int fwd,
                GMP_sent cont, void *cont_cls);
@@ -159,7 +177,7 @@ GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel3 *t);
  *
  * @param peer Peer to check.
  *
- * @return GNUNET_YES if there is a direct connection.
+ * @return #GNUNET_YES if there is a direct connection.
  */
 int
 GMP_is_neighbor (const struct MeshPeer *peer);