[PATCH v2 08/17] Add API to get MLD address from basic ML IE

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

 



From: Shivani Baranwal <quic_shivbara@xxxxxxxxxxx>

Add utility API to fetch Multi-Link Device(MLD) address from
basic Multi-Link(ML) IE.

Signed-off-by: Shivani Baranwal <quic_shivbara@xxxxxxxxxxx>
---
 src/common/ieee802_11_common.c | 21 +++++++++++++++++++++
 src/common/ieee802_11_common.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index 0eac3f84c..8b3b7d3af 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -2771,3 +2771,24 @@ const u8 * get_ml_ie(const u8 *ies, size_t len, u8 type)
 
 	return NULL;
 }
+
+const u8 * get_basic_mle_mld_addr(const u8 *buf, size_t len)
+{
+#define BASIC_ML_IE_FIXED_LENGTH \
+		(2 + /* Control field */ \
+		 1 + /* Common info length field */ \
+		 6) /* MLD mac address field */
+	if (len < BASIC_ML_IE_FIXED_LENGTH)
+		return NULL;
+#undef BASIC_ML_IE_FIXED_LENGTH
+
+	if ((buf[0] & MULTI_LINK_CONTROL_TYPE_MASK) !=
+	     MULTI_LINK_CONTROL_TYPE_BASIC)
+		return NULL;
+
+#define BASIC_ML_IE_MLD_ADDR_IDX \
+		(2 + /* Control field */ \
+		 1) /* Common Info length field */
+	return &buf[BASIC_ML_IE_MLD_ADDR_IDX];
+#undef BASIC_ML_IE_MLD_ADDR_IDX
+}
diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h
index bd2c9fbf5..c3a3234b3 100644
--- a/src/common/ieee802_11_common.h
+++ b/src/common/ieee802_11_common.h
@@ -344,5 +344,6 @@ struct wpabuf * ieee802_11_defrag_data(struct ieee802_11_elems *elems,
 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);
+const u8 * get_basic_mle_mld_addr(const u8 *buf, size_t len);
 
 #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