iPXE
Data Structures | Defines | 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...

Defines

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

Functions

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

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.


Define Documentation

#define IEEE80211_IE_SSID   0

Information element ID for SSID information element.

Definition at line 582 of file ieee80211.h.

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

#define IEEE80211_IE_RATES   1

Information element ID for rates information element.

Definition at line 600 of file ieee80211.h.

Referenced by net80211_marshal_request_info(), and net80211_process_ie().

#define IEEE80211_IE_EXT_RATES   50

Information element ID for extended rates information element.

Definition at line 603 of file ieee80211.h.

Referenced by net80211_marshal_request_info(), and net80211_process_ie().

#define IEEE80211_IE_DS_PARAM   3

Information element ID for Direct Spectrum parameter information element.

Definition at line 620 of file ieee80211.h.

Referenced by net80211_process_ie().

#define IEEE80211_IE_COUNTRY   7

Information element ID for Country information element.

Definition at line 668 of file ieee80211.h.

Referenced by net80211_process_ie().

#define IEEE80211_IE_REQUEST   10

Information element ID for Request information element.

Definition at line 683 of file ieee80211.h.

#define IEEE80211_IE_CHALLENGE_TEXT   16

Information element ID for Challenge Text information element.

Definition at line 698 of file ieee80211.h.

Information element ID for Power Constraint information element.

Definition at line 713 of file ieee80211.h.

#define IEEE80211_IE_POWER_CAPAB   33

Information element ID for Power Capability information element.

Definition at line 730 of file ieee80211.h.

#define IEEE80211_IE_CHANNELS   36

Information element ID for Channels information element.

Definition at line 754 of file ieee80211.h.

#define IEEE80211_IE_ERP_INFO   42

Information element ID for ERP Information information element.

Definition at line 768 of file ieee80211.h.

Referenced by net80211_process_ie().

#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.

#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.

Referenced by net80211_process_ie().

#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.

Referenced by net80211_process_ie().

#define IEEE80211_IE_RSN   48

Information element ID for Robust Security Network information element.

Definition at line 834 of file ieee80211.h.

Referenced by net80211_marshal_request_info(), sec80211_find_rsn(), and wpa_make_rsn_ie().

#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.

#define OUI_ORG_MASK   0x00FFFFFF

Definition at line 858 of file ieee80211.h.

#define OUI_TYPE_MASK   0xFF000000

Definition at line 859 of file ieee80211.h.

Referenced by sec80211_rsn_get_net80211_crypt().

#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.

Referenced by rsn_get_desc().

#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.

Referenced by rsn_get_desc().

#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.

Referenced by sec80211_find_rsn(), and wpa_make_rsn_ie().

#define IEEE80211_RSN_VERSION   1

802.11 RSN IE: expected version number

Definition at line 873 of file ieee80211.h.

Referenced by sec80211_find_rsn(), and wpa_make_rsn_ie().

#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.

#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.

#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.

#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.

#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.

#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.

#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.

#define IEEE80211_RSN_CAPAB_PREAUTH   0x001

802.11 RSN IE capabilities: AP supports pre-authentication

Definition at line 901 of file ieee80211.h.

#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.

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.

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.

#define IEEE80211_RSN_CAPAB_PEERKEY   0x200

802.11 RSN IE capabilities: PeerKey Handshaking is suported

Definition at line 925 of file ieee80211.h.

#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.

#define IEEE80211_RSN_2_CTR   0x014

802.11 RSN IE capabilities: Two replay counters

Definition at line 937 of file ieee80211.h.

#define IEEE80211_RSN_4_CTR   0x028

802.11 RSN IE capabilities: Four replay counters

Definition at line 940 of file ieee80211.h.

#define IEEE80211_RSN_16_CTR   0x03C

802.11 RSN IE capabilities: 16 replay counters

Definition at line 943 of file ieee80211.h.

#define IEEE80211_IE_VENDOR   221

Information element ID for Vendor Specific information element.

Definition at line 960 of file ieee80211.h.

Referenced by net80211_marshal_request_info(), sec80211_find_rsn(), wpa_make_rsn_ie(), and wpa_maybe_install_gtk().


Function Documentation

static size_t ieee80211_rsn_size ( int  npair,
int  nauth,
int  npmkid,
int  rsn_ie 
) [inline, static]

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.

Referenced by wpa_make_rsn_ie().

                                                       {
        return 16 + 4 * ( npair + nauth ) + 16 * npmkid - 4 * ! rsn_ie;
}
static int ieee80211_ie_bound ( union ieee80211_ie ie,
void *  end 
) [inline, static]

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.

References len.

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

{
        void *iep = ie;
        return ( iep + 2 <= end && iep + 2 + ie->len <= end );
}
static union ieee80211_ie* ieee80211_next_ie ( union ieee80211_ie ie,
void *  end 
) [static, write]

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.

References ieee80211_ie_bound(), len, and NULL.

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

{
        void *next_ie_byte = ( void * ) ie + ie->len + 2;
        union ieee80211_ie *next_ie = next_ie_byte;

        if ( ! end )
                return next_ie;

        if ( ieee80211_ie_bound ( next_ie, end ) )
                return next_ie;

        return NULL;
}

Variable Documentation