IPv6 address value type.
More...
|
| constexpr | ipv6_addr () noexcept=default |
| | Constructs a zero-initialized IPv6 address (::).
|
| |
| constexpr | ipv6_addr (std::array< uint32_t, 4 > words, uint8_t zone=0) noexcept |
| | Constructs an IPv6 address from four 32-bit words.
|
| |
| constexpr const std::array< uint32_t, 4 > & | addr () const noexcept |
| | Returns the four 32-bit words of the address.
|
| |
| constexpr uint8_t | zone () const noexcept |
| | Returns the zone ID.
|
| |
| constexpr bool | is_any () const noexcept |
| | Tests whether this is a zero (unset) address.
|
| |
| constexpr bool | operator== (const ipv6_addr &) const noexcept=default |
| | Compares two IPv6 addresses for equality (including zone).
|
| |
|
| static std::optional< ipv6_addr > | parse (std::string_view s) noexcept |
| | Parses an IPv6 address from its text representation.
|
| |
| static constexpr ipv6_addr | any () noexcept |
| | Returns the IPv6 wildcard address (::).
|
| |
IPv6 address value type.
Stores an IPv6 address as four 32-bit words plus an optional zone ID.
constexpr const std::array< uint32_t, 4 > & addr() const noexcept
Returns the four 32-bit words of the address.
static std::optional< ipv6_addr > parse(std::string_view s) noexcept
Parses an IPv6 address from its text representation.
std::string to_string(core_id c)
Returns a string representation of a CPU core identifier.
Definition at line 132 of file net.hpp.
◆ ipv6_addr() [1/2]
| constexpr idfxx::net::ipv6_addr::ipv6_addr |
( |
| ) |
|
|
constexprdefaultnoexcept |
Constructs a zero-initialized IPv6 address (::).
◆ ipv6_addr() [2/2]
| constexpr idfxx::net::ipv6_addr::ipv6_addr |
( |
std::array< uint32_t, 4 > |
words, |
|
|
uint8_t |
zone = 0 |
|
) |
| |
|
inlineexplicitconstexprnoexcept |
Constructs an IPv6 address from four 32-bit words.
The words hold the 16 address bytes in network byte order as laid out in memory, matching the lwIP/ESP-IDF representation. A logical literal such as {0xfe800000, 0, 0, 1} is therefore not fe80::1; prefer parse() to build an address from text.
- Parameters
-
| words | The four 32-bit words of the IPv6 address, in network byte order. |
| zone | Optional zone ID (default 0). |
Definition at line 180 of file net.hpp.
◆ addr()
| constexpr const std::array< uint32_t, 4 > & idfxx::net::ipv6_addr::addr |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the four 32-bit words of the address.
- Returns
- Reference to the address words array.
Definition at line 189 of file net.hpp.
◆ any()
| static constexpr ipv6_addr idfxx::net::ipv6_addr::any |
( |
| ) |
|
|
inlinestaticconstexprnoexcept |
Returns the IPv6 wildcard address (::).
The wildcard address is used to bind a socket to all local IPv6 interfaces. Equivalent to the POSIX IN6ADDR_ANY_INIT constant.
- Returns
- The wildcard IPv6 address.
Definition at line 167 of file net.hpp.
◆ is_any()
| constexpr bool idfxx::net::ipv6_addr::is_any |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Tests whether this is a zero (unset) address.
- Returns
- True if all address words are zero.
Definition at line 203 of file net.hpp.
◆ operator==()
| constexpr bool idfxx::net::ipv6_addr::operator== |
( |
const ipv6_addr & |
| ) |
const |
|
constexprdefaultnoexcept |
Compares two IPv6 addresses for equality (including zone).
◆ parse()
| static std::optional< ipv6_addr > idfxx::net::ipv6_addr::parse |
( |
std::string_view |
s | ) |
|
|
staticnoexcept |
Parses an IPv6 address from its text representation.
Accepts standard colon-separated hex format with optional :: compression and an optional zone suffix (e.g. "fe80::1%3"). Each group is 1–4 hex digits. Exactly one :: may appear, representing one or more consecutive all-zero groups.
- Parameters
-
| s | The string to parse (e.g. "2001:db8::1", "::1", "fe80::1%3"). |
- Returns
- The parsed address, or std::nullopt if the string is not valid.
◆ zone()
| constexpr uint8_t idfxx::net::ipv6_addr::zone |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the zone ID.
- Returns
- The zone ID.
Definition at line 196 of file net.hpp.
The documentation for this class was generated from the following file: