Loading...
Searching...
No Matches
common.h File Reference
`#include <stdint.h>`
`#include <stdlib.h>`
`#include <string.h>`

Go to the source code of this file.

## Macros

#define | CONFIG_CRYPTO_INTERNAL
#define | TEST_FAIL() 0
#define | MSG_DEBUG
#define | wpa_hexdump(x, args...)
#define | wpa_hexdump_key(x, args...)
#define | wpa_printf(x, args...)
#define | os_memcpy(x, y, z) memcpy(x, y, z)
#define | os_memcmp(x, y, z) memcmp(x, y, z)
#define | os_memset(x, y, z) memset(x, y, z)
#define | os_malloc(x) malloc(x)
#define | os_free(x) free(x)
#define | os_strlen(x) strlen(x)
#define | forced_memzero(ptr, len) memset(ptr, 0, len);
#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 | __must_check

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

## Macro Definition Documentation

## __must_check

#define __must_check

## CONFIG_CRYPTO_INTERNAL

#define CONFIG_CRYPTO_INTERNAL

## forced_memzero

#define forced_memzero | ( |  | ptr,
|  |  | len
| ) |  | memset(ptr, 0, len);

## MSG_DEBUG

#define MSG_DEBUG

## os_free

#define os_free | ( |  | x | ) | free(x)

## os_malloc

#define os_malloc | ( |  | x | ) | malloc(x)

## os_memcmp

#define os_memcmp | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | memcmp(x, y, z)

## os_memcpy

#define os_memcpy | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | memcpy(x, y, z)

## os_memset

#define os_memset | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | memset(x, y, z)

## os_strlen

#define os_strlen | ( |  | x | ) | strlen(x)

## TEST_FAIL

#define TEST_FAIL | ( |  | ) | 0

## WPA_GET_BE16

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

## WPA_GET_BE24

#define WPA_GET_BE24 | ( |  | a | ) |

Value:
((((u32) (a)[0]) << 16) | (((u32) (a)[1]) << 8) | \
((u32) (a)[2]))
len
uint8_t len
Definition gsm_04_11.h:0
u32
uint32_t u32
Definition common.h:25

## WPA_GET_BE32

#define WPA_GET_BE32 | ( |  | a | ) |

Value:
((((u32) (a)[0]) << 24) | (((u32) (a)[1]) << 16) | \
(((u32) (a)[2]) << 8) | ((u32) (a)[3]))

## WPA_GET_BE64

#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]))
u64
uint64_t u64
Definition common.h:24

## WPA_GET_LE16

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

## WPA_GET_LE32

#define WPA_GET_LE32 | ( |  | a | ) |

Value:
((((u32) (a)[3]) << 24) | (((u32) (a)[2]) << 16) | \
(((u32) (a)[1]) << 8) | ((u32) (a)[0]))

## WPA_GET_LE64

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

## wpa_hexdump

#define wpa_hexdump | ( |  | x,
|  |  | args...
| ) |  |

## wpa_hexdump_key

#define wpa_hexdump_key | ( |  | x,
|  |  | args...
| ) |  |

## wpa_printf

#define wpa_printf | ( |  | x,
|  |  | args...
| ) |  |

## WPA_PUT_BE16

#define WPA_PUT_BE16 | ( |  | a,
|  |  | val
| ) |  |

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

## WPA_PUT_BE24

#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)
u8
uint8_t u8
Definition common.h:27

## WPA_PUT_BE32

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

## WPA_PUT_BE64

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

## WPA_PUT_LE16

#define WPA_PUT_LE16 | ( |  | a,
|  |  | val
| ) |  |

Value:
do { \
(a)[1] = ((u16) (val)) >> 8; \
(a)[0] = ((u16) (val)) & 0xff; \
} while (0)

## WPA_PUT_LE32

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

## Typedef Documentation

## s16

typedef int16_t s16

## s32

typedef int32_t s32

## s64

typedef int64_t s64

## s8

typedef int8_t s8

## u16

typedef uint16_t u16

## u32

typedef uint32_t u32

## u64

typedef uint64_t u64

## u8

typedef uint8_t u8