summaryrefslogtreecommitdiff
path: root/src/lib/frct.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2018-06-07 23:35:14 +0200
committerSander Vrijders <[email protected]>2018-06-08 10:26:07 +0200
commitb74980761cdcd9a706760ae9a4efb3806ca9bee2 (patch)
tree7619284e1ceb8044c9e5bf1b8fcea6729aead825 /src/lib/frct.c
parent7d51ff3e5a4e42f21c9e5e89e5ea8493b7737161 (diff)
downloadouroboros-b74980761cdcd9a706760ae9a4efb3806ca9bee2.tar.gz
ouroboros-b74980761cdcd9a706760ae9a4efb3806ca9bee2.zip
lib: Add a data qos cube
This adds a data qos cube that is reliable. Reliable qos can be selected by setting the loss parameter of the qosspec to 0. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/lib/frct.c')
-rw-r--r--src/lib/frct.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/frct.c b/src/lib/frct.c
index bcb031c3..00261272 100644
--- a/src/lib/frct.c
+++ b/src/lib/frct.c
@@ -105,7 +105,8 @@ static void frct_fini(void)
timerwheel_destroy(frct.tw);
}
-static struct frcti * frcti_create(int fd)
+static struct frcti * frcti_create(int fd,
+ qoscube_t qc)
{
struct frcti * frcti;
time_t delta_t;
@@ -133,6 +134,9 @@ static struct frcti * frcti_create(int fd)
delta_t = (frcti->mpl + frcti->a + frcti->r) / 1000;
+ if (qc == QOS_CUBE_DATA)
+ frcti->snd_cr.cflags |= FRCTFRTX;
+
frcti->snd_cr.conf = true;
frcti->snd_cr.inact = 3 * delta_t + 1;
frcti->snd_cr.act = now.tv_sec - (frcti->snd_cr.inact + 1);
@@ -317,6 +321,9 @@ static int __frcti_snd(struct frcti * frcti,
pci->seqno = hton32(snd_cr->seqno++);
if (!(snd_cr->cflags & FRCTFRTX))
snd_cr->lwe++;
+ else
+ /* TODO: update on ACK */
+ snd_cr->lwe++;
snd_cr->act = now.tv_sec;
snd_cr->conf = false;