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))
81#ifndef MM_STATIC_ASSERT
93#define MM_STATIC_ASSERT(_expression, _message) _Static_assert((_expression), _message)
105#define MM_ARRAY_COUNT(_a) (sizeof(_a)/sizeof((_a)[0]))
127 return 'A' + nibble - 0x0a;
164#ifndef MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES
165#define MM_RSN_INFORMATION_MAX_PAIRWISE_CIPHER_SUITES (2)
169#ifndef MM_RSN_INFORMATION_MAX_AKM_SUITES
170#define MM_RSN_INFORMATION_MAX_AKM_SUITES (2)
174#define MM_RSN_INFORMATION_IE_TYPE (48)
176#define MM_VENDOR_SPECIFIC_IE_TYPE (221)
238 uint32_t search_offset, uint8_t ie_type);
251static inline int mm_find_ie(
const uint8_t *ies, uint32_t ies_len, uint8_t ie_type)
273 uint32_t search_offset,
274 const uint8_t *
id,
size_t id_len);
289 const uint8_t *
id,
size_t id_len)
#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 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_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...