[PATCH v3 03/21] EHT: Add support to parse Multi-Link elements
Veerendranath Jakkam
quic_vjakkam at quicinc.com
Wed Oct 19 07:13:51 PDT 2022
Parse and store pointers to different types of Multi-Link elements
received in management frames.
Signed-off-by: Veerendranath Jakkam <quic_vjakkam at quicinc.com>
---
src/common/ieee802_11_common.c | 46 ++++++++++++++++++++++++++++++++++
src/common/ieee802_11_common.h | 10 ++++++++
2 files changed, 56 insertions(+)
diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index d97525e9f..966861c17 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -199,6 +199,46 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen,
}
+static int ieee802_11_parse_mle(const u8 *pos, size_t elen,
+ struct ieee802_11_elems *elems,
+ int show_errors)
+{
+ u8 mle_type = pos[0] & MULTI_LINK_CONTROL_TYPE_MASK;
+
+ switch (mle_type) {
+ case MULTI_LINK_CONTROL_TYPE_BASIC:
+ elems->basic_mle = pos;
+ elems->basic_mle_len = elen;
+ break;
+ case MULTI_LINK_CONTROL_TYPE_PROBE_REQ:
+ elems->probe_req_mle = pos;
+ elems->probe_req_mle_len = elen;
+ break;
+ case MULTI_LINK_CONTROL_TYPE_RECONF:
+ elems->reconf_mle = pos;
+ elems->reconf_mle_len = elen;
+ break;
+ case MULTI_LINK_CONTROL_TYPE_TDLS:
+ elems->tdls_mle = pos;
+ elems->tdls_mle_len = elen;
+ break;
+ case MULTI_LINK_CONTROL_TYPE_PRIOR_ACCESS:
+ elems->prior_access_mle = pos;
+ elems->prior_access_mle_len = elen;
+ break;
+ default:
+ if (show_errors) {
+ wpa_printf(MSG_MSGDUMP,
+ "Unknown Multi-Link element type %u",
+ mle_type);
+ }
+ return -1;
+ }
+
+ return 0;
+}
+
+
static int ieee802_11_parse_extension(const u8 *pos, size_t elen,
struct ieee802_11_elems *elems,
int show_errors)
@@ -315,6 +355,12 @@ static int ieee802_11_parse_extension(const u8 *pos, size_t elen,
elems->eht_operation = pos;
elems->eht_operation_len = elen;
break;
+ case WLAN_EID_EXT_MULTI_LINK:
+ if (elen < 2)
+ break;
+ if (ieee802_11_parse_mle(pos, elen, elems, show_errors))
+ return -1;
+ break;
default:
if (show_errors) {
wpa_printf(MSG_MSGDUMP,
diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h
index c3a3234b3..ff6d2a89f 100644
--- a/src/common/ieee802_11_common.h
+++ b/src/common/ieee802_11_common.h
@@ -119,6 +119,11 @@ struct ieee802_11_elems {
const u8 *pasn_params;
const u8 *eht_capabilities;
const u8 *eht_operation;
+ const u8 *basic_mle;
+ const u8 *probe_req_mle;
+ const u8 *reconf_mle;
+ const u8 *tdls_mle;
+ const u8 *prior_access_mle;
u8 ssid_len;
u8 supp_rates_len;
@@ -175,6 +180,11 @@ struct ieee802_11_elems {
u8 pasn_params_len;
u8 eht_capabilities_len;
u8 eht_operation_len;
+ u8 basic_mle_len;
+ u8 probe_req_mle_len;
+ u8 reconf_mle_len;
+ u8 tdls_mle_len;
+ u8 prior_access_mle_len;
struct mb_ies_info mb_ies;
struct frag_ies_info frag_ies;
--
2.25.1
More information about the Hostap
mailing list