From c26189c117d604481d8b9ba249fce4dec1b8bf07 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Sun, 25 Sep 2016 14:49:43 +0200 Subject: [PATCH] Display network counters in ifconfig --- programs/ifconfig/src/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/programs/ifconfig/src/main.cpp b/programs/ifconfig/src/main.cpp index 9ea64902..abdffd3a 100644 --- a/programs/ifconfig/src/main.cpp +++ b/programs/ifconfig/src/main.cpp @@ -67,6 +67,14 @@ int main(int /*argc*/, char* /*argv*/[]){ } tlib::printf("%10s driver %s\n", "", driver.c_str()); + + auto rx_packets = read_file(base_path + entry_name + "/rx_packets"); + auto rx_bytes = read_file(base_path + entry_name + "/rx_bytes"); + auto tx_packets = read_file(base_path + entry_name + "/tx_packets"); + auto tx_bytes = read_file(base_path + entry_name + "/tx_bytes"); + + tlib::printf("%10s rx packets %s bytes %s\n", "", rx_packets.c_str(), rx_bytes.c_str()); + tlib::printf("%10s tx packets %s bytes %s\n", "", tx_packets.c_str(), tx_bytes.c_str()); } }