A Discrete-Event Network Simulator
API
ns3::ArpCache::Entry Class Reference

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

#include "arp-cache.h"

+ Collaboration diagram for ns3::ArpCache::Entry:

Public Member Functions

 Entry (ArpCache *arp)
 Constructor. More...
 
void ClearPendingPacket ()
 Clear the pending packet list. More...
 
void ClearRetries ()
 Zero the counter of number of retries for an entry. More...
 
Ipv4PayloadHeaderPair DequeuePending ()
 
Ipv4Address GetIpv4Address () const
 
Address GetMacAddress () const
 
uint32_t GetRetries () const
 
void IncrementRetries ()
 Increment the counter of number of retries for an entry. More...
 
bool IsAlive ()
 
bool IsAutoGenerated ()
 
bool IsDead ()
 
bool IsExpired () const
 
bool IsPermanent ()
 
bool IsWaitReply ()
 
void MarkAlive (Address macAddress)
 
void MarkAutoGenerated ()
 Changes the state of this entry to auto-generated. More...
 
void MarkDead ()
 Changes the state of this entry to dead. More...
 
void MarkPermanent ()
 Changes the state of this entry to Permanent. More...
 
void MarkWaitReply (Ipv4PayloadHeaderPair waiting)
 
void SetIpv4Address (Ipv4Address destination)
 
void SetMacAddress (Address macAddress)
 
void UpdateSeen ()
 Update the entry when seeing a packet. More...
 
bool UpdateWaitReply (Ipv4PayloadHeaderPair waiting)
 

Private Types

enum  ArpCacheEntryState_e {
  ALIVE , WAIT_REPLY , DEAD , PERMANENT ,
  STATIC_AUTOGENERATED
}
 ARP cache entry states. More...
 

Private Member Functions

Time GetTimeout () const
 Returns the entry timeout. More...
 

Private Attributes

ArpCachem_arp
 pointer to the ARP cache owning the entry More...
 
Ipv4Address m_ipv4Address
 entry's IP address More...
 
Time m_lastSeen
 last moment a packet from that address has been seen More...
 
Address m_macAddress
 entry's MAC address More...
 
std::list< Ipv4PayloadHeaderPairm_pending
 list of pending packets for the entry's IP More...
 
uint32_t m_retries
 rerty counter More...
 
ArpCacheEntryState_e m_state
 state of the entry More...
 

Detailed Description

A record that that holds information about an ArpCache entry.

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

Member Enumeration Documentation

◆ ArpCacheEntryState_e

ARP cache entry states.

Enumerator
ALIVE 
WAIT_REPLY 
DEAD 
PERMANENT 
STATIC_AUTOGENERATED 

Definition at line 296 of file arp-cache.h.

Constructor & Destructor Documentation

◆ Entry()

ns3::ArpCache::Entry::Entry ( ArpCache arp)

Constructor.

Parameters
arpThe ArpCache this entry belongs to

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ ClearPendingPacket()

void ns3::ArpCache::Entry::ClearPendingPacket ( )

Clear the pending packet list.

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

References NS_LOG_FUNCTION.

Referenced by ns3::ArpCache::Remove().

+ Here is the caller graph for this function:

◆ ClearRetries()

void ns3::ArpCache::Entry::ClearRetries ( )

Zero the counter of number of retries for an entry.

Definition at line 603 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ArpCache::HandleWaitReplyTimeout().

+ Here is the caller graph for this function:

◆ DequeuePending()

ArpCache::Ipv4PayloadHeaderPair ns3::ArpCache::Entry::DequeuePending ( )
Returns
0 is no packet is pending, the next packet to send if packets are pending.

Definition at line 557 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ArpCache::HandleWaitReplyTimeout(), and ns3::ArpL3Protocol::Receive().

+ Here is the caller graph for this function:

◆ GetIpv4Address()

Ipv4Address ns3::ArpCache::Entry::GetIpv4Address ( ) const
Returns
The Ipv4Address for this entry

Definition at line 513 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ArpCache::HandleWaitReplyTimeout().

+ Here is the caller graph for this function:

◆ GetMacAddress()

Address ns3::ArpCache::Entry::GetMacAddress ( ) const
Returns
The MacAddress of this entry

Definition at line 499 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ArpL3Protocol::Lookup(), ns3::ArpCache::LookupInverse(), ns3::aodv::Neighbors::LookupMacAddress(), and ns3::dsr::DsrRouteCache::LookupMacAddress().

+ Here is the caller graph for this function:

◆ GetRetries()

uint32_t ns3::ArpCache::Entry::GetRetries ( ) const
Returns
number of retries that have been sent for an ArpRequest in WaitReply state.

Definition at line 588 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ArpCache::HandleWaitReplyTimeout().

+ Here is the caller graph for this function:

◆ GetTimeout()

Time ns3::ArpCache::Entry::GetTimeout ( ) const
private

Returns the entry timeout.

Returns
the entry timeout

Definition at line 527 of file arp-cache.cc.

References ALIVE, DEAD, ns3::Time::Max(), NS_LOG_FUNCTION, PERMANENT, STATIC_AUTOGENERATED, and WAIT_REPLY.

+ Here is the call graph for this function:

◆ IncrementRetries()

void ns3::ArpCache::Entry::IncrementRetries ( )

Increment the counter of number of retries for an entry.

Definition at line 595 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ArpCache::HandleWaitReplyTimeout().

+ Here is the caller graph for this function:

◆ IsAlive()

bool ns3::ArpCache::Entry::IsAlive ( )
Returns
True if the state of this entry is alive; false otherwise.

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

References NS_LOG_FUNCTION.

Referenced by ns3::ArpL3Protocol::Lookup(), ns3::aodv::Neighbors::LookupMacAddress(), ns3::dsr::DsrRouteCache::LookupMacAddress(), and ns3::Ipv4L3Protocol::Receive().

+ Here is the caller graph for this function:

◆ IsAutoGenerated()

bool ns3::ArpCache::Entry::IsAutoGenerated ( )
Returns
True if the state of this entry is auto-generated; false otherwise.

Definition at line 418 of file arp-cache.cc.

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ IsDead()

bool ns3::ArpCache::Entry::IsDead ( )
Returns
True if the state of this entry is dead; false otherwise.

Definition at line 390 of file arp-cache.cc.

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ IsExpired()

bool ns3::ArpCache::Entry::IsExpired ( ) const
Returns
True if this entry has timed out; false otherwise.

This function returns true if the time elapsed strictly exceeds the timeout value (i.e., is not less than or equal to the timeout).

Definition at line 547 of file arp-cache.cc.

References two-ray-to-three-gpp-ch-calibration::delta, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and timeout.

Referenced by ns3::ArpL3Protocol::Lookup(), ns3::aodv::Neighbors::LookupMacAddress(), and ns3::dsr::DsrRouteCache::LookupMacAddress().

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

◆ IsPermanent()

bool ns3::ArpCache::Entry::IsPermanent ( )
Returns
True if the state of this entry is permanent; false otherwise.

Definition at line 411 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ArpL3Protocol::Lookup(), ns3::aodv::Neighbors::LookupMacAddress(), and ns3::dsr::DsrRouteCache::LookupMacAddress().

+ Here is the caller graph for this function:

◆ IsWaitReply()

bool ns3::ArpCache::Entry::IsWaitReply ( )
Returns
True if the state of this entry is wait_reply; false otherwise.

Definition at line 404 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::ArpCache::HandleWaitReplyTimeout(), ns3::ArpL3Protocol::Lookup(), and ns3::ArpL3Protocol::Receive().

+ Here is the caller graph for this function:

◆ MarkAlive()

void ns3::ArpCache::Entry::MarkAlive ( Address  macAddress)
Parameters
macAddress

Definition at line 435 of file arp-cache.cc.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::ArpL3Protocol::Receive().

+ Here is the caller graph for this function:

◆ MarkAutoGenerated()

void ns3::ArpCache::Entry::MarkAutoGenerated ( )

Changes the state of this entry to auto-generated.

The entry must have a valid MacAddress.

Definition at line 457 of file arp-cache.cc.

References NS_ASSERT, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ MarkDead()

void ns3::ArpCache::Entry::MarkDead ( )

Changes the state of this entry to dead.

Definition at line 425 of file arp-cache.cc.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::ArpCache::HandleWaitReplyTimeout().

+ Here is the caller graph for this function:

◆ MarkPermanent()

void ns3::ArpCache::Entry::MarkPermanent ( )

Changes the state of this entry to Permanent.

The entry must have a valid MacAddress.

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

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by FlushTest::DoRun(), and EpcS1uUlTestCase::DoRun().

+ Here is the caller graph for this function:

◆ MarkWaitReply()

void ns3::ArpCache::Entry::MarkWaitReply ( Ipv4PayloadHeaderPair  waiting)
Parameters
waiting

Definition at line 485 of file arp-cache.cc.

References NS_ASSERT, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ SetIpv4Address()

void ns3::ArpCache::Entry::SetIpv4Address ( Ipv4Address  destination)
Parameters
destinationThe Ipv4Address for this entry

Definition at line 520 of file arp-cache.cc.

References NS_LOG_FUNCTION.

◆ SetMacAddress()

void ns3::ArpCache::Entry::SetMacAddress ( Address  macAddress)
Parameters
macAddressThe MacAddress for this entry

Definition at line 506 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::NeighborCacheHelper::AddEntry(), FlushTest::DoRun(), and EpcS1uUlTestCase::DoRun().

+ Here is the caller graph for this function:

◆ UpdateSeen()

void ns3::ArpCache::Entry::UpdateSeen ( )

Update the entry when seeing a packet.

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

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

Referenced by ns3::Ipv4L3Protocol::Receive().

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

◆ UpdateWaitReply()

bool ns3::ArpCache::Entry::UpdateWaitReply ( Ipv4PayloadHeaderPair  waiting)
Parameters
waiting
Returns

Definition at line 468 of file arp-cache.cc.

References NS_ASSERT, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_arp

ArpCache* ns3::ArpCache::Entry::m_arp
private

pointer to the ARP cache owning the entry

Definition at line 311 of file arp-cache.h.

◆ m_ipv4Address

Ipv4Address ns3::ArpCache::Entry::m_ipv4Address
private

entry's IP address

Definition at line 315 of file arp-cache.h.

◆ m_lastSeen

Time ns3::ArpCache::Entry::m_lastSeen
private

last moment a packet from that address has been seen

Definition at line 313 of file arp-cache.h.

◆ m_macAddress

Address ns3::ArpCache::Entry::m_macAddress
private

entry's MAC address

Definition at line 314 of file arp-cache.h.

◆ m_pending

std::list<Ipv4PayloadHeaderPair> ns3::ArpCache::Entry::m_pending
private

list of pending packets for the entry's IP

Definition at line 316 of file arp-cache.h.

◆ m_retries

uint32_t ns3::ArpCache::Entry::m_retries
private

rerty counter

Definition at line 317 of file arp-cache.h.

◆ m_state

ArpCacheEntryState_e ns3::ArpCache::Entry::m_state
private

state of the entry

Definition at line 312 of file arp-cache.h.


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