Functions to work with different byte orders. More...
Functions to work with different byte orders.
Definition in file byteorder.h.
Go to the source code of this file.
Data Structures | |
union | le_uint16_t |
A 16 bit integer in little endian. More... | |
union | le_uint32_t |
A 32 bit integer in little endian. More... | |
union | le_uint64_t |
A 64 bit integer in little endian. More... | |
union | be_uint16_t |
A 16 bit integer in big endian aka network byte order. More... | |
union | be_uint32_t |
A 32 bit integer in big endian aka network byte order. More... | |
union | be_uint64_t |
A 64 bit integer in big endian aka network byte order. More... | |
typedef be_uint16_t | network_uint16_t |
A 16 bit integer in network byte order. | |
typedef be_uint32_t | network_uint32_t |
A 32 bit integer in network byte order. | |
typedef be_uint64_t | network_uint64_t |
A 64 bit integer in network byte order. | |
static uint16_t | byteorder_ltohs (le_uint16_t v) |
Convert from little endian to host byte order, 16 bit. | |
static uint32_t | byteorder_ltohl (le_uint32_t v) |
Convert from little endian to host byte order, 32 bit. | |
static uint64_t | byteorder_ltohll (le_uint64_t v) |
Convert from little endian to host byte order, 64 bit. | |
static be_uint16_t | byteorder_ltobs (le_uint16_t v) |
Convert from little endian to big endian, 16 bit. | |
static be_uint32_t | byteorder_ltobl (le_uint32_t v) |
Convert from little endian to big endian, 32 bit. | |
static be_uint64_t | byteorder_ltobll (le_uint64_t v) |
Convert from little endian to big endian, 64 bit. | |
static le_uint16_t | byteorder_btols (be_uint16_t v) |
Convert from big endian to little endian, 16 bit. | |
static le_uint32_t | byteorder_btoll (be_uint32_t v) |
Convert from big endian to little endian, 32 bit. | |
static le_uint64_t | byteorder_btolll (be_uint64_t v) |
Convert from big endian to little endian, 64 bit. | |
static le_uint16_t | byteorder_htols (uint16_t v) |
Convert from host byte order to little endian, 16 bit. | |
static le_uint32_t | byteorder_htoll (uint32_t v) |
Convert from host byte order to little endian, 32 bit. | |
static le_uint64_t | byteorder_htolll (uint64_t v) |
Convert from host byte order to little endian, 64 bit. | |
static network_uint16_t | byteorder_htons (uint16_t v) |
Convert from host byte order to network byte order, 16 bit. | |
static network_uint32_t | byteorder_htonl (uint32_t v) |
Convert from host byte order to network byte order, 32 bit. | |
static network_uint64_t | byteorder_htonll (uint64_t v) |
Convert from host byte order to network byte order, 64 bit. | |
static uint16_t | byteorder_ntohs (network_uint16_t v) |
Convert from network byte order to host byte order, 16 bit. | |
static uint32_t | byteorder_ntohl (network_uint32_t v) |
Convert from network byte order to host byte order, 32 bit. | |
static uint64_t | byteorder_ntohll (network_uint64_t v) |
Convert from network byte order to host byte order, 64 bit. | |
static uint16_t | byteorder_swaps (uint16_t v) |
Swap byte order, 16 bit. | |
static uint32_t | byteorder_swapl (uint32_t v) |
Swap byte order, 32 bit. | |
static uint64_t | byteorder_swapll (uint64_t v) |
Swap byte order, 64 bit. | |
static uint16_t | byteorder_bebuftohs (const uint8_t *buf) |
Read a big endian encoded unsigned integer from a buffer into host byte order encoded variable, 16-bit. | |
static uint32_t | byteorder_bebuftohl (const uint8_t *buf) |
Read a big endian encoded unsigned integer from a buffer into host byte order encoded variable, 32-bit. | |
static uint64_t | byteorder_bebuftohll (const uint8_t *buf) |
Read a big endian encoded unsigned integer from a buffer into host byte order encoded variable, 64-bit. | |
static void | byteorder_htobebufs (uint8_t *buf, uint16_t val) |
Write a host byte order encoded unsigned integer as big endian encoded value into a buffer, 16-bit. | |
static void | byteorder_htobebufl (uint8_t *buf, uint32_t val) |
Write a host byte order encoded unsigned integer as big endian encoded value into a buffer, 32-bit. | |
static void | byteorder_htobebufll (uint8_t *buf, uint64_t val) |
Write a host byte order encoded unsigned integer as big endian encoded value into a buffer, 64-bit. | |
static uint16_t | htons (uint16_t v) |
Convert from host byte order to network byte order, 16 bit. | |
static uint32_t | htonl (uint32_t v) |
Convert from host byte order to network byte order, 32 bit. | |
static uint64_t | htonll (uint64_t v) |
Convert from host byte order to network byte order, 64 bit. | |
static uint16_t | ntohs (uint16_t v) |
Convert from network byte order to host byte order, 16 bit. | |
static uint32_t | ntohl (uint32_t v) |
Convert from network byte order to host byte order, 32 bit. | |
static uint64_t | ntohll (uint64_t v) |
Convert from network byte order to host byte order, 64 bit. | |
static uint16_t | byteorder_lebuftohs (const uint8_t *buf) |
static uint32_t | byteorder_lebuftohl (const uint8_t *buf) |
static uint64_t | byteorder_lebuftohll (const uint8_t *buf) |
static void | byteorder_htolebufs (uint8_t *buf, uint16_t val) |
static void | byteorder_htolebufl (uint8_t *buf, uint32_t val) |
static void | byteorder_htolebufll (uint8_t *buf, uint64_t val) |
typedef be_uint16_t network_uint16_t |
A 16 bit integer in network byte order.
Definition at line 108 of file byteorder.h.
typedef be_uint32_t network_uint32_t |
A 32 bit integer in network byte order.
Definition at line 113 of file byteorder.h.
typedef be_uint64_t network_uint64_t |
A 64 bit integer in network byte order.
Definition at line 118 of file byteorder.h.
|
inlinestatic |
Read a big endian encoded unsigned integer from a buffer into host byte order encoded variable, 32-bit.
[in] | buf | position in a buffer holding the target value |
Definition at line 556 of file byteorder.h.
|
inlinestatic |
Read a big endian encoded unsigned integer from a buffer into host byte order encoded variable, 64-bit.
[in] | buf | position in a buffer holding the target value |
Definition at line 561 of file byteorder.h.
|
inlinestatic |
Read a big endian encoded unsigned integer from a buffer into host byte order encoded variable, 16-bit.
[in] | buf | position in a buffer holding the target value |
Definition at line 551 of file byteorder.h.
|
inlinestatic |
Convert from big endian to little endian, 32 bit.
[in] | v | The integer in big endian. |
v
converted to little endian. Definition at line 450 of file byteorder.h.
|
inlinestatic |
Convert from big endian to little endian, 64 bit.
[in] | v | The integer in big endian. |
v
converted to little endian. Definition at line 457 of file byteorder.h.
|
inlinestatic |
Convert from big endian to little endian, 16 bit.
[in] | v | The integer in big endian. |
v
converted to little endian. Definition at line 443 of file byteorder.h.
|
inlinestatic |
Write a host byte order encoded unsigned integer as big endian encoded value into a buffer, 32-bit.
[out] | buf | target buffer, must be able to accept 4 bytes |
[in] | val | value written to the buffer, in host byte order |
Definition at line 572 of file byteorder.h.
|
inlinestatic |
Write a host byte order encoded unsigned integer as big endian encoded value into a buffer, 64-bit.
[out] | buf | target buffer, must be able to accept 8 bytes |
[in] | val | value written to the buffer, in host byte order |
Definition at line 578 of file byteorder.h.
|
inlinestatic |
Write a host byte order encoded unsigned integer as big endian encoded value into a buffer, 16-bit.
[out] | buf | target buffer, must be able to accept 2 bytes |
[in] | val | value written to the buffer, in host byte order |
Definition at line 566 of file byteorder.h.
|
inlinestatic |
Definition at line 605 of file byteorder.h.
|
inlinestatic |
Definition at line 611 of file byteorder.h.
|
inlinestatic |
Definition at line 599 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to little endian, 32 bit.
[in] | v | The integer in host byte order. |
v
converted to little endian. Definition at line 471 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to little endian, 64 bit.
[in] | v | The integer in host byte order. |
v
converted to little endian. Definition at line 478 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to little endian, 16 bit.
[in] | v | The integer in host byte order. |
v
converted to little endian. Definition at line 464 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to network byte order, 32 bit.
[in] | v | The integer in host byte order. |
v
converted to network byte order. Definition at line 492 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to network byte order, 64 bit.
[in] | v | The integer in host byte order. |
v
converted to network byte order. Definition at line 499 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to network byte order, 16 bit.
[in] | v | The integer in host byte order. |
v
converted to network byte order. Definition at line 485 of file byteorder.h.
|
inlinestatic |
Definition at line 589 of file byteorder.h.
|
inlinestatic |
Definition at line 594 of file byteorder.h.
|
inlinestatic |
Definition at line 584 of file byteorder.h.
|
inlinestatic |
Convert from little endian to big endian, 32 bit.
[in] | v | The integer in little endian. |
v
converted to big endian. Definition at line 429 of file byteorder.h.
|
inlinestatic |
Convert from little endian to big endian, 64 bit.
[in] | v | The integer in little endian. |
v
converted to big endian. Definition at line 436 of file byteorder.h.
|
inlinestatic |
Convert from little endian to big endian, 16 bit.
[in] | v | The integer in little endian. |
v
converted to big endian. Definition at line 422 of file byteorder.h.
|
inlinestatic |
Convert from little endian to host byte order, 32 bit.
[in] | v | The integer in little endian. |
v
converted to host byte order. Definition at line 412 of file byteorder.h.
|
inlinestatic |
Convert from little endian to host byte order, 64 bit.
[in] | v | The integer in little endian. |
v
converted to host byte order. Definition at line 417 of file byteorder.h.
|
inlinestatic |
Convert from little endian to host byte order, 16 bit.
[in] | v | The integer in little endian. |
v
converted to host byte order. Definition at line 407 of file byteorder.h.
|
inlinestatic |
Convert from network byte order to host byte order, 32 bit.
[in] | v | The integer in network byte order. |
v
converted to host byte order. Definition at line 511 of file byteorder.h.
|
inlinestatic |
Convert from network byte order to host byte order, 64 bit.
[in] | v | The integer in network byte order. |
v
converted to host byte order. Definition at line 516 of file byteorder.h.
|
inlinestatic |
Convert from network byte order to host byte order, 16 bit.
[in] | v | The integer in network byte order. |
v
converted to host byte order. Definition at line 506 of file byteorder.h.
|
inlinestatic |
Swap byte order, 32 bit.
[in] | v | The integer to swap. |
Definition at line 397 of file byteorder.h.
|
inlinestatic |
Swap byte order, 64 bit.
[in] | v | The integer to swap. |
Definition at line 402 of file byteorder.h.
|
inlinestatic |
Swap byte order, 16 bit.
[in] | v | The integer to swap. |
Definition at line 392 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to network byte order, 32 bit.
[in] | v | The integer to convert. |
Definition at line 526 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to network byte order, 64 bit.
[in] | v | The integer to convert. |
Definition at line 531 of file byteorder.h.
|
inlinestatic |
Convert from host byte order to network byte order, 16 bit.
[in] | v | The integer to convert. |
Definition at line 521 of file byteorder.h.
|
inlinestatic |
Convert from network byte order to host byte order, 32 bit.
[in] | v | The integer to convert. |
Definition at line 541 of file byteorder.h.
|
inlinestatic |
Convert from network byte order to host byte order, 64 bit.
[in] | v | The integer to convert. |
Definition at line 546 of file byteorder.h.
|
inlinestatic |
Convert from network byte order to host byte order, 16 bit.
[in] | v | The integer to convert. |
Definition at line 536 of file byteorder.h.