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

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

#include <arp-cache.h>

Public Member Functions

 Entry (ArpCache *arp)
 Constructor. More...
 
void ClearRetries (void)
 Zero the counter of number of retries for an entry.
 
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.
 
bool IsAlive (void)
 
bool IsDead (void)
 
bool IsExpired (void) const
 
bool IsWaitReply (void)
 
void MarkAlive (Address macAddress)
 
void MarkDead (void)
 Changes the state of this entry to dead.
 
void MarkWaitReply (Ptr< Packet > waiting)
 
void SetIpv4Address (Ipv4Address destination)
 
bool UpdateWaitReply (Ptr< Packet > waiting)
 

Private Types

enum  ArpCacheEntryState_e { ALIVE, WAIT_REPLY, DEAD }
 

Private Member Functions

Time GetTimeout (void) const
 
void UpdateSeen (void)
 

Private Attributes

ArpCachem_arp
 
Ipv4Address m_ipv4Address
 
Time m_lastSeen
 
Address m_macAddress
 
std::list< Ptr< Packet > > m_pending
 
uint32_t m_retries
 
ArpCacheEntryState_e m_state
 

Detailed Description

A record that that holds information about an ArpCache entry.

Definition at line 116 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 269 of file arp-cache.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

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 395 of file arp-cache.cc.

References NS_LOG_FUNCTION.

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

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

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

References NS_LOG_FUNCTION.

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

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

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

References NS_ASSERT, and NS_LOG_FUNCTION.

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

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 416 of file arp-cache.cc.

References NS_LOG_FUNCTION.

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

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

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

References NS_LOG_FUNCTION.

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

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

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

References NS_LOG_FUNCTION.

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

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 382 of file arp-cache.cc.

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

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

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

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

References NS_LOG_FUNCTION.

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

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

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

References NS_ASSERT, and NS_LOG_FUNCTION.

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

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

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

References NS_ASSERT, and NS_LOG_FUNCTION.

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

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

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

References NS_LOG_FUNCTION.

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

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

References NS_ASSERT, and NS_LOG_FUNCTION.

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


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