[PATCH 08/18] scan: Add API to get extended IEs from scan result IEs
Veerendranath Jakkam
quic_vjakkam at quicinc.com
Thu Jul 28 06:45:37 PDT 2022
From: Shivani Baranwal <quic_shivbara at quicinc.com>
Add API to get extended IEs 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 102c544d4..19ef676df 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1945,6 +1945,18 @@ const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie)
}
+const u8 * wpa_scan_get_ie_ext(const struct wpa_scan_res *res, u8 ie)
+{
+ 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_ie_ext((const u8 *) (res + 1), ie_len, ie);
+}
+
+
/**
* 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..660096073 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_ie_ext(const struct wpa_scan_res *res, u8 ie);
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