join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::IpAddressImpl Class Referenceabstract

IP address implementation interface. More...

Inheritance diagram for join::IpAddressImpl:

Public Member Functions

virtual ~IpAddressImpl ()
 destroy the IpAddressImpl instance.
 
virtual int family () const =0
 get address family.
 
virtual const void * addr () const =0
 get the internal address structure.
 
virtual socklen_t length () const =0
 get the size in byte of the internal address structure.
 
virtual uint32_t scope () const =0
 get the scope identifier of the address.
 
virtual int prefix () const =0
 get prefix length from netmask address.
 
virtual bool isWildcard () const =0
 check if IP address is a wildcard address.
 
virtual bool isLoopBack () const =0
 check if IP address is a loopback address.
 
virtual bool isLinkLocal () const =0
 check if IP address is link local.
 
virtual bool isSiteLocal () const =0
 check if IP address is site local (deprecated).
 
virtual bool isUniqueLocal () const =0
 check if IP address is unique local.
 
virtual bool isBroadcast (int prefix) const =0
 check if IP address is a broadcast address.
 
virtual bool isMulticast () const =0
 check if IP address is multicast.
 
virtual bool isIpv4Compat () const =0
 check if IP address is IPv4 compatible (deprecated).
 
virtual bool isIpv4Mapped () const =0
 check if IP address is IPv4 mapped.
 
virtual std::string toString () const =0
 convert internal address structure to string.
 
virtual std::string toArpa () const =0
 convert IP address to the in-addr.arpa or ip6.arpa domain name.
 
virtual void clear ()=0
 clear IP address.
 
virtual uint8_t & operator[] (size_t position)=0
 returns a reference to the element at the specified location.
 

Protected Member Functions

 IpAddressImpl ()
 create the IpAddressImpl instance.
 
 IpAddressImpl (const IpAddressImpl &address)=delete
 create the IpAddressImpl instance by copy.
 

Detailed Description

IP address implementation interface.

Constructor & Destructor Documentation

◆ IpAddressImpl() [1/2]

join::IpAddressImpl::IpAddressImpl ( )
inlineprotected

create the IpAddressImpl instance.

◆ IpAddressImpl() [2/2]

join::IpAddressImpl::IpAddressImpl ( const IpAddressImpl & address)
protecteddelete

create the IpAddressImpl instance by copy.

Parameters
addressaddress to copy.

◆ ~IpAddressImpl()

virtual join::IpAddressImpl::~IpAddressImpl ( )
inlinevirtual

destroy the IpAddressImpl instance.

Member Function Documentation

◆ addr()

virtual const void * join::IpAddressImpl::addr ( ) const
pure virtual

get the internal address structure.

Returns
a pointer to an in6_addr structure if IPv6 or to an in_addr structure if IPv4;

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ clear()

virtual void join::IpAddressImpl::clear ( )
pure virtual

clear IP address.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ family()

virtual int join::IpAddressImpl::family ( ) const
pure virtual

get address family.

Returns
AF_INET6 if IPv6, AF_INET if IPv4.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isBroadcast()

virtual bool join::IpAddressImpl::isBroadcast ( int prefix) const
pure virtual

check if IP address is a broadcast address.

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

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isIpv4Compat()

virtual bool join::IpAddressImpl::isIpv4Compat ( ) const
pure virtual

check if IP address is IPv4 compatible (deprecated).

Returns
if IPv4 compatible true is returned, false otherwise.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isIpv4Mapped()

virtual bool join::IpAddressImpl::isIpv4Mapped ( ) const
pure virtual

check if IP address is IPv4 mapped.

Returns
if IPv4 mapped true is returned, false otherwise.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isLinkLocal()

virtual bool join::IpAddressImpl::isLinkLocal ( ) const
pure virtual

check if IP address is link local.

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

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isLoopBack()

virtual bool join::IpAddressImpl::isLoopBack ( ) const
pure virtual

check if IP address is a loopback address.

Returns
if loopback true is returned, false otherwise.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isMulticast()

virtual bool join::IpAddressImpl::isMulticast ( ) const
pure virtual

check if IP address is multicast.

Returns
if multicast true is returned, false otherwise.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isSiteLocal()

virtual bool join::IpAddressImpl::isSiteLocal ( ) const
pure virtual

check if IP address is site local (deprecated).

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

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isUniqueLocal()

virtual bool join::IpAddressImpl::isUniqueLocal ( ) const
pure virtual

check if IP address is unique local.

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

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ isWildcard()

virtual bool join::IpAddressImpl::isWildcard ( ) const
pure virtual

check if IP address is a wildcard address.

Returns
if wildcard true is returned, false otherwise.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ length()

virtual socklen_t join::IpAddressImpl::length ( ) const
pure virtual

get the size in byte of the internal address structure.

Returns
the size in byte of the internal address structure.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ operator[]()

virtual uint8_t & join::IpAddressImpl::operator[] ( size_t position)
pure virtual

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.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ prefix()

virtual int join::IpAddressImpl::prefix ( ) const
pure virtual

get prefix length from netmask address.

Returns
prefix length.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ scope()

virtual uint32_t join::IpAddressImpl::scope ( ) const
pure virtual

get the scope identifier of the address.

Returns
the scope identifier of the address.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ toArpa()

virtual std::string join::IpAddressImpl::toArpa ( ) const
pure virtual

convert IP address to the in-addr.arpa or ip6.arpa domain name.

Returns
the converted IP address.

Implemented in join::Ipv4Address, and join::Ipv6Address.

◆ toString()

virtual std::string join::IpAddressImpl::toString ( ) const
pure virtual

convert internal address structure to string.

Returns
the internal address structure converted to string.

Implemented in join::Ipv4Address, and join::Ipv6Address.


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