|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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"
32 #include "ns3/deprecated.h"
252 void Print (std::ostream& os)
const;
399 void GetBytes (uint8_t buf[16])
const;
488 Ipv6Prefix (uint8_t prefix[16], uint8_t prefixLength);
495 Ipv6Prefix (
char const* prefix, uint8_t prefixLength);
533 void GetBytes (uint8_t buf[16])
const;
565 void Print (std::ostream &os)
const;
bool IsLocalhost() const
If the IPv6 address is localhost (::1).
bool IsMatch(Ipv6Address a, Ipv6Address b) const
If the Address match the type.
static Ipv6Address Deserialize(const uint8_t buf[16])
Deserialize this address.
friend bool operator!=(Ipv6Address const &a, Ipv6Address const &b)
Not equal to operator.
void Set(char const *address)
Sets an Ipv6Address by parsing the input C-string.
friend bool operator!=(Ipv6Prefix const &a, Ipv6Prefix const &b)
Not equal to operator.
static bool IsMatchingType(const Address &address)
If the Address matches the type.
A class used for addressing MAC8 MAC's.
uint8_t GetMinimumPrefixLength() const
Get the minimum prefix length, i.e., 128 - the length of the largest sequence trailing zeroes.
bool IsIpv4MappedAddress() const
If the address is an IPv4-mapped address.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
void GetBytes(uint8_t buf[16]) const
Get the bytes corresponding to the prefix.
static Ipv6Prefix GetOnes()
Get the "all-1" IPv6 mask (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
This class can contain 16 bit addresses.
bool operator<(const EventId &a, const EventId &b)
uint8_t m_address[16]
The address representation on 128 bits (16 bytes).
static Ipv6Address GetAllHostsMulticast()
Get the "all hosts multicast" address.
~Ipv6Address()
Destructor.
bool IsInitialized(void) const
bool IsAllNodesMulticast() const
If the IPv6 address is "all nodes multicast" (ff02::1/8).
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
void GetBytes(uint8_t buf[16]) const
Get the bytes corresponding to the address.
static Ipv6Address GetLoopback()
Get the loopback address.
bool HasPrefix(Ipv6Prefix const &prefix) const
Compares an address and a prefix.
void Serialize(uint8_t buf[16]) const
Serialize this address to a 16-byte buffer.
void Print(std::ostream &os) const
Print this address to the given output stream.
void SetPrefixLength(uint8_t prefixLength)
Set prefix length.
bool IsSolicitedMulticast() const
If the IPv6 address is a Solicited multicast address.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
Ipv6Address CombinePrefix(Ipv6Prefix const &prefix) const
Combine this address with a prefix.
friend bool operator==(Ipv6Address const &a, Ipv6Address const &b)
Equal to operator.
a polymophic address class
friend bool operator==(Ipv6Prefix const &a, Ipv6Prefix const &b)
Equal to operator.
Ipv4Address GetIpv4MappedAddress() const
Return the Ipv4 address.
static Ipv6Address ConvertFrom(const Address &address)
Convert the Address object into an Ipv6Address ones.
void Print(std::ostream &os) const
Print this address to the given output stream.
static Ipv6Prefix GetZero()
Get the zero prefix ( /0).
bool operator==(const EventId &a, const EventId &b)
uint8_t m_prefix[16]
The prefix representation.
Ipv6Address ConvertToIpv6Address() const
Convert the Prefix into an IPv6 Address.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
bool m_initialized
IPv6 address has been explicitly initialized to a valid value.
bool IsLinkLocalMulticast() const
If the IPv6 address is link-local multicast (ff02::/16).
uint8_t m_prefixLength
The prefix length.
static Ipv6Address MakeAutoconfiguredAddress(Address addr, Ipv6Address prefix)
Make the autoconfigured IPv6 address from a Mac address.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
static Ipv6Address MakeAutoconfiguredLinkLocalAddress(Address mac)
Make the autoconfigured link-local IPv6 address from a Mac address.
static Ipv6Address GetAllNodesMulticast()
Get the "all nodes multicast" address.
Ipv6Prefix()
Default constructor.
Hash function class for IPv6 addresses.
uint8_t GetPrefixLength() const
Get prefix length.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
friend bool operator<(Ipv6Address const &a, Ipv6Address const &b)
Less than to operator.
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
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).
Address ConvertTo(void) const
convert the IPv6Address object to an Address object.
static Ipv6Address MakeIpv4MappedAddress(Ipv4Address addr)
Make the Ipv4-mapped IPv6 address.
bool IsAny() const
If the IPv6 address is the "Any" address.
std::ostream & operator<<(std::ostream &os, const Angles &a)
bool IsDocumentation() const
If the IPv6 address is a documentation address (2001:DB8::/32).
Describes an IPv6 prefix.
static uint8_t GetType(void)
Return the Type of address.
static Ipv6Address GetAllRoutersMulticast()
Get the "all routers multicast" address.
bool IsAllRoutersMulticast() const
If the IPv6 address is "all routers multicast" (ff02::2/8).
Ipv6Address()
Default constructor.
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
size_t operator()(Ipv6Address const &x) const
Returns the hash of an IPv6 address.
std::istream & operator>>(std::istream &is, Angles &a)