- debug
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_connection.h
index b55d55fe6e9f5275a5fa251d1f2cc94864c58218..3fecf3b63276a24445dbeb885ddcbde7e4f4b4a7 100644 (file)
@@ -136,7 +136,7 @@ GMC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
                     const struct GNUNET_MessageHeader *message);
 
 /**
- * Core handler for mesh network traffic going orig->dest.
+ * Core handler for encrypted mesh network traffic (channel mgmt, data).
  *
  * @param cls Closure (unused).
  * @param message Message received.
@@ -146,23 +146,8 @@ GMC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 int
-GMC_handle_fwd (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_MessageHeader *message);
-
-
-/**
- * Core handler for mesh network traffic going dest->orig.
- *
- * @param cls Closure (unused).
- * @param message Message received.
- * @param peer Peer who sent the message.
- *
- * @return GNUNET_OK to keep the connection open,
- *         GNUNET_SYSERR to close it (signal serious error)
- */
-int
-GMC_handle_bck (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_MessageHeader *message);
+GMC_handle_encrypted (void *cls, const struct GNUNET_PeerIdentity *peer,
+                      const struct GNUNET_MessageHeader *message);
 
 /**
  * Core handler for mesh network traffic point-to-point acks.
@@ -305,6 +290,17 @@ GMC_get_tunnel (const struct MeshConnection *c);
 unsigned int
 GMC_get_buffer (struct MeshConnection *c, int fwd);
 
+/**
+ * Get how many messages have we allowed to send to us from a direction..
+ *
+ * @param c Connection.
+ * @param fwd Are we asking about traffic from FWD (BCK messages)?
+ *
+ * @return last_ack_sent - last_pid_recv
+ */
+unsigned int
+GMC_get_allowed (struct MeshConnection *c, int fwd);
+
 /**
  * Get messages queued in a connection.
  *
@@ -316,6 +312,19 @@ GMC_get_buffer (struct MeshConnection *c, int fwd);
 unsigned int
 GMC_get_qn (struct MeshConnection *c, int fwd);
 
+/**
+ * Allow the connection to advertise a buffer of the given size.
+ *
+ * The connection will send an @c fwd ACK message (so: in direction !fwd)
+ * allowing up to last_pid_recv + buffer.
+ *
+ * @param c Connection.
+ * @param buffer How many more messages the connection can accept.
+ * @param fwd Is this about FWD traffic? (The ack will go dest->root).
+ */
+void
+GMC_allow (struct MeshConnection *c, unsigned int buffer, int fwd);
+
 /**
  * Send FWD keepalive packets for a connection.
  *