|
Botan 3.12.0
Crypto and TLS for C&
|
#include <ipv6_address.h>
Public Member Functions | |
| std::span< const uint8_t, 16 > | address () const |
| std::optional< IPv4Address > | as_ipv4 () const |
| IPv6Address (std::array< uint8_t, 16 > ip) | |
| IPv6Address (std::span< const uint8_t, 16 > ip) | |
| IPv6Address | operator& (const IPv6Address &other) const |
| auto | operator<=> (const IPv6Address &) const =default |
| std::optional< size_t > | prefix_length () const |
| std::string | to_string () const |
Static Public Member Functions | |
| static std::optional< IPv6Address > | from_string (std::string_view str) |
| static IPv6Address | host_mask () |
| static IPv6Address | netmask (size_t bits) |
IPv6 Address
Definition at line 25 of file ipv6_address.h.
|
explicit |
Definition at line 17 of file ipv6_address.cpp.
Referenced by from_string(), host_mask(), netmask(), operator&(), and operator<=>().
|
inlineexplicit |
Definition at line 29 of file ipv6_address.h.
|
inline |
Definition at line 45 of file ipv6_address.h.
Referenced by Botan::IPv6Subnet::serialize().
| std::optional< IPv4Address > Botan::IPv6Address::as_ipv4 | ( | ) | const |
If this IPv6 address is an IPv4-compatible IPv6 address (RFC 4291 2.5.5.1) or an IPv4-mapped IPv6 address (RFC 4291 2.5.5.2), return the embedded IPv4 address.
Definition at line 81 of file ipv6_address.cpp.
References Botan::load_be().
|
static |
Definition at line 24 of file ipv6_address.cpp.
References IPv6Address(), and Botan::string_to_ipv6().
Referenced by Botan::IPv6Subnet::from_string(), and Botan::X509_Certificate::matches_dns_name().
|
inlinestatic |
|
static |
Return an address with the leading bits set to one and the remainder zero. Throws Invalid_Argument if bits > 128.
Definition at line 33 of file ipv6_address.cpp.
References BOTAN_ARG_CHECK, and IPv6Address().
Referenced by Botan::IPv6Subnet::contains(), host_mask(), prefix_length(), and Botan::IPv6Subnet::serialize().
| IPv6Address Botan::IPv6Address::operator& | ( | const IPv6Address & | other | ) | const |
Definition at line 55 of file ipv6_address.cpp.
References IPv6Address().
|
default |
References IPv6Address().
| std::optional< size_t > Botan::IPv6Address::prefix_length | ( | ) | const |
If this value is a netmask consisting of a run of one bits followed by a run of zero bits, return the number of one bits.
Otherwise return nullopt.
Definition at line 63 of file ipv6_address.cpp.
References netmask().
| std::string Botan::IPv6Address::to_string | ( | ) | const |
Definition at line 51 of file ipv6_address.cpp.
References Botan::ipv6_to_string().