27 #include "ns3/packet.h" 28 #include "ns3/nstime.h" 29 #include "ns3/net-device.h" 30 #include "ns3/ipv6-address.h" 32 #include "ns3/timer.h" 33 #include "ns3/sgi-hashmap.h" 34 #include "ns3/output-stream-wrapper.h" 42 class Icmpv6L4Protocol;
409 typedef sgi::hash_map<Ipv6Address, NdiscCache::Entry *, Ipv6AddressHash>
Cache;
413 typedef sgi::hash_map<Ipv6Address, NdiscCache::Entry *, Ipv6AddressHash>::iterator
CacheI;
Address GetMacAddress() const
Get the MAC address of this entry.
void FunctionDelayTimeout()
Function called when delay timer timeout.
static TypeId GetTypeId()
Get the type ID.
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
bool IsReachable() const
Is the entry REACHABLE.
NdiscCache::Entry * Add(Ipv6Address to)
Add an entry.
void SetUnresQlen(uint32_t unresQlen)
Set the max number of waiting packet.
void StopNudTimer()
Stop NUD timer and reset the NUD retransmission counter.
Ipv6Address m_ipv6Address
The IPv6 address.
uint8_t m_nsRetransmit
Number of NS retransmission.
Ptr< Icmpv6L4Protocol > m_icmpv6
the icmpv6 L4 protocol for this cache.
bool IsIncomplete() const
Is the entry INCOMPLETE.
void SetDevice(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface, Ptr< Icmpv6L4Protocol > icmpv6)
Set the device and interface.
Time GetLastReachabilityConfirmation() const
Get the time of last reachability confirmation.
NdiscCacheEntryState_e m_state
The state of the entry.
void MarkPermanent()
Change the state to this entry to PERMANENT.
Try to wait contact from remote host.
a polymophic address class
uint32_t GetUnresQlen()
Get the max number of waiting packet.
Ptr< NetDevice > GetDevice() const
Get the NetDevice associated with this cache.
Address m_macAddress
The MAC address.
Ptr< Ipv6Interface > m_interface
the interface.
sgi::hash_map< Ipv6Address, NdiscCache::Entry *, Ipv6AddressHash > Cache
Neighbor Discovery Cache container.
NdiscCacheEntryState_e
The Entry state enumeration.
void FunctionRetransmitTimeout()
Function called when retransmit timer timeout.
void MarkReachable()
Changes the state to this entry to REACHABLE.
bool m_router
Type of node (router or host).
void Flush()
Flush the cache.
IPv6 Neighbor Discovery cache.
Ptr< Ipv6Interface > GetInterface() const
Get the Ipv6Interface associated with this cache.
void PrintNdiscCache(Ptr< OutputStreamWrapper > stream)
Print the NDISC cache entries.
Mapping exists between IPv6 and L2 addresses.
void StartRetransmitTimer()
Start retransmit timer.
void ClearWaitingPacket()
Clear the waiting packet list.
Entry(NdiscCache *nd)
Constructor.
bool IsStale() const
Is the entry STALE.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void StartDelayTimer()
Start delay timer.
bool IsRouter() const
If the entry is a host or a router.
void StartReachableTimer()
Start the reachable timer.
void FunctionReachableTimeout()
Function called when reachable timer timeout.
NdiscCache & operator=(NdiscCache const &)
Copy constructor.
void StartProbeTimer()
Start probe timer.
No mapping between IPv6 and L2 addresses.
static const uint32_t DEFAULT_UNRES_QLEN
Default value for unres qlen.
void Remove(NdiscCache::Entry *entry)
Delete an entry.
void FunctionProbeTimeout()
Function called when probe timer timeout.
uint32_t m_unresQlen
Max number of packet stored in m_waiting.
void UpdateReachableTimer()
Update the reachable timer.
std::list< NdiscCache::Entry * > LookupInverse(Address dst)
Lookup in the cache for a MAC address.
void SetMacAddress(Address mac)
Set the MAC address of this entry.
Time m_lastReachabilityConfirmation
Last time we see a reachability confirmation.
Describes an IPv6 address.
bool IsProbe() const
Is the entry PROBE.
Permanent Mapping exists between IPv6 and L2 addresses.
NdiscCache::Entry * Lookup(Ipv6Address dst)
Lookup in the cache.
void MarkStale()
Changes the state to this entry to STALE.
void DoDispose()
Dispose this object.
void SetIpv6Address(Ipv6Address ipv6Address)
Set the IPv6 address.
void MarkDelay()
Change the state to this entry to DELAY.
NdiscCache * m_ndCache
the NdiscCache associated.
void MarkIncomplete(Ipv6PayloadHeaderPair p)
Changes the state to this entry to INCOMPLETE.
Cache m_ndCache
A list of Entry.
std::list< Ipv6PayloadHeaderPair > m_waiting
The list of packet waiting.
A record that holds information about a NdiscCache entry.
Timer m_nudTimer
Timer (used for NUD).
void SetRouter(bool router)
Set the node type.
Try to contact IPv6 address to know again its L2 address.
A base class which provides memory management and object aggregation.
sgi::hash_map< Ipv6Address, NdiscCache::Entry *, Ipv6AddressHash >::iterator CacheI
Neighbor Discovery Cache container iterator.
std::pair< Ptr< Packet >, Ipv6Header > Ipv6PayloadHeaderPair
Pair of a packet and an Ipv4 header.
bool IsDelay() const
Is the entry DELAY.
bool IsPermanent() const
Is the entry PERMANENT.
a unique identifier for an interface.
void AddWaitingPacket(Ipv6PayloadHeaderPair p)
Add a packet (or replace old value) in the queue.
void MarkProbe()
Changes the state to this entry to PROBE.
Ptr< NetDevice > m_device
The NetDevice.