summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast/ca.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/unicast/ca.c')
-rw-r--r--src/ipcpd/unicast/ca.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/ipcpd/unicast/ca.c b/src/ipcpd/unicast/ca.c
index f93d0504..a1751672 100644
--- a/src/ipcpd/unicast/ca.c
+++ b/src/ipcpd/unicast/ca.c
@@ -1,10 +1,10 @@
/*
- * Ouroboros - Copyright (C) 2016 - 2020
+ * Ouroboros - Copyright (C) 2016 - 2026
*
* Congestion Avoidance
*
- * Dimitri Staessens <dimitri.staessens@ugent.be>
- * Sander Vrijders <sander.vrijders@ugent.be>
+ * Dimitri Staessens <dimitri@ouroboros.rocks>
+ * Sander Vrijders <sander@ouroboros.rocks>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -25,12 +25,10 @@
#include <ouroboros/logs.h>
#include "ca.h"
-#include "pol-ca-ops.h"
-#include "pol/ca-mb-ecn.h"
-#include "pol/ca-nop.h"
+#include "ca/pol.h"
struct {
- struct pol_ca_ops * ops;
+ struct ca_ops * ops;
} ca;
int ca_init(enum pol_cong_avoid pol)
@@ -51,7 +49,6 @@ int ca_init(enum pol_cong_avoid pol)
return 0;
}
-
void ca_fini(void)
{
ca.ops = NULL;
@@ -92,8 +89,20 @@ void ca_wnd_wait(ca_wnd_t wnd)
return ca.ops->wnd_wait(wnd);
}
-uint8_t ca_calc_ecn(int fd,
- size_t len)
+int ca_calc_ecn(int fd,
+ uint8_t * ecn,
+ qoscube_t qc,
+ size_t len)
{
- return ca.ops->calc_ecn(fd, len);
+ return ca.ops->calc_ecn(fd, ecn, qc, len);
+}
+
+ssize_t ca_print_stats(void * ctx,
+ char * buf,
+ size_t len)
+{
+ if (ca.ops->print_stats == NULL)
+ return 0;
+
+ return ca.ops->print_stats(ctx, buf, len);
}