A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::NdiscCache::Entry Class Reference

A record that holds information about a NdiscCache entry. More...

#include "ndisc-cache.h"

+ Collaboration diagram for ns3::NdiscCache::Entry:

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< Ipv6PayloadHeaderPairMarkReachable (Address mac)
 Changes the state to this entry to REACHABLE.
 
void MarkStale ()
 Changes the state to this entry to STALE.
 
std::list< Ipv6PayloadHeaderPairMarkStale (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

NdiscCachem_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< Ipv6PayloadHeaderPairm_waiting
 The list of packet waiting.
 

Detailed Description

A record that holds information about a NdiscCache entry.

Definition at line 155 of file ndisc-cache.h.

Member Enumeration Documentation

◆ NdiscCacheEntryState_e

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 169 of file ndisc-cache.h.

Constructor & Destructor Documentation

◆ Entry()

ns3::NdiscCache::Entry::Entry ( NdiscCache * nd)

Constructor.

Parameters
ndThe NdiscCache this entry belongs to.

Definition at line 235 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

◆ ~Entry()

virtual ns3::NdiscCache::Entry::~Entry ( )
virtualdefault

Member Function Documentation

◆ AddWaitingPacket()

void ns3::NdiscCache::Entry::AddWaitingPacket ( Ipv6PayloadHeaderPair p)

Add a packet (or replace old value) in the queue.

Parameters
ppacket to add
Todo
report packet as 'dropped'

Definition at line 261 of file ndisc-cache.cc.

References ns3::NdiscCache::m_ndCache, and NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup().

+ Here is the caller graph for this function:

◆ ClearWaitingPacket()

void ns3::NdiscCache::Entry::ClearWaitingPacket ( )

Clear the waiting packet list.

Todo
report packets as 'dropped'

Definition at line 275 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Ipv6L3Protocol::ReachabilityHint(), ns3::Icmpv6L4Protocol::ReceiveLLA(), and ns3::NdiscCache::Remove().

+ Here is the caller graph for this function:

◆ FunctionDelayTimeout()

void ns3::NdiscCache::Entry::FunctionDelayTimeout ( )

Function called when delay timer timeout.

Definition at line 345 of file ndisc-cache.cc.

References ns3::Ipv6Address::IsAny(), ns3::NdiscCache::m_ndCache, NS_LOG_FUNCTION, and ns3::Ipv6L3Protocol::PROT_NUMBER.

Referenced by StartDelayTimer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FunctionProbeTimeout()

void ns3::NdiscCache::Entry::FunctionProbeTimeout ( )

Function called when probe timer timeout.

Definition at line 384 of file ndisc-cache.cc.

References ns3::Ipv6Address::IsAny(), ns3::NdiscCache::m_icmpv6, ns3::NdiscCache::m_ndCache, NS_LOG_FUNCTION, and ns3::Ipv6L3Protocol::PROT_NUMBER.

Referenced by StartProbeTimer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FunctionReachableTimeout()

void ns3::NdiscCache::Entry::FunctionReachableTimeout ( )

Function called when reachable timer timeout.

Definition at line 283 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by StartReachableTimer().

+ Here is the caller graph for this function:

◆ FunctionRetransmitTimeout()

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 290 of file ndisc-cache.cc.

References ns3::Create(), ns3::Icmpv6Header::ICMPV6_ADDR_UNREACHABLE, ns3::Ipv6Address::IsAny(), ns3::NdiscCache::m_icmpv6, ns3::NdiscCache::m_ndCache, ns3::Ipv6Address::MakeSolicitedAddress(), and NS_LOG_FUNCTION.

Referenced by StartRetransmitTimer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEntryState()

NdiscCacheEntryState_e ns3::NdiscCache::Entry::GetEntryState ( ) const

Get the state of the entry.

Returns
The state of the entry

◆ GetIpv6Address()

Ipv6Address ns3::NdiscCache::Entry::GetIpv6Address ( ) const

Get the IPv6 address.

Returns
The IPv6 address

Definition at line 444 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

◆ GetLastReachabilityConfirmation()

Time ns3::NdiscCache::Entry::GetLastReachabilityConfirmation ( ) const

Get the time of last reachability confirmation.

Returns
time

Definition at line 451 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

◆ GetMacAddress()

Address ns3::NdiscCache::Entry::GetMacAddress ( ) const

Get the MAC address of this entry.

Returns
the L2 address

Definition at line 662 of file ndisc-cache.cc.

References 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().

+ Here is the caller graph for this function:

◆ IsAutoGenerated()

bool ns3::NdiscCache::Entry::IsAutoGenerated ( ) const

Is the entry STATIC_AUTOGENERATED.

Returns
True if the state of this entry is auto-generated; false otherwise.

Definition at line 655 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Ipv6L3Protocol::ReachabilityHint().

+ Here is the caller graph for this function:

◆ IsDelay()

bool ns3::NdiscCache::Entry::IsDelay ( ) const

Is the entry DELAY.

Returns
true if the entry is in DELAY state, false otherwise

Definition at line 627 of file ndisc-cache.cc.

References DELAY, and NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::Lookup().

+ Here is the caller graph for this function:

◆ IsIncomplete()

bool ns3::NdiscCache::Entry::IsIncomplete ( ) const

Is the entry INCOMPLETE.

Returns
true if the entry is in INCOMPLETE state, false otherwise

Definition at line 634 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::HandleRedirection(), and ns3::Ipv6L3Protocol::ReachabilityHint().

+ Here is the caller graph for this function:

◆ IsPermanent()

bool ns3::NdiscCache::Entry::IsPermanent ( ) const

Is the entry PERMANENT.

Returns
true if the entry is in PERMANENT state, false otherwise

Definition at line 648 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Ipv6L3Protocol::ReachabilityHint().

+ Here is the caller graph for this function:

◆ IsProbe()

bool ns3::NdiscCache::Entry::IsProbe ( ) const

Is the entry PROBE.

Returns
true if the entry is in PROBE state, false otherwise

Definition at line 641 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Ipv6L3Protocol::ReachabilityHint().

+ Here is the caller graph for this function:

◆ IsReachable()

bool ns3::NdiscCache::Entry::IsReachable ( ) const

Is the entry REACHABLE.

Returns
true if the entry is in REACHABLE state, false otherwise

Definition at line 620 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Ipv6L3Protocol::ReachabilityHint().

+ Here is the caller graph for this function:

◆ IsRouter()

bool ns3::NdiscCache::Entry::IsRouter ( ) const

If the entry is a host or a router.

Returns
true if the node is a router, 0 if it is a host

Definition at line 254 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

◆ IsStale()

bool ns3::NdiscCache::Entry::IsStale ( ) const

Is the entry STALE.

Returns
true if the entry is in STALE state, false otherwise

Definition at line 613 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::Lookup().

+ Here is the caller graph for this function:

◆ MarkAutoGenerated()

void ns3::NdiscCache::Entry::MarkAutoGenerated ( )

Changes the state of this entry to auto-generated.

The entry must have a valid MacAddress.

Definition at line 605 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::NeighborCacheHelper::AddEntry().

+ Here is the caller graph for this function:

◆ MarkDelay()

void ns3::NdiscCache::Entry::MarkDelay ( )

Change the state to this entry to DELAY.

Definition at line 590 of file ndisc-cache.cc.

References DELAY, and NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::Lookup().

+ Here is the caller graph for this function:

◆ MarkIncomplete()

void ns3::NdiscCache::Entry::MarkIncomplete ( Ipv6PayloadHeaderPair p)

Changes the state to this entry to INCOMPLETE.

Parameters
ppacket that wait to be sent

Definition at line 539 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup().

+ Here is the caller graph for this function:

◆ MarkPermanent()

void ns3::NdiscCache::Entry::MarkPermanent ( )

Change the state to this entry to PERMANENT.

Definition at line 597 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by FlushTest::DoRun().

+ Here is the caller graph for this function:

◆ MarkProbe()

void ns3::NdiscCache::Entry::MarkProbe ( )

Changes the state to this entry to PROBE.

Definition at line 560 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

◆ MarkReachable() [1/2]

void ns3::NdiscCache::Entry::MarkReachable ( )

Changes the state to this entry to REACHABLE.

Definition at line 574 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

◆ MarkReachable() [2/2]

std::list< NdiscCache::Ipv6PayloadHeaderPair > ns3::NdiscCache::Entry::MarkReachable ( Address mac)

Changes the state to this entry to REACHABLE.

Parameters
macMAC address
Returns
the list of packet waiting

Definition at line 551 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Ipv6L3Protocol::ReachabilityHint(), and ns3::Icmpv6L4Protocol::ReceiveLLA().

+ Here is the caller graph for this function:

◆ MarkStale() [1/2]

void ns3::NdiscCache::Entry::MarkStale ( )

Changes the state to this entry to STALE.

Definition at line 567 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

◆ MarkStale() [2/2]

std::list< NdiscCache::Ipv6PayloadHeaderPair > ns3::NdiscCache::Entry::MarkStale ( Address mac)

Changes the state to this entry to STALE.

Parameters
macL2 address
Returns
the list of packet waiting

Definition at line 581 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), and ns3::Icmpv6L4Protocol::ReceiveLLA().

+ Here is the caller graph for this function:

◆ Print()

void ns3::NdiscCache::Entry::Print ( std::ostream & os) const

Print this entry to the given output stream.

Parameters
osthe output stream to which this Ipv6Address is printed

Definition at line 676 of file ndisc-cache.cc.

References DELAY.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ SetIpv6Address()

void ns3::NdiscCache::Entry::SetIpv6Address ( Ipv6Address ipv6Address)

Set the IPv6 address.

Parameters
ipv6AddressIPv6 address

Definition at line 437 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

◆ SetMacAddress()

void ns3::NdiscCache::Entry::SetMacAddress ( Address mac)

Set the MAC address of this entry.

Parameters
macthe MAC address to set

Definition at line 669 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::NeighborCacheHelper::AddEntry(), FlushTest::DoRun(), ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleRedirection(), and ns3::Icmpv6L4Protocol::ReceiveLLA().

+ Here is the caller graph for this function:

◆ SetRouter()

void ns3::NdiscCache::Entry::SetRouter ( bool router)

Set the node type.

Parameters
routertrue is a router, false means a host

Definition at line 247 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::ReceiveLLA().

+ Here is the caller graph for this function:

◆ StartDelayTimer()

void ns3::NdiscCache::Entry::StartDelayTimer ( )

Start delay timer.

Definition at line 503 of file ndisc-cache.cc.

References FunctionDelayTimeout(), ns3::NdiscCache::m_ndCache, and NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup(), and ns3::Icmpv6L4Protocol::Lookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartProbeTimer()

void ns3::NdiscCache::Entry::StartProbeTimer ( )

Start probe timer.

Definition at line 489 of file ndisc-cache.cc.

References FunctionProbeTimeout(), ns3::NdiscCache::m_ndCache, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ StartReachableTimer()

void ns3::NdiscCache::Entry::StartReachableTimer ( )

Start the reachable timer.

Definition at line 458 of file ndisc-cache.cc.

References FunctionReachableTimeout(), ns3::NdiscCache::m_ndCache, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::HandleNA(), ns3::Ipv6L3Protocol::ReachabilityHint(), and ns3::Icmpv6L4Protocol::ReceiveLLA().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartRetransmitTimer()

void ns3::NdiscCache::Entry::StartRetransmitTimer ( )

Start retransmit timer.

Definition at line 517 of file ndisc-cache.cc.

References FunctionRetransmitTimeout(), ns3::NdiscCache::m_ndCache, and NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::Lookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StopNudTimer()

void ns3::NdiscCache::Entry::StopNudTimer ( )

Stop NUD timer and reset the NUD retransmission counter.

Definition at line 531 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::Icmpv6L4Protocol::HandleNA(), and ns3::Icmpv6L4Protocol::ReceiveLLA().

+ Here is the caller graph for this function:

◆ UpdateReachableTimer()

void ns3::NdiscCache::Entry::UpdateReachableTimer ( )

Update the reachable timer.

Definition at line 473 of file ndisc-cache.cc.

References ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by ns3::Ipv6L3Protocol::ReachabilityHint(), and ns3::Ipv6L3Protocol::Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ipv6Address

Ipv6Address ns3::NdiscCache::Entry::m_ipv6Address
private

The IPv6 address.

Definition at line 407 of file ndisc-cache.h.

◆ m_lastReachabilityConfirmation

Time ns3::NdiscCache::Entry::m_lastReachabilityConfirmation
private

Last time we see a reachability confirmation.

Definition at line 432 of file ndisc-cache.h.

◆ m_macAddress

Address ns3::NdiscCache::Entry::m_macAddress
private

The MAC address.

Definition at line 412 of file ndisc-cache.h.

◆ m_ndCache

NdiscCache* ns3::NdiscCache::Entry::m_ndCache
protected

the NdiscCache associated.

Definition at line 401 of file ndisc-cache.h.

◆ m_nsRetransmit

uint8_t ns3::NdiscCache::Entry::m_nsRetransmit
private

Number of NS retransmission.

Definition at line 437 of file ndisc-cache.h.

◆ m_nudTimer

Timer ns3::NdiscCache::Entry::m_nudTimer
private

Timer (used for NUD).

Definition at line 427 of file ndisc-cache.h.

◆ m_router

bool ns3::NdiscCache::Entry::m_router
private

Type of node (router or host).

Definition at line 422 of file ndisc-cache.h.

◆ m_state

NdiscCacheEntryState_e ns3::NdiscCache::Entry::m_state

The state of the entry.

Definition at line 183 of file ndisc-cache.h.

Referenced by ns3::Icmpv6L4Protocol::HandleNA(), and ns3::Icmpv6L4Protocol::ReceiveLLA().

◆ m_waiting

std::list<Ipv6PayloadHeaderPair> ns3::NdiscCache::Entry::m_waiting
private

The list of packet waiting.

Definition at line 417 of file ndisc-cache.h.


The documentation for this class was generated from the following files: