Loading...
Searching...
No Matches
31#define os_bswap_64(x) ((uint64_t) \
32 ((((x) & 0xff00000000000000ull) >> 56) | \
33 (((x) & 0x00ff000000000000ull) >> 40) | \
34 (((x) & 0x0000ff0000000000ull) >> 24) | \
35 (((x) & 0x000000ff00000000ull) >> 8) | \
36 (((x) & 0x00000000ff000000ull) << 8) | \
37 (((x) & 0x0000000000ff0000ull) << 24) | \
38 (((x) & 0x000000000000ff00ull) << 40) | \
39 (((x) & 0x00000000000000ffull) << 56)))
43#define os_bswap_32(x) ((uint32_t) \
44 ((((x) & 0xff000000) >> 24) | \
45 (((x) & 0x00ff0000) >> 8) | \
46 (((x) & 0x0000ff00) << 8) | \
47 (((x) & 0x000000ff) << 24)))
51#define os_bswap_16(x) ((uint16_t) \
52 ((((x) & 0xff00) >> 8) | \
53 (((x) & 0x00ff) << 8)))
56#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
59#define ntohll(x) ((uint64_t)(x))
63#define htonll(x) ((uint64_t)(x))
67#define ntohl(x) ((uint32_t)(x))
71#define htonl(x) ((uint32_t)(x))
75#define ntohs(x) ((uint16_t)(x))
79#define htons(x) ((uint16_t)(x))
83#define htobe16(x) ((uint16_t)(x))
87#define htole16(x) os_bswap_16 (x)
91#define be16toh(x) ((uint16_t)(x))
95#define le16toh(x) os_bswap_16 (x)
99#define htobe32(x) ((uint32_t)(x))
103#define htole32(x) os_bswap_32 (x)
107#define be32toh(x) ((uint32_t)(x))
111#define le32toh(x) os_bswap_32 (x)
115#define htobe64(x) ((uint64_t)(x))
119#define htole64(x) os_bswap_64 (x)
123#define be64toh(x) ((uint64_t)(x))
127#define le64toh(x) os_bswap_64 (x)
133#define ntohll(x) os_bswap_64(x)
143#define ntohl(x) os_bswap_32(x)
151#define htons(x) os_bswap_16(x)
160#define htobe16(x) os_bswap_16(x)
164#define htole16(x) ((uint16_t)(x))
168#define be16toh(x) os_bswap_16(x)
172#define le16toh(x) ((uint16_t)(x))
176#define htobe32(x) os_bswap_32(x)
180#define htole32(x) ((uint32_t)(x))
184#define be32toh(x) os_bswap_32(x)
188#define le32toh(x) ((uint32_t)(x))
192#define htobe64(x) os_bswap_64(x)
196#define htole64(x) ((uint64_t)(x))
200#define be64toh(x) os_bswap_64(x)
204#define le64toh(x) ((uint64_t)(x))
209#if SOC_ESP_NIMBLE_CONTROLLER && CONFIG_BT_CONTROLLER_ENABLED
210void r_put_le16(
void *buf, uint16_t x);
211#define put_le16 r_put_le16
213void r_put_le24(
void *buf, uint32_t x);
214#define put_le24 r_put_le24
216void r_put_le32(
void *buf, uint32_t x);
217#define put_le32 r_put_le32
219void r_put_le64(
void *buf, uint64_t x);
220#define put_le64 r_put_le64
222uint16_t r_get_le16(
const void *buf);
223#define get_le16 r_get_le16
225uint32_t r_get_le24(
const void *buf);
226#define get_le24 r_get_le24
228uint32_t r_get_le32(
const void *buf);
229#define get_le32 r_get_le32
231uint64_t r_get_le64(
const void *buf);
232#define get_le64 r_get_le64
234void r_put_be16(
void *buf, uint16_t x);
235#define put_be16 r_put_be16
237void r_put_be24(
void *buf, uint32_t x);
238#define put_be24 r_put_be24
240void r_put_be32(
void *buf, uint32_t x);
241#define put_be32 r_put_be32
243void r_put_be64(
void *buf, uint64_t x);
244#define put_be64 r_put_be64
246uint16_t r_get_be16(
const void *buf);
247#define get_be16 r_get_be16
249uint32_t r_get_be24(
const void *buf);
250#define get_be24 r_get_be24
252uint32_t r_get_be32(
const void *buf);
253#define get_be32 r_get_be32
255uint64_t r_get_be64(
const void *buf);
256#define get_be64 r_get_be64
258void r_swap_in_place(
void *buf,
int len);
259#define swap_in_place r_swap_in_place
261void r_swap_buf(uint8_t *dst,
const uint8_t *src,
int len);
262#define swap_buf r_swap_buf
266void put_le16(
void *buf, uint16_t x);
267void put_le24(
void *buf, uint32_t x);
268void put_le32(
void *buf, uint32_t x);
269void put_le64(
void *buf, uint64_t x);
270uint16_t get_le16(
const void *buf);
271uint32_t get_le24(
const void *buf);
272uint32_t get_le32(
const void *buf);
273uint64_t get_le64(
const void *buf);
274void put_be16(
void *buf, uint16_t x);
275void put_be24(
void *buf, uint32_t x);
276void put_be32(
void *buf, uint32_t x);
277void put_be64(
void *buf, uint64_t x);
278uint16_t get_be16(
const void *buf);
279uint32_t get_be24(
const void *buf);
280uint32_t get_be32(
const void *buf);
281uint64_t get_be64(
const void *buf);
282void swap_in_place(
void *buf,
int len);
283void swap_buf(uint8_t *dst,
const uint8_t *src,
int len);