]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make Beacon IEs available in wpa_supplicant BSS command
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 13 Dec 2016 13:49:22 +0000 (15:49 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 13 Dec 2016 18:07:52 +0000 (20:07 +0200)
This makes both the Probe Response and Beacon frame IEs available to
upper layers if scan results include both IE sets. When the BSS command
mask includes WPA_BSS_MASK_BEACON_IE, a new beacon_ie=<hexdump> entry
will be included in output if the BSS entry has two separate sets of IEs
(ie=<hexdump> showing the Probe Response frame contents and
beacon_ie=<hexdump> the Beacon rame contents).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/common/wpa_ctrl.h
wpa_supplicant/ctrl_iface.c

index 6be472de6c16473d7ad8c579a13b8af7e6efbe6d..ae31ef36ac83d8854368090435ee58673e62aa61 100644 (file)
@@ -319,6 +319,7 @@ extern "C" {
 #define WPA_BSS_MASK_EST_THROUGHPUT    BIT(20)
 #define WPA_BSS_MASK_FST               BIT(21)
 #define WPA_BSS_MASK_UPDATE_IDX                BIT(22)
+#define WPA_BSS_MASK_BEACON_IE         BIT(23)
 
 
 /* VENDOR_ELEM_* frame id values */
index beb06ed5f0e3469753079aeed24a4e9a2eb2875d..4439efbe2b46a5e881398fac145d658bffa779cb 100644 (file)
@@ -4450,6 +4450,27 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
                pos += ret;
        }
 
+       if ((mask & WPA_BSS_MASK_BEACON_IE) && bss->beacon_ie_len) {
+               ret = os_snprintf(pos, end - pos, "beacon_ie=");
+               if (os_snprintf_error(end - pos, ret))
+                       return 0;
+               pos += ret;
+
+               ie = (const u8 *) (bss + 1);
+               ie += bss->ie_len;
+               for (i = 0; i < bss->beacon_ie_len; i++) {
+                       ret = os_snprintf(pos, end - pos, "%02x", *ie++);
+                       if (os_snprintf_error(end - pos, ret))
+                               return 0;
+                       pos += ret;
+               }
+
+               ret = os_snprintf(pos, end - pos, "\n");
+               if (os_snprintf_error(end - pos, ret))
+                       return 0;
+               pos += ret;
+       }
+
        if (mask & WPA_BSS_MASK_DELIM) {
                ret = os_snprintf(pos, end - pos, "====\n");
                if (os_snprintf_error(end - pos, ret))