#include "ipv6.h"
#include "rtrlib/lib/convert_byte_order_private.h"
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
Go to the source code of this file.
◆ lrtr_ipv6_addr_equal()
Compares two lrtr_ipv6_addr structs.
- Parameters
-
- Returns
- true if a == b
-
false if a != b
◆ lrtr_ipv6_addr_to_str()
int lrtr_ipv6_addr_to_str |
( |
const struct lrtr_ipv6_addr * |
ip, |
|
|
char * |
str, |
|
|
const unsigned int |
len |
|
) |
| |
Converts the passed ipv6_addr to string representation.
- Parameters
-
[in] | ip_addr | Pointer to an IPv6 address |
[out] | str | Pointer to string buf, at least INET6_ADDRSTRLEN bytes. |
[in] | len | Length of string buffer str |
- Returns
- 0 on success
-
-1 on error
◆ lrtr_ipv6_get_bits()
Extracts quantity bits from an IPv6 address.
The bit with the highest significance is bit 0. All bits that aren't in the specified range will be 0.
- Parameters
-
[in] | val | ipv6_addr |
[in] | first_bit | Position of the first bit that is extracted, inclusive. |
[in] | quantity | How many bits will be extracted. |
- Returns
- ipv6_addr, with all bits not in specified range set to 0.
◆ lrtr_ipv6_str_to_addr()
int lrtr_ipv6_str_to_addr |
( |
const char * |
str, |
|
|
struct lrtr_ipv6_addr * |
ip |
|
) |
| |
Converts the passed IPv6 address string in to lrtr_ipv6_addr struct.
- Parameters
-
- Returns
- 0 on success
-
-1 on error