From: Jouni Malinen Date: Sun, 18 Jul 2010 21:30:24 +0000 (-0700) Subject: Make IEEE 802.11 IE parser aware of P2P IE X-Git-Tag: hostap-1-bp~1162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91a9464528d3d329f40b2ab8134e4d4d48556250;p=thirdparty%2Fhostap.git Make IEEE 802.11 IE parser aware of P2P IE This does not handle fragmented IEs and is only used to check quickly whether the IE blob includes any P2P IE(s). --- diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index dc8856841..d9dfb708c 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -96,6 +96,22 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen, } break; + case OUI_WFA: + switch (pos[3]) { + case P2P_OUI_TYPE: + /* Wi-Fi Alliance - P2P IE */ + elems->p2p = pos; + elems->p2p_len = elen; + break; + default: + wpa_printf(MSG_MSGDUMP, "Unknown WFA " + "information element ignored " + "(type=%d len=%lu)\n", + pos[3], (unsigned long) elen); + return -1; + } + break; + case OUI_BROADCOM: switch (pos[3]) { case VENDOR_HT_CAPAB_OUI_TYPE: diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index 4a4f5a742..406c13a68 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -40,6 +40,7 @@ struct ieee802_11_elems { const u8 *ht_capabilities; const u8 *ht_operation; const u8 *vendor_ht_cap; + const u8 *p2p; u8 ssid_len; u8 supp_rates_len; @@ -64,6 +65,7 @@ struct ieee802_11_elems { u8 ht_capabilities_len; u8 ht_operation_len; u8 vendor_ht_cap_len; + u8 p2p_len; }; typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;