]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
scan: Helper function to get ML IE of specified type from scan result IEs
authorShivani Baranwal <quic_shivbara@quicinc.com>
Thu, 8 Sep 2022 14:44:13 +0000 (20:14 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 15 Sep 2022 03:08:20 +0000 (06:08 +0300)
Add a helper function to get Multi-Link element of a specified type from
scan result Probe Response frame or Beacon frame elements.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
wpa_supplicant/scan.c
wpa_supplicant/scan.h

index a933e01b628faacf79b6dbd065f135aa7c3f06d8..05913a181878594a58436272938f1ad94cd88c9a 100644 (file)
@@ -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
index d1780eb09979d0d57a863a3bbe1285675ce1460b..f826d91344e8c81b080f70c3147ef8a7dcc925a9 100644 (file)
@@ -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,