From 00f18733d860621b467661a713a9714dc2b8a7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Sat, 5 Oct 2019 09:46:14 +0000 Subject: [PATCH] Compute loss for each path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud.c | 3 +++ mud.h | 1 + 2 files changed, 4 insertions(+) diff --git a/mud.c b/mud.c index 1d72e5a..e248570 100644 --- a/mud.c +++ b/mud.c @@ -1246,6 +1246,9 @@ mud_update_window(struct mud *mud, struct mud_path *path, uint64_t send_dt, uint64_t send_bytes, uint64_t recv_dt, uint64_t recv_bytes) { + if (send_bytes && send_bytes >= recv_bytes) + path->loss = (send_bytes - recv_bytes) * 100 / send_bytes; + // TODO } diff --git a/mud.h b/mud.h index c214d71..efd5dcc 100644 --- a/mud.h +++ b/mud.h @@ -36,6 +36,7 @@ struct mud_path { uint64_t window; uint64_t window_time; uint64_t window_size; + uint64_t loss; struct { size_t min; size_t max;