]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WFD: Add wfd_subelems hexdump in BSS ctrl_iface command output
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 2 Mar 2012 15:26:01 +0000 (17:26 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 29 Aug 2012 16:51:29 +0000 (19:51 +0300)
This makes it easier to parse the WFD subelements from scan results.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/common/wpa_ctrl.h
wpa_supplicant/ctrl_iface.c

index 0bcfcaeed096d2bfe647e2305f30ed3e6033291a..bb9b5587f26b29640a1b520d87cecf82cebbffbf 100644 (file)
@@ -166,6 +166,7 @@ extern "C" {
 #define WPA_BSS_MASK_WPS_SCAN          BIT(13)
 #define WPA_BSS_MASK_P2P_SCAN          BIT(14)
 #define WPA_BSS_MASK_INTERNETW         BIT(15)
+#define WPA_BSS_MASK_WIFI_DISPLAY      BIT(16)
 
 
 /* wpa_supplicant/hostapd control interface access */
index 472318984dfc62df1e8db6e276186e0375d3f600..5950daf67a71bfc732b96226a2be7b7d6e46d25e 100644 (file)
@@ -12,6 +12,7 @@
 #include "utils/eloop.h"
 #include "common/version.h"
 #include "common/ieee802_11_defs.h"
+#include "common/ieee802_11_common.h"
 #include "common/wpa_ctrl.h"
 #include "eap_peer/eap.h"
 #include "eapol_supp/eapol_supp_sm.h"
@@ -2740,6 +2741,31 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
        }
 #endif /* CONFIG_P2P */
 
+#ifdef CONFIG_WIFI_DISPLAY
+       if (mask & WPA_BSS_MASK_WIFI_DISPLAY) {
+               struct wpabuf *wfd;
+               ie = (const u8 *) (bss + 1);
+               wfd = ieee802_11_vendor_ie_concat(ie, bss->ie_len,
+                                                 WFD_IE_VENDOR_TYPE);
+               if (wfd) {
+                       ret = os_snprintf(pos, end - pos, "wfd_subelems=");
+                       if (ret < 0 || ret >= end - pos)
+                               return pos - buf;
+                       pos += ret;
+
+                       pos += wpa_snprintf_hex(pos, end - pos,
+                                               wpabuf_head(wfd),
+                                               wpabuf_len(wfd));
+                       wpabuf_free(wfd);
+
+                       ret = os_snprintf(pos, end - pos, "\n");
+                       if (ret < 0 || ret >= end - pos)
+                               return pos - buf;
+                       pos += ret;
+               }
+       }
+#endif /* CONFIG_WIFI_DISPLAY */
+
 #ifdef CONFIG_INTERWORKING
        if (mask & WPA_BSS_MASK_INTERNETW) {
                pos = anqp_add_hex(pos, end, "anqp_venue_name",