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).
This commit is contained in:
Jouni Malinen 2010-07-18 14:30:24 -07:00 committed by Jouni Malinen
parent dd6cc5a20c
commit 91a9464528
2 changed files with 18 additions and 0 deletions

View file

@ -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:

View file

@ -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;