11#include "ns3/assert.h"
24 m_state(TENTATIVE_OPTIMISTIC),
63 : m_address(o.m_address),
68 m_nsDadUid(o.m_nsDadUid)
90 if (address.IsLocalhost())
96 else if (address.IsLinkLocal())
102 else if (address.IsLinkLocalMulticast())
228 m_dadTimer.SetArguments (interface,
m_address);
229 m_dadTimer.Schedule (
Seconds (1));
233void Ipv6InterfaceAddress::StopDadTimer ()
236 m_dadTimer.Cancel ();
virtual void FunctionDadTimeout(Ipv6Interface *interface, Ipv6Address addr)
Function called when DAD timeout.
Describes an IPv6 address.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
bool IsLinkLocalMulticast() const
If the IPv6 address is link-local multicast (ff02::/16).
Ipv6Address CombinePrefix(const Ipv6Prefix &prefix) const
Combine this address with a prefix.
IPv6 address associated with an interface.
void SetScope(Ipv6InterfaceAddress::Scope_e scope)
Set the scope.
Ipv6Address m_address
The IPv6 address.
uint32_t m_nsDadUid
Last DAD probe packet UID.
~Ipv6InterfaceAddress()
Destructor.
void SetAddress(Ipv6Address address)
Set IPv6 address (and scope).
Ipv6Address GetAddress() const
Get the IPv6 address.
Ipv6InterfaceAddress()
Default constructor.
uint32_t GetNsDadUid() const
Get the latest DAD probe packet UID.
void SetState(Ipv6InterfaceAddress::State_e state)
Set the state.
Ipv6InterfaceAddress::Scope_e GetScope() const
Get address scope.
void SetNsDadUid(uint32_t uid)
Set the latest DAD probe packet UID.
Ipv6Prefix GetPrefix() const
Get the IPv6 prefix.
bool GetOnLink() const
Get the on-link property.
void SetOnLink(bool onLink)
Get the on-link property.
Ipv6InterfaceAddress::State_e GetState() const
Get the address state.
bool m_onLink
The address belongs to an on-link network.
State_e
State of an address associated with an interface.
@ TENTATIVE_OPTIMISTIC
Address is tentative but we are optimistic so we can send packet even if DAD is not yet finished.
bool IsInSameSubnet(Ipv6Address b) const
Checks if the address is in the same subnet.
Scope_e m_scope
Scope of the address.
State_e m_state
State of the address.
Ipv6Prefix m_prefix
The IPv6 prefix.
@ LINKLOCAL
Link-local address (fe80::/64)
@ HOST
Localhost (::1/128)
@ GLOBAL
Global address (2000::/3)
Describes an IPv6 prefix.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)