UniRec
2.9.3
|
Data Structures | |
union | ip_addr_t |
Functions | |
INLINE int | ip_is4 (const ip_addr_t *addr) |
INLINE int | ip_is6 (const ip_addr_t *addr) |
INLINE uint32_t | ip_get_v4_as_int (ip_addr_t *addr) |
INLINE char * | ip_get_v4_as_bytes (const ip_addr_t *addr) |
INLINE ip_addr_t | ip_from_int (uint32_t i) |
INLINE ip_addr_t | ip_from_4_bytes_be (char b[4]) |
INLINE ip_addr_t | ip_from_4_bytes_le (char b[4]) |
INLINE ip_addr_t | ip_from_16_bytes_be (char b[16]) |
INLINE ip_addr_t | ip_from_16_bytes_le (char b[16]) |
INLINE int | ip_cmp (const ip_addr_t *addr1, const ip_addr_t *addr2) |
INLINE int | ip_is_null (const ip_addr_t *addr) |
INLINE int | ip_from_str (const char *str, ip_addr_t *addr) |
INLINE void | ip_to_str (const ip_addr_t *addr, char *str) |
No valid IPv6 address should look like this so it's possible to determine IP address version without explicitly storing any flag.Addresses are stored in big endian (network byte order).This implementation assumes the platform uses little endian (true for x86 architectures).
union ip_addr_t |
Convert 4B array (in network byte order) into IPv4 address encoded as ip_addr_t.
[in] | b | 4 bytes array in network byte order for conversion. |
Convert 4B array (in little-endian byte order) into IPv4 address encoded as ip_addr_t.
[in] | b | 4 bytes array in little-endian byte order for conversion. |
Check if IP address is NULL/invalid/unspecified?
There are two variants being used as invalid/unspecified address:
[in] | addr | IP address to check. |