|
Botan 3.12.0
Crypto and TLS for C&
|
#include <ipv4_address.h>
Public Member Functions | |
| IPv4Address (uint32_t ip) | |
| IPv4Address | operator& (const IPv4Address &other) const |
| auto | operator<=> (const IPv4Address &) const =default |
| std::optional< size_t > | prefix_length () const |
| std::array< uint8_t, 4 > | to_bytes () const |
| The address as four bytes, network-byte-order. | |
| std::string | to_string () const |
| Dotted-decimal form, e.g. "10.0.0.1". | |
| uint32_t | value () const |
| The address as a 32-bit big-endian integer. | |
Static Public Member Functions | |
| static std::optional< IPv4Address > | from_string (std::string_view str) |
| static IPv4Address | host_mask () |
| static IPv4Address | netmask (size_t bits) |
IPv4 Address
Definition at line 23 of file ipv4_address.h.
|
inlineexplicit |
Definition at line 25 of file ipv4_address.h.
Referenced by from_string(), host_mask(), netmask(), operator&(), and operator<=>().
|
static |
Definition at line 17 of file ipv4_address.cpp.
References IPv4Address(), and Botan::string_to_ipv4().
Referenced by Botan::IPv4Subnet::from_string().
|
inlinestatic |
|
static |
Return an address with the leading bits set to one and the remainder zero. Throws Invalid_Argument if bits > 32.
Definition at line 26 of file ipv4_address.cpp.
References BOTAN_ARG_CHECK, and IPv4Address().
Referenced by Botan::IPv4Subnet::contains(), host_mask(), and Botan::IPv4Subnet::serialize().
|
inline |
|
default |
References IPv4Address().
| std::optional< size_t > Botan::IPv4Address::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 44 of file ipv4_address.cpp.
Referenced by Botan::IPv4Subnet::from_address_and_mask().
| std::array< uint8_t, 4 > Botan::IPv4Address::to_bytes | ( | ) | const |
The address as four bytes, network-byte-order.
Definition at line 34 of file ipv4_address.cpp.
References Botan::store_be().
| std::string Botan::IPv4Address::to_string | ( | ) | const |
Dotted-decimal form, e.g. "10.0.0.1".
Definition at line 40 of file ipv4_address.cpp.
References Botan::ipv4_to_string().
|
inline |
The address as a 32-bit big-endian integer.
Definition at line 42 of file ipv4_address.h.
Referenced by Botan::AlternativeName::add_ipv4_address().