This class represents an internet (IP) version 6 host address. More...
#include <mn_basic_ip6_address.hpp>
Public Member Functions | |
basic_ip6_address () | |
construct a ip6 address (any) More... | |
basic_ip6_address (uint32_t ax, uint32_t bx, uint32_t cx, uint32_t dx) noexcept | |
construct a ip6 address from uint32_t's More... | |
basic_ip6_address (uint32_t iarray[4]) noexcept | |
construct a ip6 address from uint32_t's More... | |
basic_ip6_address (uint8_t address[16]) noexcept | |
construct a ip6 address from array More... | |
basic_ip6_address (const char *str_ip) noexcept | |
construct a ip6 address from string More... | |
basic_ip6_address (const basic_ip6_address &ipOther) noexcept | |
construct a ip6 address from a other ip6 address More... | |
const char * | to_string () |
uint8_t * | get_bytes () |
uint32_t * | get_array () |
int | length () const |
Returns the length in bytes of the ip address. More... | |
virtual uint32_t | get_int (int index) |
Get the ip section on the given position as int. More... | |
virtual uint32_t | get_int (int index) const |
Get the ip section on the given position as int. More... | |
void | set_zero () |
set the ip to zero More... | |
void | set_loopback () |
set the ip to loopback More... | |
virtual bool | is_loopback () |
virtual bool | is_broadcast () |
virtual bool | is_multicast () |
virtual bool | is_any () |
virtual bool | is_linklocal () |
virtual bool | is_sitelocal () |
virtual bool | is_toredo () |
virtual bool | is_ip4mapped () |
virtual bool | is_equel (const basic_ip6_address &ipOther) |
virtual bool | is_equel (const basic_ip6_address &ipOther, const basic_ip6_address &mask) |
basic_ip6_address & | operator= (const basic_ip6_address &ip) |
uint8_t | operator[] (int index) const |
uint8_t & | operator[] (int index) |
bool | operator== (const basic_ip6_address &ipOther) |
bool | operator!= (const basic_ip6_address &ipOther) |
basic_ip6_address | operator& (const basic_ip6_address &other) const |
basic_ip6_address | operator| (const basic_ip6_address &other) const |
basic_ip6_address | operator^ (const basic_ip6_address &other) const |
basic_ip6_address | operator~ () const |
virtual void | swap (basic_ip6_address &rhs) noexcept |
Public Member Functions inherited from mn::net::basic_ip_address | |
basic_ip_address (address_family fam) | |
Constructor. More... | |
virtual address_family | get_family () |
Get the address family (AF_INET or AF_INET6) of the address. More... | |
virtual void | swap (basic_ip_address &rhs) noexcept |
Static Public Member Functions | |
static basic_ip4_address | to_ip4 (const basic_ip6_address &ip6) |
static basic_ip6_address | from_ip4 (const basic_ip4_address &ip4) |
Create a new basic_ip6_address from a given IPv4 address. More... | |
static basic_ip6_address | netmask (int mask) |
Protected Attributes | |
union { | |
uint8_t | m_Numbers [MNNET_IPV6_ADDRESS_BYTES] |
uint16_t | as_short [8] |
uint32_t | as_int [4] |
}; | |
Protected Attributes inherited from mn::net::basic_ip_address | |
address_family | m_aFamily |
A saved / cached copy of the address family type of this socket. More... | |
Detailed Description
This class represents an internet (IP) version 6 host address.
Constructor & Destructor Documentation
◆ basic_ip6_address() [1/6]
mn::net::basic_ip6_address::basic_ip6_address | ( | ) |
construct a ip6 address (any)
Construtor
◆ basic_ip6_address() [2/6]
|
noexcept |
construct a ip6 address from uint32_t's
Construtor
◆ basic_ip6_address() [3/6]
|
noexcept |
construct a ip6 address from uint32_t's
Construtor
◆ basic_ip6_address() [4/6]
|
noexcept |
construct a ip6 address from array
Construtor
◆ basic_ip6_address() [5/6]
|
noexcept |
construct a ip6 address from string
Construtor
- Parameters
-
newAddress The ip6 address as string
◆ basic_ip6_address() [6/6]
|
noexcept |
construct a ip6 address from a other ip6 address
Construtor
- Parameters
-
ipOther The other object
Member Function Documentation
◆ from_ip4()
|
inlinestatic |
Create a new basic_ip6_address from a given IPv4 address.
- Parameters
-
ip4 The IPv4 address to convert
- Returns
- The new basic_ip6_address from a given IPv4 address
◆ get_array()
|
inline |
Get this ip6 address as int array
- Returns
- the ip6 address as array
◆ get_bytes()
|
virtual |
Get this ip6 address as char array
- Returns
- the ip6 address as array
Implements mn::net::basic_ip_address.
◆ get_int() [1/2]
|
inlinevirtual |
Get the ip section on the given position as int.
- Parameters
-
index The index of the position (0-3)
- Returns
- The ip section on the given position as int
◆ get_int() [2/2]
|
inlinevirtual |
Get the ip section on the given position as int.
- Parameters
-
index The index of the position (0-3)
- Returns
- The ip section on the given position as int
◆ is_any()
|
inlinevirtual |
◆ is_broadcast()
|
inlinevirtual |
is this ip6 address a broadcast address? - return always false
Implements mn::net::basic_ip_address.
◆ is_equel() [1/2]
|
virtual |
is this ip6 address equel with the given address
- Returns
- If true then equel and if false then not
◆ is_equel() [2/2]
|
virtual |
Compare this ip6 address with (ipOther & netmask)
- Returns
- true if they match, integer different than zero otherwise
◆ is_ip4mapped()
|
virtual |
is this ip6 address ip4 mapped?
- Returns
- If true then yes and false when not
◆ is_linklocal()
|
inlinevirtual |
is the ip6 address linklocal?
- Returns
- If true then yes and false when not
◆ is_loopback()
|
inlinevirtual |
is this ip6 address a loopback address?
- Returns
- If true then yes and false when not
Implements mn::net::basic_ip_address.
◆ is_multicast()
|
inlinevirtual |
is this ip6 address a multicast address?
- Returns
- If true then yes and false when not
◆ is_sitelocal()
|
inlinevirtual |
is this ip6 address sitelocal?
- Returns
- If true then yes and false when not
◆ is_toredo()
|
inlinevirtual |
is this ip6 address toredo?
- Returns
- If true then yes and false when not
◆ length()
|
virtual |
Returns the length in bytes of the ip address.
- Returns
- The length in bytes of the ip address
Implements mn::net::basic_ip_address.
◆ netmask()
|
static |
Create an IPv6 netmask
◆ operator!=()
|
inline |
◆ operator&()
basic_ip6_address mn::net::basic_ip6_address::operator& | ( | const basic_ip6_address & | other | ) | const |
◆ operator=()
basic_ip6_address & mn::net::basic_ip6_address::operator= | ( | const basic_ip6_address & | ip | ) |
◆ operator==()
|
inline |
◆ operator[]() [1/2]
|
inline |
◆ operator[]() [2/2]
|
inline |
◆ operator^()
basic_ip6_address mn::net::basic_ip6_address::operator^ | ( | const basic_ip6_address & | other | ) | const |
◆ operator|()
basic_ip6_address mn::net::basic_ip6_address::operator| | ( | const basic_ip6_address & | other | ) | const |
◆ operator~()
basic_ip6_address mn::net::basic_ip6_address::operator~ | ( | ) | const |
◆ set_loopback()
|
inline |
set the ip to loopback
◆ set_zero()
|
inline |
set the ip to zero
◆ swap()
|
inlinevirtualnoexcept |
◆ to_ip4()
|
inlinestatic |
Create a new basic_ip4_address from a given IPv6 address
- Parameters
-
ip6 The IPv6 address to convert
- Returns
- The new basic_ip4_address from a given IPv6 address
◆ to_string()
|
virtual |
Get this ip6 address as readeble string
- Returns
- the ip6 address as readeble string
Implements mn::net::basic_ip_address.
Member Data Documentation
◆
union { ... } |
The type for a basic_ip6_address, as union - for easer internal use
The documentation for this class was generated from the following files: