Utility macros and functions relating to WLAN.
|
| struct | mm_rsn_information |
| | Data structure to represent information extracted from an RSN information element. More...
|
| |
| struct | mm_s1g_operation |
| | Data structure to represent information extracted from an S1G Operation information element. More...
|
| |
|
| const char * | mm_akm_suite_to_string (uint32_t akm_suite_oui) |
| | Get the name of the given AKM Suite as a string. More...
|
| |
| int | mm_find_ie_from_offset (const uint8_t *ies, uint32_t ies_len, uint32_t search_offset, uint8_t ie_type) |
| | Search a list of Information Elements (IEs) from the given starting offset and find the first instance of matching the given type. More...
|
| |
| static int | mm_find_ie (const uint8_t *ies, uint32_t ies_len, uint8_t ie_type) |
| | Search a list of Information Elements (IEs) and find the first instance of matching the given type. More...
|
| |
| int | mm_find_vendor_specific_ie_from_offset (const uint8_t *ies, uint32_t ies_len, uint32_t search_offset, const uint8_t *id, size_t id_len) |
| | Search through the given list of Information Elements (IEs) from the given starting offset to find the first Vendor Specific IE that matches the given id. More...
|
| |
| static int | mm_find_vendor_specific_ie (const uint8_t *ies, uint32_t ies_len, const uint8_t *id, size_t id_len) |
| | Search through the given list of Information Elements (IEs) to find the first Vendor Specific IE that matches the given id. More...
|
| |
| int | mm_parse_rsn_information (const uint8_t *ies, uint32_t ies_len, struct mm_rsn_information *output) |
| | Search through the given list of information elements to find the RSN IE then parse it to extract relevant information into an instance of mm_rsn_information. More...
|
| |
| int | mm_parse_s1g_operation (const uint8_t *ies, uint32_t ies_len, struct mm_s1g_operation *output) |
| | Find the S1G Operation information element from within a block of IEs and extract useful information from it. More...
|
| |
| static bool | mm_mac_addr_is_zero (const uint8_t *mac_addr) |
| | Determines if a given MAC address is all zeros. More...
|
| |
◆ MM_RSN_INFORMATION_IE_TYPE
| #define MM_RSN_INFORMATION_IE_TYPE (48) |
Tag number of the RSN information element, in which we can find security details of the AP.
Definition at line 190 of file mmutils.h.
◆ MM_RSN_INFORMATION_MAX_AKM_SUITES
| #define MM_RSN_INFORMATION_MAX_AKM_SUITES (2) |
Maximum number of AKM suites our parser will process.
Definition at line 186 of file mmutils.h.
◆ MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES
| #define MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES (2) |
Maximum number of pairwise cipher suites our parser will process.
Definition at line 181 of file mmutils.h.
◆ MM_S1G_OPERATION_IE_TYPE
| #define MM_S1G_OPERATION_IE_TYPE (232) |
Tag number of the S1G Operation information element.
Definition at line 194 of file mmutils.h.
◆ MM_VENDOR_SPECIFIC_IE_TYPE
| #define MM_VENDOR_SPECIFIC_IE_TYPE (221) |
Tag number of the Vendor Specific information element.
Definition at line 192 of file mmutils.h.
◆ mm_akm_suite_oui
Enumeration of Authentication Key Management (AKM) Suite OUIs as BE32 integers.
| Enumerator |
|---|
| MM_AKM_SUITE_NONE | Open (no security)
|
| MM_AKM_SUITE_PSK | Pre-shared key (WFA OUI)
|
| MM_AKM_SUITE_SAE | Simultaneous Authentication of Equals (SAE)
|
| MM_AKM_SUITE_OWE | OWE.
|
| MM_AKM_SUITE_OTHER | Another suite not in this enum.
|
Definition at line 156 of file mmutils.h.
◆ mm_cipher_suite_oui
Enumeration of Cipher Suite OUIs as BE32 integers.
| Enumerator |
|---|
| MM_CIPHER_SUITE_AES_CCM | Open (no security)
|
| MM_CIPHER_SUITE_OTHER | Another cipher suite not in this enum.
|
Definition at line 171 of file mmutils.h.
◆ mm_errno
Explicitly defined errno values to obviate the need to include errno.h.
MM prefix to avoid namespace collision in case errno.h gets included.
Definition at line 198 of file mmutils.h.
◆ mm_akm_suite_to_string()
| const char * mm_akm_suite_to_string |
( |
uint32_t |
akm_suite_oui | ) |
|
Get the name of the given AKM Suite as a string.
- Parameters
-
| akm_suite_oui | The OUI of the AKM suite as a big endian integer. |
- Returns
- the string representation.
◆ mm_find_ie()
| static int mm_find_ie |
( |
const uint8_t * |
ies, |
|
|
uint32_t |
ies_len, |
|
|
uint8_t |
ie_type |
|
) |
| |
|
inlinestatic |
Search a list of Information Elements (IEs) and find the first instance of matching the given type.
- Parameters
-
| ies | Buffer containing the information elements. |
| ies_len | Length of ies |
| ie_type | The type of the IE to look for. |
- Returns
- If the information element is found, the offset of the start of the IE within
ies; if no match is found then -1; if the IE is found but is malformed then -2.
Definition at line 270 of file mmutils.h.
◆ mm_find_ie_from_offset()
| int mm_find_ie_from_offset |
( |
const uint8_t * |
ies, |
|
|
uint32_t |
ies_len, |
|
|
uint32_t |
search_offset, |
|
|
uint8_t |
ie_type |
|
) |
| |
Search a list of Information Elements (IEs) from the given starting offset and find the first instance of matching the given type.
- Warning
- A
search_offset that is not aligned to the start of an IE header will result in undefined behaviour.
- Parameters
-
| ies | Buffer containing the information elements. |
| ies_len | Length of ies. |
| search_offset | Offset to start searching from. This must point to a IE header. |
| ie_type | The type of the IE to look for. |
- Returns
- If the information element is found, the offset of the start of the IE within
ies; if no match is found then -1; if the IE is found but is malformed then -2.
◆ mm_find_vendor_specific_ie()
| static int mm_find_vendor_specific_ie |
( |
const uint8_t * |
ies, |
|
|
uint32_t |
ies_len, |
|
|
const uint8_t * |
id, |
|
|
size_t |
id_len |
|
) |
| |
|
inlinestatic |
Search through the given list of Information Elements (IEs) to find the first Vendor Specific IE that matches the given id.
- Parameters
-
| [in] | ies | Buffer containing the information elements. |
| [in] | ies_len | Length of ies. |
| [in] | id | Buffer containing the IE ID, usually OUI+TYPE. |
| [in] | id_len | Length of the ID. |
- Returns
- If the information element is found, the offset of the start of the IE within
ies; if no match is found then -1; if the IE is found but is malformed then -2.
Definition at line 309 of file mmutils.h.
◆ mm_find_vendor_specific_ie_from_offset()
| int mm_find_vendor_specific_ie_from_offset |
( |
const uint8_t * |
ies, |
|
|
uint32_t |
ies_len, |
|
|
uint32_t |
search_offset, |
|
|
const uint8_t * |
id, |
|
|
size_t |
id_len |
|
) |
| |
Search through the given list of Information Elements (IEs) from the given starting offset to find the first Vendor Specific IE that matches the given id.
- Warning
- A
search_offset that is not aligned to the start of an IE header will result in undefined behaviour.
- Parameters
-
| [in] | ies | Buffer containing the information elements. |
| [in] | ies_len | Length of ies. |
| [in] | search_offset | Offset to start searching from. This must point to a IE header. |
| [in] | id | Buffer containing the IE ID, usually OUI+TYPE. |
| [in] | id_len | Length of the ID. |
- Returns
- If the information element is found, the offset of the start of the IE within
ies; if no match is found then -1; if the IE is found but is malformed then -2.
◆ mm_mac_addr_is_zero()
| static bool mm_mac_addr_is_zero |
( |
const uint8_t * |
mac_addr | ) |
|
|
inlinestatic |
Determines if a given MAC address is all zeros.
- Parameters
-
- Returns
true if all bytes in the given MAC address are zero, else false
Definition at line 365 of file mmutils.h.
◆ mm_parse_rsn_information()
| int mm_parse_rsn_information |
( |
const uint8_t * |
ies, |
|
|
uint32_t |
ies_len, |
|
|
struct mm_rsn_information * |
output |
|
) |
| |
Search through the given list of information elements to find the RSN IE then parse it to extract relevant information into an instance of mm_rsn_information.
- Parameters
-
| [in] | ies | Buffer containing the information elements. |
| [in] | ies_len | Length of ies. |
| [out] | output | Pointer to an instance of mm_rsn_information to receive output. |
- Returns
- -2 on parse error, -1 if the RSN IE was not found, 0 if the RSN IE was found.
◆ mm_parse_s1g_operation()
| int mm_parse_s1g_operation |
( |
const uint8_t * |
ies, |
|
|
uint32_t |
ies_len, |
|
|
struct mm_s1g_operation * |
output |
|
) |
| |
Find the S1G Operation information element from within a block of IEs and extract useful information from it.
- Parameters
-
| [in] | ies | Buffer containing the information elements. |
| [in] | ies_len | Length of ies. |
| [out] | output | Pointer to an instance of mm_rsn_information to receive output. |
- Returns
- -2 on parse error, -1 if the S1G Opration IE was not found, 0 on success.