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