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

DSR send buffer. More...

#include "dsr-rsendbuff.h"

+ Collaboration diagram for ns3::dsr::DsrSendBuffer:

Public Member Functions

 DsrSendBuffer ()
 Default constructor. More...
 
bool Dequeue (Ipv4Address dst, DsrSendBuffEntry &entry)
 Return first found (the earliest) entry for the given destination. More...
 
void DropPacketWithDst (Ipv4Address dst)
 Remove all packets with destination IP address dst. More...
 
bool Enqueue (DsrSendBuffEntry &entry)
 Push entry in queue, if there is no entry with the same packet and destination address in queue. More...
 
bool Find (Ipv4Address dst)
 Check if a packet with destination dst exists in the queue. More...
 
std::vector< DsrSendBuffEntry > & GetBuffer ()
 Return a pointer to the internal queue. More...
 
uint32_t GetMaxQueueLen () const
 Return the maximum queue length. More...
 
Time GetSendBufferTimeout () const
 Return the entry lifetime in the queue. More...
 
uint32_t GetSize ()
 Number of entries. More...
 
void SetMaxQueueLen (uint32_t len)
 Set the maximum queue length. More...
 
void SetSendBufferTimeout (Time t)
 Set the entry lifetime in the queue. More...
 

Private Member Functions

void Drop (DsrSendBuffEntry 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 IsEqual (DsrSendBuffEntry en, const Ipv4Address dst)
 Check if the send buffer entry is the same or not. More...
 

Private Attributes

uint32_t m_maxLen
 The maximum number of packets that we allow a routing protocol to buffer. More...
 
std::vector< DsrSendBuffEntrym_sendBuffer
 The send buffer to cache unsent packet. More...
 
Time m_sendBufferTimeout
 The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds. More...
 

Detailed Description

DSR send buffer.

Definition at line 124 of file dsr-rsendbuff.h.

Constructor & Destructor Documentation

ns3::dsr::DsrSendBuffer::DsrSendBuffer ( )
inline

Default constructor.

Definition at line 130 of file dsr-rsendbuff.h.

Member Function Documentation

bool ns3::dsr::DsrSendBuffer::Dequeue ( Ipv4Address  dst,
DsrSendBuffEntry entry 
)

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

Parameters
dstIPv4 address of the destination
entrypointer to entry to return
Returns
true if successfully dequeued, false otherwise

Definition at line 104 of file dsr-rsendbuff.cc.

References ns3::dsr::DsrSendBuffEntry::GetPacket(), ns3::Packet::GetSize(), m_sendBuffer, NS_LOG_DEBUG, and Purge().

Referenced by DsrSendBuffTest::DoRun(), and ns3::dsr::DsrRouting::SendPacketFromBuffer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrSendBuffer::Drop ( DsrSendBuffEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by timeout.

Definition at line 173 of file dsr-rsendbuff.cc.

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

Referenced by DropPacketWithDst(), Enqueue(), and Purge().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrSendBuffer::DropPacketWithDst ( Ipv4Address  dst)

Remove all packets with destination IP address dst.

Parameters
dstIPv4 address of the destination

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

References Drop(), IsEqual(), m_sendBuffer, NS_LOG_FUNCTION, and Purge().

Referenced by DsrSendBuffTest::DoRun(), and ns3::dsr::DsrRouting::RouteRequestTimerExpire().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrSendBuffer::Enqueue ( DsrSendBuffEntry entry)

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

Parameters
entryDsrSendBuffEntry to put in the queue
Returns
true if successfully enqueued, false otherwise

Definition at line 53 of file dsr-rsendbuff.cc.

References Drop(), ns3::dsr::DsrSendBuffEntry::GetDestination(), ns3::dsr::DsrSendBuffEntry::GetPacket(), ns3::Packet::GetUid(), m_maxLen, m_sendBuffer, m_sendBufferTimeout, Purge(), and ns3::dsr::DsrSendBuffEntry::SetExpireTime().

Referenced by DsrSendBuffTest::CheckSizeLimit(), DsrSendBuffTest::DoRun(), ns3::dsr::DsrRouting::PacketNewRoute(), and ns3::dsr::DsrRouting::Send().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Check if a packet with destination dst exists in the queue.

Parameters
dstIPv4 address of the destination
Returns
true if found, false otherwise

Definition at line 124 of file dsr-rsendbuff.cc.

References m_sendBuffer, and NS_LOG_DEBUG.

Referenced by DsrSendBuffTest::DoRun(), ns3::dsr::DsrRouting::RouteRequestTimerExpire(), ns3::dsr::DsrRouting::Send(), ns3::dsr::DsrRouting::SendErrorRequest(), and ns3::dsr::DsrRouting::SendPacketFromBuffer().

+ Here is the caller graph for this function:

std::vector<DsrSendBuffEntry>& ns3::dsr::DsrSendBuffer::GetBuffer ( )
inline

Return a pointer to the internal queue.

Returns
a pointer to the internal queue

Definition at line 214 of file dsr-rsendbuff.h.

References m_sendBuffer.

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

+ Here is the caller graph for this function:

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

Return the maximum queue length.

Returns
the maximum queue length

Definition at line 176 of file dsr-rsendbuff.h.

References m_maxLen.

Referenced by DsrSendBuffTest::CheckSizeLimit(), and DsrSendBuffTest::DoRun().

+ Here is the caller graph for this function:

Time ns3::dsr::DsrSendBuffer::GetSendBufferTimeout ( ) const
inline

Return the entry lifetime in the queue.

Returns
the entry lifetime in the queue

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

References m_sendBufferTimeout.

Referenced by DsrSendBuffTest::DoRun().

+ Here is the caller graph for this function:

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

Number of entries.

Returns
the number of entries in the queue

Definition at line 46 of file dsr-rsendbuff.cc.

References m_sendBuffer, and Purge().

Referenced by ns3::dsr::DsrRouting::CheckSendBuffer(), DsrSendBuffTest::CheckSizeLimit(), DsrSendBuffTest::CheckTimeout(), DsrSendBuffTest::DoRun(), ns3::dsr::DsrRouting::RouteRequestTimerExpire(), ns3::dsr::DsrRouting::Send(), ns3::dsr::DsrRouting::SendErrorRequest(), and ns3::dsr::DsrRouting::SendPacketFromBuffer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool ns3::dsr::DsrSendBuffer::IsEqual ( DsrSendBuffEntry  en,
const Ipv4Address  dst 
)
inlinestaticprivate

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

Parameters
enSendBufferEntry
dstIPv4 address to check
Returns
true if the SendBufferEntry destination is the same, false otherwise

Definition at line 234 of file dsr-rsendbuff.h.

References ns3::dsr::DsrSendBuffEntry::GetDestination().

Referenced by DropPacketWithDst().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Remove all expired entries.

Definition at line 152 of file dsr-rsendbuff.cc.

References Drop(), m_sendBuffer, NS_LOG_DEBUG, and NS_LOG_INFO.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Set the maximum queue length.

Parameters
lenthe maximum queue length

Definition at line 185 of file dsr-rsendbuff.h.

References m_maxLen.

Referenced by DsrSendBuffTest::DoRun(), and ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::DsrSendBuffer::SetSendBufferTimeout ( Time  t)
inline

Set the entry lifetime in the queue.

Parameters
tthe entry lifetime in the queue

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

References m_sendBufferTimeout.

Referenced by DsrSendBuffTest::DoRun(), and ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

Member Data Documentation

uint32_t ns3::dsr::DsrSendBuffer::m_maxLen
private

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

Definition at line 224 of file dsr-rsendbuff.h.

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

std::vector<DsrSendBuffEntry> ns3::dsr::DsrSendBuffer::m_sendBuffer
private

The send buffer to cache unsent packet.

Definition at line 221 of file dsr-rsendbuff.h.

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

Time ns3::dsr::DsrSendBuffer::m_sendBufferTimeout
private

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

Definition at line 225 of file dsr-rsendbuff.h.

Referenced by Enqueue(), GetSendBufferTimeout(), and SetSendBufferTimeout().


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