Patchwork [v2,2/2] Included session transfer stats (rx/tx packets/bytes) into each station's SIGUSR1-dump.

login
register
mail settings
Submitter Jan Vales
Date Jan. 2, 2013, 1:57 p.m.
Message ID <1357135026-8147-3-git-send-email-jan@jvales.net>
Download mbox | patch
Permalink /patch/209051/
State Accepted
Headers show

Comments

Jan Vales - Jan. 2, 2013, 1:57 p.m.
Signed-off-by: Jan Vales <jan@jvales.net>
---
 hostapd/dump_state.c | 7 +++++++
 1 file changed, 7 insertions(+)
Jouni Malinen - Jan. 6, 2013, 6:41 p.m.
Thanks, I applied a bit cleaned up version into the devel branch.

Patch

diff --git a/hostapd/dump_state.c b/hostapd/dump_state.c
index d33e05f..f221a32 100644
--- a/hostapd/dump_state.c
+++ b/hostapd/dump_state.c
@@ -19,6 +19,7 @@ 
 #include "ap/ap_config.h"
 #include "ap/sta_info.h"
 #include "dump_state.h"
+#include "ap/ap_drv_ops.h"
 
 
 static void fprint_char(FILE *f, char c)
@@ -72,6 +73,7 @@  static void hostapd_dump_state(struct hostapd_data *hapd)
 #ifndef CONFIG_NO_RADIUS
 	char *buf;
 #endif /* CONFIG_NO_RADIUS */
+        struct hostap_sta_driver_data data;
 
 	if (!hapd->conf->dump_log_name) {
 		wpa_printf(MSG_DEBUG, "Dump file not defined - ignoring dump "
@@ -139,6 +141,11 @@  static void hostapd_dump_state(struct hostapd_data *hapd)
 			  "DEAUTH")));
 
 		ieee802_1x_dump_state(f, "  ", sta);
+
+		if (hostapd_drv_read_sta_data(hapd, &data, sta->addr) == 0) {
+			fprintf(f,"  rx_pkt=%lu tx_pkt=%lu\n  rx_byte=%lu tx_byte=%lu",
+				data.rx_packets, data.tx_packets, data.rx_bytes, data.tx_bytes);
+		}
 	}
 
 #ifndef CONFIG_NO_RADIUS