actor-framework
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
caf::ipv6_address Class Reference
Inheritance diagram for caf::ipv6_address:
Inheritance graph
[legend]
Collaboration diagram for caf::ipv6_address:
Collaboration graph
[legend]

Public Types

using super = byte_address< ipv6_address >
 
using array_type = std::array< uint8_t, num_bytes >
 
using u16_array_type = std::array< uint16_t, 8 >
 
using uint16_ilist = std::initializer_list< uint16_t >
 

Public Member Functions

 ipv6_address ()
 Constructs an all-zero address.
 
 ipv6_address (uint16_ilist prefix, uint16_ilist suffix)
 Constructs an address from given prefix and suffix. More...
 
 ipv6_address (ipv4_address addr)
 Embeds an IPv4 address into an IPv6 address.
 
 ipv6_address (array_type bytes)
 Constructs an IPv6 address from given bytes.
 
int compare (ipv6_address other) const noexcept
 Returns a negative number if *this < other, zero if *this == other and a positive number if *this > other. More...
 
int compare (ipv4_address other) const noexcept
 Returns a negative number if *this < other, zero if *this == other and a positive number if *this > other. More...
 
bool embeds_v4 () const noexcept
 Returns whether this address embeds an IPv4 address.
 
ipv4_address embedded_v4 () const noexcept
 Returns an embedded IPv4 address. More...
 
bool is_loopback () const noexcept
 Returns whether this is a loopback address.
 
array_type & bytes () noexcept
 Returns the bytes of the IP address as array.
 
const array_type & bytes () const noexcept
 Returns the bytes of the IP address as array.
 
array_type & data () noexcept
 Alias for bytes().
 
const array_type & data () const noexcept
 Alias for bytes().
 
bool zero () const noexcept
 Returns whether this address contains only zeros, i.e., equals ::.
 
- Public Member Functions inherited from caf::byte_address< ipv6_address >
uint8_t & operator[] (size_t index) noexcept
 Returns the byte at given index.
 
const uint8_t & operator[] (size_t index) const noexcept
 Returns the byte at given index.
 
size_t size () const noexcept
 Returns the number of bytes of the address.
 
ipv6_address network_address (size_t prefix_length) const noexcept
 
ipv6_addressoperator&= (const ipv6_address &other)
 Bitwise ANDs *this and other.
 
ipv6_addressoperator|= (const ipv6_address &other)
 Bitwise ORs *this and other.
 
ipv6_addressoperator^= (const ipv6_address &other)
 Bitwise XORs *this and other.
 

Static Public Member Functions

static ipv6_address any () noexcept
 Returns INADDR6_ANY, i.e., ::.
 
static ipv6_address loopback () noexcept
 Returns INADDR6_LOOPBACK, i.e., ::1.
 

Static Public Attributes

static constexpr size_t num_bytes = 16
 

Friends

template<class Inspector >
bool inspect (Inspector &f, ipv6_address &x)
 
CAF_CORE_EXPORT std::string to_string (ipv6_address x)
 

Constructor & Destructor Documentation

◆ ipv6_address()

caf::ipv6_address::ipv6_address ( uint16_ilist  prefix,
uint16_ilist  suffix 
)

Constructs an address from given prefix and suffix.

Precondition
prefix.size() + suffix.size() <= 8
Warning
assumes network byte order for prefix and suffix

Member Function Documentation

◆ compare() [1/2]

int caf::ipv6_address::compare ( ipv6_address  other) const
noexcept

Returns a negative number if *this < other, zero if *this == other and a positive number if *this > other.

◆ compare() [2/2]

int caf::ipv6_address::compare ( ipv4_address  other) const
noexcept

Returns a negative number if *this < other, zero if *this == other and a positive number if *this > other.

◆ embedded_v4()

ipv4_address caf::ipv6_address::embedded_v4 ( ) const
noexcept

Returns an embedded IPv4 address.

Precondition
embeds_v4()

The documentation for this class was generated from the following files: