join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::Ipv6Address Class Reference

IPv6 address implementation. More...

Inheritance diagram for join::Ipv6Address:
Collaboration diagram for join::Ipv6Address:

Public Member Functions

 Ipv6Address ()
 create the Ipv6Address instance.
 
 Ipv6Address (const Ipv4Address &address)
 create the Ipv6Address instance by copy.
 
 Ipv6Address (const Ipv6Address &address)
 create the Ipv6Address instance by copy.
 
Ipv6Addressoperator= (const Ipv6Address &address)
 copy the Ipv6Address instance.
 
 Ipv6Address (const void *address)
 create the Ipv6Address instance using IPv6 address structure.
 
 Ipv6Address (const void *address, uint32_t scope)
 create the Ipv6Address instance using IPv6 address structure.
 
 Ipv6Address (int prefix)
 create netmask address using prefix.
 
 ~Ipv6Address ()
 destroy the Ipv6Address instance.
 
int family () const
 get address family.
 
const void * addr () const
 get the internal address structure.
 
socklen_t length () const
 get the size in byte of the internal address structure.
 
uint32_t scope () const
 get the scope identifier of the address.
 
int prefix () const
 get prefix length from netmask address.
 
bool isWildcard () const
 check if IP address is
 
bool isLoopBack () const
 check if IP address is a loopback address.
 
bool isLinkLocal () const
 check if IP address is link local.
 
bool isSiteLocal () const
 check if IP address is site local (deprecated).
 
bool isUniqueLocal () const
 check if IP address is unique local.
 
bool isBroadcast (int prefix) const
 check if IP address is a broadcast address.
 
bool isMulticast () const
 check if IP address is multicast.
 
bool isIpv4Compat () const
 check if IP address is IPv4 compatible (deprecated).
 
bool isIpv4Mapped () const
 check if IP address is IPv4 mapped.
 
std::string toString () const
 convert internal address structure to string.
 
std::string toArpa () const
 convert IP address to the ip6.arpa domain name.
 
Ipv6Address operator& (const Ipv6Address &address) const
 perform AND operation on IP address.
 
Ipv6Address operator| (const Ipv6Address &address) const
 perform OR operation on IP address.
 
Ipv6Address operator^ (const Ipv6Address &address) const
 perform XOR operation on IP address.
 
Ipv6Address operator~ () const
 perform NOT operation on IP address.
 
void clear ()
 clear IP address (wilcard address).
 
uint8_t & operator[] (size_t position)
 returns a reference to the element at the specified location.
 
- Public Member Functions inherited from join::IpAddressImpl
virtual ~IpAddressImpl ()
 destroy the IpAddressImpl instance.
 

Static Public Member Functions

static bool parse (const std::string &address, Ipv6Address &ip)
 parse an IPv6 address in string format.
 

Additional Inherited Members

- Protected Member Functions inherited from join::IpAddressImpl
 IpAddressImpl ()
 create the IpAddressImpl instance.
 
 IpAddressImpl (const IpAddressImpl &address)=delete
 create the IpAddressImpl instance by copy.
 

Detailed Description

IPv6 address implementation.

Constructor & Destructor Documentation

◆ Ipv6Address() [1/6]

join::Ipv6Address::Ipv6Address ( )
inline

create the Ipv6Address instance.

◆ Ipv6Address() [2/6]

join::Ipv6Address::Ipv6Address ( const Ipv4Address & address)
inline

create the Ipv6Address instance by copy.

Parameters
addressaddress to copy.

◆ Ipv6Address() [3/6]

join::Ipv6Address::Ipv6Address ( const Ipv6Address & address)
inline

create the Ipv6Address instance by copy.

Parameters
addressaddress to copy.

◆ Ipv6Address() [4/6]

join::Ipv6Address::Ipv6Address ( const void * address)
inline

create the Ipv6Address instance using IPv6 address structure.

Parameters
addressaddress structure to use.

◆ Ipv6Address() [5/6]

join::Ipv6Address::Ipv6Address ( const void * address,
uint32_t scope )
inline

create the Ipv6Address instance using IPv6 address structure.

Parameters
addressaddress structure to use.
scopethe scope identifier of the address.

◆ Ipv6Address() [6/6]

join::Ipv6Address::Ipv6Address ( int prefix)
inline

create netmask address using prefix.

Parameters
prefixnumber of bits to create the netmask address from.

◆ ~Ipv6Address()

join::Ipv6Address::~Ipv6Address ( )
inline

destroy the Ipv6Address instance.

Member Function Documentation

◆ addr()

const void * join::Ipv6Address::addr ( ) const
inlinevirtual

get the internal address structure.

Returns
The internal address structure.

Implements join::IpAddressImpl.

◆ clear()

void join::Ipv6Address::clear ( )
inlinevirtual

clear IP address (wilcard address).

Implements join::IpAddressImpl.

◆ family()

int join::Ipv6Address::family ( ) const
inlinevirtual

get address family.

Returns
AF_INET6 if IPv6, AF_INET if IPv4.

Implements join::IpAddressImpl.

◆ isBroadcast()

bool join::Ipv6Address::isBroadcast ( int prefix) const
inlinevirtual

check if IP address is a broadcast address.

Parameters
prefixprefix length.
Returns
if broadcast true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ isIpv4Compat()

bool join::Ipv6Address::isIpv4Compat ( ) const
inlinevirtual

check if IP address is IPv4 compatible (deprecated).

Returns
if IPv4 compatible true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ isIpv4Mapped()

bool join::Ipv6Address::isIpv4Mapped ( ) const
inlinevirtual

check if IP address is IPv4 mapped.

Returns
if IPv4 mapped true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ isLinkLocal()

bool join::Ipv6Address::isLinkLocal ( ) const
inlinevirtual

check if IP address is link local.

Returns
if IP address is link local true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ isLoopBack()

bool join::Ipv6Address::isLoopBack ( ) const
inlinevirtual

check if IP address is a loopback address.

Returns
if loopback true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ isMulticast()

bool join::Ipv6Address::isMulticast ( ) const
inlinevirtual

check if IP address is multicast.

Returns
if multicast true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ isSiteLocal()

bool join::Ipv6Address::isSiteLocal ( ) const
inlinevirtual

check if IP address is site local (deprecated).

Returns
if IP address is site local true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ isUniqueLocal()

bool join::Ipv6Address::isUniqueLocal ( ) const
inlinevirtual

check if IP address is unique local.

Returns
if IP address is unique local true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ isWildcard()

bool join::Ipv6Address::isWildcard ( ) const
inlinevirtual

check if IP address is

Returns
if wildcard true is returned, false otherwise.

Implements join::IpAddressImpl.

◆ length()

socklen_t join::Ipv6Address::length ( ) const
inlinevirtual

get the size in byte of the internal address structure.

Returns
the size in byte of the internal address structure.

Implements join::IpAddressImpl.

◆ operator&()

Ipv6Address join::Ipv6Address::operator& ( const Ipv6Address & address) const
inline

perform AND operation on IP address.

Parameters
addressaddress to compare.
Returns
result of AND operation on IpAddress.

◆ operator=()

Ipv6Address & join::Ipv6Address::operator= ( const Ipv6Address & address)
inline

copy the Ipv6Address instance.

Parameters
addressaddress to copy.

◆ operator[]()

uint8_t & join::Ipv6Address::operator[] ( size_t position)
inlinevirtual

returns a reference to the element at the specified location.

Parameters
positionposition of the element to return.
Returns
reference to the requested element.
Exceptions
invalid_argumentif position is out of range.

Implements join::IpAddressImpl.

◆ operator^()

Ipv6Address join::Ipv6Address::operator^ ( const Ipv6Address & address) const
inline

perform XOR operation on IP address.

Parameters
addressaddress to compare.
Returns
result of XOR operation on IpAddress.

◆ operator|()

Ipv6Address join::Ipv6Address::operator| ( const Ipv6Address & address) const
inline

perform OR operation on IP address.

Parameters
addressaddress to compare.
Returns
result of OR operation on IpAddress.

◆ operator~()

Ipv6Address join::Ipv6Address::operator~ ( ) const
inline

perform NOT operation on IP address.

Returns
result of NOT operation on IpAddress.

◆ parse()

static bool join::Ipv6Address::parse ( const std::string & address,
Ipv6Address & ip )
inlinestatic

parse an IPv6 address in string format.

Parameters
addressaddress string to use.
ipIP address output.
Returns
true on success, false otherwise.

◆ prefix()

int join::Ipv6Address::prefix ( ) const
inlinevirtual

get prefix length from netmask address.

Returns
prefix length.

Implements join::IpAddressImpl.

◆ scope()

uint32_t join::Ipv6Address::scope ( ) const
inlinevirtual

get the scope identifier of the address.

Returns
the scope identifier of the address.

Implements join::IpAddressImpl.

◆ toArpa()

std::string join::Ipv6Address::toArpa ( ) const
inlinevirtual

convert IP address to the ip6.arpa domain name.

Returns
the converted IP address.

Implements join::IpAddressImpl.

◆ toString()

std::string join::Ipv6Address::toString ( ) const
inlinevirtual

convert internal address structure to string.

Returns
the internal address structure converted to string.

Implements join::IpAddressImpl.


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