]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Include session transfer stats into SIGUSR1 dump
authorJan Vales <jan@jvales.net>
Sun, 6 Jan 2013 18:39:30 +0000 (20:39 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 12 Jan 2013 15:51:54 +0000 (17:51 +0200)
Add the RX/TX packets/bytes into each station's SIGUSR1 dump
information.

Signed-off-by: Jan Vales <jan@jvales.net>
hostapd/dump_state.c

index d33e05f7f3bd834a9439974e8f219eef34ff3ec1..fcd98905159c26326dd7ecd1b9e020339f0b332e 100644 (file)
@@ -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,13 @@ 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\n",
+                               data.rx_packets, data.tx_packets,
+                               data.rx_bytes, data.tx_bytes);
+               }
        }
 
 #ifndef CONFIG_NO_RADIUS