23 #include "ns3/packet.h" 24 #include "ns3/net-device.h" 25 #include "ns3/mac16-address.h" 26 #include "ns3/mac64-address.h" 27 #include "ns3/traffic-control-layer.h" 48 .SetGroupName (
"Internet")
62 m_baseReachableTime (0),
94 if (!DynamicCast<LoopbackNetDevice> (
m_device))
124 NS_FATAL_ERROR (
"IPv6 autoconf for this kind of address not implemented.");
237 if (it->first.GetAddress () == addr)
244 m_addresses.push_back (std::make_pair (iface, solicited));
256 if (icmpv6 && icmpv6->IsAlwaysDad ())
330 NS_FATAL_ERROR (
"Removing index that does not exist in Ipv6Interface::RemoveAddress");
362 if(it->first.GetAddress () ==
address)
404 if (DynamicCast<LoopbackNetDevice> (
m_device))
419 if (dest == it->first.GetAddress ())
443 NS_ASSERT_MSG (
m_device->IsMulticast (),
"Ipv6Interface::SendTo (): Sending multicast packet over non-multicast device");
445 hardwareDestination =
m_device->GetMulticast (dest);
521 if (it->first.GetAddress () ==
address)
523 it->first.SetState (state);
536 if (it->first.GetAddress () ==
address)
538 it->first.SetNsDadUid (uid);
Ipv6InterfaceAddressList m_addresses
The addresses assigned to this interface.
static bool IsMatchingType(const Address &address)
Ipv6Address GetAddress() const
Get the IPv6 address.
bool IsLocalhost() const
If the IPv6 address is localhost (::1).
bool m_ifup
The state of this interface.
bool AddAddress(Ipv6InterfaceAddress iface)
Add an IPv6 address.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetState(Ipv6Address address, Ipv6InterfaceAddress::State_e state)
Update state of an interface address.
void SetUp()
Enable this interface.
Ipv6InterfaceAddress GetLinkLocalAddress() const
Get link-local address from IPv6 interface.
bool m_forwarding
Forwarding state.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
Access to the IPv6 forwarding table, interfaces, and configuration.
static Mac16Address ConvertFrom(const Address &address)
static bool IsMatchingType(const Address &address)
IPv6 layer implementation.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
IPv6 address associated with an interface.
Ptr< NetDevice > m_device
NetDevice associated with this interface.
void SetDevice(Ptr< NetDevice > device)
Set the NetDevice.
bool IsForwarding() const
If the interface allows forwarding packets.
void SetReachableTime(uint16_t reachableTime)
Set the reachable time.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
virtual void DoDispose(void)
Destructor implementation.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static bool IsMatchingType(const Address &address)
Check that a generic Address is compatible with Mac8Address.
bool IsSolicitedMulticastAddress(Ipv6Address address) const
Checks if the address is a Solicited Multicast address for this interface.
a polymophic address class
void SetBaseReachableTime(uint16_t baseReachableTime)
Set the base reachable time.
bool IsMatch(Ipv6Address a, Ipv6Address b) const
If the Address match the type.
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).
void Send(Ptr< Packet > p, const Ipv6Header &hdr, Ipv6Address dest)
Send a packet through this interface.
void SetMetric(uint16_t metric)
Set the metric.
Ptr< Node > m_node
Node associated with this interface.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
virtual ~Ipv6Interface()
Destructor.
void SetRetransTimer(uint16_t retransTimer)
Set the retransmission timer.
void Flush()
Flush the cache.
uint16_t m_retransTimer
Retransmission timer (in millisecond).
bool IsUp() const
Is the interface UP ?
An implementation of the ICMPv6 protocol.
static TypeId GetTypeId()
Get the type ID.
Ipv6InterfaceAddress m_linkLocalAddress
The link-local addresses assigned to this interface.
void SetTrafficControl(Ptr< TrafficControlLayer > tc)
Set the TrafficControlLayer.
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.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t m_curHopLimit
Current hop limit.
uint16_t GetReachableTime() const
Get the reachable time.
static uint16_t GetStaticProtocolNumber()
Get ICMPv6 protocol number.
void SetCurHopLimit(uint8_t curHopLimit)
Set the current hop limit.
uint32_t GetNAddresses(void) const
Get number of addresses on this IPv6 interface.
std::list< std::pair< Ipv6InterfaceAddress, Ipv6Address > >::const_iterator Ipv6InterfaceAddressListCI
Const Container Iterator for the Ipv6InterfaceAddresses.
Ipv6InterfaceAddress GetAddress(uint32_t index) const
Get an address from IPv6 interface.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
std::list< std::pair< Ipv6InterfaceAddress, Ipv6Address > >::iterator Ipv6InterfaceAddressListI
Container Iterator for the Ipv6InterfaceAddresses.
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.
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.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
uint16_t m_reachableTime
Reachable time (in millisecond).
Time Seconds(double value)
Construct a Time in the indicated unit.
uint16_t GetBaseReachableTime() const
Get the base reachable time.
uint8_t GetCurHopLimit() const
Get the current hop limit value.
Describes an IPv6 prefix.
Ipv6InterfaceAddress RemoveAddress(uint32_t index)
Remove an address from interface.
Ptr< NdiscCache > GetNdiscCache() const
A base class which provides memory management and object aggregation.
bool IsDown() const
Is the interface DOWN ?
virtual void DoDispose()
Dispose this object.
static bool IsMatchingType(const Address &address)
uint16_t m_metric
The metric.
Ptr< TrafficControlLayer > m_tc
TrafficControlLayer associated with this interface.
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)
Set the parent TypeId.
Ptr< NdiscCache > m_ndCache
Neighbor cache.
static Mac8Address ConvertFrom(const Address &address)
Convert a generic address to a Mac8Address.
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
Ipv6Prefix GetPrefix() const
Get the IPv6 prefix.
uint16_t GetRetransTimer() const
Get the retransmission timer.
void AddHeader(const Header &header)
Add header to this packet.
bool IsAny() const
If the IPv6 address is the "Any" address.
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
Ipv6Interface()
Constructs an Ipv6Interface.