A record that holds information about a NdiscCache entry. More...
#include "ndisc-cache.h"
| Public Types | |
| enum | NdiscCacheEntryState_e { INCOMPLETE , REACHABLE , STALE , DELAY , PROBE , PERMANENT , STATIC_AUTOGENERATED } | 
| The Entry state enumeration.  More... | |
| Public Member Functions | |
| Entry (NdiscCache *nd) | |
| Constructor. | |
| virtual | ~Entry ()=default | 
| void | AddWaitingPacket (Ipv6PayloadHeaderPair p) | 
| Add a packet (or replace old value) in the queue. | |
| void | ClearWaitingPacket () | 
| Clear the waiting packet list. | |
| void | FunctionDelayTimeout () | 
| Function called when delay timer timeout. | |
| void | FunctionProbeTimeout () | 
| Function called when probe timer timeout. | |
| void | FunctionReachableTimeout () | 
| Function called when reachable timer timeout. | |
| void | FunctionRetransmitTimeout () | 
| Function called when retransmit timer timeout. | |
| NdiscCacheEntryState_e | GetEntryState () const | 
| Get the state of the entry. | |
| Ipv6Address | GetIpv6Address () const | 
| Get the IPv6 address. | |
| Time | GetLastReachabilityConfirmation () const | 
| Get the time of last reachability confirmation. | |
| Address | GetMacAddress () const | 
| Get the MAC address of this entry. | |
| bool | IsAutoGenerated () const | 
| Is the entry STATIC_AUTOGENERATED. | |
| bool | IsDelay () const | 
| Is the entry DELAY. | |
| bool | IsIncomplete () const | 
| Is the entry INCOMPLETE. | |
| bool | IsPermanent () const | 
| Is the entry PERMANENT. | |
| bool | IsProbe () const | 
| Is the entry PROBE. | |
| bool | IsReachable () const | 
| Is the entry REACHABLE. | |
| bool | IsRouter () const | 
| If the entry is a host or a router. | |
| bool | IsStale () const | 
| Is the entry STALE. | |
| void | MarkAutoGenerated () | 
| Changes the state of this entry to auto-generated. | |
| void | MarkDelay () | 
| Change the state to this entry to DELAY. | |
| void | MarkIncomplete (Ipv6PayloadHeaderPair p) | 
| Changes the state to this entry to INCOMPLETE. | |
| void | MarkPermanent () | 
| Change the state to this entry to PERMANENT. | |
| void | MarkProbe () | 
| Changes the state to this entry to PROBE. | |
| void | MarkReachable () | 
| Changes the state to this entry to REACHABLE. | |
| std::list< Ipv6PayloadHeaderPair > | MarkReachable (Address mac) | 
| Changes the state to this entry to REACHABLE. | |
| void | MarkStale () | 
| Changes the state to this entry to STALE. | |
| std::list< Ipv6PayloadHeaderPair > | MarkStale (Address mac) | 
| Changes the state to this entry to STALE. | |
| void | Print (std::ostream &os) const | 
| Print this entry to the given output stream. | |
| void | SetIpv6Address (Ipv6Address ipv6Address) | 
| Set the IPv6 address. | |
| void | SetMacAddress (Address mac) | 
| Set the MAC address of this entry. | |
| void | SetRouter (bool router) | 
| Set the node type. | |
| void | StartDelayTimer () | 
| Start delay timer. | |
| void | StartProbeTimer () | 
| Start probe timer. | |
| void | StartReachableTimer () | 
| Start the reachable timer. | |
| void | StartRetransmitTimer () | 
| Start retransmit timer. | |
| void | StopNudTimer () | 
| Stop NUD timer and reset the NUD retransmission counter. | |
| void | UpdateReachableTimer () | 
| Update the reachable timer. | |
| Public Attributes | |
| NdiscCacheEntryState_e | m_state | 
| The state of the entry. | |
| Protected Attributes | |
| NdiscCache * | m_ndCache | 
| the NdiscCache associated. | |
| Private Attributes | |
| Ipv6Address | m_ipv6Address | 
| The IPv6 address. | |
| Time | m_lastReachabilityConfirmation | 
| Last time we see a reachability confirmation. | |
| Address | m_macAddress | 
| The MAC address. | |
| uint8_t | m_nsRetransmit | 
| Number of NS retransmission. | |
| Timer | m_nudTimer | 
| Timer (used for NUD). | |
| bool | m_router | 
| Type of node (router or host). | |
| std::list< Ipv6PayloadHeaderPair > | m_waiting | 
| The list of packet waiting. | |
A record that holds information about a NdiscCache entry.
Definition at line 160 of file ndisc-cache.h.
The Entry state enumeration.
| Enumerator | |
|---|---|
| INCOMPLETE | No mapping between IPv6 and L2 addresses. | 
| REACHABLE | Mapping exists between IPv6 and L2 addresses. | 
| STALE | Mapping is stale. | 
| DELAY | Try to wait contact from remote host. | 
| PROBE | Try to contact IPv6 address to know again its L2 address. | 
| PERMANENT | Permanent Mapping exists between IPv6 and L2 addresses. | 
| STATIC_AUTOGENERATED | Permanent entries generate by NeighborCacheHelper. | 
Definition at line 174 of file ndisc-cache.h.
| ns3::NdiscCache::Entry::Entry | ( | NdiscCache * | nd | ) | 
Constructor.
| nd | The NdiscCache this entry belongs to. | 
Definition at line 246 of file ndisc-cache.cc.
References ns3::NdiscCache::NdiscCache(), m_lastReachabilityConfirmation, m_ndCache, m_nsRetransmit, m_nudTimer, m_router, m_waiting, and NS_LOG_FUNCTION.
| 
 | virtualdefault | 
| void ns3::NdiscCache::Entry::AddWaitingPacket | ( | Ipv6PayloadHeaderPair | p | ) | 
Add a packet (or replace old value) in the queue.
| p | packet to add | 
Definition at line 272 of file ndisc-cache.cc.
References m_ndCache, m_waiting, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::Lookup().
| void ns3::NdiscCache::Entry::ClearWaitingPacket | ( | ) | 
Clear the waiting packet list.
Definition at line 286 of file ndisc-cache.cc.
References m_waiting, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Ipv6L3Protocol::ReachabilityHint(), ns3::Icmpv6L4Protocol::ReceiveLLA(), and ns3::NdiscCache::Remove().
| void ns3::NdiscCache::Entry::FunctionDelayTimeout | ( | ) | 
Function called when delay timer timeout.
Definition at line 356 of file ndisc-cache.cc.
References ns3::Ipv6Address::IsAny(), m_ipv6Address, m_ndCache, m_nsRetransmit, MarkProbe(), NS_LOG_FUNCTION, ns3::Ipv6L3Protocol::PROT_NUMBER, and StartProbeTimer().
Referenced by StartDelayTimer().
| void ns3::NdiscCache::Entry::FunctionProbeTimeout | ( | ) | 
Function called when probe timer timeout.
Definition at line 395 of file ndisc-cache.cc.
References ns3::Ipv6Address::IsAny(), ns3::NdiscCache::m_icmpv6, m_ipv6Address, m_ndCache, m_nsRetransmit, NS_LOG_FUNCTION, ns3::Ipv6L3Protocol::PROT_NUMBER, and StartProbeTimer().
Referenced by StartProbeTimer().
| void ns3::NdiscCache::Entry::FunctionReachableTimeout | ( | ) | 
Function called when reachable timer timeout.
Definition at line 294 of file ndisc-cache.cc.
References MarkStale(), and NS_LOG_FUNCTION.
Referenced by StartReachableTimer().
| void ns3::NdiscCache::Entry::FunctionRetransmitTimeout | ( | ) | 
Function called when retransmit timer timeout.
It verify that the NS retransmit has reached the max so discard the entry otherwise it retransmit a NS.
Definition at line 301 of file ndisc-cache.cc.
References ns3::Create(), ns3::Icmpv6Header::ICMPV6_ADDR_UNREACHABLE, ns3::Ipv6Address::IsAny(), ns3::NdiscCache::m_icmpv6, m_ipv6Address, m_ndCache, m_nsRetransmit, m_waiting, ns3::Ipv6Address::MakeSolicitedAddress(), NS_LOG_FUNCTION, and StartRetransmitTimer().
Referenced by StartRetransmitTimer().
| NdiscCacheEntryState_e ns3::NdiscCache::Entry::GetEntryState | ( | ) | const | 
Get the state of the entry.
| Ipv6Address ns3::NdiscCache::Entry::GetIpv6Address | ( | ) | const | 
Get the IPv6 address.
Definition at line 455 of file ndisc-cache.cc.
References m_ipv6Address, and NS_LOG_FUNCTION.
| Time ns3::NdiscCache::Entry::GetLastReachabilityConfirmation | ( | ) | const | 
Get the time of last reachability confirmation.
Definition at line 462 of file ndisc-cache.cc.
References m_lastReachabilityConfirmation, and NS_LOG_FUNCTION.
| Address ns3::NdiscCache::Entry::GetMacAddress | ( | ) | const | 
Get the MAC address of this entry.
Definition at line 673 of file ndisc-cache.cc.
References m_macAddress, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), ns3::Icmpv6L4Protocol::Lookup(), ns3::Icmpv6L4Protocol::Lookup(), ns3::NdiscCache::LookupInverse(), ns3::Ipv6L3Protocol::ReachabilityHint(), and ns3::Icmpv6L4Protocol::ReceiveLLA().
| bool ns3::NdiscCache::Entry::IsAutoGenerated | ( | ) | const | 
Is the entry STATIC_AUTOGENERATED.
Definition at line 666 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, and STATIC_AUTOGENERATED.
Referenced by ns3::Icmpv6L4Protocol::Lookup(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Ipv6L3Protocol::ReachabilityHint().
| bool ns3::NdiscCache::Entry::IsDelay | ( | ) | const | 
Is the entry DELAY.
Definition at line 638 of file ndisc-cache.cc.
References DELAY, m_state, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::Lookup().
| bool ns3::NdiscCache::Entry::IsIncomplete | ( | ) | const | 
Is the entry INCOMPLETE.
Definition at line 645 of file ndisc-cache.cc.
References INCOMPLETE, m_state, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::HandleRedirection(), and ns3::Ipv6L3Protocol::ReachabilityHint().
| bool ns3::NdiscCache::Entry::IsPermanent | ( | ) | const | 
Is the entry PERMANENT.
Definition at line 659 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, and PERMANENT.
Referenced by ns3::Icmpv6L4Protocol::Lookup(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Ipv6L3Protocol::ReachabilityHint().
| bool ns3::NdiscCache::Entry::IsProbe | ( | ) | const | 
Is the entry PROBE.
Definition at line 652 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, and PROBE.
Referenced by ns3::Ipv6L3Protocol::ReachabilityHint().
| bool ns3::NdiscCache::Entry::IsReachable | ( | ) | const | 
Is the entry REACHABLE.
Definition at line 631 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, and REACHABLE.
Referenced by ns3::Icmpv6L4Protocol::Lookup(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Ipv6L3Protocol::ReachabilityHint().
| bool ns3::NdiscCache::Entry::IsRouter | ( | ) | const | 
If the entry is a host or a router.
Definition at line 265 of file ndisc-cache.cc.
References m_router, and NS_LOG_FUNCTION.
| bool ns3::NdiscCache::Entry::IsStale | ( | ) | const | 
Is the entry STALE.
Definition at line 624 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, and STALE.
Referenced by ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::Lookup().
| void ns3::NdiscCache::Entry::MarkAutoGenerated | ( | ) | 
Changes the state of this entry to auto-generated.
The entry must have a valid MacAddress.
Definition at line 616 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, STATIC_AUTOGENERATED, and StopNudTimer().
Referenced by ns3::NeighborCacheHelper::AddEntry().
| void ns3::NdiscCache::Entry::MarkDelay | ( | ) | 
Change the state to this entry to DELAY.
Definition at line 601 of file ndisc-cache.cc.
References DELAY, m_state, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::Lookup().
| void ns3::NdiscCache::Entry::MarkIncomplete | ( | Ipv6PayloadHeaderPair | p | ) | 
Changes the state to this entry to INCOMPLETE.
| p | packet that wait to be sent | 
Definition at line 550 of file ndisc-cache.cc.
References INCOMPLETE, m_state, m_waiting, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::Lookup().
| void ns3::NdiscCache::Entry::MarkPermanent | ( | ) | 
Change the state to this entry to PERMANENT.
Definition at line 608 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, PERMANENT, and StopNudTimer().
Referenced by FlushTest::DoRun().
| void ns3::NdiscCache::Entry::MarkProbe | ( | ) | 
Changes the state to this entry to PROBE.
Definition at line 571 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, and PROBE.
Referenced by FunctionDelayTimeout().
| void ns3::NdiscCache::Entry::MarkReachable | ( | ) | 
Changes the state to this entry to REACHABLE.
Definition at line 585 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, and REACHABLE.
| std::list< NdiscCache::Ipv6PayloadHeaderPair > ns3::NdiscCache::Entry::MarkReachable | ( | Address | mac | ) | 
Changes the state to this entry to REACHABLE.
| mac | MAC address | 
Definition at line 562 of file ndisc-cache.cc.
References m_macAddress, m_state, m_waiting, NS_LOG_FUNCTION, and REACHABLE.
Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Ipv6L3Protocol::ReachabilityHint(), and ns3::Icmpv6L4Protocol::ReceiveLLA().
| void ns3::NdiscCache::Entry::MarkStale | ( | ) | 
Changes the state to this entry to STALE.
Definition at line 578 of file ndisc-cache.cc.
References m_state, NS_LOG_FUNCTION, and STALE.
| std::list< NdiscCache::Ipv6PayloadHeaderPair > ns3::NdiscCache::Entry::MarkStale | ( | Address | mac | ) | 
Changes the state to this entry to STALE.
| mac | L2 address | 
Definition at line 592 of file ndisc-cache.cc.
References m_macAddress, m_state, m_waiting, NS_LOG_FUNCTION, and STALE.
Referenced by FunctionReachableTimeout(), ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), and ns3::Icmpv6L4Protocol::ReceiveLLA().
| void ns3::NdiscCache::Entry::Print | ( | std::ostream & | os | ) | const | 
Print this entry to the given output stream.
| os | the output stream to which this Ipv6Address is printed | 
Definition at line 687 of file ndisc-cache.cc.
References DELAY, INCOMPLETE, m_ipv6Address, m_macAddress, m_state, PERMANENT, PROBE, REACHABLE, STALE, and STATIC_AUTOGENERATED.
Referenced by ns3::operator<<().
| void ns3::NdiscCache::Entry::SetIpv6Address | ( | Ipv6Address | ipv6Address | ) | 
Set the IPv6 address.
| ipv6Address | IPv6 address | 
Definition at line 448 of file ndisc-cache.cc.
References m_ipv6Address, and NS_LOG_FUNCTION.
| void ns3::NdiscCache::Entry::SetMacAddress | ( | Address | mac | ) | 
Set the MAC address of this entry.
| mac | the MAC address to set | 
Definition at line 680 of file ndisc-cache.cc.
References m_macAddress, m_state, and NS_LOG_FUNCTION.
Referenced by ns3::NeighborCacheHelper::AddEntry(), FlushTest::DoRun(), ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleRedirection(), and ns3::Icmpv6L4Protocol::ReceiveLLA().
| void ns3::NdiscCache::Entry::SetRouter | ( | bool | router | ) | 
Set the node type.
| router | true is a router, false means a host | 
Definition at line 258 of file ndisc-cache.cc.
References m_router, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::ReceiveLLA().
| void ns3::NdiscCache::Entry::StartDelayTimer | ( | ) | 
Start delay timer.
Definition at line 514 of file ndisc-cache.cc.
References FunctionDelayTimeout(), m_ndCache, m_nudTimer, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::Lookup().
| void ns3::NdiscCache::Entry::StartProbeTimer | ( | ) | 
Start probe timer.
Definition at line 500 of file ndisc-cache.cc.
References FunctionProbeTimeout(), m_ndCache, m_nudTimer, and NS_LOG_FUNCTION.
Referenced by FunctionDelayTimeout(), and FunctionProbeTimeout().
| void ns3::NdiscCache::Entry::StartReachableTimer | ( | ) | 
Start the reachable timer.
Definition at line 469 of file ndisc-cache.cc.
References FunctionReachableTimeout(), m_lastReachabilityConfirmation, m_ndCache, m_nudTimer, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Ipv6L3Protocol::ReachabilityHint(), and ns3::Icmpv6L4Protocol::ReceiveLLA().
| void ns3::NdiscCache::Entry::StartRetransmitTimer | ( | ) | 
Start retransmit timer.
Definition at line 528 of file ndisc-cache.cc.
References FunctionRetransmitTimeout(), m_ndCache, m_nudTimer, and NS_LOG_FUNCTION.
Referenced by FunctionRetransmitTimeout(), and ns3::Icmpv6L4Protocol::Lookup().
| void ns3::NdiscCache::Entry::StopNudTimer | ( | ) | 
Stop NUD timer and reset the NUD retransmission counter.
Definition at line 542 of file ndisc-cache.cc.
References m_nsRetransmit, m_nudTimer, and NS_LOG_FUNCTION.
Referenced by ns3::Icmpv6L4Protocol::HandleNA(), MarkAutoGenerated(), MarkPermanent(), and ns3::Icmpv6L4Protocol::ReceiveLLA().
| void ns3::NdiscCache::Entry::UpdateReachableTimer | ( | ) | 
Update the reachable timer.
Definition at line 484 of file ndisc-cache.cc.
References m_lastReachabilityConfirmation, m_nudTimer, m_state, ns3::Simulator::Now(), NS_LOG_FUNCTION, and REACHABLE.
Referenced by ns3::Ipv6L3Protocol::ReachabilityHint(), and ns3::Ipv6L3Protocol::Receive().
| 
 | private | 
The IPv6 address.
Definition at line 412 of file ndisc-cache.h.
Referenced by FunctionDelayTimeout(), FunctionProbeTimeout(), FunctionRetransmitTimeout(), GetIpv6Address(), Print(), and SetIpv6Address().
| 
 | private | 
Last time we see a reachability confirmation.
Definition at line 437 of file ndisc-cache.h.
Referenced by Entry(), GetLastReachabilityConfirmation(), StartReachableTimer(), and UpdateReachableTimer().
| 
 | private | 
The MAC address.
Definition at line 417 of file ndisc-cache.h.
Referenced by GetMacAddress(), MarkReachable(), MarkStale(), Print(), and SetMacAddress().
| 
 | protected | 
the NdiscCache associated.
Definition at line 406 of file ndisc-cache.h.
Referenced by Entry(), AddWaitingPacket(), FunctionDelayTimeout(), FunctionProbeTimeout(), FunctionRetransmitTimeout(), StartDelayTimer(), StartProbeTimer(), StartReachableTimer(), and StartRetransmitTimer().
| 
 | private | 
Number of NS retransmission.
Definition at line 442 of file ndisc-cache.h.
Referenced by Entry(), FunctionDelayTimeout(), FunctionProbeTimeout(), FunctionRetransmitTimeout(), and StopNudTimer().
| 
 | private | 
Timer (used for NUD).
Definition at line 432 of file ndisc-cache.h.
Referenced by Entry(), StartDelayTimer(), StartProbeTimer(), StartReachableTimer(), StartRetransmitTimer(), StopNudTimer(), and UpdateReachableTimer().
| 
 | private | 
Type of node (router or host).
Definition at line 427 of file ndisc-cache.h.
Referenced by Entry(), IsRouter(), and SetRouter().
| NdiscCacheEntryState_e ns3::NdiscCache::Entry::m_state | 
The state of the entry.
Definition at line 188 of file ndisc-cache.h.
Referenced by ns3::Icmpv6L4Protocol::HandleNA(), IsAutoGenerated(), IsDelay(), IsIncomplete(), IsPermanent(), IsProbe(), IsReachable(), IsStale(), MarkAutoGenerated(), MarkDelay(), MarkIncomplete(), MarkPermanent(), MarkProbe(), MarkReachable(), MarkReachable(), MarkStale(), MarkStale(), Print(), ns3::Icmpv6L4Protocol::ReceiveLLA(), SetMacAddress(), and UpdateReachableTimer().
| 
 | private | 
The list of packet waiting.
Definition at line 422 of file ndisc-cache.h.
Referenced by Entry(), AddWaitingPacket(), ClearWaitingPacket(), FunctionRetransmitTimeout(), MarkIncomplete(), MarkReachable(), and MarkStale().