UNISTDX_NET_IPV6_ADDRESS
using inet6_type = struct ::in6_addr

IPv6 Internet address type.

using sockinet6_type = struct ::sockaddr_in6

IPv6 socket address type.

using addr6_type = u128

IPv6 address representation unsigned integer type.

class sys::ipv6_address

IPv6 address class.

Types
  • using size_type = size_t

    Alias to std::size_t.

  • using const_iterator = const_pointer

    Constant iterator.

  • using iterator = pointer

    Iterator.

  • using reference = value_type &

    Reference to octet.

  • using pointer = value_type *

    Pointer to octet.

  • using rep_type = addr6_type

    Unsigned 16-byte integer type.

  • using value_type = u8

    Octet type (1-byte unsigned integer).

  • using hex_type = u16

    Hextet type (2-byte unsigned integer).

Fields
Methods
  • size() -> constexpr static size_type

    Get the number of octets.

  • from_prefix(prefix_type prefix) -> ipv6_address

    Create network mask from network prefix.

  • position(const ipv6_address & netmask) const -> constexpr addr6_type

    Compute address position in the subnetwork specified by netmask.

  • clear() -> void

    Fill with noughts.

  • back() const -> value_type

    Get last octet.

  • back() -> reference

    Get last octet.

  • front() const -> value_type

    Get first octet.

  • front() -> reference

    Get first octet.

  • end() const -> const_iterator

    Get iterator to the end of octet array.

  • end() -> iterator

    Get iterator to the end of octet array.

  • begin() const -> const_iterator

    Get iterator to the beginning of octet array.

  • begin() -> iterator

    Get iterator to the beginning of octet array.

  • data() const -> const_pointer

    Get pointer to the first octet.

  • data() -> pointer

    Get pointer to the first octet.

  • to_prefix() const -> prefix_type

    Return network prefix assuming that this address is network mask.

  • operator!() const -> constexpr bool

    Returns true if integer representations is nought.

  • operator bool() const -> constexprexplicit

    Returns true if integer representations is non-nought.

  • operator!=(ipv6_address rhs) const -> bool

    Compare address integer representations.

  • operator==(const ipv6_address & rhs) const -> bool

    Compare address integer representations.

  • operator>=(const ipv6_address & rhs) const -> bool
  • operator>(const ipv6_address & rhs) const -> bool
  • operator<=(const ipv6_address & rhs) const -> bool
  • operator<(const ipv6_address & rhs) const -> bool

    Compare address integer representations.

  • operator[](size_t i) const -> constexpr value_type

    Get address octet by index.

  • rep() const -> constexpr const addr6_type &

    Get integer representation of the address.

  • integers() const -> constexpr const u64 *
  • operator const inet6_type &() const -> constexpr

    Automatically cast to in6_addr system type.

  • ipv6_address(const char * rhs)explicit
  • ipv6_address(hex_type h1, hex_type h2, hex_type h3, hex_type h4, hex_type h5, hex_type h6, hex_type h7, hex_type h8) -> constexpr

    Construct IPv4 address manually specifying each hextet.

  • ipv6_address(const inet6_type & rhs) -> constexprexplicit

    Construct IPv4 address from in6_addr system type.

  • ipv6_address(addr6_type rhs) -> constexprexplicit

    Construct IPv6 address from integer type.

  • ipv6_address(const ipv6_address & rhs) -> constexpr

    Copy-constructor.

  • ipv6_address() -> constexpr
Friends
  • operator>>

    Get address in binary form.

  • operator<<

    Put address in binary form.

  • operator>>

    Parse textual representation of the address.

  • operator<<

    Print textual representation of the address.

struct sys::ipaddr_traits< ipv6_address >

Specialisation of ipaddr_traits for ipv6_address.

Types
Fields
  • constexpr const sa_family_type family

    IP-address family.

  • constexpr const value_type loopback_first_octet

    First octet of loopback address.

Methods
struct std::hash< sys::ipv6_address >

Specialisation of std::hash for sys::ipv6_address.

Base classes
  • public std::hash< sys::ipv6_address::rep_type >
Derived classes
Types
  • using argument_type = sys::ipv6_address

    Hash function argument type.

  • using result_type = size_t

    Hash function return value type.

Methods
operator<<(std::ostream & out, const ipv6_address & rhs) -> std::ostream &

Print textual representation of the address.

operator>>(std::istream & in, ipv6_address & rhs) -> std::istream &

Parse textual representation of the address.