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

DSR maintain buffer. More...

#include <dsr-maintain-buff.h>

+ Collaboration diagram for ns3::dsr::MaintainBuffer:

Public Member Functions

 MaintainBuffer ()
 Default constructor. More...
 
bool Dequeue (Ipv4Address dst, MaintainBuffEntry &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 (MaintainBuffEntry &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...
 
uint32_t GetSize ()
 Number of entries. More...
 
Fields
uint32_t GetMaxQueueLen () const
 Verify if all the elements in the maintainence buffer entry is the same. More...
 
void SetMaxQueueLen (uint32_t len)
 Verify if all the elements in the maintainence buffer entry is the same. More...
 
Time GetMaintainBufferTimeout () const
 Verify if all the elements in the maintainence buffer entry is the same. More...
 
void SetMaintainBufferTimeout (Time t)
 Verify if all the elements in the maintainence buffer entry is the same. More...
 
bool AllEqual (MaintainBuffEntry &entry)
 Verify if all the elements in the maintainence buffer entry is the same. More...
 
bool LinkEqual (MaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for link ack. More...
 
bool NetworkEqual (MaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for network ack. More...
 
bool PromiscEqual (MaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for promiscuous ack. More...
 

Private Member Functions

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

Static Private Member Functions

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

Private Attributes

std::vector< NetworkKeym_allNetworkKey
 
std::vector< MaintainBuffEntrym_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 231 of file dsr-maintain-buff.h.

Constructor & Destructor Documentation

ns3::dsr::MaintainBuffer::MaintainBuffer ( )
inline

Default constructor.

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

Member Function Documentation

bool ns3::dsr::MaintainBuffer::AllEqual ( MaintainBuffEntry entry)

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

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

References ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::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::MaintainBuffer::Dequeue ( Ipv4Address  dst,
MaintainBuffEntry entry 
)

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

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

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Remove all packets with destination IP address dst.

Definition at line 82 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::MaintainBuffer::Find ( Ipv4Address  nextHop)

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

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

References m_maintainBuffer, and NS_LOG_DEBUG.

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

+ Here is the caller graph for this function:

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

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

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

References m_maintainBufferTimeout.

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

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

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

References m_maxLen.

uint32_t ns3::dsr::MaintainBuffer::GetSize ( )

Number of entries.

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

References m_maintainBuffer, and Purge().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool ns3::dsr::MaintainBuffer::IsEqual ( MaintainBuffEntry  en,
const Ipv4Address  nextHop 
)
inlinestaticprivate

Verify if the maintain buffer is equal or not.

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

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

Referenced by DropPacketWithNextHop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::MaintainBuffer::LinkEqual ( MaintainBuffEntry entry)

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

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

References ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::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::MaintainBuffer::NetworkEqual ( MaintainBuffEntry entry)

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

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

References ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::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::MaintainBuffer::PromiscEqual ( MaintainBuffEntry entry)

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

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

References ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::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::MaintainBuffer::Purge ( )
private

Remove all expired entries.

Definition at line 222 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::MaintainBuffer::SetMaintainBufferTimeout ( Time  t)
inline

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

Definition at line 264 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::MaintainBuffer::SetMaxQueueLen ( uint32_t  len)
inline

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

Definition at line 256 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::MaintainBuffer::m_allNetworkKey
private

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

std::vector<MaintainBuffEntry> ns3::dsr::MaintainBuffer::m_maintainBuffer
private

The vector of maintain buffer entries.

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

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

Time ns3::dsr::MaintainBuffer::m_maintainBufferTimeout
private

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

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

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

uint32_t ns3::dsr::MaintainBuffer::m_maxLen
private

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

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

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


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