diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-05-07 10:42:47 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-05-07 10:42:47 +0000 |
commit | ee677929b0582716e218bb97e4d7f7aca5bf8bb8 (patch) | |
tree | 5a4d776714e50c6da041977cc4b678bc41bd2fde /src | |
parent | 4ef6d2d4498d015bec1e2375acfd7caefccbfe1a (diff) | |
download | gnunet-ee677929b0582716e218bb97e4d7f7aca5bf8bb8.tar.gz gnunet-ee677929b0582716e218bb97e4d7f7aca5bf8bb8.zip |
- add PID getter
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 19 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.h | 11 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index ebd3388ef..b043615ed 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c | |||
@@ -2704,6 +2704,25 @@ GMC_get_qn (struct MeshConnection *c, int fwd) | |||
2704 | 2704 | ||
2705 | 2705 | ||
2706 | /** | 2706 | /** |
2707 | * Get next PID to use. | ||
2708 | * | ||
2709 | * @param c Connection. | ||
2710 | * @param fwd Is query about FWD traffic? | ||
2711 | * | ||
2712 | * @return Last PID used + 1. | ||
2713 | */ | ||
2714 | unsigned int | ||
2715 | GMC_get_pid (struct MeshConnection *c, int fwd) | ||
2716 | { | ||
2717 | struct MeshFlowControl *fc; | ||
2718 | |||
2719 | fc = fwd ? &c->fwd_fc : &c->bck_fc; | ||
2720 | |||
2721 | return fc->last_pid_sent + 1; | ||
2722 | } | ||
2723 | |||
2724 | |||
2725 | /** | ||
2707 | * Allow the connection to advertise a buffer of the given size. | 2726 | * Allow the connection to advertise a buffer of the given size. |
2708 | * | 2727 | * |
2709 | * The connection will send an @c fwd ACK message (so: in direction !fwd) | 2728 | * The connection will send an @c fwd ACK message (so: in direction !fwd) |
diff --git a/src/mesh/gnunet-service-mesh_connection.h b/src/mesh/gnunet-service-mesh_connection.h index b97f61194..78d807817 100644 --- a/src/mesh/gnunet-service-mesh_connection.h +++ b/src/mesh/gnunet-service-mesh_connection.h | |||
@@ -368,6 +368,17 @@ unsigned int | |||
368 | GMC_get_qn (struct MeshConnection *c, int fwd); | 368 | GMC_get_qn (struct MeshConnection *c, int fwd); |
369 | 369 | ||
370 | /** | 370 | /** |
371 | * Get next PID to use. | ||
372 | * | ||
373 | * @param c Connection. | ||
374 | * @param fwd Is query about FWD traffic? | ||
375 | * | ||
376 | * @return Last PID used + 1. | ||
377 | */ | ||
378 | unsigned int | ||
379 | GMC_get_pid (struct MeshConnection *c, int fwd); | ||
380 | |||
381 | /** | ||
371 | * Allow the connection to advertise a buffer of the given size. | 382 | * Allow the connection to advertise a buffer of the given size. |
372 | * | 383 | * |
373 | * The connection will send an @c fwd ACK message (so: in direction !fwd) | 384 | * The connection will send an @c fwd ACK message (so: in direction !fwd) |