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_ie * | ieee80211_next_ie (union ieee80211_ie *ie, void *end) |
| Advance to next 802.11 information element. | |
Variables | |
| struct ieee80211_frame | packed |
| An 802.11 data or management frame without QoS or WDS header fields. | |
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 gPXE does not require that in those it receives.
This group also includes a few inline functions to simplify common tasks in IE processing.
| #define IEEE80211_IE_SSID 0 |
Information element ID for SSID information element.
Definition at line 581 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 599 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 602 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 619 of file ieee80211.h.
Referenced by net80211_process_ie().
| #define IEEE80211_IE_COUNTRY 7 |
Information element ID for Country information element.
Definition at line 667 of file ieee80211.h.
Referenced by net80211_process_ie().
| #define IEEE80211_IE_REQUEST 10 |
| #define IEEE80211_IE_CHALLENGE_TEXT 16 |
Information element ID for Challenge Text information element.
Definition at line 697 of file ieee80211.h.
| #define IEEE80211_IE_POWER_CONSTRAINT 52 |
Information element ID for Power Constraint information element.
Definition at line 712 of file ieee80211.h.
| #define IEEE80211_IE_POWER_CAPAB 33 |
Information element ID for Power Capability information element.
Definition at line 729 of file ieee80211.h.
| #define IEEE80211_IE_CHANNELS 36 |
Information element ID for Channels information element.
Definition at line 753 of file ieee80211.h.
| #define IEEE80211_IE_ERP_INFO 42 |
Information element ID for ERP Information information element.
Definition at line 767 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 770 of file ieee80211.h.
| #define IEEE80211_ERP_USE_PROTECTION 0x02 |
ERP information element: Flag set if CTS protection must be used.
Definition at line 773 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 776 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 833 of file ieee80211.h.
Referenced by net80211_marshal_request_info(), sec80211_find_rsn(), and wpa_make_rsn_ie().
| #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.
Definition at line 855 of file ieee80211.h.
| #define OUI_ORG_MASK 0x00FFFFFF |
Definition at line 857 of file ieee80211.h.
| #define OUI_TYPE_MASK 0xFF000000 |
| #define IEEE80211_RSN_OUI _MKOUI ( 0x00, 0x0F, 0xAC, 0 ) |
Organization part for OUIs in standard RSN IE.
Definition at line 862 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 865 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 868 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 872 of file ieee80211.h.
Referenced by sec80211_find_rsn(), and wpa_make_rsn_ie().
| #define IEEE80211_RSN_CTYPE_WEP40 _MKOUI ( 0, 0, 0, 0x01 ) |
| #define IEEE80211_RSN_CTYPE_WEP104 _MKOUI ( 0, 0, 0, 0x05 ) |
| #define IEEE80211_RSN_CTYPE_TKIP _MKOUI ( 0, 0, 0, 0x02 ) |
| #define IEEE80211_RSN_CTYPE_CCMP _MKOUI ( 0, 0, 0, 0x04 ) |
| #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 891 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 894 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 897 of file ieee80211.h.
| #define IEEE80211_RSN_CAPAB_PREAUTH 0x001 |
802.11 RSN IE capabilities: AP supports pre-authentication
Definition at line 900 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 gPXE sets it to 0.
Definition at line 907 of file ieee80211.h.
| #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 914 of file ieee80211.h.
| #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 921 of file ieee80211.h.
| #define IEEE80211_RSN_CAPAB_PEERKEY 0x200 |
802.11 RSN IE capabilities: PeerKey Handshaking is suported
Definition at line 924 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 933 of file ieee80211.h.
| #define IEEE80211_RSN_2_CTR 0x014 |
| #define IEEE80211_RSN_4_CTR 0x028 |
| #define IEEE80211_RSN_16_CTR 0x03C |
| #define IEEE80211_IE_VENDOR 221 |
Information element ID for Vendor Specific information element.
Definition at line 959 of file ieee80211.h.
Referenced by net80211_marshal_request_info(), sec80211_find_rsn(), wpa_handle_1_of_4(), wpa_make_rsn_ie(), and wpa_maybe_install_gtk().
| static size_t ieee80211_rsn_size | ( | int | npair, | |
| int | nauth, | |||
| int | npmkid, | |||
| int | rsn_ie | |||
| ) | [inline, static] |
Calculate necessary size of RSN information element.
| npair | Number of pairwise ciphers supported | |
| nauth | Number of authentication types supported | |
| npmkid | Number of PMKIDs to include | |
| is_rsn | If TRUE, calculate RSN IE size; if FALSE, calculate WPA IE size |
| size | Necessary size of IE, including header bytes |
Definition at line 843 of file ieee80211.h.
Referenced by wpa_make_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.
| ie | Information element | |
| end | End of buffer in which information element is stored |
| ok | TRUE if the IE is completely contained within the buffer |
Definition at line 1011 of file ieee80211.h.
References len.
Referenced by ieee80211_next_ie(), net80211_probe_step(), net80211_process_ie(), sec80211_find_rsn(), wpa_handle_1_of_4(), and wpa_maybe_install_gtk().
01012 { 01013 void *iep = ie; 01014 return ( iep + 2 <= end && iep + 2 + ie->len <= end ); 01015 }
| static union ieee80211_ie* ieee80211_next_ie | ( | union ieee80211_ie * | ie, | |
| void * | end | |||
| ) | [static, write] |
Advance to next 802.11 information element.
| ie | Current information element pointer | |
| end | Pointer to first byte not in information element space |
| next | Pointer to next information element, or NULL if no more |
Definition at line 1027 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(), wpa_handle_1_of_4(), and wpa_maybe_install_gtk().
01029 { 01030 void *next_ie_byte = ( void * ) ie + ie->len + 2; 01031 union ieee80211_ie *next_ie = next_ie_byte; 01032 01033 if ( ! end ) 01034 return next_ie; 01035 01036 if ( ieee80211_ie_bound ( next_ie, end ) ) 01037 return next_ie; 01038 01039 return NULL; 01040 }
| struct ieee80211_auth packed |
An 802.11 data or management frame without QoS or WDS header fields.
Authentication frame data.
Probe request frame data.
Reassociation request frame data.
Association or reassociation response frame data.
Association request frame data.
Disassociation or deauthentication frame data.
Beacon or probe response frame data.
802.11 Vendor Specific information element
802.11 Robust Security Network ("WPA") information element
802.11 ERP Information information element
802.11 Channels information element
802.11 Channels information element channel band tuple
802.11 Power Capability information element
802.11 Power Constraint information element
802.11 Challenge Text information element
802.11 Request information element
802.11 Country information element
802.11 Country information element regulatory band triplet
802.11 Country information element regulatory extension triplet
802.11 Direct Spectrum parameter information element
802.11 rates information element
802.11 SSID information element
Generic 802.11 information element header.
10-byte CTS or ACK frame format, with abbreviated header
16-byte RTS frame format, with abbreviated header
The 802.2 LLC/SNAP header sent before actual data in a data frame.
This header is not acknowledged in the 802.11 standard at all; it is treated just like data for MAC-layer purposes, including fragmentation and encryption. It is actually two headers concatenated: a three-byte 802.2 LLC header indicating Subnetwork Accesss Protocol (SNAP) in both source and destination Service Access Point (SAP) fields, and a five-byte SNAP header indicating a zero OUI and two-byte Ethernet protocol type field.
Thus, an eight-byte header in which six of the bytes are redundant. Lovely, isn't it?
The first 8 rates go in an IE of type RATES (1), and any more rates go in one of type EXT_RATES (50). Each rate is a byte with the low 7 bits equal to the rate in units of 500 kbps, and the high bit set if and only if the rate is "basic" (must be supported by all connected stations).
This just contains the channel number. It has the fancy name because IEEE 802.11 also defines a frequency-hopping PHY that changes channels at regular intervals following a predetermined pattern; in practice nobody uses the FH PHY.
This contains some data about RF regulations.
This contains a list of information element types we would like to be included in probe response frames.
This is used in authentication frames under Shared Key authentication.
This is used to specify an additional power limitation on top of the Country requirements.
This is used in association request frames to indicate the extremes of our TX power abilities. It is required only if we indicate support for spectrum management.
This is used in association frames to indicate the channels we can use. It is required only if we indicate support for spectrum management.
This is used to communicate some PHY-level flags.
Showing once again a striking clarity of design, the IEEE folks put dynamically-sized data in the middle of this structure. As such, the below structure definition only works for IEs we create ourselves, which always have one pairwise cipher and one AKM; received IEs should be parsed piecemeal.
Also inspired was IEEE's choice of 16-bit fields to count the number of 4-byte elements in a structure with a maximum length of 255 bytes.
Many fields reference a cipher or authentication-type ID; this is a three-byte OUI followed by one byte identifying the cipher with respect to that OUI. For all standard ciphers the OUI is 00:0F:AC, except in old-style WPA IEs encapsulated in vendor-specific IEs, where it's 00:50:F2.
One often sees the RSN IE masquerading as vendor-specific on devices that were produced prior to 802.11i (the WPA amendment) being finalized.
1.5.7.1