aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-02-18 09:29:45 (GMT)
committerJouni Malinen <j@w1.fi>2009-02-18 09:29:45 (GMT)
commit8807377fe4846533af65f7706c1f901828d8e952 (patch)
tree12bf2ca0a59367c3ac408ed8e988663ae0571a48
parent878ad127ba7c660b8cc551b3dbd1f7ae08129db2 (diff)
downloadhostap-8807377fe4846533af65f7706c1f901828d8e952.zip
hostap-8807377fe4846533af65f7706c1f901828d8e952.tar.gz
hostap-8807377fe4846533af65f7706c1f901828d8e952.tar.bz2
nl80211: Add TX/RX packet counts into accounting information
-rw-r--r--hostapd/driver_nl80211.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hostapd/driver_nl80211.c b/hostapd/driver_nl80211.c
index f09f5b5..b70484d 100644
--- a/hostapd/driver_nl80211.c
+++ b/hostapd/driver_nl80211.c
@@ -690,6 +690,8 @@ static int get_sta_handler(struct nl_msg *msg, void *arg)
[NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32 },
[NL80211_STA_INFO_RX_BYTES] = { .type = NLA_U32 },
[NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32 },
+ [NL80211_STA_INFO_RX_PACKETS] = { .type = NLA_U32 },
+ [NL80211_STA_INFO_TX_PACKETS] = { .type = NLA_U32 },
};
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
@@ -719,6 +721,12 @@ static int get_sta_handler(struct nl_msg *msg, void *arg)
data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_RX_BYTES]);
if (stats[NL80211_STA_INFO_TX_BYTES])
data->tx_bytes = nla_get_u32(stats[NL80211_STA_INFO_TX_BYTES]);
+ if (stats[NL80211_STA_INFO_RX_PACKETS])
+ data->rx_packets =
+ nla_get_u32(stats[NL80211_STA_INFO_RX_PACKETS]);
+ if (stats[NL80211_STA_INFO_TX_PACKETS])
+ data->tx_packets =
+ nla_get_u32(stats[NL80211_STA_INFO_TX_PACKETS]);
return NL_SKIP;
}