A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::NdiscCache::Entry Class Reference

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

#include <ndisc-cache.h>

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

Public Member Functions

 Entry (NdiscCache *nd)
 Constructor.
void AddWaitingPacket (Ptr< Packet > 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. It verify that the NS retransmit has reached the max so discard the entry otherwise it retransmit a NS.
Time GetLastReachabilityConfirmation () const
 Get the time of last reachability confirmation.
Address GetMacAddress () const
 Get the MAC address of this entry.
uint8_t GetNSRetransmit () const
 Get the number of NS retransmit.
void IncNSRetransmit ()
 Increment NS retransmit.
bool IsDelay () const
 Is the entry DELAY.
bool IsIncomplete () const
 Is the entry INCOMPLETE.
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 MarkDelay ()
 Change the state to this entry to DELAY.
void MarkIncomplete (Ptr< Packet > p)
 Changes the state to this entry to INCOMPLETE.
void MarkProbe ()
 Changes the state to this entry to PROBE.
std::list< Ptr< Packet > > MarkReachable (Address mac)
 Changes the state to this entry to REACHABLE.
void MarkReachable ()
 Changes the state to this entry to REACHABLE.
std::list< Ptr< Packet > > MarkStale (Address mac)
 Changes the state to this entry to STALE.
void MarkStale ()
 Changes the state to this entry to STALE.
void ResetNSRetransmit ()
 Reset NS retransmit (=0).
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 StopDelayTimer ()
 Stop delay timer.
void StopProbeTimer ()
 Stop probe timer.
void StopReachableTimer ()
 Stop the reachable timer.
void StopRetransmitTimer ()
 Stop retransmit timer.
void UpdateLastReachabilityconfirmation ()
 Update the time of last reachability confirmation.

Private Types

enum  NdiscCacheEntryState_e {
  INCOMPLETE, REACHABLE, STALE, DELAY,
  PROBE
}
 The Entry state enumeration. More...

Private Attributes

Timer m_delayTimer
 Delay timer (used for NUD when in DELAY state).
Ipv6Address m_ipv6Address
 The IPv6 address.
Time m_lastReachabilityConfirmation
 Last time we see a reachability confirmation.
Address m_macAddress
 The MAC address.
NdiscCachem_ndCache
 the NdiscCache associated.
uint8_t m_nsRetransmit
 Number of NS retransmission.
Timer m_probeTimer
 Probe timer (used for NUD in PROBE state).
Timer m_reachableTimer
 Reachable timer (used for NUD in REACHABLE state).
Timer m_retransTimer
 Retransmission timer (used for NUD in INCOMPLETE state).
bool m_router
 Type of node (router or host).
NdiscCacheEntryState_e m_state
 The state of the entry.
std::list< Ptr< Packet > > m_waiting
 The list of packet waiting.

Detailed Description

A record that holds information about an NdiscCache entry.

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

Member Enumeration Documentation

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

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

Constructor & Destructor Documentation

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

Constructor.

Parameters
ndThe NdiscCache this entry belongs to.

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

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

void ns3::NdiscCache::Entry::AddWaitingPacket ( Ptr< Packet p)

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

Parameters
ppacket to add

Definition at line 178 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:

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

Clear the waiting packet list.

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

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

Function called when delay timer timeout.

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

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

Referenced by StartDelayTimer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Function called when probe timer timeout.

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

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

Referenced by StartProbeTimer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Function called when reachable timer timeout.

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

References NS_LOG_FUNCTION_NOARGS.

Referenced by StartReachableTimer().

+ Here is the caller graph for this function:

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

References ns3::Icmpv6Header::ICMPV6_ADDR_UNREACHABLE, ns3::Ipv6Address::IsAny(), ns3::NdiscCache::m_ndCache, ns3::Ipv6Address::MakeSolicitedAddress(), and NS_LOG_FUNCTION_NOARGS.

Referenced by StartRetransmitTimer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Get the time of last reachability confirmation.

Returns
time

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

References NS_LOG_FUNCTION_NOARGS.

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

Get the MAC address of this entry.

Returns
the L2 address

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

uint8_t ns3::NdiscCache::Entry::GetNSRetransmit ( ) const

Get the number of NS retransmit.

Returns
number of NS that have been retransmit

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

References NS_LOG_FUNCTION_NOARGS.

void ns3::NdiscCache::Entry::IncNSRetransmit ( )

Increment NS retransmit.

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

References NS_LOG_FUNCTION_NOARGS.

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

Is the entry DELAY.

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

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

References DELAY, and NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

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

Is the entry INCOMPLETE.

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

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

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

Is the entry PROBE.

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

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

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

Is the entry REACHABLE.

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

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

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

References NS_LOG_FUNCTION_NOARGS.

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

Is the entry STALE.

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

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

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

Change the state to this entry to DELAY.

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

References DELAY, and NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

void ns3::NdiscCache::Entry::MarkIncomplete ( Ptr< Packet p)

Changes the state to this entry to INCOMPLETE.

Parameters
ppacket that wait to be sent

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

Changes the state to this entry to PROBE.

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

References NS_LOG_FUNCTION_NOARGS.

std::list< Ptr< Packet > > 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 438 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

Changes the state to this entry to REACHABLE.

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

References NS_LOG_FUNCTION_NOARGS.

std::list< Ptr< Packet > > 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 464 of file ndisc-cache.cc.

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

Changes the state to this entry to STALE.

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

References NS_LOG_FUNCTION_NOARGS.

void ns3::NdiscCache::Entry::ResetNSRetransmit ( )

Reset NS retransmit (=0).

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

References NS_LOG_FUNCTION_NOARGS.

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

Set the IPv6 address.

Parameters
ipv6AddressIPv6 address

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

References NS_LOG_FUNCTION.

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

Set the MAC address of this entry.

Parameters
macthe MAC address to set

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

Set the node type.

Parameters
routertrue is a router, false means a host

Definition at line 166 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:

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

Start delay timer.

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

References ns3::Icmpv6L4Protocol::DELAY_FIRST_PROBE_TIME, FunctionDelayTimeout(), NS_LOG_FUNCTION_NOARGS, and ns3::Seconds().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Start probe timer.

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

References FunctionProbeTimeout(), ns3::MilliSeconds(), NS_LOG_FUNCTION_NOARGS, and ns3::Icmpv6L4Protocol::RETRANS_TIMER.

+ Here is the call graph for this function:

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

Start the reachable timer.

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

References FunctionReachableTimeout(), ns3::MilliSeconds(), NS_LOG_FUNCTION_NOARGS, and ns3::Icmpv6L4Protocol::REACHABLE_TIME.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Start retransmit timer.

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

References FunctionRetransmitTimeout(), ns3::MilliSeconds(), NS_LOG_FUNCTION_NOARGS, and ns3::Icmpv6L4Protocol::RETRANS_TIMER.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::NdiscCache::Entry::StopDelayTimer ( )

Stop delay timer.

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

void ns3::NdiscCache::Entry::StopProbeTimer ( )

Stop probe timer.

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

void ns3::NdiscCache::Entry::StopReachableTimer ( )

Stop the reachable timer.

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

void ns3::NdiscCache::Entry::StopRetransmitTimer ( )

Stop retransmit timer.

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

References NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

void ns3::NdiscCache::Entry::UpdateLastReachabilityconfirmation ( )

Update the time of last reachability confirmation.

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

References NS_LOG_FUNCTION_NOARGS.

Member Data Documentation

Timer ns3::NdiscCache::Entry::m_delayTimer
private

Delay timer (used for NUD when in DELAY state).

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

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

The IPv6 address.

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

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

Last time we see a reachability confirmation.

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

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

The MAC address.

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

NdiscCache* ns3::NdiscCache::Entry::m_ndCache
private

the NdiscCache associated.

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

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

Number of NS retransmission.

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

Timer ns3::NdiscCache::Entry::m_probeTimer
private

Probe timer (used for NUD in PROBE state).

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

Timer ns3::NdiscCache::Entry::m_reachableTimer
private

Reachable timer (used for NUD in REACHABLE state).

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

Timer ns3::NdiscCache::Entry::m_retransTimer
private

Retransmission timer (used for NUD in INCOMPLETE state).

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

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

Type of node (router or host).

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

NdiscCacheEntryState_e ns3::NdiscCache::Entry::m_state
private

The state of the entry.

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

std::list<Ptr<Packet> > ns3::NdiscCache::Entry::m_waiting
private

The list of packet waiting.

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


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