- add PID getter
authorBart Polot <bart@net.in.tum.de>
Wed, 7 May 2014 10:42:47 +0000 (10:42 +0000)
committerBart Polot <bart@net.in.tum.de>
Wed, 7 May 2014 10:42:47 +0000 (10:42 +0000)
src/mesh/gnunet-service-mesh_connection.c
src/mesh/gnunet-service-mesh_connection.h

index ebd3388efde3292329f06ff2abd4ad54d0163451..b043615edfa41e9649d151c17d8d43a7159f33ab 100644 (file)
@@ -2703,6 +2703,25 @@ GMC_get_qn (struct MeshConnection *c, int fwd)
 }
 
 
+/**
+ * Get next PID to use.
+ *
+ * @param c Connection.
+ * @param fwd Is query about FWD traffic?
+ *
+ * @return Last PID used + 1.
+ */
+unsigned int
+GMC_get_pid (struct MeshConnection *c, int fwd)
+{
+  struct MeshFlowControl *fc;
+
+  fc = fwd ? &c->fwd_fc : &c->bck_fc;
+
+  return fc->last_pid_sent + 1;
+}
+
+
 /**
  * Allow the connection to advertise a buffer of the given size.
  *
index b97f61194c86a70b3dfa3951bd933b3c928a7533..78d807817d62aca5ce15602741eec986bfd7d6f2 100644 (file)
@@ -367,6 +367,17 @@ GMC_get_allowed (struct MeshConnection *c, int fwd);
 unsigned int
 GMC_get_qn (struct MeshConnection *c, int fwd);
 
+/**
+ * Get next PID to use.
+ *
+ * @param c Connection.
+ * @param fwd Is query about FWD traffic?
+ *
+ * @return Last PID used + 1.
+ */
+unsigned int
+GMC_get_pid (struct MeshConnection *c, int fwd);
+
 /**
  * Allow the connection to advertise a buffer of the given size.
  *