]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - scan.c
iw: show age of last scan
[thirdparty/iw.git] / scan.c
diff --git a/scan.c b/scan.c
index 9941775e5dc2e3a2e1a39fb94e4f6883724340ed..02437d109dda2cd6b5a29b4468b58d31a058c609 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -754,6 +754,7 @@ static int print_bss_handler(struct nl_msg *msg, void *arg)
                [NL80211_BSS_SIGNAL_MBM] = { .type = NLA_U32 },
                [NL80211_BSS_SIGNAL_UNSPEC] = { .type = NLA_U8 },
                [NL80211_BSS_STATUS] = { .type = NLA_U32 },
+               [NL80211_BSS_SEEN_MS_AGO] = { .type = NLA_U32 },
        };
        struct scan_params *params = arg;
 
@@ -845,6 +846,10 @@ static int print_bss_handler(struct nl_msg *msg, void *arg)
                unsigned char s = nla_get_u8(bss[NL80211_BSS_SIGNAL_UNSPEC]);
                printf("\tsignal: %d/100\n", s);
        }
+       if (bss[NL80211_BSS_SEEN_MS_AGO]) {
+               int age = nla_get_u32(bss[NL80211_BSS_SEEN_MS_AGO]);
+               printf("\tlast seen: %d ms ago\n", age);
+       }
        if (bss[NL80211_BSS_INFORMATION_ELEMENTS])
                print_ies(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]),
                          nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]),