Tor
0.4.7.0-alpha-dev
|
Inline functions for reading and writing multibyte values from the middle of strings, and for manipulating byte order. More...
Go to the source code of this file.
Functions | |
static uint8_t | get_uint8 (const void *cp) |
static void | set_uint8 (void *cp, uint8_t v) |
static uint16_t | get_uint16 (const void *cp) |
static uint32_t | get_uint32 (const void *cp) |
static uint64_t | get_uint64 (const void *cp) |
static void | set_uint16 (void *cp, uint16_t v) |
static void | set_uint32 (void *cp, uint32_t v) |
static void | set_uint64 (void *cp, uint64_t v) |
static uint16_t | tor_htons (uint16_t a) |
static uint16_t | tor_ntohs (uint16_t a) |
static uint32_t | tor_htonl (uint32_t a) |
static uint32_t | tor_ntohl (uint32_t a) |
static uint64_t | tor_htonll (uint64_t a) |
static uint64_t | tor_ntohll (uint64_t a) |
Inline functions for reading and writing multibyte values from the middle of strings, and for manipulating byte order.
Definition in file bytes.h.
|
inlinestatic |
Read a 16-bit value beginning at cp. Equivalent to *(uint16_t*)(cp), but will not cause segfaults on platforms that forbid unaligned memory access.
Definition at line 42 of file bytes.h.
Referenced by cell_unpack(), fetch_ext_or_command_from_buf(), packed_cell_get_circid(), parse_create2_payload(), peek_buf_has_control0_command(), and relay_header_unpack().
|
inlinestatic |
Read a 32-bit value beginning at cp. Equivalent to *(uint32_t*)(cp), but will not cause segfaults on platforms that forbid unaligned memory access.
Definition at line 54 of file bytes.h.
Referenced by cell_unpack(), connected_cell_parse(), get_random_virtual_addr(), and packed_cell_get_circid().
|
inlinestatic |
|
inlinestatic |
Read an 8-bit from cp.
Definition at line 23 of file bytes.h.
Referenced by cell_unpack(), connected_cell_parse(), hs_parse_address_impl(), packed_cell_get_command(), parse_socks(), pathbias_check_probe_response(), and relay_header_unpack().
|
inlinestatic |
Set a 16-bit value beginning at cp to v. Equivalent to *(uint16_t*)(cp) = v, but will not cause segfaults on platforms that forbid unaligned memory access.
Definition at line 78 of file bytes.h.
Referenced by cell_pack(), connection_write_ext_or_command(), control_send_v0_reject(), relay_header_pack(), and var_cell_pack_header().
|
inlinestatic |
Set a 32-bit value beginning at cp to v. Equivalent to *(uint32_t*)(cp) = v, but will not cause segfaults on platforms that forbid unaligned memory access.
Definition at line 87 of file bytes.h.
Referenced by cell_pack(), connected_cell_format_payload(), generate_srv(), get_random_virtual_addr(), and var_cell_pack_header().
|
inlinestatic |
Set a 64-bit value beginning at cp to v. Equivalent to *(uint64_t*)(cp) = v, but will not cause segfaults on platforms that forbid unaligned memory access.
Definition at line 96 of file bytes.h.
Referenced by commit_encode(), generate_srv(), and reveal_encode().
|
inlinestatic |
Store an 8-bit value from v to cp.
Definition at line 31 of file bytes.h.
Referenced by build_hs_address(), build_hs_checksum(), cell_pack(), connected_cell_format_payload(), relay_header_pack(), and var_cell_pack_header().
|
inlinestatic |
Convert a 32-bit value from host order to network order (big-endian).
Definition at line 163 of file bytes.h.
Referenced by ope_get_cipher(), tor_htonll(), and tor_ntohl().
|
inlinestatic |
Return a uint64_t value from a in network byte order.
Definition at line 184 of file bytes.h.
Referenced by build_mac(), commit_encode(), crypto_mac_sha3_256(), generate_srv(), reveal_encode(), and tor_ntohll().
|
inlinestatic |
Convert a 16-bit value from host order to network order (big-endian).
Definition at line 142 of file bytes.h.
Referenced by tor_ntohs().
|
inlinestatic |
|
inlinestatic |