aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/process.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-06 15:31:02 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-07 21:29:00 (GMT)
commit422ef7d2056e982bbd83415f5a329e996b0c2608 (patch)
treeee7d77b826ed8d6cc2352f7c0af7740f14b6d3cb /wlantest/process.c
parentd84d38935127dc6f64ed1c1b8aa986e85d99c9b6 (diff)
downloadhostap-422ef7d2056e982bbd83415f5a329e996b0c2608.zip
hostap-422ef7d2056e982bbd83415f5a329e996b0c2608.tar.gz
hostap-422ef7d2056e982bbd83415f5a329e996b0c2608.tar.bz2
wlantest: Create station list for each BSS
Diffstat (limited to 'wlantest/process.c')
-rw-r--r--wlantest/process.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/wlantest/process.c b/wlantest/process.c
index 448317e..d47b434 100644
--- a/wlantest/process.c
+++ b/wlantest/process.c
@@ -162,6 +162,38 @@ static void rx_mgmt_probe_resp(struct wlantest *wt, const u8 *data, size_t len)
}
+static void rx_mgmt_auth(struct wlantest *wt, const u8 *data, size_t len)
+{
+ const struct ieee80211_mgmt *mgmt;
+ struct wlantest_bss *bss;
+ struct wlantest_sta *sta;
+
+ mgmt = (const struct ieee80211_mgmt *) data;
+ bss = bss_get(wt, mgmt->bssid);
+ if (bss == NULL)
+ return;
+ if (os_memcmp(mgmt->sa, mgmt->bssid, ETH_ALEN) == 0)
+ sta = sta_get(bss, mgmt->da);
+ else
+ sta = sta_get(bss, mgmt->sa);
+ if (sta == NULL)
+ return;
+
+ if (len < 24 + 6) {
+ wpa_printf(MSG_INFO, "Too short Authentication frame from "
+ MACSTR, MAC2STR(mgmt->sa));
+ return;
+ }
+
+ wpa_printf(MSG_DEBUG, "AUTH " MACSTR " -> " MACSTR
+ " (alg=%u trans=%u status=%u)",
+ MAC2STR(mgmt->sa), MAC2STR(mgmt->da),
+ le_to_host16(mgmt->u.auth.auth_alg),
+ le_to_host16(mgmt->u.auth.auth_transaction),
+ le_to_host16(mgmt->u.auth.status_code));
+}
+
+
static void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len)
{
const struct ieee80211_hdr *hdr;
@@ -193,6 +225,9 @@ static void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len)
case WLAN_FC_STYPE_PROBE_RESP:
rx_mgmt_probe_resp(wt, data, len);
break;
+ case WLAN_FC_STYPE_AUTH:
+ rx_mgmt_auth(wt, data, len);
+ break;
}
}