diff mbox series

[1/2] iw: Support authenticated-at station statistic.

Message ID 1555105210-22996-1-git-send-email-greearb@candelatech.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series [1/2] iw: Support authenticated-at station statistic. | expand

Commit Message

Ben Greear April 12, 2019, 9:40 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

This can be helpful for calculating roaming time and other
higher precision stats.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 nl80211.h | 2 ++
 station.c | 3 +++
 2 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/nl80211.h b/nl80211.h
index e1ea2cb..ebaae12 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -3139,6 +3139,7 @@  enum nl80211_sta_bss_param {
  * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames
  *	sent to the station (u64, usec)
  * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
+ * @NL80211_STA_INFO_AUTH_AT_MS: Timestamp of last assoc -> auth transition, in ms
  * @__NL80211_STA_INFO_AFTER_LAST: internal
  * @NL80211_STA_INFO_MAX: highest possible station info attribute
  */
@@ -3184,6 +3185,7 @@  enum nl80211_sta_info {
 	NL80211_STA_INFO_CONNECTED_TO_GATE,
 	NL80211_STA_INFO_TX_DURATION,
 	NL80211_STA_INFO_AIRTIME_WEIGHT,
+	NL80211_STA_INFO_AUTH_AT_MS,
 
 	/* keep last */
 	__NL80211_STA_INFO_AFTER_LAST,
diff --git a/station.c b/station.c
index 25cbbc3..3b0c5f1 100644
--- a/station.c
+++ b/station.c
@@ -557,6 +557,9 @@  static int print_sta_handler(struct nl_msg *msg, void *arg)
 	if (sinfo[NL80211_STA_INFO_CONNECTED_TIME])
 		printf("\n\tconnected time:\t%u seconds",
 			nla_get_u32(sinfo[NL80211_STA_INFO_CONNECTED_TIME]));
+	if (sinfo[NL80211_STA_INFO_AUTH_AT_MS])
+		printf("\n\tauthenticated at:\t%llu ms",
+			 (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_AUTH_AT_MS]));
 
 	printf("\n");
 	return NL_SKIP;