iPXE
Data Structures | Macros | Functions | Variables
802.11 information elements

Many management frames include a section that amounts to a concatenation of these information elements, so that the sender can choose which information to send and the receiver can ignore the parts it doesn't understand. More...

Data Structures

struct  ieee80211_ie_header
 Generic 802.11 information element header. More...
 
struct  ieee80211_ie_ssid
 802.11 SSID information element More...
 
struct  ieee80211_ie_rates
 802.11 rates information element More...
 
struct  ieee80211_ie_ds_param
 802.11 Direct Spectrum parameter information element More...
 
struct  ieee80211_ie_country_ext_triplet
 802.11 Country information element regulatory extension triplet More...
 
struct  ieee80211_ie_country_band_triplet
 802.11 Country information element regulatory band triplet More...
 
union  ieee80211_ie_country_triplet
 802.11 Country information element regulatory triplet More...
 
struct  ieee80211_ie_country
 802.11 Country information element More...
 
struct  ieee80211_ie_request
 802.11 Request information element More...
 
struct  ieee80211_ie_challenge_text
 802.11 Challenge Text information element More...
 
struct  ieee80211_ie_power_constraint
 802.11 Power Constraint information element More...
 
struct  ieee80211_ie_power_capab
 802.11 Power Capability information element More...
 
struct  ieee80211_ie_channels_channel_band
 802.11 Channels information element channel band tuple More...
 
struct  ieee80211_ie_channels
 802.11 Channels information element More...
 
struct  ieee80211_ie_erp_info
 802.11 ERP Information information element More...
 
struct  ieee80211_ie_rsn
 802.11 Robust Security Network ("WPA") information element More...
 
struct  ieee80211_ie_vendor
 802.11 Vendor Specific information element More...
 
union  ieee80211_ie
 Any 802.11 information element. More...
 

Macros

#define IEEE80211_IE_SSID   0
 Information element ID for SSID information element. More...
 
#define IEEE80211_IE_RATES   1
 Information element ID for rates information element. More...
 
#define IEEE80211_IE_EXT_RATES   50
 Information element ID for extended rates information element. More...
 
#define IEEE80211_IE_DS_PARAM   3
 Information element ID for Direct Spectrum parameter information element. More...
 
#define IEEE80211_IE_COUNTRY   7
 Information element ID for Country information element. More...
 
#define IEEE80211_IE_REQUEST   10
 Information element ID for Request information element. More...
 
#define IEEE80211_IE_CHALLENGE_TEXT   16
 Information element ID for Challenge Text information element. More...
 
#define IEEE80211_IE_POWER_CONSTRAINT   52
 Information element ID for Power Constraint information element. More...
 
#define IEEE80211_IE_POWER_CAPAB   33
 Information element ID for Power Capability information element. More...
 
#define IEEE80211_IE_CHANNELS   36
 Information element ID for Channels information element. More...
 
#define IEEE80211_IE_ERP_INFO   42
 Information element ID for ERP Information information element. More...
 
#define IEEE80211_ERP_NONERP_PRESENT   0x01
 ERP information element: Flag set if 802.11b stations are present. More...
 
#define IEEE80211_ERP_USE_PROTECTION   0x02
 ERP information element: Flag set if CTS protection must be used. More...
 
#define IEEE80211_ERP_BARKER_LONG   0x04
 ERP information element: Flag set if long preambles must be used. More...
 
#define IEEE80211_IE_RSN   48
 Information element ID for Robust Security Network information element. More...
 
#define _MKOUI(a, b, c, t)   ( ( ( t ) << 24 ) | ( ( c ) << 16 ) | ( ( b ) << 8 ) | ( a ) )
 Make OUI plus type byte into 32-bit integer for easy comparison. More...
 
#define OUI_ORG_MASK   0x00FFFFFF
 
#define OUI_TYPE_MASK   0xFF000000
 
#define IEEE80211_RSN_OUI   _MKOUI ( 0x00, 0x0F, 0xAC, 0 )
 Organization part for OUIs in standard RSN IE. More...
 
#define IEEE80211_WPA_OUI   _MKOUI ( 0x00, 0x50, 0xF2, 0 )
 Organization part for OUIs in old WPA IE. More...
 
#define IEEE80211_WPA_OUI_VEN   _MKOUI ( 0x00, 0x50, 0xF2, 0x01 )
 Old vendor-type WPA IE OUI type + subtype. More...
 
#define IEEE80211_RSN_VERSION   1
 802.11 RSN IE: expected version number More...
 
#define IEEE80211_RSN_CTYPE_WEP40   _MKOUI ( 0, 0, 0, 0x01 )
 802.11 RSN IE: cipher type for 40-bit WEP More...
 
#define IEEE80211_RSN_CTYPE_WEP104   _MKOUI ( 0, 0, 0, 0x05 )
 802.11 RSN IE: cipher type for 104-bit WEP More...
 
#define IEEE80211_RSN_CTYPE_TKIP   _MKOUI ( 0, 0, 0, 0x02 )
 802.11 RSN IE: cipher type for TKIP ("WPA") More...
 
#define IEEE80211_RSN_CTYPE_CCMP   _MKOUI ( 0, 0, 0, 0x04 )
 802.11 RSN IE: cipher type for CCMP ("WPA2") More...
 
#define IEEE80211_RSN_CTYPE_USEGROUP   _MKOUI ( 0, 0, 0, 0x00 )
 802.11 RSN IE: cipher type for "use group" More...
 
#define IEEE80211_RSN_ATYPE_8021X   _MKOUI ( 0, 0, 0, 0x01 )
 802.11 RSN IE: auth method type for using an 802.1X server More...
 
#define IEEE80211_RSN_ATYPE_PSK   _MKOUI ( 0, 0, 0, 0x02 )
 802.11 RSN IE: auth method type for using a pre-shared key More...
 
#define IEEE80211_RSN_CAPAB_PREAUTH   0x001
 802.11 RSN IE capabilities: AP supports pre-authentication More...
 
#define IEEE80211_RSN_CAPAB_NO_PAIRWISE   0x002
 802.11 RSN IE capabilities: Node has conflict between TKIP and WEP More...
 
#define IEEE80211_RSN_CAPAB_PTKSA_REPLAY   0x00C
 802.11 RSN IE capabilities: Number of PTKSA replay counters More...
 
#define IEEE80211_RSN_CAPAB_GTKSA_REPLAY   0x030
 802.11 RSN IE capabilities: Number of GTKSA replay counters More...
 
#define IEEE80211_RSN_CAPAB_PEERKEY   0x200
 802.11 RSN IE capabilities: PeerKey Handshaking is suported More...
 
#define IEEE80211_RSN_1_CTR   0x000
 802.11 RSN IE capabilities: One replay counter More...
 
#define IEEE80211_RSN_2_CTR   0x014
 802.11 RSN IE capabilities: Two replay counters More...
 
#define IEEE80211_RSN_4_CTR   0x028
 802.11 RSN IE capabilities: Four replay counters More...
 
#define IEEE80211_RSN_16_CTR   0x03C
 802.11 RSN IE capabilities: 16 replay counters More...
 
#define IEEE80211_IE_VENDOR   221
 Information element ID for Vendor Specific information element. More...
 

Functions

static size_t ieee80211_rsn_size (int npair, int nauth, int npmkid, int rsn_ie)
 Calculate necessary size of RSN information element. More...
 
static int ieee80211_ie_bound (union ieee80211_ie *ie, void *end)
 Check that 802.11 information element is bounded by buffer. More...
 
static union ieee80211_ieieee80211_next_ie (union ieee80211_ie *ie, void *end)
 Advance to next 802.11 information element. More...
 

Variables

union ieee80211_ie_country_triplet __attribute__
 

Detailed Description

Many management frames include a section that amounts to a concatenation of these information elements, so that the sender can choose which information to send and the receiver can ignore the parts it doesn't understand.

Each IE contains a two-byte header, one byte ID and one byte length, followed by IE-specific data. The length does not include the two-byte header. Information elements are required to be sorted by ID, but iPXE does not require that in those it receives.

This group also includes a few inline functions to simplify common tasks in IE processing.

Macro Definition Documentation

◆ IEEE80211_IE_SSID

#define IEEE80211_IE_SSID   0

Information element ID for SSID information element.

Definition at line 582 of file ieee80211.h.

◆ IEEE80211_IE_RATES

#define IEEE80211_IE_RATES   1

Information element ID for rates information element.

Definition at line 600 of file ieee80211.h.

◆ IEEE80211_IE_EXT_RATES

#define IEEE80211_IE_EXT_RATES   50

Information element ID for extended rates information element.

Definition at line 603 of file ieee80211.h.

◆ IEEE80211_IE_DS_PARAM

#define IEEE80211_IE_DS_PARAM   3

Information element ID for Direct Spectrum parameter information element.

Definition at line 620 of file ieee80211.h.

◆ IEEE80211_IE_COUNTRY

#define IEEE80211_IE_COUNTRY   7

Information element ID for Country information element.

Definition at line 668 of file ieee80211.h.

◆ IEEE80211_IE_REQUEST

#define IEEE80211_IE_REQUEST   10

Information element ID for Request information element.

Definition at line 683 of file ieee80211.h.

◆ IEEE80211_IE_CHALLENGE_TEXT

#define IEEE80211_IE_CHALLENGE_TEXT   16

Information element ID for Challenge Text information element.

Definition at line 698 of file ieee80211.h.

◆ IEEE80211_IE_POWER_CONSTRAINT

#define IEEE80211_IE_POWER_CONSTRAINT   52

Information element ID for Power Constraint information element.

Definition at line 713 of file ieee80211.h.

◆ IEEE80211_IE_POWER_CAPAB

#define IEEE80211_IE_POWER_CAPAB   33

Information element ID for Power Capability information element.

Definition at line 730 of file ieee80211.h.

◆ IEEE80211_IE_CHANNELS

#define IEEE80211_IE_CHANNELS   36

Information element ID for Channels information element.

Definition at line 754 of file ieee80211.h.

◆ IEEE80211_IE_ERP_INFO

#define IEEE80211_IE_ERP_INFO   42

Information element ID for ERP Information information element.

Definition at line 768 of file ieee80211.h.

◆ IEEE80211_ERP_NONERP_PRESENT

#define IEEE80211_ERP_NONERP_PRESENT   0x01

ERP information element: Flag set if 802.11b stations are present.

Definition at line 771 of file ieee80211.h.

◆ IEEE80211_ERP_USE_PROTECTION

#define IEEE80211_ERP_USE_PROTECTION   0x02

ERP information element: Flag set if CTS protection must be used.

Definition at line 774 of file ieee80211.h.

◆ IEEE80211_ERP_BARKER_LONG

#define IEEE80211_ERP_BARKER_LONG   0x04

ERP information element: Flag set if long preambles must be used.

Definition at line 777 of file ieee80211.h.

◆ IEEE80211_IE_RSN

#define IEEE80211_IE_RSN   48

Information element ID for Robust Security Network information element.

Definition at line 834 of file ieee80211.h.

◆ _MKOUI

#define _MKOUI (   a,
  b,
  c,
 
)    ( ( ( t ) << 24 ) | ( ( c ) << 16 ) | ( ( b ) << 8 ) | ( a ) )

Make OUI plus type byte into 32-bit integer for easy comparison.

Definition at line 856 of file ieee80211.h.

◆ OUI_ORG_MASK

#define OUI_ORG_MASK   0x00FFFFFF

Definition at line 858 of file ieee80211.h.

◆ OUI_TYPE_MASK

#define OUI_TYPE_MASK   0xFF000000

Definition at line 859 of file ieee80211.h.

◆ IEEE80211_RSN_OUI

#define IEEE80211_RSN_OUI   _MKOUI ( 0x00, 0x0F, 0xAC, 0 )

Organization part for OUIs in standard RSN IE.

Definition at line 863 of file ieee80211.h.

◆ IEEE80211_WPA_OUI

#define IEEE80211_WPA_OUI   _MKOUI ( 0x00, 0x50, 0xF2, 0 )

Organization part for OUIs in old WPA IE.

Definition at line 866 of file ieee80211.h.

◆ IEEE80211_WPA_OUI_VEN

#define IEEE80211_WPA_OUI_VEN   _MKOUI ( 0x00, 0x50, 0xF2, 0x01 )

Old vendor-type WPA IE OUI type + subtype.

Definition at line 869 of file ieee80211.h.

◆ IEEE80211_RSN_VERSION

#define IEEE80211_RSN_VERSION   1

802.11 RSN IE: expected version number

Definition at line 873 of file ieee80211.h.

◆ IEEE80211_RSN_CTYPE_WEP40

#define IEEE80211_RSN_CTYPE_WEP40   _MKOUI ( 0, 0, 0, 0x01 )

802.11 RSN IE: cipher type for 40-bit WEP

Definition at line 876 of file ieee80211.h.

◆ IEEE80211_RSN_CTYPE_WEP104

#define IEEE80211_RSN_CTYPE_WEP104   _MKOUI ( 0, 0, 0, 0x05 )

802.11 RSN IE: cipher type for 104-bit WEP

Definition at line 879 of file ieee80211.h.

◆ IEEE80211_RSN_CTYPE_TKIP

#define IEEE80211_RSN_CTYPE_TKIP   _MKOUI ( 0, 0, 0, 0x02 )

802.11 RSN IE: cipher type for TKIP ("WPA")

Definition at line 882 of file ieee80211.h.

◆ IEEE80211_RSN_CTYPE_CCMP

#define IEEE80211_RSN_CTYPE_CCMP   _MKOUI ( 0, 0, 0, 0x04 )

802.11 RSN IE: cipher type for CCMP ("WPA2")

Definition at line 885 of file ieee80211.h.

◆ IEEE80211_RSN_CTYPE_USEGROUP

#define IEEE80211_RSN_CTYPE_USEGROUP   _MKOUI ( 0, 0, 0, 0x00 )

802.11 RSN IE: cipher type for "use group"

This can only appear as a pairwise cipher, and means unicast frames should be encrypted in the same way as broadcast/multicast frames.

Definition at line 892 of file ieee80211.h.

◆ IEEE80211_RSN_ATYPE_8021X

#define IEEE80211_RSN_ATYPE_8021X   _MKOUI ( 0, 0, 0, 0x01 )

802.11 RSN IE: auth method type for using an 802.1X server

Definition at line 895 of file ieee80211.h.

◆ IEEE80211_RSN_ATYPE_PSK

#define IEEE80211_RSN_ATYPE_PSK   _MKOUI ( 0, 0, 0, 0x02 )

802.11 RSN IE: auth method type for using a pre-shared key

Definition at line 898 of file ieee80211.h.

◆ IEEE80211_RSN_CAPAB_PREAUTH

#define IEEE80211_RSN_CAPAB_PREAUTH   0x001

802.11 RSN IE capabilities: AP supports pre-authentication

Definition at line 901 of file ieee80211.h.

◆ IEEE80211_RSN_CAPAB_NO_PAIRWISE

#define IEEE80211_RSN_CAPAB_NO_PAIRWISE   0x002

802.11 RSN IE capabilities: Node has conflict between TKIP and WEP

This is a legacy issue; APs always set it to 0, and iPXE sets it to 0.

Definition at line 908 of file ieee80211.h.

◆ IEEE80211_RSN_CAPAB_PTKSA_REPLAY

#define IEEE80211_RSN_CAPAB_PTKSA_REPLAY   0x00C

802.11 RSN IE capabilities: Number of PTKSA replay counters

A value of 0 means one replay counter, 1 means two, 2 means four, and 3 means sixteen.

Definition at line 915 of file ieee80211.h.

◆ IEEE80211_RSN_CAPAB_GTKSA_REPLAY

#define IEEE80211_RSN_CAPAB_GTKSA_REPLAY   0x030

802.11 RSN IE capabilities: Number of GTKSA replay counters

A value of 0 means one replay counter, 1 means two, 2 means four, and 3 means sixteen.

Definition at line 922 of file ieee80211.h.

◆ IEEE80211_RSN_CAPAB_PEERKEY

#define IEEE80211_RSN_CAPAB_PEERKEY   0x200

802.11 RSN IE capabilities: PeerKey Handshaking is suported

Definition at line 925 of file ieee80211.h.

◆ IEEE80211_RSN_1_CTR

#define IEEE80211_RSN_1_CTR   0x000

802.11 RSN IE capabilities: One replay counter

This should be AND'ed with IEEE80211_RSN_CAPAB_PTKSA_REPLAY or IEEE80211_RSN_CAPAB_GTKSA_REPLAY (or both) to produce a value which can be OR'ed into the capabilities field.

Definition at line 934 of file ieee80211.h.

◆ IEEE80211_RSN_2_CTR

#define IEEE80211_RSN_2_CTR   0x014

802.11 RSN IE capabilities: Two replay counters

Definition at line 937 of file ieee80211.h.

◆ IEEE80211_RSN_4_CTR

#define IEEE80211_RSN_4_CTR   0x028

802.11 RSN IE capabilities: Four replay counters

Definition at line 940 of file ieee80211.h.

◆ IEEE80211_RSN_16_CTR

#define IEEE80211_RSN_16_CTR   0x03C

802.11 RSN IE capabilities: 16 replay counters

Definition at line 943 of file ieee80211.h.

◆ IEEE80211_IE_VENDOR

#define IEEE80211_IE_VENDOR   221

Information element ID for Vendor Specific information element.

Definition at line 960 of file ieee80211.h.

Function Documentation

◆ ieee80211_rsn_size()

static size_t ieee80211_rsn_size ( int  npair,
int  nauth,
int  npmkid,
int  rsn_ie 
)
inlinestatic

Calculate necessary size of RSN information element.

Parameters
npairNumber of pairwise ciphers supported
nauthNumber of authentication types supported
npmkidNumber of PMKIDs to include
is_rsnIf TRUE, calculate RSN IE size; if FALSE, calculate WPA IE size
Return values
sizeNecessary size of IE, including header bytes

Definition at line 844 of file ieee80211.h.

845  {
846  return 16 + 4 * ( npair + nauth ) + 16 * npmkid - 4 * ! rsn_ie;
847 }

Referenced by wpa_make_rsn_ie().

◆ ieee80211_ie_bound()

static int ieee80211_ie_bound ( union ieee80211_ie ie,
void *  end 
)
inlinestatic

Check that 802.11 information element is bounded by buffer.

Parameters
ieInformation element
endEnd of buffer in which information element is stored
Return values
okTRUE if the IE is completely contained within the buffer

Definition at line 1012 of file ieee80211.h.

1013 {
1014  void *iep = ie;
1015  return ( iep + 2 <= end && iep + 2 + ie->len <= end );
1016 }
u8 len
Information element data length.
Definition: ieee80211.h:977
uint32_t end
Ending offset.
Definition: netvsc.h:18

References end, and len.

Referenced by net80211_probe_step(), net80211_process_ie(), sec80211_find_rsn(), and wpa_maybe_install_gtk().

◆ ieee80211_next_ie()

static union ieee80211_ie* ieee80211_next_ie ( union ieee80211_ie ie,
void *  end 
)
static

Advance to next 802.11 information element.

Parameters
ieCurrent information element pointer
endPointer to first byte not in information element space
Return values
nextPointer to next information element, or NULL if no more

When processing received IEs, end should be set to the I/O buffer tail pointer; when marshalling IEs for sending, end should be NULL.

Definition at line 1028 of file ieee80211.h.

1030 {
1031  void *next_ie_byte = ( void * ) ie + ie->len + 2;
1032  union ieee80211_ie *next_ie = next_ie_byte;
1033 
1034  if ( ! end )
1035  return next_ie;
1036 
1037  if ( ieee80211_ie_bound ( next_ie, end ) )
1038  return next_ie;
1039 
1040  return NULL;
1041 }
static int ieee80211_ie_bound(union ieee80211_ie *ie, void *end)
Check that 802.11 information element is bounded by buffer.
Definition: ieee80211.h:1012
Any 802.11 information element.
Definition: ieee80211.h:972
u8 len
Information element data length.
Definition: ieee80211.h:977
uint32_t end
Ending offset.
Definition: netvsc.h:18
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
if(natsemi->flags &NATSEMI_64BIT) return 1

Referenced by net80211_marshal_request_info(), net80211_probe_step(), net80211_process_ie(), sec80211_find_rsn(), and wpa_maybe_install_gtk().

Variable Documentation

◆ __attribute__