WFD: Add wfd_subelems hexdump in BSS ctrl_iface command output

This makes it easier to parse the WFD subelements from scan results.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2012-03-02 17:26:01 +02:00 committed by Jouni Malinen
parent 9675ce354a
commit 337c781f9c
2 changed files with 27 additions and 0 deletions

View 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 */

View 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",