LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
common.h File Reference
#include "os.h"
#include <stdint.h>
#include "wpa_debug.h"

Go to the source code of this file.

Macros

#define WPA_TYPES_DEFINED
 
#define __LITTLE_ENDIAN   1234
 
#define __BIG_ENDIAN   4321
 
#define WPA_BYTE_SWAP_DEFINED
 
#define WPA_GET_BE16(a)   ((u16) (((a)[0] << 8) | (a)[1]))
 
#define WPA_PUT_BE16(a, val)
 
#define WPA_GET_LE16(a)   ((u16) (((a)[1] << 8) | (a)[0]))
 
#define WPA_PUT_LE16(a, val)
 
#define WPA_GET_BE24(a)
 
#define WPA_PUT_BE24(a, val)
 
#define WPA_GET_BE32(a)
 
#define WPA_PUT_BE32(a, val)
 
#define WPA_GET_LE32(a)
 
#define WPA_PUT_LE32(a, val)
 
#define WPA_GET_BE64(a)
 
#define WPA_PUT_BE64(a, val)
 
#define WPA_GET_LE64(a)
 
#define ETH_ALEN   6
 
#define IFNAMSIZ   16
 
#define ETH_P_ALL   0x0003
 
#define ETH_P_PAE   0x888E /* Port Access Entity (IEEE 802.1X) */
 
#define ETH_P_EAPOL   ETH_P_PAE
 
#define ETH_P_RSN_PREAUTH   0x88c7
 
#define ETH_P_RRB   0x890D
 
#define PRINTF_FORMAT(a, b)
 
#define STRUCT_PACKED
 
#define MAC2STR(a)   (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
 
#define MACSTR   "%02x:%02x:%02x:%02x:%02x:%02x"
 
#define BIT(x)   (1 << (x))
 
#define __force
 
#define __bitwise
 
#define __must_check
 
#define wpa_unicode2ascii_inplace(s)   do { } while (0)
 
#define wpa_strdup_tchar(s)   strdup((s))
 
#define aliasing_hide_typecast(a, t)   (t *) __hide_aliasing_typecast((a))
 

Typedefs

typedef uint64_t u64
 
typedef uint32_t u32
 
typedef uint16_t u16
 
typedef uint8_t u8
 
typedef int64_t s64
 
typedef int32_t s32
 
typedef int16_t s16
 
typedef int8_t s8
 
typedef u16 __bitwise be16
 
typedef u16 __bitwise le16
 
typedef u32 __bitwise be32
 
typedef u32 __bitwise le32
 
typedef u64 __bitwise be64
 
typedef u64 __bitwise le64
 

Functions

int hwaddr_aton (const char *txt, u8 *addr)
 
int hwaddr_aton2 (const char *txt, u8 *addr)
 
int hexstr2bin (const char *hex, u8 *buf, size_t len)
 
void inc_byte_array (u8 *counter, size_t len)
 
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)
 
void * __hide_aliasing_typecast (void *foo)
 

Macro Definition Documentation

#define __BIG_ENDIAN   4321

Definition at line 203 of file common.h.

#define __bitwise

Definition at line 420 of file common.h.

#define __force

Definition at line 419 of file common.h.

#define __LITTLE_ENDIAN   1234

Definition at line 202 of file common.h.

#define __must_check

Definition at line 434 of file common.h.

#define aliasing_hide_typecast (   a,
 
)    (t *) __hide_aliasing_typecast((a))

Definition at line 475 of file common.h.

#define BIT (   x)    (1 << (x))

Definition at line 408 of file common.h.

#define ETH_ALEN   6

Definition at line 315 of file common.h.

#define ETH_P_ALL   0x0003

Definition at line 321 of file common.h.

#define ETH_P_EAPOL   ETH_P_PAE

Definition at line 327 of file common.h.

#define ETH_P_PAE   0x888E /* Port Access Entity (IEEE 802.1X) */

Definition at line 324 of file common.h.

#define ETH_P_RRB   0x890D

Definition at line 333 of file common.h.

#define ETH_P_RSN_PREAUTH   0x88c7

Definition at line 330 of file common.h.

#define IFNAMSIZ   16

Definition at line 318 of file common.h.

#define MAC2STR (   a)    (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]

Definition at line 403 of file common.h.

#define MACSTR   "%02x:%02x:%02x:%02x:%02x:%02x"

Definition at line 404 of file common.h.

#define PRINTF_FORMAT (   a,
 
)

Definition at line 341 of file common.h.

#define STRUCT_PACKED

Definition at line 342 of file common.h.

#define WPA_BYTE_SWAP_DEFINED

Definition at line 243 of file common.h.

#define WPA_GET_BE16 (   a)    ((u16) (((a)[0] << 8) | (a)[1]))

Definition at line 249 of file common.h.

#define WPA_GET_BE24 (   a)
Value:
((((u32) (a)[0]) << 16) | (((u32) (a)[1]) << 8) | \
((u32) (a)[2]))
uint32_t u32
Definition: common.h:158

Definition at line 263 of file common.h.

#define WPA_GET_BE32 (   a)
Value:
((((u32) (a)[0]) << 24) | (((u32) (a)[1]) << 16) | \
(((u32) (a)[2]) << 8) | ((u32) (a)[3]))
uint32_t u32
Definition: common.h:158

Definition at line 272 of file common.h.

#define WPA_GET_BE64 (   a)
Value:
((((u64) (a)[0]) << 56) | (((u64) (a)[1]) << 48) | \
(((u64) (a)[2]) << 40) | (((u64) (a)[3]) << 32) | \
(((u64) (a)[4]) << 24) | (((u64) (a)[5]) << 16) | \
(((u64) (a)[6]) << 8) | ((u64) (a)[7]))
uint64_t u64
Definition: common.h:157

Definition at line 292 of file common.h.

#define WPA_GET_LE16 (   a)    ((u16) (((a)[1] << 8) | (a)[0]))

Definition at line 256 of file common.h.

#define WPA_GET_LE32 (   a)
Value:
((((u32) (a)[3]) << 24) | (((u32) (a)[2]) << 16) | \
(((u32) (a)[1]) << 8) | ((u32) (a)[0]))
uint32_t u32
Definition: common.h:158

Definition at line 282 of file common.h.

#define WPA_GET_LE64 (   a)
Value:
((((u64) (a)[7]) << 56) | (((u64) (a)[6]) << 48) | \
(((u64) (a)[5]) << 40) | (((u64) (a)[4]) << 32) | \
(((u64) (a)[3]) << 24) | (((u64) (a)[2]) << 16) | \
(((u64) (a)[1]) << 8) | ((u64) (a)[0]))
uint64_t u64
Definition: common.h:157

Definition at line 308 of file common.h.

#define WPA_PUT_BE16 (   a,
  val 
)
Value:
do { \
(a)[0] = ((u16) (val)) >> 8; \
(a)[1] = ((u16) (val)) & 0xff; \
} while (0)
uint16_t u16
Definition: common.h:159

Definition at line 250 of file common.h.

#define WPA_PUT_BE24 (   a,
  val 
)
Value:
do { \
(a)[0] = (u8) ((((u32) (val)) >> 16) & 0xff); \
(a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
(a)[2] = (u8) (((u32) (val)) & 0xff); \
} while (0)
uint8_t u8
Definition: common.h:160
uint32_t u32
Definition: common.h:158

Definition at line 265 of file common.h.

#define WPA_PUT_BE32 (   a,
  val 
)
Value:
do { \
(a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \
(a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \
(a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \
(a)[3] = (u8) (((u32) (val)) & 0xff); \
} while (0)
uint8_t u8
Definition: common.h:160
uint32_t u32
Definition: common.h:158

Definition at line 274 of file common.h.

#define WPA_PUT_BE64 (   a,
  val 
)
Value:
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)
uint8_t u8
Definition: common.h:160
uint64_t u64
Definition: common.h:157

Definition at line 296 of file common.h.

#define WPA_PUT_LE16 (   a,
  val 
)
Value:
do { \
(a)[1] = ((u16) (val)) >> 8; \
(a)[0] = ((u16) (val)) & 0xff; \
} while (0)
uint16_t u16
Definition: common.h:159

Definition at line 257 of file common.h.

#define WPA_PUT_LE32 (   a,
  val 
)
Value:
do { \
(a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
(a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
(a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
(a)[0] = (u8) (((u32) (val)) & 0xff); \
} while (0)
uint8_t u8
Definition: common.h:160
uint32_t u32
Definition: common.h:158

Definition at line 284 of file common.h.

#define wpa_strdup_tchar (   s)    strdup((s))

Definition at line 452 of file common.h.

#define WPA_TYPES_DEFINED

Definition at line 165 of file common.h.

#define wpa_unicode2ascii_inplace (   s)    do { } while (0)

Definition at line 451 of file common.h.

Typedef Documentation

typedef u16 __bitwise be16

Definition at line 423 of file common.h.

typedef u32 __bitwise be32

Definition at line 425 of file common.h.

typedef u64 __bitwise be64

Definition at line 427 of file common.h.

typedef u16 __bitwise le16

Definition at line 424 of file common.h.

typedef u32 __bitwise le32

Definition at line 426 of file common.h.

typedef u64 __bitwise le64

Definition at line 428 of file common.h.

typedef int16_t s16

Definition at line 163 of file common.h.

typedef int32_t s32

Definition at line 162 of file common.h.

typedef int64_t s64

Definition at line 161 of file common.h.

typedef int8_t s8

Definition at line 164 of file common.h.

typedef uint16_t u16

Definition at line 159 of file common.h.

typedef uint32_t u32

Definition at line 158 of file common.h.

typedef uint64_t u64

Definition at line 157 of file common.h.

typedef uint8_t u8

Definition at line 160 of file common.h.

Function Documentation

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 
)
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 
)