mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-31 09:14:03 -05:00
nl80211: Fetch STA TX/RX duration statistics
This makes per-STA TX/RX duration statistics available for airtime policy configuration. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
This commit is contained in:
parent
1d6f63854e
commit
58d4c23615
@ -1759,6 +1759,7 @@ struct hostapd_data;
|
||||
struct hostap_sta_driver_data {
|
||||
unsigned long rx_packets, tx_packets;
|
||||
unsigned long long rx_bytes, tx_bytes;
|
||||
unsigned long long rx_airtime, tx_airtime;
|
||||
int bytes_64bit; /* whether 64-bit byte counters are supported */
|
||||
unsigned long current_tx_rate;
|
||||
unsigned long current_rx_rate;
|
||||
|
@ -6309,6 +6309,8 @@ static int get_sta_handler(struct nl_msg *msg, void *arg)
|
||||
[NL80211_STA_INFO_TX_BYTES64] = { .type = NLA_U64 },
|
||||
[NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
|
||||
[NL80211_STA_INFO_ACK_SIGNAL] = { .type = NLA_U8 },
|
||||
[NL80211_STA_INFO_RX_DURATION] = { .type = NLA_U64 },
|
||||
[NL80211_STA_INFO_TX_DURATION] = { .type = NLA_U64 },
|
||||
};
|
||||
struct nlattr *rate[NL80211_RATE_INFO_MAX + 1];
|
||||
static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
|
||||
@ -6366,6 +6368,12 @@ static int get_sta_handler(struct nl_msg *msg, void *arg)
|
||||
if (stats[NL80211_STA_INFO_TX_PACKETS])
|
||||
data->tx_packets =
|
||||
nla_get_u32(stats[NL80211_STA_INFO_TX_PACKETS]);
|
||||
if (stats[NL80211_STA_INFO_RX_DURATION])
|
||||
data->rx_airtime =
|
||||
nla_get_u64(stats[NL80211_STA_INFO_RX_DURATION]);
|
||||
if (stats[NL80211_STA_INFO_TX_DURATION])
|
||||
data->tx_airtime =
|
||||
nla_get_u64(stats[NL80211_STA_INFO_TX_DURATION]);
|
||||
if (stats[NL80211_STA_INFO_TX_FAILED])
|
||||
data->tx_retry_failed =
|
||||
nla_get_u32(stats[NL80211_STA_INFO_TX_FAILED]);
|
||||
|
Loading…
Reference in New Issue
Block a user