[PATCH v2 02/17] Add API to get ML IE of specified type from IEs buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add utitliy API to get specified type Multi-Link IE from IEs buffer

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@xxxxxxxxxxx>
---
 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


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux