IPv4 address value type.
More...
|
| constexpr | ipv4_addr () noexcept=default |
| | Constructs a zero-initialized IPv4 address (0.0.0.0).
|
| |
| constexpr | ipv4_addr (uint32_t addr) noexcept |
| | Constructs an IPv4 address from a raw network-byte-order value.
|
| |
| constexpr | ipv4_addr (uint8_t a, uint8_t b, uint8_t c, uint8_t d) noexcept |
| | Constructs an IPv4 address from individual octets.
|
| |
| constexpr uint32_t | addr () const noexcept |
| | Returns the raw address value in network byte order.
|
| |
| constexpr bool | is_any () const noexcept |
| | Tests whether this is a zero (unset) address.
|
| |
| constexpr bool | operator== (const ipv4_addr &) const noexcept=default |
| | Compares two IPv4 addresses for equality.
|
| |
|
| static std::optional< ipv4_addr > | parse (std::string_view s) noexcept |
| | Parses an IPv4 address from dotted-decimal notation.
|
| |
| static constexpr ipv4_addr | any () noexcept |
| | Returns the IPv4 wildcard address (0.0.0.0).
|
| |
IPv4 address value type.
Stores an IPv4 address in network byte order. Provides construction from individual octets and conversion to string representation.
constexpr uint32_t addr() const noexcept
Returns the raw address value in network byte order.
std::string to_string(core_id c)
Returns a string representation of a CPU core identifier.
Definition at line 41 of file net.hpp.
◆ ipv4_addr() [1/3]
| constexpr idfxx::net::ipv4_addr::ipv4_addr |
( |
| ) |
|
|
constexprdefaultnoexcept |
Constructs a zero-initialized IPv4 address (0.0.0.0).
◆ ipv4_addr() [2/3]
| constexpr idfxx::net::ipv4_addr::ipv4_addr |
( |
uint32_t |
addr | ) |
|
|
inlineexplicitconstexprnoexcept |
Constructs an IPv4 address from a raw network-byte-order value.
- Parameters
-
| addr | The IPv4 address in network byte order. |
Definition at line 81 of file net.hpp.
◆ ipv4_addr() [3/3]
| constexpr idfxx::net::ipv4_addr::ipv4_addr |
( |
uint8_t |
a, |
|
|
uint8_t |
b, |
|
|
uint8_t |
c, |
|
|
uint8_t |
d |
|
) |
| |
|
inlineconstexprnoexcept |
Constructs an IPv4 address from individual octets.
- Parameters
-
| a | First octet (most significant). |
| b | Second octet. |
| c | Third octet. |
| d | Fourth octet (least significant). |
Definition at line 92 of file net.hpp.
◆ addr()
| constexpr uint32_t idfxx::net::ipv4_addr::addr |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the raw address value in network byte order.
- Returns
- The IPv4 address as a 32-bit integer in network byte order.
Definition at line 103 of file net.hpp.
◆ any()
| static constexpr ipv4_addr idfxx::net::ipv4_addr::any |
( |
| ) |
|
|
inlinestaticconstexprnoexcept |
Returns the IPv4 wildcard address (0.0.0.0).
The wildcard address is used to bind a socket to all local IPv4 interfaces. Equivalent to the POSIX INADDR_ANY constant.
- Returns
- The wildcard IPv4 address.
Definition at line 74 of file net.hpp.
◆ is_any()
| constexpr bool idfxx::net::ipv4_addr::is_any |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Tests whether this is a zero (unset) address.
- Returns
- True if the address is 0.0.0.0.
Definition at line 110 of file net.hpp.
◆ operator==()
| constexpr bool idfxx::net::ipv4_addr::operator== |
( |
const ipv4_addr & |
| ) |
const |
|
constexprdefaultnoexcept |
Compares two IPv4 addresses for equality.
◆ parse()
| static std::optional< ipv4_addr > idfxx::net::ipv4_addr::parse |
( |
std::string_view |
s | ) |
|
|
staticnoexcept |
Parses an IPv4 address from dotted-decimal notation.
Accepts addresses in the form "a.b.c.d" where each octet is a decimal value from 0 to 255 with no leading zeros.
- Parameters
-
| s | The string to parse (e.g. "192.168.1.1"). |
- Returns
- The parsed address, or std::nullopt if the string is not valid.
}
static std::optional< ipv4_addr > parse(std::string_view s) noexcept
Parses an IPv4 address from dotted-decimal notation.
The documentation for this class was generated from the following file: