diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2012-02-08 12:07:54 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-02-08 12:07:54 +0200 |
commit | a91e268c5e9cc00c382f287a2749250a0b9ef096 (patch) | |
tree | 9734a817d65ccd9085051d3b44ce2eaa040bc67c /wpa_supplicant | |
parent | 59c8500f18cd379a8c8dc788fc6f01829420fbc4 (diff) | |
download | external_wpa_supplicant_8_ti-a91e268c5e9cc00c382f287a2749250a0b9ef096.zip external_wpa_supplicant_8_ti-a91e268c5e9cc00c382f287a2749250a0b9ef096.tar.gz external_wpa_supplicant_8_ti-a91e268c5e9cc00c382f287a2749250a0b9ef096.tar.bz2 |
Show BSS entry age (seconds since last update)
The BSS ctrl_iface command can sow the age of a BSS table entry to
make it easier for external programs to figure out whether an entry
is still current depending on the use case.
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r-- | wpa_supplicant/ctrl_iface.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 7f4fb09..d56df84 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -2193,6 +2193,7 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s, int ret; char *pos, *end; const u8 *ie, *ie2; + struct os_time now; if (os_strcmp(cmd, "FIRST") == 0) bss = dl_list_first(&wpa_s->bss, struct wpa_bss, list); @@ -2235,6 +2236,7 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s, if (bss == NULL) return 0; + os_get_time(&now); pos = buf; end = buf + buflen; ret = os_snprintf(pos, end - pos, @@ -2247,11 +2249,13 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s, "noise=%d\n" "level=%d\n" "tsf=%016llu\n" + "age=%d\n" "ie=", bss->id, MAC2STR(bss->bssid), bss->freq, bss->beacon_int, bss->caps, bss->qual, bss->noise, bss->level, - (unsigned long long) bss->tsf); + (unsigned long long) bss->tsf, + (int) (now.sec - bss->last_update.sec)); if (ret < 0 || ret >= end - pos) return pos - buf; pos += ret; |