![]() |
Morse Micro IoT SDK
2.10.4
|
Utility macros and functions relating to WLAN.
Data Structures | |
| 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... | |
Macros | |
| #define | MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES (2) |
| Maximum number of pairwise cipher suites our parser will process. More... | |
| #define | MM_RSN_INFORMATION_MAX_AKM_SUITES (2) |
| Maximum number of AKM suites our parser will process. More... | |
| #define | MM_RSN_INFORMATION_IE_TYPE (48) |
| Tag number of the RSN information element, in which we can find security details of the AP. More... | |
| #define | MM_VENDOR_SPECIFIC_IE_TYPE (221) |
| Tag number of the Vendor Specific information element. More... | |
| #define | MM_S1G_OPERATION_IE_TYPE (232) |
| Tag number of the S1G Operation information element. More... | |
Enumerations | |
| enum | mm_akm_suite_oui { MM_AKM_SUITE_NONE = 0 , MM_AKM_SUITE_PSK = 0x506f9a02 , MM_AKM_SUITE_SAE = 0x000fac08 , MM_AKM_SUITE_OWE = 0x000fac12 , MM_AKM_SUITE_OTHER = 1 } |
| Enumeration of Authentication Key Management (AKM) Suite OUIs as BE32 integers. More... | |
| enum | mm_cipher_suite_oui { MM_CIPHER_SUITE_AES_CCM = 0x000fac04 , MM_CIPHER_SUITE_OTHER = 1 } |
| Enumeration of Cipher Suite OUIs as BE32 integers. More... | |
| enum | mm_errno { MM_ENOMEM = 12 , MM_EFAULT = 14 , MM_ENODEV = 19 , MM_EINVAL = 22 , MM_ETIMEDOUT = 110 } |
| Explicitly defined errno values to obviate the need to include errno.h. More... | |
Functions | |
| 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... | |
| static bool | mm_mac_addr_is_multicast (const uint8_t *mac_addr) |
| Determines if a given MAC address is a multicast/broadcast address. More... | |
| static bool | mm_mac_addr_is_broadcast (const uint8_t *mac_addr) |
Determines if a given MAC address is the broadcast address (i.e., ff:ff:ff:ff:ff:ff ). More... | |
| static bool | mm_mac_addr_is_equal (const uint8_t *mac_addr1, const uint8_t *mac_addr2) |
| Compares two MAC addresses and determines if they are equal. More... | |
| #define MM_RSN_INFORMATION_IE_TYPE (48) |
| #define MM_RSN_INFORMATION_MAX_AKM_SUITES (2) |
| #define MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES (2) |
| #define MM_S1G_OPERATION_IE_TYPE (232) |
| #define MM_VENDOR_SPECIFIC_IE_TYPE (221) |
| enum mm_akm_suite_oui |
Enumeration of Authentication Key Management (AKM) Suite OUIs as BE32 integers.
| enum mm_cipher_suite_oui |
| enum mm_errno |
| const char * mm_akm_suite_to_string | ( | uint32_t | akm_suite_oui | ) |
Get the name of the given AKM Suite as a string.
| akm_suite_oui | The OUI of the AKM suite as a big endian integer. |
|
inlinestatic |
Search a list of Information Elements (IEs) and find the first instance of matching the given type.
| ies | Buffer containing the information elements. |
| ies_len | Length of ies |
| ie_type | The type of the IE to look for. |
ies; if no match is found then -1; if the IE is found but is malformed then -2. | 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.
search_offset that is not aligned to the start of an IE header will result in undefined behaviour.| 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. |
ies; if no match is found then -1; if the IE is found but is malformed then -2.
|
inlinestatic |
Search through the given list of Information Elements (IEs) to find the first Vendor Specific IE that matches the given id.
| [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. |
ies; if no match is found then -1; if the IE is found but is malformed then -2. | 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.
search_offset that is not aligned to the start of an IE header will result in undefined behaviour.| [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. |
ies; if no match is found then -1; if the IE is found but is malformed then -2.
|
inlinestatic |
Determines if a given MAC address is the broadcast address (i.e., ff:ff:ff:ff:ff:ff ).
| mac_addr | Array of length MMWLAN_MAC_ADDR_LEN containing a MAC address. |
true if the given MAC address is the broadcast address, else false
|
inlinestatic |
Compares two MAC addresses and determines if they are equal.
| mac_addr1 | Array of length MMWLAN_MAC_ADDR_LEN containing a MAC address. |
| mac_addr2 | Array of length MMWLAN_MAC_ADDR_LEN containing a MAC address. |
true if the two MAC addresses match, else false
|
inlinestatic |
Determines if a given MAC address is a multicast/broadcast address.
| mac_addr | Array of length MMWLAN_MAC_ADDR_LEN containing a MAC address. |
true if given MAC address is a multicast address, else false
|
inlinestatic |
Determines if a given MAC address is all zeros.
| mac_addr | Array of length MMWLAN_MAC_ADDR_LEN containing a MAC address. |
true if all bytes in the given MAC address are zero, else false | 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.
| [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. |
| 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.
| [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. |