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 (void)
 Clear the pending packet list. More...
 
void ClearRetries (void)
 Zero the counter of number of retries for an entry. More...
 
Ptr< PacketDequeuePending (void)
 
Ipv4Address GetIpv4Address (void) const
 
Address GetMacAddress (void) const
 
uint32_t GetRetries (void) const
 
void IncrementRetries (void)
 Increment the counter of number of retries for an entry. More...
 
bool IsAlive (void)
 
bool IsDead (void)
 
bool IsExpired (void) const
 
bool IsPermanent (void)
 
bool IsWaitReply (void)
 
void MarkAlive (Address macAddress)
 
void MarkDead (void)
 Changes the state of this entry to dead. More...
 
void MarkPermanent (void)
 Changes the state of this entry to Permanent. More...
 
void MarkWaitReply (Ptr< Packet > waiting)
 
void SetIpv4Address (Ipv4Address destination)
 
void SetMacAddresss (Address macAddress)
 
bool UpdateWaitReply (Ptr< Packet > waiting)
 

Private Types

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

Private Member Functions

Time GetTimeout (void) const
 Returns the entry timeout. More...
 
void UpdateSeen (void)
 Update the entry when seeing a packet. 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< Ptr< Packet > > m_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 173 of file arp-cache.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
arpThe ArpCache this entry belongs to

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

References NS_LOG_FUNCTION.

Member Function Documentation

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

Clear the pending packet list.

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

Zero the counter of number of retries for an entry.

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

Ptr< Packet > ns3::ArpCache::Entry::DequeuePending ( void  )
Returns
0 is no packet is pending, the next packet to send if packets are pending.

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

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

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

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:

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

Returns the entry timeout.

Returns
the entry timeout

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

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

+ Here is the call graph for this function:

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

Increment the counter of number of retries for an entry.

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

bool ns3::ArpCache::Entry::IsExpired ( void  ) 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 473 of file arp-cache.cc.

References ns3::Time::GetSeconds(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and timeout.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References NS_LOG_FUNCTION.

Referenced by ns3::aodv::Neighbors::LookupMacAddress(), and ns3::dsr::RouteCache::LookupMacAddress().

+ Here is the caller graph for this function:

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

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

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

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

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by EpcS1uUlTestCase::DoRun(), and ns3::ArpL3Protocol::Receive().

+ Here is the caller graph for this function:

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

Changes the state of this entry to dead.

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

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

Changes the state of this entry to Permanent.

The entry must have a valid MacAddress.

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

References NS_ASSERT, and NS_LOG_FUNCTION.

void ns3::ArpCache::Entry::MarkWaitReply ( Ptr< Packet waiting)
Parameters
waiting

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

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by EpcS1uUlTestCase::DoRun(), and ns3::ArpL3Protocol::Lookup().

+ Here is the caller graph for this function:

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

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

References NS_LOG_FUNCTION.

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

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

References NS_LOG_FUNCTION.

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

Update the entry when seeing a packet.

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

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

+ Here is the call graph for this function:

bool ns3::ArpCache::Entry::UpdateWaitReply ( Ptr< Packet waiting)
Parameters
waiting
Returns

Definition at line 402 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

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

pointer to the ARP cache owning the entry

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

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

entry's IP address

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

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

last moment a packet from that address has been seen

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

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

entry's MAC address

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

std::list<Ptr<Packet> > ns3::ArpCache::Entry::m_pending
private

list of pending packets for the entry's IP

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

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

rerty counter

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

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

state of the entry

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


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