IPv4 address types and helper function.
More...
IPv4 address types and helper function.
|
file | addr.h |
| IPv6 address type and helper functions definitions.
|
|
◆ ipv4_addr_equal()
Checks if two IPv4 addresses are equal.
- Parameters
-
[in] | a | An IPv4 address. |
[in] | b | Another IPv4 address. |
- Returns
- true, if
a
and b
are equal
-
false, otherwise.
Definition at line 55 of file addr.h.
◆ ipv4_addr_from_buf()
Converts an IPv4 address from a buffer of characters to a byte-represented IPv4 address.
- Note
addr_len
should be between 0 and IPV4_ADDR_MAX_STR_LEN
- Parameters
-
[out] | result | The resulting byte representation |
[in] | addr | An IPv4 address string representation |
[in] | addr_len | The amount of characters to parse |
- Returns
result
, on success
-
NULL, if
addr
was malformed
-
NULL, if
result
or addr
was NULL
◆ ipv4_addr_from_str()
Converts an IPv4 address string representation to a byte-represented IPv4 address.
- Parameters
-
[out] | result | The resulting byte representation |
[in] | addr | An IPv4 address string representation |
- Returns
result
, on success
-
NULL, if
addr
was malformed
-
NULL, if
result
or addr
was NULL
◆ ipv4_addr_to_str()
char* ipv4_addr_to_str |
( |
char * |
result, |
|
|
const ipv4_addr_t * |
addr, |
|
|
uint8_t |
result_len |
|
) |
| |
Converts an IPv4 address to its string representation.
- Parameters
-
[out] | result | The resulting string representation of at least IPV4_ADDR_MAX_STR_LEN. |
[in] | addr | An IPv4 address |
[in] | result_len | Length of result |
- Returns
result
, on success
-
NULL, if
result_len
was lesser than IPV4_ADDR_MAX_STR_LEN
-
NULL, if
result
or addr
was NULL