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

DSR error buffer. More...

#include "dsr-errorbuff.h"

+ Collaboration diagram for ns3::dsr::DsrErrorBuffer:

Public Member Functions

 DsrErrorBuffer ()
 Default constructor. More...
 
bool Dequeue (Ipv4Address dst, DsrErrorBuffEntry &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 (DsrErrorBuffEntry &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< DsrErrorBuffEntry > & GetBuffer ()
 
Time GetErrorBufferTimeout () const
 
uint32_t GetMaxQueueLen () const
 
uint32_t GetSize ()
 Number of entries. More...
 
void SetErrorBufferTimeout (Time t)
 
void SetMaxQueueLen (uint32_t len)
 

Private Member Functions

void Drop (DsrErrorBuffEntry en, std::string reason)
 Notify that packet is dropped from queue by timeout. More...
 
void DropLink (DsrErrorBuffEntry 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 (DsrErrorBuffEntry en, const std::vector< Ipv4Address > link)
 Check if the send buffer entry is the same or not. More...
 

Private Attributes

std::vector< DsrErrorBuffEntrym_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::DsrErrorBuffer::DsrErrorBuffer ( )
inline

Default constructor.

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

Member Function Documentation

bool ns3::dsr::DsrErrorBuffer::Dequeue ( Ipv4Address  dst,
DsrErrorBuffEntry entry 
)

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

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

References ns3::dsr::DsrErrorBuffEntry::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::DsrErrorBuffer::Drop ( DsrErrorBuffEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by timeout.

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

References ns3::dsr::DsrErrorBuffEntry::GetDestination(), ns3::dsr::DsrErrorBuffEntry::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::DsrErrorBuffer::DropLink ( DsrErrorBuffEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by timeout.

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

References ns3::dsr::DsrErrorBuffEntry::GetNextHop(), ns3::dsr::DsrErrorBuffEntry::GetPacket(), ns3::dsr::DsrErrorBuffEntry::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::DsrErrorBuffer::DropPacketForErrLink ( Ipv4Address  source,
Ipv4Address  nextHop 
)

Remove all packets with the error link.

Definition at line 85 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::DsrErrorBuffer::Enqueue ( DsrErrorBuffEntry 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 53 of file dsr-errorbuff.cc.

References Drop(), ns3::dsr::DsrErrorBuffEntry::GetDestination(), ns3::dsr::DsrErrorBuffEntry::GetNextHop(), ns3::dsr::DsrErrorBuffEntry::GetPacket(), ns3::dsr::DsrErrorBuffEntry::GetSource(), ns3::Packet::GetUid(), m_errorBuffer, m_errorBufferTimeout, m_maxLen, NS_LOG_INFO, Purge(), and ns3::dsr::DsrErrorBuffEntry::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::DsrErrorBuffer::Find ( Ipv4Address  dst)

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

Definition at line 129 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<DsrErrorBuffEntry>& ns3::dsr::DsrErrorBuffer::GetBuffer ( )
inline

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

References m_errorBuffer.

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

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

References m_errorBufferTimeout.

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

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

References m_maxLen.

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

Number of entries.

Definition at line 46 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::DsrErrorBuffer::LinkEqual ( DsrErrorBuffEntry  en,
const std::vector< Ipv4Address link 
)
inlinestaticprivate

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

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

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

Referenced by DropPacketForErrLink().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Remove all expired entries.

Definition at line 157 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::DsrErrorBuffer::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::DsrErrorBuffer::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<DsrErrorBuffEntry> ns3::dsr::DsrErrorBuffer::m_errorBuffer
private

The send buffer to cache unsent packet.

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

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

Time ns3::dsr::DsrErrorBuffer::m_errorBufferTimeout
private

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

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

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

uint32_t ns3::dsr::DsrErrorBuffer::m_maxLen
private

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

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

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


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