aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/rx_mgmt.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-21 19:24:20 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-21 19:24:20 (GMT)
commitcdd71e307eb5978b0de8bf14eddd6773ad28bf03 (patch)
treedc6af650e05b562ef101919246ef3661bdc286d4 /wlantest/rx_mgmt.c
parentfc686b1994276ace6e8ca35ca664719afcef2d5e (diff)
downloadhostap-cdd71e307eb5978b0de8bf14eddd6773ad28bf03.zip
hostap-cdd71e307eb5978b0de8bf14eddd6773ad28bf03.tar.gz
hostap-cdd71e307eb5978b0de8bf14eddd6773ad28bf03.tar.bz2
wlantest: Add per-STA counter for (Re)AssocResp comeback frames
Diffstat (limited to 'wlantest/rx_mgmt.c')
-rw-r--r--wlantest/rx_mgmt.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c
index e9ab330..4921d8d 100644
--- a/wlantest/rx_mgmt.c
+++ b/wlantest/rx_mgmt.c
@@ -290,6 +290,26 @@ static void rx_mgmt_assoc_resp(struct wlantest *wt, const u8 *data, size_t len)
MAC2STR(mgmt->sa), MAC2STR(mgmt->da), capab, status,
aid & 0x3fff);
+ if (status == WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY) {
+ struct ieee802_11_elems elems;
+ const u8 *ies = mgmt->u.assoc_resp.variable;
+ size_t ies_len = len - (mgmt->u.assoc_resp.variable - data);
+ if (ieee802_11_parse_elems(ies, ies_len, &elems, 0) ==
+ ParseFailed) {
+ wpa_printf(MSG_INFO, "Failed to parse IEs in "
+ "AssocResp from " MACSTR,
+ MAC2STR(mgmt->sa));
+ } else if (elems.timeout_int == 0 ||
+ elems.timeout_int_len != 5) {
+ wpa_printf(MSG_INFO, "No valid Timeout Interval IE in "
+ "AssocResp (status=30) from " MACSTR,
+ MAC2STR(mgmt->sa));
+ } else {
+ sta->counters[
+ WLANTEST_STA_COUNTER_ASSOCRESP_COMEBACK]++;
+ }
+ }
+
if (status)
return;
@@ -399,6 +419,26 @@ static void rx_mgmt_reassoc_resp(struct wlantest *wt, const u8 *data,
MAC2STR(mgmt->sa), MAC2STR(mgmt->da), capab, status,
aid & 0x3fff);
+ if (status == WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY) {
+ struct ieee802_11_elems elems;
+ const u8 *ies = mgmt->u.reassoc_resp.variable;
+ size_t ies_len = len - (mgmt->u.reassoc_resp.variable - data);
+ if (ieee802_11_parse_elems(ies, ies_len, &elems, 0) ==
+ ParseFailed) {
+ wpa_printf(MSG_INFO, "Failed to parse IEs in "
+ "ReassocResp from " MACSTR,
+ MAC2STR(mgmt->sa));
+ } else if (elems.timeout_int == 0 ||
+ elems.timeout_int_len != 5) {
+ wpa_printf(MSG_INFO, "No valid Timeout Interval IE in "
+ "ReassocResp (status=30) from " MACSTR,
+ MAC2STR(mgmt->sa));
+ } else {
+ sta->counters[
+ WLANTEST_STA_COUNTER_REASSOCRESP_COMEBACK]++;
+ }
+ }
+
if (status)
return;