A Discrete-Event Network Simulator
API
ns3::dsr::DsrMaintainBuffer Class Reference

DSR maintain buffer. More...

#include "dsr-maintain-buff.h"

+ Collaboration diagram for ns3::dsr::DsrMaintainBuffer:

Public Member Functions

 DsrMaintainBuffer ()
 Default constructor. More...
 
bool AllEqual (DsrMaintainBuffEntry &entry)
 Verify if all the elements in the maintainence buffer entry is the same. More...
 
bool Dequeue (Ipv4Address dst, DsrMaintainBuffEntry &entry)
 Return first found (the earliest) entry for given destination. More...
 
void DropPacketWithNextHop (Ipv4Address nextHop)
 Remove all packets with destination IP address dst. More...
 
bool Enqueue (DsrMaintainBuffEntry &entry)
 Push entry in queue, if there is no entry with the same packet and destination address in queue. More...
 
bool Find (Ipv4Address nextHop)
 Finds whether a packet with destination dst exists in the queue. More...
 
Time GetMaintainBufferTimeout () const
 
uint32_t GetMaxQueueLen () const
 
uint32_t GetSize ()
 Number of entries. More...
 
bool LinkEqual (DsrMaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for link ack. More...
 
bool NetworkEqual (DsrMaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for network ack. More...
 
bool PromiscEqual (DsrMaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for promiscuous ack. More...
 
void SetMaintainBufferTimeout (Time t)
 
void SetMaxQueueLen (uint32_t len)
 

Private Member Functions

void Purge ()
 Remove all expired entries. More...
 

Static Private Member Functions

static bool IsEqual (DsrMaintainBuffEntry en, const Ipv4Address nextHop)
 Verify if the maintain buffer is equal or not. More...
 

Private Attributes

std::vector< NetworkKeym_allNetworkKey
 
std::vector< DsrMaintainBuffEntrym_maintainBuffer
 The vector of maintain buffer entries. More...
 
Time m_maintainBufferTimeout
 The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds. More...
 
uint32_t m_maxLen
 The maximum number of packets that we allow a routing protocol to buffer. More...
 

Detailed Description

DSR maintain buffer.

Definition at line 250 of file dsr-maintain-buff.h.

Constructor & Destructor Documentation

ns3::dsr::DsrMaintainBuffer::DsrMaintainBuffer ( )
inline

Default constructor.

Definition at line 256 of file dsr-maintain-buff.h.

Member Function Documentation

bool ns3::dsr::DsrMaintainBuffer::AllEqual ( DsrMaintainBuffEntry entry)

Verify if all the elements in the maintainence buffer entry is the same.

Definition at line 125 of file dsr-maintain-buff.cc.

References ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), and m_maintainBuffer.

Referenced by ns3::dsr::DsrRouting::ScheduleNetworkPacketRetry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrMaintainBuffer::Dequeue ( Ipv4Address  dst,
DsrMaintainBuffEntry entry 
)

Return first found (the earliest) entry for given destination.

Definition at line 93 of file dsr-maintain-buff.cc.

References ns3::dsr::DsrMaintainBuffEntry::GetPacket(), ns3::Packet::GetSize(), m_maintainBuffer, NS_LOG_DEBUG, and Purge().

Referenced by ns3::dsr::DsrRouting::CancelPacketTimerNextHop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrMaintainBuffer::DropPacketWithNextHop ( Ipv4Address  nextHop)

Remove all packets with destination IP address dst.

Definition at line 83 of file dsr-maintain-buff.cc.

References IsEqual(), m_maintainBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, and Purge().

+ Here is the call graph for this function:

bool ns3::dsr::DsrMaintainBuffer::Find ( Ipv4Address  nextHop)

Finds whether a packet with destination dst exists in the queue.

Definition at line 110 of file dsr-maintain-buff.cc.

References m_maintainBuffer, and NS_LOG_DEBUG.

Referenced by ns3::dsr::DsrRouting::CancelPacketTimerNextHop().

+ Here is the caller graph for this function:

Time ns3::dsr::DsrMaintainBuffer::GetMaintainBufferTimeout ( ) const
inline

Definition at line 279 of file dsr-maintain-buff.h.

References m_maintainBufferTimeout.

uint32_t ns3::dsr::DsrMaintainBuffer::GetMaxQueueLen ( ) const
inline

Definition at line 271 of file dsr-maintain-buff.h.

References m_maxLen.

uint32_t ns3::dsr::DsrMaintainBuffer::GetSize ( void  )

Number of entries.

Definition at line 46 of file dsr-maintain-buff.cc.

References m_maintainBuffer, and Purge().

Referenced by ns3::dsr::DsrRouting::CancelLinkPacketTimer(), and ns3::dsr::DsrRouting::CancelPacketTimerNextHop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool ns3::dsr::DsrMaintainBuffer::IsEqual ( DsrMaintainBuffEntry  en,
const Ipv4Address  nextHop 
)
inlinestaticprivate

Verify if the maintain buffer is equal or not.

Definition at line 307 of file dsr-maintain-buff.h.

References ns3::dsr::DsrMaintainBuffEntry::GetNextHop().

Referenced by DropPacketWithNextHop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrMaintainBuffer::LinkEqual ( DsrMaintainBuffEntry entry)

Verify if the maintain buffer entry is the same in every field for link ack.

Definition at line 190 of file dsr-maintain-buff.cc.

References ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), m_maintainBuffer, and NS_LOG_DEBUG.

Referenced by ns3::dsr::DsrRouting::CancelLinkPacketTimer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrMaintainBuffer::NetworkEqual ( DsrMaintainBuffEntry entry)

Verify if the maintain buffer entry is the same in every field for network ack.

Definition at line 146 of file dsr-maintain-buff.cc.

References ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), and m_maintainBuffer.

Referenced by ns3::dsr::DsrRouting::CancelNetworkPacketTimer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrMaintainBuffer::PromiscEqual ( DsrMaintainBuffEntry entry)

Verify if the maintain buffer entry is the same in every field for promiscuous ack.

Definition at line 167 of file dsr-maintain-buff.cc.

References ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), m_maintainBuffer, and NS_LOG_DEBUG.

Referenced by ns3::dsr::DsrRouting::CancelPassiveTimer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrMaintainBuffer::Purge ( )
private

Remove all expired entries.

Definition at line 223 of file dsr-maintain-buff.cc.

References m_maintainBuffer, and NS_LOG_DEBUG.

Referenced by Dequeue(), DropPacketWithNextHop(), Enqueue(), and GetSize().

+ Here is the caller graph for this function:

void ns3::dsr::DsrMaintainBuffer::SetMaintainBufferTimeout ( Time  t)
inline

Definition at line 283 of file dsr-maintain-buff.h.

References m_maintainBufferTimeout.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::DsrMaintainBuffer::SetMaxQueueLen ( uint32_t  len)
inline

Definition at line 275 of file dsr-maintain-buff.h.

References m_maxLen.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<NetworkKey> ns3::dsr::DsrMaintainBuffer::m_allNetworkKey
private

Definition at line 299 of file dsr-maintain-buff.h.

std::vector<DsrMaintainBuffEntry> ns3::dsr::DsrMaintainBuffer::m_maintainBuffer
private

The vector of maintain buffer entries.

Definition at line 298 of file dsr-maintain-buff.h.

Referenced by AllEqual(), Dequeue(), DropPacketWithNextHop(), Enqueue(), Find(), GetSize(), LinkEqual(), NetworkEqual(), PromiscEqual(), and Purge().

Time ns3::dsr::DsrMaintainBuffer::m_maintainBufferTimeout
private

The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.

Definition at line 305 of file dsr-maintain-buff.h.

Referenced by Enqueue(), GetMaintainBufferTimeout(), and SetMaintainBufferTimeout().

uint32_t ns3::dsr::DsrMaintainBuffer::m_maxLen
private

The maximum number of packets that we allow a routing protocol to buffer.

Definition at line 303 of file dsr-maintain-buff.h.

Referenced by Enqueue(), GetMaxQueueLen(), and SetMaxQueueLen().


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