|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
IPv6 address value type. More...
Public Member Functions | |
| 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 Public Member Functions | |
| 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.
|
constexprdefaultnoexcept |
Constructs a zero-initialized IPv6 address (::).
|
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.
| words | The four 32-bit words of the IPv6 address, in network byte order. |
| zone | Optional zone ID (default 0). |
|
constexprdefaultnoexcept |
Compares two IPv6 addresses for equality (including zone).
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.
| s | The string to parse (e.g. "2001:db8::1", "::1", "fe80::1%3"). |