EHT: Parse Multi-Link elements

Parse and store pointers to different types of Multi-Link elements
received in Management frames.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
Veerendranath Jakkam 2022-10-19 19:43:51 +05:30 committed by Jouni Malinen
parent 73f540b6a7
commit 347ea8f0a5
2 changed files with 56 additions and 0 deletions

View file

@ -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,

View file

@ -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;