Browse Source

wlantest: Add per-BSS counters for BIP deauth/disassoc

Jouni Malinen 14 years ago
parent
commit
783a082ccc
3 changed files with 9 additions and 0 deletions
  1. 5 0
      wlantest/rx_mgmt.c
  2. 2 0
      wlantest/wlantest_cli.c
  3. 2 0
      wlantest/wlantest_ctrl.h

+ 5 - 0
wlantest/rx_mgmt.c

@@ -784,6 +784,11 @@ static int check_bip(struct wlantest *wt, const u8 *data, size_t len)
 	os_memcpy(bss->ipn[keyid], mmie + 2, 6);
 	bss->counters[WLANTEST_BSS_COUNTER_VALID_BIP_MMIE]++;
 
+	if (stype == WLAN_FC_STYPE_DEAUTH)
+		bss->counters[WLANTEST_BSS_COUNTER_BIP_DEAUTH]++;
+	else if (stype == WLAN_FC_STYPE_DISASSOC)
+		bss->counters[WLANTEST_BSS_COUNTER_BIP_DISASSOC]++;
+
 	return 0;
 }
 

+ 2 - 0
wlantest/wlantest_cli.c

@@ -569,6 +569,8 @@ static const struct bss_counters bss_counters[] = {
 	{ "valid_bip_mmie", WLANTEST_BSS_COUNTER_VALID_BIP_MMIE },
 	{ "invalid_bip_mmie", WLANTEST_BSS_COUNTER_INVALID_BIP_MMIE },
 	{ "missing_bip_mmie", WLANTEST_BSS_COUNTER_MISSING_BIP_MMIE },
+	{ "bip_deauth", WLANTEST_BSS_COUNTER_BIP_DEAUTH },
+	{ "bip_disassoc", WLANTEST_BSS_COUNTER_BIP_DISASSOC },
 	{ NULL, 0 }
 };
 

+ 2 - 0
wlantest/wlantest_ctrl.h

@@ -60,6 +60,8 @@ enum wlantest_bss_counter {
 	WLANTEST_BSS_COUNTER_VALID_BIP_MMIE,
 	WLANTEST_BSS_COUNTER_INVALID_BIP_MMIE,
 	WLANTEST_BSS_COUNTER_MISSING_BIP_MMIE,
+	WLANTEST_BSS_COUNTER_BIP_DEAUTH,
+	WLANTEST_BSS_COUNTER_BIP_DISASSOC,
 	NUM_WLANTEST_BSS_COUNTER
 };