[PATCH v2 02/17] Add API to get ML IE of specified type from IEs buffer
Veerendranath Jakkam
quic_vjakkam at quicinc.com
Thu Sep 8 07:44:08 PDT 2022
Add utitliy API to get specified type Multi-Link IE from IEs buffer
Signed-off-by: Veerendranath Jakkam <quic_vjakkam at quicinc.com>
---
src/common/ieee802_11_common.c | 16 ++++++++++++++++
src/common/ieee802_11_common.h | 1 +
2 files changed, 17 insertions(+)
diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index c8ee90cd7..0eac3f84c 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -2755,3 +2755,19 @@ struct wpabuf * ieee802_11_defrag(struct ieee802_11_elems *elems,
return ieee802_11_defrag_data(elems, eid, eid_ext, data, len);
}
+
+const u8 * get_ml_ie(const u8 *ies, size_t len, u8 type)
+{
+ const struct element *elem;
+
+ if (!ies)
+ return NULL;
+
+ for_each_element_extid(elem, WLAN_EID_EXT_MULTI_LINK, ies, len) {
+ if (elem->datalen >= 2 &&
+ (elem->data[1] & MULTI_LINK_CONTROL_TYPE_MASK) == type)
+ return &elem->id;
+ }
+
+ return NULL;
+}
diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h
index 94e1d7b8b..bd2c9fbf5 100644
--- a/src/common/ieee802_11_common.h
+++ b/src/common/ieee802_11_common.h
@@ -343,5 +343,6 @@ struct wpabuf * ieee802_11_defrag_data(struct ieee802_11_elems *elems,
const u8 *data, u8 len);
struct wpabuf * ieee802_11_defrag(struct ieee802_11_elems *elems,
u8 eid, u8 eid_ext);
+const u8 * get_ml_ie(const u8 *ies, size_t len, u8 type);
#endif /* IEEE802_11_COMMON_H */
--
2.25.1
More information about the Hostap
mailing list