23 #include "ns3/packet.h"
26 #include "ns3/net-device.h"
28 #include "ns3/mac16-address.h"
29 #include "ns3/mac64-address.h"
59 m_baseReachableTime (0),
90 if (!DynamicCast<LoopbackNetDevice> (
m_device))
111 NS_ASSERT_MSG (
false,
"IPv6 autoconf for this kind of address not implemented.");
210 if ((*it).GetAddress () == addr)
223 if (icmpv6 && icmpv6->IsAlwaysDad ())
243 if ((*it).GetAddress ().IsLinkLocal ())
248 NS_ASSERT_MSG (
false,
"No link-local address on interface " <<
this);
288 NS_ASSERT_MSG (
false,
"Try to remove index that don't exist in Ipv6Interface::RemoveAddress");
321 if((*it).GetAddress() ==
address)
361 if (DynamicCast<LoopbackNetDevice> (
m_device))
373 if (dest == (*it).GetAddress ())
397 NS_ASSERT_MSG (
m_device->IsMulticast (),
"Ipv6Interface::SendTo (): Sending multicast packet over non-multicast device");
399 hardwareDestination =
m_device->GetMulticast (dest);
475 if ((*it).GetAddress () ==
address)
477 (*it).SetState (state);
490 if ((*it).GetAddress () ==
address)
492 (*it).SetNsDadUid (uid);
bool IsMatch(Ipv6Address a, Ipv6Address b) const
If the Address match the type.
Ipv6InterfaceAddressList m_addresses
The addresses assigned to this interface.
bool IsAny() const
If the IPv6 address is the "Any" address.
static bool IsMatchingType(const Address &address)
static Ipv6Address GetLoopback()
Get the loopback address.
bool m_ifup
The state of this interface.
bool AddAddress(Ipv6InterfaceAddress iface)
Add an IPv6 address.
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
void SetState(Ipv6Address address, Ipv6InterfaceAddress::State_e state)
Update state of an interface address.
void SetUp()
Enable this interface.
uint16_t GetRetransTimer() const
Get the retransmission timer.
bool m_forwarding
Forwarding state.
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
static Mac16Address ConvertFrom(const Address &address)
static bool IsMatchingType(const Address &address)
IPv6 layer implementation.
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
Ipv6InterfaceAddress GetAddress(uint32_t index) const
Get an address from IPv6 interface.
IPv6 address associated with an interface.
Ptr< NetDevice > m_device
NetDevice associated with this interface.
void SetDevice(Ptr< NetDevice > device)
Set the NetDevice.
void SetReachableTime(uint16_t reachableTime)
Set the reachable time.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::list< Ipv6InterfaceAddress >::iterator Ipv6InterfaceAddressListI
Container Iterator for the Ipv6InterfaceAddresses.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
bool IsUp() const
Is the interface UP ?
bool IsDown() const
Is the interface DOWN ?
a polymophic address class
void SetBaseReachableTime(uint16_t baseReachableTime)
Set the base reachable time.
static void FunctionDadTimeout(Ptr< Icmpv6L4Protocol > icmpv6, Ipv6Interface *interface, Ipv6Address addr)
Function called when DAD timeout.
uint16_t m_baseReachableTime
Base value used for computing the random reachable time value (in millisecond).
uint16_t GetBaseReachableTime() const
Get the base reachable time.
Ipv6Address GetAddress() const
Get the IPv6 address.
uint32_t GetNAddresses(void) const
Get number of addresses on this IPv6 interface.
void SetMetric(uint16_t metric)
Set the metric.
Ptr< Node > m_node
Node associated with this interface.
virtual ~Ipv6Interface()
Destructor.
void SetRetransTimer(uint16_t retransTimer)
Set the retransmission timer.
uint16_t m_retransTimer
Retransmission timer (in millisecond).
static TypeId GetTypeId()
Get the type ID.
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
Ipv6Prefix GetPrefix() const
Get the IPv6 prefix.
void Send(Ptr< Packet > p, Ipv6Address dest)
Send a packet through this interface.
#define NS_LOG_LOGIC(msg)
void SetNsDadUid(Ipv6Address address, uint32_t uid)
Update NS DAD packet UID of an interface address.
static Mac48Address ConvertFrom(const Address &address)
void SetNode(Ptr< Node > node)
Set node associated with interface.
void SetForwarding(bool forward)
Set forwarding enabled or not.
uint8_t m_curHopLimit
Current hop limit.
void SetCurHopLimit(uint8_t curHopLimit)
Set the current hop limit.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
#define NS_ASSERT_MSG(condition, message)
void DoDAD(Ipv6Address target, Ptr< Ipv6Interface > interface)
Do the Duplication Address Detection (DAD).
static Ipv6Address MakeAutoconfiguredLinkLocalAddress(Mac16Address mac)
Make the autoconfigured link-local IPv6 address with Mac16Address.
Ipv6InterfaceAddress GetLinkLocalAddress() const
Get link-local address from IPv6 interface.
uint8_t GetCurHopLimit() const
Get the current hop limit value.
Describes an IPv6 address.
uint16_t GetMetric() const
Get the metric.
State_e
State of an address associated with an interface.
static Mac64Address ConvertFrom(const Address &address)
void DoSetup()
Initialize interface.
uint16_t m_reachableTime
Reachable time (in millisecond).
bool IsForwarding() const
If the interface allows forwarding packets.
Describes an IPv6 prefix.
uint16_t GetReachableTime() const
Get the reachable time.
Ipv6InterfaceAddress RemoveAddress(uint32_t index)
Remove an address from interface.
a base class which provides memory management and object aggregation
virtual void DoDispose()
Dispose this object.
static bool IsMatchingType(const Address &address)
std::list< Ipv6InterfaceAddress >::const_iterator Ipv6InterfaceAddressListCI
Const Container Iterator for the Ipv6InterfaceAddresses.
uint16_t m_metric
The metric.
bool IsLocalhost() const
If the IPv6 address is localhost (::1).
Ptr< T > GetObject(void) const
void SetDown()
Disable this interface.
a unique identifier for an interface.
Ipv6InterfaceAddress GetAddressMatchingDestination(Ipv6Address dst)
Get an address which is in the same network prefix as destination.
TypeId SetParent(TypeId tid)
Ptr< NdiscCache > m_ndCache
Neighbor cache.
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
Ipv6Interface()
Constructs an Ipv6Interface.