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

DSR error buffer. More...

#include <dsr-errorbuff.h>

+ Collaboration diagram for ns3::dsr::ErrorBuffer:

Public Member Functions

 ErrorBuffer ()
 Default constructor. More...
 
bool Dequeue (Ipv4Address dst, ErrorBuffEntry &entry)
 Return first found (the earliest) entry for given destination. More...
 
void DropPacketForErrLink (Ipv4Address source, Ipv4Address nextHop)
 Remove all packets with the error link. More...
 
bool Enqueue (ErrorBuffEntry &entry)
 Push entry in queue, if there is no entry with the same packet and destination address in queue. More...
 
bool Find (Ipv4Address dst)
 Finds whether a packet with destination dst exists in the queue. More...
 
std::vector< ErrorBuffEntry > & GetBuffer ()
 
uint32_t GetSize ()
 Number of entries. More...
 
Fields
uint32_t GetMaxQueueLen () const
 
void SetMaxQueueLen (uint32_t len)
 
Time GetErrorBufferTimeout () const
 
void SetErrorBufferTimeout (Time t)
 

Private Member Functions

void Drop (ErrorBuffEntry en, std::string reason)
 Notify that packet is dropped from queue by timeout. More...
 
void DropLink (ErrorBuffEntry en, std::string reason)
 Notify that packet is dropped from queue by timeout. More...
 
void Purge ()
 Remove all expired entries. More...
 

Static Private Member Functions

static bool LinkEqual (ErrorBuffEntry en, const std::vector< Ipv4Address > link)
 Check if the send buffer entry is the same or not. More...
 

Private Attributes

std::vector< ErrorBuffEntrym_errorBuffer
 The send buffer to cache unsent packet. More...
 
Time m_errorBufferTimeout
 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 error buffer.

Definition at line 148 of file dsr-errorbuff.h.

Constructor & Destructor Documentation

ns3::dsr::ErrorBuffer::ErrorBuffer ( )
inline

Default constructor.

Definition at line 154 of file dsr-errorbuff.h.

Member Function Documentation

bool ns3::dsr::ErrorBuffer::Dequeue ( Ipv4Address  dst,
ErrorBuffEntry entry 
)

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

Definition at line 108 of file dsr-errorbuff.cc.

References ns3::dsr::ErrorBuffEntry::GetPacket(), ns3::Packet::GetSize(), m_errorBuffer, NS_LOG_DEBUG, and Purge().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::ErrorBuffer::Drop ( ErrorBuffEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by timeout.

Definition at line 177 of file dsr-errorbuff.cc.

References ns3::dsr::ErrorBuffEntry::GetDestination(), ns3::dsr::ErrorBuffEntry::GetPacket(), ns3::Packet::GetUid(), and NS_LOG_LOGIC.

Referenced by Enqueue(), and Purge().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::ErrorBuffer::DropLink ( ErrorBuffEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by timeout.

Definition at line 186 of file dsr-errorbuff.cc.

References ns3::dsr::ErrorBuffEntry::GetNextHop(), ns3::dsr::ErrorBuffEntry::GetPacket(), ns3::dsr::ErrorBuffEntry::GetSource(), ns3::Packet::GetUid(), and NS_LOG_LOGIC.

Referenced by DropPacketForErrLink().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::ErrorBuffer::DropPacketForErrLink ( Ipv4Address  source,
Ipv4Address  nextHop 
)

Remove all packets with the error link.

Definition at line 84 of file dsr-errorbuff.cc.

References DropLink(), LinkEqual(), list, m_errorBuffer, NS_LOG_FUNCTION, and Purge().

Referenced by ns3::dsr::DsrRouting::AddRoute(), and ns3::dsr::DsrRouting::AddRoute_Link().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::ErrorBuffer::Enqueue ( ErrorBuffEntry entry)

Push entry in queue, if there is no entry with the same packet and destination address in queue.

Todo:
check the source and destination over here

Definition at line 52 of file dsr-errorbuff.cc.

References Drop(), ns3::dsr::ErrorBuffEntry::GetDestination(), ns3::dsr::ErrorBuffEntry::GetNextHop(), ns3::dsr::ErrorBuffEntry::GetPacket(), ns3::dsr::ErrorBuffEntry::GetSource(), ns3::Packet::GetUid(), m_errorBuffer, m_errorBufferTimeout, m_maxLen, NS_LOG_INFO, Purge(), and ns3::dsr::ErrorBuffEntry::SetExpireTime().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::ErrorBuffer::Find ( Ipv4Address  dst)

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

Definition at line 128 of file dsr-errorbuff.cc.

References m_errorBuffer, and NS_LOG_DEBUG.

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

+ Here is the caller graph for this function:

std::vector<ErrorBuffEntry>& ns3::dsr::ErrorBuffer::GetBuffer ( )
inline

Definition at line 187 of file dsr-errorbuff.h.

References m_errorBuffer.

Time ns3::dsr::ErrorBuffer::GetErrorBufferTimeout ( ) const
inline

Definition at line 177 of file dsr-errorbuff.h.

References m_errorBufferTimeout.

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

Definition at line 169 of file dsr-errorbuff.h.

References m_maxLen.

uint32_t ns3::dsr::ErrorBuffer::GetSize ( )

Number of entries.

Definition at line 45 of file dsr-errorbuff.cc.

References m_errorBuffer, and Purge().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool ns3::dsr::ErrorBuffer::LinkEqual ( ErrorBuffEntry  en,
const std::vector< Ipv4Address link 
)
inlinestaticprivate

Check if the send buffer entry is the same or not.

Definition at line 206 of file dsr-errorbuff.h.

References ns3::dsr::ErrorBuffEntry::GetNextHop(), and ns3::dsr::ErrorBuffEntry::GetSource().

Referenced by DropPacketForErrLink().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Remove all expired entries.

Definition at line 156 of file dsr-errorbuff.cc.

References Drop(), m_errorBuffer, and NS_LOG_DEBUG.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::ErrorBuffer::SetErrorBufferTimeout ( Time  t)
inline

Definition at line 181 of file dsr-errorbuff.h.

References m_errorBufferTimeout.

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

+ Here is the caller graph for this function:

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

Definition at line 173 of file dsr-errorbuff.h.

References m_maxLen.

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

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<ErrorBuffEntry> ns3::dsr::ErrorBuffer::m_errorBuffer
private

The send buffer to cache unsent packet.

Definition at line 194 of file dsr-errorbuff.h.

Referenced by Dequeue(), DropPacketForErrLink(), Enqueue(), Find(), GetBuffer(), GetSize(), and Purge().

Time ns3::dsr::ErrorBuffer::m_errorBufferTimeout
private

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

Definition at line 204 of file dsr-errorbuff.h.

Referenced by Enqueue(), GetErrorBufferTimeout(), and SetErrorBufferTimeout().

uint32_t ns3::dsr::ErrorBuffer::m_maxLen
private

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

Definition at line 202 of file dsr-errorbuff.h.

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


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