class IPAddress

Defined at line 127 of file x64-shared/gen/third_party/openweave-core/src/include/InetLayer/IPAddress.h

Internet protocol address

Public Members

uint32_t[4] Addr
static IPAddress Any

Public Methods

bool IsIPv6 ()

Test whether address is IPv6 compatible.

bool IsIPv6GlobalUnicast ()

Test whether address is IPv6 global unicast address.

bool IsIPv6ULA ()

Test whether address is IPv6 unique-local address (ULA).

bool IsIPv6LinkLocal ()

Test whether address is IPv6 link-local address (LL).

bool IsIPv6Multicast ()

Test whether address is IPv6 multicast.

bool IsMulticast ()

Test whether address is IPv4 or IPv6 multicast.

uint64_t InterfaceId ()

Extract the IID of an IPv6 ULA address.

Returns

64-bit interface identifier, or zero if the IP address is not

an IPv6 unique-local address.

uint16_t Subnet ()

Extract the 16-bit subnet identifier of an IPv6 ULA address.

Returns

16-bit subnet identifier, or zero if the IP address is not

an IPv6 unique-local address.

uint64_t GlobalId ()

Extract the 16-bit global network identifier of an IPv6 ULA

address.

Returns

40-bit global network identifier, or zero if the IP address

is not an IPv6 unique-local address.

IPAddressType Type ()

Extract the type of the IP address.

bool operator== (const IPAddress & other)

Compare this IP address with another for equivalence.

Parameters

other [in] The address to compare.
bool operator!= (const IPAddress & other)

Compare this IP address with another for inequivalence.

Parameters

other [in] The address to compare.
IPAddress & operator= (const IPAddress & other)

Conventional assignment operator.

Parameters

other [in] The address to copy.

Returns

A reference to this object.

char * ToString (char * buf, uint32_t bufSize)

Emit the IP address in conventional text presentation format.

Note Well: not compliant with RFC 5952 on some platforms. Specifically,

zero compression may not be applied according to section 4.2.

Parameters

buf [out] The address of the emitted text.
bufSize [in] The size of the buffer for the emitted text.

Returns

The argument

if no formatting error, or zero otherwise.

bool FromString (const char * str, IPAddress & output)

Scan the IP address from its conventional presentation text.

Parameters

str [in] The address of the emitted text.
output [out] The object to set to the scanned address.
bool FromString (const char * str, size_t strLen, IPAddress & output)

Scan the IP address from its conventional presentation text.

Parameters

str [in] A pointer to the text to be scanned.
strLen [in] The length of the text to be scanned.
output [out] The object to set to the scanned address.
void WriteAddress (uint8_t *& p)

Emit the IP address in standard network representation.

Parameters

p [in] Reference to the cursor to use for writing.
void ReadAddress (const uint8_t *& p, IPAddress & output)

Emit the IP address in standard network representation.

Parameters

p [in] Reference to the cursor to use for reading.
output [out] Object to receive decoded IP address.
bool IsIPv4 ()

Test whether address is IPv4 compatible.

bool IsIPv4Multicast ()

Test whether address is IPv4 multicast.

bool IsIPv4Broadcast ()

Test whether address is IPv4 broadcast.

struct in6_addr ToIPv6 ()
IPAddress FromIPv6 (const struct in6_addr & addr)
struct in_addr ToIPv4 ()
IPAddress FromIPv4 (const struct in_addr & addr)
IPAddress FromSockAddr (const struct sockaddr & sockaddr)

Inject the IPv6 address from a POSIX

struct sockaddr

&

Returns

The constructed IP address.

IPAddress MakeULA (uint64_t globalId, uint16_t subnet, uint64_t interfaceId)

Construct an IPv6 unique-local address (ULA) from its parts.

Returns

The constructed IP address.

IPAddress MakeLLA (uint64_t interfaceId)

Construct an IPv6 link-local address (LL) from its IID.

Returns

The constructed IP address.

IPAddress MakeIPv6Multicast (uint8_t aFlags, uint8_t aScope, const uint8_t[14] aGroupId)

Construct an IPv6 multicast address from its parts.

Returns

The constructed IP address.

IPAddress MakeIPv6Multicast (uint8_t aFlags, uint8_t aScope, uint32_t aGroupId)

Construct an IPv6 multicast address from its parts.

Returns

The constructed IP address.

IPAddress MakeIPv6WellKnownMulticast (uint8_t aScope, uint32_t aGroupId)

Construct a well-known IPv6 multicast address from its parts.

Returns

The constructed IP address.

IPAddress MakeIPv6TransientMulticast (uint8_t aFlags, uint8_t aScope, const uint8_t[14] aGroupId)

Construct a transient IPv6 multicast address from its parts.

Returns

The constructed IP address.

IPAddress MakeIPv6PrefixMulticast (uint8_t aScope, uint8_t aPrefixLength, const uint64_t & aPrefix, uint32_t aGroupId)

Construct a transient, prefix IPv6 multicast address from its parts.

Returns

The constructed IP address.

IPAddress MakeIPv4Broadcast ()

Construct an IPv4 broadcast address.

Returns

The constructed IP address.