21 #ifndef IPV6_ADDRESS_H 
   22 #define IPV6_ADDRESS_H 
   29 #include "ns3/attribute-helper.h" 
   30 #include "ns3/address.h" 
   31 #include "ns3/ipv4-address.h" 
   86   void Set (
char const* address);
 
   94   void Set (uint8_t address[16]);
 
  159   void Print (std::ostream& os) 
const;
 
  295   void GetBytes (uint8_t buf[16]) 
const;
 
  382   void GetBytes (uint8_t buf[16]) 
const;
 
  403   void Print (std::ostream &os) 
const;
 
  452 inline bool operator != (
const Ipv6Address& a, 
const Ipv6Address& b)
 
  454   return std::memcmp (a.m_address, b.m_address, 16);
 
  457 inline bool operator < (
const Ipv6Address& a, 
const Ipv6Address& b)
 
  459   return (std::memcmp (a.m_address, b.m_address, 16) < 0);
 
bool IsMatch(Ipv6Address a, Ipv6Address b) const 
If the Address match the type. 
static bool IsMatchingType(const Address &address)
If the Address matches the type. 
bool IsAny() const 
If the IPv6 address is the "Any" address. 
static Ipv6Address GetLoopback()
Get the loopback address. 
std::istream & operator>>(std::istream &is, Angles &a)
static Ipv6Address MakeAutoconfiguredAddress(Mac48Address addr, Ipv6Address prefix)
Make the autoconfigured IPv6 address with Mac48Address. 
Ipv6Address()
Default constructor. 
uint8_t m_address[16]
The address representation on 128 bits (16 bytes). 
bool IsLinkLocalMulticast() const 
If the IPv6 address is link-local multicast (ff02::/16). 
Ipv6Prefix()
Default constructor. 
static Ipv6Address Deserialize(const uint8_t buf[16])
Deserialize this address. 
bool IsLinkLocal() const 
If the IPv6 address is a link-local address (fe80::/64). 
bool IsAllRoutersMulticast() const 
If the IPv6 address is "all routers multicast" (ff02::2/8). 
bool IsEqual(const Ipv6Prefix &other) const 
Comparison operation between two Ipv6Prefix. 
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address. 
size_t operator()(Ipv6Address const &x) const 
Unary operator to hash IPv6 address. 
bool IsEqual(const Ipv6Address &other) const 
Comparison operation between two Ipv6Addresses. 
bool IsAllHostsMulticast() const 
If the IPv6 address is "all hosts multicast" (ff02::3/8). 
bool IsAllNodesMulticast() const 
If the IPv6 address is "all nodes multicast" (ff02::1/8). 
static Ipv6Prefix GetZero()
Get the zero prefix ( /0). 
a polymophic address class 
Address ConvertTo(void) const 
convert the IPv6Address object to an Address object. 
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address. 
void Print(std::ostream &os) const 
Print this address to the given output stream. 
void GetBytes(uint8_t buf[16]) const 
Get the bytes corresponding to the address. 
void Set(char const *address)
Sets an Ipv6Address by parsing the input C-string. 
static Ipv6Address GetAllHostsMulticast()
Get the "all hosts multicast" address. 
#define ATTRIBUTE_HELPER_HEADER(type)
std::ostream & operator<<(std::ostream &os, const Angles &a)
bool IsMulticast() const 
If the IPv6 address is multicast (ff00::/8). 
static Ipv6Address GetAllNodesMulticast()
Get the "all nodes multicast" address. 
uint8_t m_prefix[16]
The prefix representation. 
Hash function class for IPv6 addresses. 
Describes an IPv6 address. 
Ipv4 addresses are stored in host order in this class. 
void Print(std::ostream &os) const 
Print this address to the given output stream. 
bool IsSolicitedMulticast() const 
If the IPv6 address is a Solicited multicast address. 
static Ipv6Prefix GetOnes()
Get the "all-1" IPv6 mask (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff). 
void GetBytes(uint8_t buf[16]) const 
Get the bytes corresponding to the prefix. 
~Ipv6Address()
Destructor. 
static Ipv6Address GetOnes()
Get the "all-1" IPv6 address (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff). 
static Ipv6Prefix GetLoopback()
Get the loopback prefix ( /128). 
Describes an IPv6 prefix. It is just a bitmask like Ipv4Mask. 
Ipv4Address GetIpv4MappedAddress() const 
Return the Ipv4 address. 
uint8_t GetPrefixLength() const 
Get prefix length. 
bool IsLocalhost() const 
If the IPv6 address is localhost (::1). 
static Ipv6Address MakeIpv4MappedAddress(Ipv4Address addr)
Make the Ipv4-mapped IPv6 address. 
Ipv6Address CombinePrefix(Ipv6Prefix const &prefix)
Combine this address with a prefix. 
static Ipv6Address MakeAutoconfiguredLinkLocalAddress(Mac48Address mac)
Make the autoconfigured link-local IPv6 address with Mac48Address. 
bool IsIpv4MappedAddress()
If the address is an IPv4-mapped address. 
static uint8_t GetType(void)
Return the Type of address. 
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address. 
static Ipv6Address GetAllRoutersMulticast()
Get the "all routers multicast" address. 
static Ipv6Address ConvertFrom(const Address &address)
Convert the Address object into an Ipv6Address ones. 
void Serialize(uint8_t buf[16]) const 
Serialize this address to a 16-byte buffer.