[PATCH v2 07/17] scan: Add API to get ML IE of specified type from scan result IEs

Veerendranath Jakkam quic_vjakkam at quicinc.com
Thu Sep 8 07:44:13 PDT 2022


From: Shivani Baranwal <quic_shivbara at quicinc.com>

Add API to get ML IE of specified type from scan result probe response
or beacon IEs.

Signed-off-by: Shivani Baranwal <quic_shivbara at quicinc.com>
---
 wpa_supplicant/scan.c | 12 ++++++++++++
 wpa_supplicant/scan.h |  1 +
 2 files changed, 13 insertions(+)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index a933e01b6..05913a181 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1947,6 +1947,18 @@ const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie)
 }
 
 
+const u8 * wpa_scan_get_ml_ie(const struct wpa_scan_res *res, u8 type)
+{
+	size_t ie_len = res->ie_len;
+
+	/* Use the Beacon frame IEs if res->ie_len is not available */
+	if (!ie_len)
+		ie_len = res->beacon_ie_len;
+
+	return get_ml_ie((const u8 *) (res + 1), ie_len, type);
+}
+
+
 /**
  * wpa_scan_get_vendor_ie - Fetch vendor information element from a scan result
  * @res: Scan result entry
diff --git a/wpa_supplicant/scan.h b/wpa_supplicant/scan.h
index d1780eb09..f826d9134 100644
--- a/wpa_supplicant/scan.h
+++ b/wpa_supplicant/scan.h
@@ -51,6 +51,7 @@ wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s,
 				struct scan_info *info, int new_scan);
 int wpa_supplicant_update_scan_results(struct wpa_supplicant *wpa_s);
 const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie);
+const u8 * wpa_scan_get_ml_ie(const struct wpa_scan_res *res, u8 type);
 const u8 * wpa_scan_get_vendor_ie(const struct wpa_scan_res *res,
 				  u32 vendor_type);
 const u8 * wpa_scan_get_vendor_ie_beacon(const struct wpa_scan_res *res,
-- 
2.25.1




More information about the Hostap mailing list