aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBeni Lev <beni.lev@intel.com>2017-08-21 16:43:52 (GMT)
committerJouni Malinen <j@w1.fi>2019-01-01 15:56:25 (GMT)
commit19677b77c3a48116eb2fa5db06966da7220cd76d (patch)
treeb95d36a3c339df2ce3e2adb831090aab2bd2a1e0 /src
parent2994ecfb5f0a2585f52c628231a5745b2a3026e5 (diff)
downloadhostap-19677b77c3a48116eb2fa5db06966da7220cd76d.zip
hostap-19677b77c3a48116eb2fa5db06966da7220cd76d.tar.gz
hostap-19677b77c3a48116eb2fa5db06966da7220cd76d.tar.bz2
OCE: Add RSSI based association rejection support (STA)
An AP might refuse to connect a STA if it has a low RSSI. In such case, the AP informs the STA with the desired RSSI delta and a retry timeout. Any subsequent association attempt with that AP (BSS) should be avoided, unless the RSSI level improved by the desired delta or the timeout has expired. Defined in Wi-Fi Alliance Optimized Connectivity Experience technical specification v1.0, section 3.14 (RSSI-based association rejection information). Signed-off-by: Beni Lev <beni.lev@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/common/ieee802_11_common.c18
-rw-r--r--src/common/ieee802_11_common.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index 733a4f3..46d2a35 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -1538,6 +1538,24 @@ const u8 * get_ie_ext(const u8 *ies, size_t len, u8 ext)
}
+const u8 * get_vendor_ie(const u8 *ies, size_t len, u32 vendor_type)
+{
+ const u8 *pos = ies, *end = ies + len;
+
+ while (end - pos > 1) {
+ if (2 + pos[1] > end - pos)
+ break;
+
+ if (pos[0] == WLAN_EID_VENDOR_SPECIFIC && pos[1] >= 4 &&
+ vendor_type == WPA_GET_BE32(&pos[2]))
+ return pos;
+ pos += 2 + pos[1];
+ }
+
+ return NULL;
+}
+
+
size_t mbo_add_ie(u8 *buf, size_t len, const u8 *attr, size_t attr_len)
{
/*
diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h
index 99c4d02..5f22fcd 100644
--- a/src/common/ieee802_11_common.h
+++ b/src/common/ieee802_11_common.h
@@ -193,6 +193,7 @@ extern size_t global_op_class_size;
const u8 * get_ie(const u8 *ies, size_t len, u8 eid);
const u8 * get_ie_ext(const u8 *ies, size_t len, u8 ext);
+const u8 * get_vendor_ie(const u8 *ies, size_t len, u32 vendor_type);
size_t mbo_add_ie(u8 *buf, size_t len, const u8 *attr, size_t attr_len);