#include "os.h"
#include <stdint.h>
#include "wpa_debug.h"
Go to the source code of this file.
Defines | |
#define | __BIG_ENDIAN 4321 |
#define | __bitwise |
#define | __force |
#define | __LITTLE_ENDIAN 1234 |
#define | __must_check |
#define | aliasing_hide_typecast(a, t) (t *) __hide_aliasing_typecast((a)) |
#define | be_to_host16(n) bswap_16((__force u16) (be16) (n)) |
#define | be_to_host32(n) bswap_32((__force u32) (be32) (n)) |
#define | be_to_host64(n) bswap_64((__force u64) (be64) (n)) |
#define | BIT(x) (1 << (x)) |
#define | ETH_ALEN 6 |
#define | ETH_P_ALL 0x0003 |
#define | ETH_P_EAPOL ETH_P_PAE |
#define | ETH_P_PAE 0x888E |
#define | ETH_P_RRB 0x890D |
#define | ETH_P_RSN_PREAUTH 0x88c7 |
#define | host_to_be16(n) ((__force be16) bswap_16((n))) |
#define | host_to_be32(n) ((__force be32) bswap_32((n))) |
#define | host_to_be64(n) ((__force be64) bswap_64((n))) |
#define | host_to_le16(n) ((__force le16) (u16) (n)) |
#define | host_to_le32(n) ((__force le32) (u32) (n)) |
#define | host_to_le64(n) ((__force le64) (u64) (n)) |
#define | IFNAMSIZ 16 |
#define | le_to_host16(n) ((__force u16) (le16) (n)) |
#define | le_to_host32(n) ((__force u32) (le32) (n)) |
#define | le_to_host64(n) ((__force u64) (le64) (n)) |
#define | MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
#define | MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" |
#define | PRINTF_FORMAT(a, b) |
#define | STRUCT_PACKED |
#define | WPA_BYTE_SWAP_DEFINED |
#define | WPA_GET_BE16(a) ((u16) (((a)[0] << 8) | (a)[1])) |
#define | WPA_GET_BE24(a) |
#define | WPA_GET_BE32(a) |
#define | WPA_GET_BE64(a) |
#define | WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) |
#define | WPA_GET_LE32(a) |
#define | WPA_GET_LE64(a) |
#define | WPA_PUT_BE16(a, val) |
#define | WPA_PUT_BE24(a, val) |
#define | WPA_PUT_BE32(a, val) |
#define | WPA_PUT_BE64(a, val) |
#define | WPA_PUT_LE16(a, val) |
#define | WPA_PUT_LE32(a, val) |
#define | wpa_strdup_tchar(s) strdup((s)) |
#define | WPA_TYPES_DEFINED |
#define | wpa_unicode2ascii_inplace(s) do { } while (0) |
Typedefs | |
typedef u16 __bitwise | be16 |
typedef u32 __bitwise | be32 |
typedef u64 __bitwise | be64 |
typedef u16 __bitwise | le16 |
typedef u32 __bitwise | le32 |
typedef u64 __bitwise | le64 |
typedef int16_t | s16 |
typedef int32_t | s32 |
typedef int64_t | s64 |
typedef int8_t | s8 |
typedef uint16_t | u16 |
typedef uint32_t | u32 |
typedef uint64_t | u64 |
typedef uint8_t | u8 |
Functions | |
void * | __hide_aliasing_typecast (void *foo) |
int | hexstr2bin (const char *hex, u8 *buf, size_t len) |
int | hwaddr_aton (const char *txt, u8 *addr) |
int | hwaddr_aton2 (const char *txt, u8 *addr) |
void | inc_byte_array (u8 *counter, size_t len) |
static int | is_zero_ether_addr (const u8 *a) |
void | wpa_get_ntp_timestamp (u8 *buf) |
int | wpa_snprintf_hex (char *buf, size_t buf_size, const u8 *data, size_t len) |
int | wpa_snprintf_hex_uppercase (char *buf, size_t buf_size, const u8 *data, size_t len) |
const char * | wpa_ssid_txt (const u8 *ssid, size_t ssid_len) |
#define aliasing_hide_typecast | ( | a, | |||
t | ) | (t *) __hide_aliasing_typecast((a)) |
#define MAC2STR | ( | a | ) | (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
struct radius_attr_vendor STRUCT_PACKED |
#define WPA_GET_BE16 | ( | a | ) | ((u16) (((a)[0] << 8) | (a)[1])) |
#define WPA_GET_BE24 | ( | a | ) |
#define WPA_GET_BE32 | ( | a | ) |
#define WPA_GET_BE64 | ( | a | ) |
#define WPA_GET_LE16 | ( | a | ) | ((u16) (((a)[1] << 8) | (a)[0])) |
#define WPA_GET_LE32 | ( | a | ) |
#define WPA_GET_LE64 | ( | a | ) |
#define WPA_PUT_BE16 | ( | a, | |||
val | ) |
#define WPA_PUT_BE24 | ( | a, | |||
val | ) |
#define WPA_PUT_BE32 | ( | a, | |||
val | ) |
#define WPA_PUT_BE64 | ( | a, | |||
val | ) |
do { \ (a)[0] = (u8) (((u64) (val)) >> 56); \ (a)[1] = (u8) (((u64) (val)) >> 48); \ (a)[2] = (u8) (((u64) (val)) >> 40); \ (a)[3] = (u8) (((u64) (val)) >> 32); \ (a)[4] = (u8) (((u64) (val)) >> 24); \ (a)[5] = (u8) (((u64) (val)) >> 16); \ (a)[6] = (u8) (((u64) (val)) >> 8); \ (a)[7] = (u8) (((u64) (val)) & 0xff); \ } while (0)
#define WPA_PUT_LE16 | ( | a, | |||
val | ) |
#define WPA_PUT_LE32 | ( | a, | |||
val | ) |
int hexstr2bin | ( | const char * | hex, | |
u8 * | buf, | |||
size_t | len | |||
) |
int hwaddr_aton | ( | const char * | txt, | |
u8 * | addr | |||
) |
int hwaddr_aton2 | ( | const char * | txt, | |
u8 * | addr | |||
) |
void inc_byte_array | ( | u8 * | counter, | |
size_t | len | |||
) |
inc_byte_array - Increment arbitrary length byte array by one : Pointer to byte array : Length of the counter in bytes
This function increments the last byte of the counter by one and continues rolling over to more significant bytes if the byte was incremented from 0xff to 0x00.
static int is_zero_ether_addr | ( | const u8 * | a | ) | [inline, static] |
int wpa_snprintf_hex | ( | char * | buf, | |
size_t | buf_size, | |||
const u8 * | data, | |||
size_t | len | |||
) |
int wpa_snprintf_hex_uppercase | ( | char * | buf, | |
size_t | buf_size, | |||
const u8 * | data, | |||
size_t | len | |||
) |
wpa_snprintf_hex_uppercase - Print data as a upper case hex string into buf : Memory area to use as the output buffer : Maximum buffer size in bytes (should be at least 2 * len + 1) : Data to be printed : Length of data in bytes Returns: Number of bytes written
const char* wpa_ssid_txt | ( | const u8 * | ssid, | |
size_t | ssid_len | |||
) |
wpa_ssid_txt - Convert SSID to a printable string : SSID (32-octet string) : Length of ssid in octets Returns: Pointer to a printable string
This function can be used to convert SSIDs into printable form. In most cases, SSIDs do not use unprintable characters, but IEEE 802.11 standard does not limit the used character set, so anything could be used in an SSID.
This function uses a static buffer, so only one call can be used at the time, i.e., this is not re-entrant and the returned buffer must be used before calling this again.