NetBurner 3.1
IPADDR6 Class

Classes

class  IPADDR6
 Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode. More...
 

Functions

bool IPADDR6::IsEmbeddedIPV4 () const
 An IPADDR6 object can store a IPv4 or IPv6 address. This function returns true if the instance contains an IPv4 address. More...
 
IPADDR4 IPADDR6::Extract4 () const
 Extracts an IPv4 address from the object. More...
 
bool IPADDR6::IsNull () const
 Check if the IP address is null. More...
 
bool IPADDR6::NotNull () const
 Check if the IP address is not null. More...
 
bool IPADDR6::IsLoopBack () const
 Check if the IP address is the loopback address for the interface. More...
 
bool IPADDR6::IsMultiCast () const
 Check if the IPADDR6 object contains a Multicast IP address the interface. More...
 
bool IPADDR6::IsLinkLocal () const
 Check if the IP address is the link-local address for the interface. More...
 
MACADR IPADDR6::McastMac () const
 Return the MAC address used for Multicasts for the interface. More...
 
void IPADDR6::print (bool bCompact=true, bool bShowV4Raw=false) const
 Print the IP address value to stdout. More...
 
void IPADDR6::fdprint (int fd, bool bCompact=true, bool bShowV4Raw=false) const
 Print the IP address to the specified file descriptor. More...
 
int IPADDR6::sprintf (char *cp, int maxl, bool bCompact=true, bool bShowV4Raw=false) const
 Print the IP address to the specified buffer. More...
 
static IPADDR6 IPADDR6::AsciiToIp6 (const char *cp, bool bembed_v4addreses=true)
 Return an IPADDR6 object created from an ASCII value IPv4 or IPv6 address. More...
 
static IPADDR6 IPADDR6::NullIP ()
 Return a null IPADDR6 object. More...
 
void IPADDR6::SetFromAscii (const char *cp, bool bembed_v4addreses=true)
 Set the IP address value of an IPADDR6 object. More...
 
void IPADDR6::SetFromIP4 (IPADDR4 ip)
 Set the IP address value of an IPADDR6 object from an IPADD4 object. More...
 
void IPADDR6::SetFromUint32Shortcut (uint32_t w0, uint32_t w1, uint32_t w2, uint32_t w3)
 Set the IP address value of an IPADDR6 object from 4 discrete uint32_t values. More...
 
void IPADDR6::SetNull ()
 Set the IP address value of an IPADDR6 object to null. More...
 

Detailed Description

The NetBurner IPv6 IPADDR6 Class

Function Documentation

◆ AsciiToIp6()

IPADDR6 IPADDR6::AsciiToIp6 ( const char *  cp,
bool  bembed_v4addreses = true 
)
static

Return an IPADDR6 object created from an ASCII value IPv4 or IPv6 address.

Parameters
*cp,pointerto the ASCII string representing an IPv4 or IPv6 address
bembed_v4addresses,iffalse function will only process an IPv6 address
Return values
IPADDR6object
See also
NullIP()

◆ Extract4()

IPADDR4 IPADDR6::Extract4 ( ) const
inline

Extracts an IPv4 address from the object.

Return values
IPADDR4Value of the IPv4 address

◆ fdprint()

void IPADDR6::fdprint ( int  fd,
bool  bCompact = true,
bool  bShowV4Raw = false 
) const

Print the IP address to the specified file descriptor.

Parameters
fd,validfile descriptor to send the data
bCompact,displayIPv6 address in compact notation
bShowV4Raw,normallyalways set to false. if set to true, will display the IPv4 address 128-bits of the IP address object in the raw format ::FFFF:xx.xx.xx.xx.
See also
print(), sprintf()

◆ IsEmbeddedIPV4()

bool IPADDR6::IsEmbeddedIPV4 ( ) const
inline

An IPADDR6 object can store a IPv4 or IPv6 address. This function returns true if the instance contains an IPv4 address.

Internally, an IPv4 address is stored in the format ::FFFF:xx.xx.xx.xx

Return values
trueIf the IPADDR6 object contains and IPv4 address
falseOtherwise

◆ IsLinkLocal()

bool IPADDR6::IsLinkLocal ( ) const
inline

Check if the IP address is the link-local address for the interface.

Return values
trueif the IP address value is the link-local address
See also
IsLoopBack(), IsMultiCast()

◆ IsLoopBack()

bool IPADDR6::IsLoopBack ( ) const
inline

Check if the IP address is the loopback address for the interface.

Return values
trueif the IP address value is the loopback address
See also
IsMultiCast(), IsLinkLocal()

◆ IsMultiCast()

bool IPADDR6::IsMultiCast ( ) const
inline

Check if the IPADDR6 object contains a Multicast IP address the interface.

Return values
trueif the IP address value is a Multicast address
See also
IsLoopBack(), IsLinkLocal()

◆ IsNull()

bool IPADDR6::IsNull ( ) const
inline

Check if the IP address is null.

Return values
trueif the IP address value is null
See also
NotNull()

◆ McastMac()

MACADR IPADDR6::McastMac ( ) const

Return the MAC address used for Multicasts for the interface.

Return values
MACADRif a Multicast address exists
nullotherwise

◆ NotNull()

bool IPADDR6::NotNull ( ) const
inline

Check if the IP address is not null.

Return values
trueif the IP address value is not null
See also
IsNull()

◆ NullIP()

IPADDR6 IPADDR6::NullIP ( )
static

Return a null IPADDR6 object.

Return values
nullIPADDR6 object
See also
AsciiToIp6()

◆ print()

void IPADDR6::print ( bool  bCompact = true,
bool  bShowV4Raw = false 
) const

Print the IP address value to stdout.

Parameters
bCompact,displayIPv6 address in compact notation
bShowV4Raw,normallyalways set to false. if set to true, will display the IPv4 address 128-bits of the IP address object in the raw format ::FFFF:xx.xx.xx.xx.
See also
fdprint(), sprintf()

◆ SetFromAscii()

void IPADDR6::SetFromAscii ( const char *  cp,
bool  bembed_v4addreses = true 
)

Set the IP address value of an IPADDR6 object.

Parameters
*cp,pointerto the ASCII string representing an IPv4 or IPv6 address
bembed_v4addresses,iffalse function will only process an IPv6 address
See also
SetFromIP4(), SetNull()

◆ SetFromIP4()

void IPADDR6::SetFromIP4 ( IPADDR4  ip)

Set the IP address value of an IPADDR6 object from an IPADD4 object.

Parameters
ip,IPADD4object
See also
SetFromAscii(), SetNull()

◆ SetFromUint32Shortcut()

void IPADDR6::SetFromUint32Shortcut ( uint32_t  w0,
uint32_t  w1,
uint32_t  w2,
uint32_t  w3 
)
inline

Set the IP address value of an IPADDR6 object from 4 discrete uint32_t values.

Parameters
wo,unsigned32-bit integer
w1,unsigned32-bit integer
w2,unsigned32-bit integer
w3,unsigned32-bit integer
See also
SetFromAscii(), SetFromIP4(), SetNull()

◆ SetNull()

void IPADDR6::SetNull ( )
inline

Set the IP address value of an IPADDR6 object to null.

See also
SetFromAscii(), SetFromIP4()

◆ sprintf()

int IPADDR6::sprintf ( char *  cp,
int  maxl,
bool  bCompact = true,
bool  bShowV4Raw = false 
) const

Print the IP address to the specified buffer.

Parameters
*cp,pointerto the destination buffer to store the data
maxl,maximumnumber of bytes to write to buffer
bCompact,displayIPv6 address in compact notation
bShowV4Raw,normallyalways set to false. if set to true, will display the IPv4 address 128-bits of the IP address object in the raw format ::FFFF:xx.xx.xx.xx.
Returns
Number of bytes copied to buffer
See also
print(), fdprint()