From 2352e93059e55bc76ff65a0732bd45213e58b2f8 Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Tue, 7 Apr 2026 10:03:18 -0500 Subject: [PATCH] WIP: Add JUST the upload/download bytes fields to the throughput map. --- src/rust/lqos_sys/src/bpf/common/throughput.h | 2 ++ src/rust/lqos_sys/src/throughput.rs | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rust/lqos_sys/src/bpf/common/throughput.h b/src/rust/lqos_sys/src/bpf/common/throughput.h index 3312d44b..cd7bb395 100644 --- a/src/rust/lqos_sys/src/bpf/common/throughput.h +++ b/src/rust/lqos_sys/src/bpf/common/throughput.h @@ -12,6 +12,8 @@ struct host_counter { __u64 download_bytes; __u64 upload_bytes; + __u64 actual_download_bytes; + __u64 actual_upload_bytes; __u64 download_packets; __u64 upload_packets; __u64 tcp_download_packets; diff --git a/src/rust/lqos_sys/src/throughput.rs b/src/rust/lqos_sys/src/throughput.rs index 878eb5d5..347f66ba 100644 --- a/src/rust/lqos_sys/src/throughput.rs +++ b/src/rust/lqos_sys/src/throughput.rs @@ -11,6 +11,12 @@ pub struct HostCounter { /// Upload bytes counter (keeps incrementing) pub upload_bytes: u64, + /// Actually transmitted download bytes counter (keeps incrementing) + pub actual_download_bytes: u64, + + /// Actually transmitted upload bytes counter (keeps incrementing) + pub actual_upload_bytes: u64, + /// Download packets counter (keeps incrementing) pub download_packets: u64, @@ -62,6 +68,6 @@ mod test { #[test] fn host_counter_size() { - assert_eq!(std::mem::size_of::(), 112); + assert_eq!(std::mem::size_of::(), 128); } } -- knotmirror 0.0.1