]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Added signal level to STA tracking
authorKevin Mahoney <k.mahoney@cablelabs.com>
Tue, 18 Oct 2016 22:07:13 +0000 (22:07 +0000)
committerJouni Malinen <j@w1.fi>
Fri, 28 Oct 2016 21:55:49 +0000 (00:55 +0300)
Add signal level information to the station tracking information. Also
make it available via the "TRACK_STA_LIST" control command.

Signed-off-by: Kevin Mahoney <k.mahoney@cablelabs.com>
hostapd/ctrl_iface.c
src/ap/beacon.c
src/ap/beacon.h
src/ap/hostapd.h
src/ap/ieee802_11.c

index dadc4b70b96f01346d3e23e396c676c4120ef7f5..68751decf0e4fdb8f55e9a7632f9b86904092e91 100644 (file)
@@ -2083,8 +2083,9 @@ static int hostapd_ctrl_iface_track_sta_list(struct hostapd_data *hapd,
                int ret;
 
                os_reltime_sub(&now, &info->last_seen, &age);
-               ret = os_snprintf(pos, end - pos, MACSTR " %u\n",
-                                 MAC2STR(info->addr), (unsigned int) age.sec);
+               ret = os_snprintf(pos, end - pos, MACSTR " %u %d\n",
+                                 MAC2STR(info->addr), (unsigned int) age.sec,
+                                 info->ssi_signal);
                if (os_snprintf_error(end - pos, ret))
                        break;
                pos += ret;
index 474ff597344db35002d8237a6a498ea9c6584463..811bedec608d396be0ac35a779a1876a38a6dafe 100644 (file)
@@ -623,7 +623,7 @@ static struct hostapd_sta_info * sta_track_get(struct hostapd_iface *iface,
 }
 
 
-void sta_track_add(struct hostapd_iface *iface, const u8 *addr)
+void sta_track_add(struct hostapd_iface *iface, const u8 *addr, int ssi_signal)
 {
        struct hostapd_sta_info *info;
 
@@ -633,6 +633,7 @@ void sta_track_add(struct hostapd_iface *iface, const u8 *addr)
                dl_list_del(&info->list);
                dl_list_add_tail(&iface->sta_seen, &info->list);
                os_get_reltime(&info->last_seen);
+               info->ssi_signal = ssi_signal;
                return;
        }
 
@@ -642,6 +643,7 @@ void sta_track_add(struct hostapd_iface *iface, const u8 *addr)
                return;
        os_memcpy(info->addr, addr, ETH_ALEN);
        os_get_reltime(&info->last_seen);
+       info->ssi_signal = ssi_signal;
 
        if (iface->num_sta_seen >= iface->conf->track_sta_max_num) {
                /* Expire oldest entry to make room for a new one */
@@ -717,7 +719,7 @@ void handle_probe_req(struct hostapd_data *hapd,
                return;
        ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN;
        if (hapd->iconf->track_sta_max_num)
-               sta_track_add(hapd->iface, mgmt->sa);
+               sta_track_add(hapd->iface, mgmt->sa, ssi_signal);
        ie_len = len - IEEE80211_HDRLEN;
 
        for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++)
index fc711815cf65e9cc7298871cad6dbd465900bd62..a26e30879cf53e5ee56129e86f6e72cf2f3e07a1 100644 (file)
@@ -21,7 +21,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface);
 int ieee802_11_build_ap_params(struct hostapd_data *hapd,
                               struct wpa_driver_ap_params *params);
 void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params);
-void sta_track_add(struct hostapd_iface *iface, const u8 *addr);
+void sta_track_add(struct hostapd_iface *iface, const u8 *addr, int ssi_signal);
 void sta_track_del(struct hostapd_sta_info *info);
 void sta_track_expire(struct hostapd_iface *iface, int force);
 struct hostapd_data *
index dec46f692206c3c078881293bbc3de4dcddae47c..919b1853487e51325227af6ccbde24381eedcfc5 100644 (file)
@@ -311,6 +311,7 @@ struct hostapd_sta_info {
        struct dl_list list;
        u8 addr[ETH_ALEN];
        struct os_reltime last_seen;
+       int ssi_signal;
 #ifdef CONFIG_TAXONOMY
        struct wpabuf *probe_ie_taxonomy;
 #endif /* CONFIG_TAXONOMY */
index 4aa1f7f8072f8999c431df0841233a15eec6561b..f7659e78f0ff356ee295ab789629556ccb9cec00 100644 (file)
@@ -3029,7 +3029,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
        }
 
        if (hapd->iconf->track_sta_max_num)
-               sta_track_add(hapd->iface, mgmt->sa);
+               sta_track_add(hapd->iface, mgmt->sa, fi->ssi_signal);
 
        switch (stype) {
        case WLAN_FC_STYPE_AUTH: