30#include <basictypes.h>
31#include <nbprintfinternal.h>
43 void Compactformat(
char *cp)
const;
66 bool IsEmbeddedIPV4()
const {
return ((val[2] == 0xFFFF) && (val[0] == 0) && (val[1] == 0)); }
107 return (uint32_t) val[3];
133 bool IsNull()
const {
return ((val[0] | val[1] | val[3] | ((val[2] != 0xFFFF) && (val[2] != 0))) == 0); }
154 {
return ((val[3] == 1) && (val[2] == 0) && (val[1] == 0) && (val[0] == 0)); }
164 inline bool IsMultiCast()
const {
return ((val[0] & 0xff000000) == 0xff000000); };
175 inline bool IsLinkLocal()
const {
return ((val[0] & 0xffc00000) == 0xfe800000); };
198 void print(
bool bCompact =
true,
bool bShowV4Raw =
false)
const;
210 void fdprint(
int fd,
bool bCompact =
true,
bool bShowV4Raw =
false)
const;
225 int sprintf(
char *cp,
int maxl,
bool bCompact =
true,
bool bShowV4Raw =
false)
const;
283 void SetSolicitedNodeIP6(
const IPADDR6 &ip6);
286 void SetFromIPMask(
MACADR &ma,
const IPADDR6 &g_root,
int mask_len);
342 int GetPrintLen(
bool compact);
343 int PrintHelper(PutCharsFunction *pf,
void *data,
bool compact);
346 beuint32_t
inline GetInternalValue(
int i)
const {
return val[i]; };
357} __attribute__((packed));
365 return ((i.val[3] == j.val[3]) && (i.val[2] == j.val[2]) && (i.val[1] == j.val[1]) && (i.val[0] == j.val[0]));
370 return !((i.val[3] == j.val[3]) && (i.val[2] == j.val[2]) && (i.val[1] == j.val[1]) && (i.val[0] == j.val[0]));
375 if (i.val[0] > j.val[0])
return true;
377 if (i.val[0] == j.val[0])
379 if (i.val[1] > j.val[1])
return true;
381 if (i.val[1] == j.val[1])
383 if (i.val[2] > j.val[2])
return true;
385 if (i.val[2] == j.val[2])
387 if (i.val[3] > j.val[3])
return true;
396 if (i.val[0] < j.val[0])
return true;
398 if (i.val[0] == j.val[0])
400 if (i.val[1] < j.val[1])
return true;
401 if (i.val[1] == j.val[1])
403 if (i.val[2] < j.val[2])
return true;
404 if (i.val[2] == j.val[2])
406 if (i.val[3] < j.val[3])
return true;
Used to store and manipulate IPv4 addresses in dual stack mode.
Definition nettypes.h:225
bool IsLoopBack() const
Check if the IP address is the loopback address for the interface.
Definition nettypes.h:304
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
Definition ipv6_addr.h:41
void print(bool bCompact=true, bool bShowV4Raw=false) const
Print the IP address value to stdout.
int sprintf(char *cp, int maxl, bool bCompact=true, bool bShowV4Raw=false) const
Print the IP address to the specified buffer.
void SetFromAscii(const char *cp, bool bembed_v4addresses=true)
Set the IP address value of an IPADDR6 object.
IPADDR4 Extract4() const
Extracts an IPv4 address from the object.
Definition ipv6_addr.h:80
bool IsLinkLocal() const
Check if the IP address is the link-local address for the interface.
Definition ipv6_addr.h:175
void SetFromIP4(IPADDR4 ip)
Set the IP address value of an IPADDR6 object from an IPADD4 object.
uint32_t GetEmbededIP4Uint() const
Get the embedded IPv4 address as a 32-bit unsigned integer.
Definition ipv6_addr.h:104
bool IsEmbeddedIPV4() const
An IPADDR6 object can store a IPv4 or IPv6 address. This function returns true if the instance contai...
Definition ipv6_addr.h:66
MACADR McastMac() const
Return the MAC address used for Multicasts for the interface.
void SetNull()
Set the IP address value of an IPADDR6 object to null.
Definition ipv6_addr.h:320
bool IsMultiCast() const
Check if the IPADDR6 object contains a Multicast IP address the interface.
Definition ipv6_addr.h:164
bool IsNull() const
Check if the IP address is null.
Definition ipv6_addr.h:133
void 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.
Definition ipv6_addr.h:307
static IPADDR6 NullIP()
Static function to return a null IPADDR6 object.
void fdprint(int fd, bool bCompact=true, bool bShowV4Raw=false) const
Print the IP address to the specified file descriptor.
static IPADDR6 AsciiToIp6(const char *cp, bool bembed_v4addresses=true)
Static function to return an IPADDR6 object created from an ASCII value IPv4 or IPv6 address.
bool IsLoopBack() const
Check if the IP address is the loopback address for the interface.
Definition ipv6_addr.h:151
bool NotNull() const
Check if the IP address is not null.
Definition ipv6_addr.h:142
Used to store and manipulate MAC addresses.
Definition nettypes.h:69