41#define MM_MIN(_x, _y) (((_x) < (_y)) ? (_x) : (_y))
57#define MM_MAX(_x, _y) (((_x) > (_y)) ? (_x) : (_y))
64#ifndef MM_FAST_ROUND_UP
65#define MM_FAST_ROUND_UP(x, m) ((((x) - 1) | ((m) - 1)) + 1)
69#define MM_UNUSED(_x) (void)(_x)
73#define MM_PACKED __attribute__((packed))
78#define MM_WEAK __attribute__((weak))
83#define MM_FALLTHROUGH __attribute__((fallthrough))
86#ifndef MM_STATIC_ASSERT
98#define MM_STATIC_ASSERT(_expression, _message) _Static_assert((_expression), _message)
110#define MM_ARRAY_COUNT(_a) (sizeof(_a) / sizeof((_a)[0]))
120#define MM_MEMBER_SIZE(_type, _member) (sizeof(((_type *)0)->_member))
143 return 'A' + nibble - 0x0a;
180#ifndef MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES
181#define MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES (2)
185#ifndef MM_RSN_INFORMATION_MAX_AKM_SUITES
186#define MM_RSN_INFORMATION_MAX_AKM_SUITES (2)
190#define MM_RSN_INFORMATION_IE_TYPE (48)
192#define MM_VENDOR_SPECIFIC_IE_TYPE (221)
194#define MM_S1G_OPERATION_IE_TYPE (232)
256 uint32_t search_offset, uint8_t ie_type);
270static inline int mm_find_ie(
const uint8_t *ies, uint32_t ies_len, uint8_t ie_type)
293 uint32_t search_offset,
294 const uint8_t *
id,
size_t id_len);
310 const uint8_t *
id,
size_t id_len)
367 return (mac_addr[0] | mac_addr[1] | mac_addr[2] |
368 mac_addr[3] | mac_addr[4] | mac_addr[5]) == 0x00;
#define MM_RSN_INFORMATION_MAX_AKM_SUITES
Maximum number of AKM suites our parser will process.
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...
mm_akm_suite_oui
Enumeration of Authentication Key Management (AKM) Suite OUIs as BE32 integers.
static bool mm_mac_addr_is_zero(const uint8_t *mac_addr)
Determines if a given MAC address is all zeros.
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.
const char * mm_akm_suite_to_string(uint32_t akm_suite_oui)
Get the name of the given AKM Suite as a string.
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 ...
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 th...
mm_errno
Explicitly defined errno values to obviate the need to include errno.h.
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 rel...
#define MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES
Maximum number of pairwise cipher suites our parser will process.
mm_cipher_suite_oui
Enumeration of Cipher Suite OUIs as BE32 integers.
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 instanc...
@ MM_AKM_SUITE_SAE
Simultaneous Authentication of Equals (SAE)
@ MM_AKM_SUITE_NONE
Open (no security)
@ MM_AKM_SUITE_OTHER
Another suite not in this enum.
@ MM_AKM_SUITE_PSK
Pre-shared key (WFA OUI)
@ MM_CIPHER_SUITE_OTHER
Another cipher suite not in this enum.
@ MM_CIPHER_SUITE_AES_CCM
Open (no security)
static char mm_nibble_to_hex_char(uint8_t nibble)
Convert the least significant 4 bits of the given argument to a character representing their hexadeci...
Data structure to represent information extracted from an S1G Operation information element.
uint8_t operating_channel_width_mhz
Width of the operating channel in MHz.
uint8_t operating_channel_number
Channel number of the operating channel.
uint8_t primary_channel_width_mhz
Width of the primary channel in MHz.
uint8_t primary_channel_number
Channel number of the primary channel.
uint8_t operating_class
Operating class.