A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
bool AllEqual (DsrMaintainBuffEntry &entry)
 Verify if all the elements in the maintenance buffer entry is the same.
 
bool Dequeue (Ipv4Address dst, DsrMaintainBuffEntry &entry)
 Return first found (the earliest) entry for given destination.
 
void DropPacketWithNextHop (Ipv4Address nextHop)
 Remove all packets with next hop IP address dst.
 
bool Enqueue (DsrMaintainBuffEntry &entry)
 Push entry in queue, if there is no entry with the same packet and destination address in queue.
 
bool Find (Ipv4Address nextHop)
 Finds whether a packet with next hop dst exists in the queue.
 
Time GetMaintainBufferTimeout () const
 Get maintain buffer timeout.
 
uint32_t GetMaxQueueLen () const
 Get maximum queue length.
 
uint32_t GetSize ()
 Number of entries.
 
bool LinkEqual (DsrMaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for link ack.
 
bool NetworkEqual (DsrMaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for network ack.
 
bool PromiscEqual (DsrMaintainBuffEntry &entry)
 Verify if the maintain buffer entry is the same in every field for promiscuous ack.
 
void SetMaintainBufferTimeout (Time t)
 Set maintain buffer timeout.
 
void SetMaxQueueLen (uint32_t len)
 Set maximum queue length.
 

Private Member Functions

void Purge ()
 Remove all expired entries.
 

Private Attributes

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

Detailed Description

DSR maintain buffer.

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

Constructor & Destructor Documentation

◆ DsrMaintainBuffer()

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

Default constructor.

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

Member Function Documentation

◆ AllEqual()

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

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

Note
For real this function checks if at most one entry is equal. If it is, that entry is removed. Further entries are NOT checked. This could be a bug.
Parameters
entryThe Entry to check
Returns
true if an Entry was found and removed.

Definition at line 135 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:

◆ Dequeue()

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

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

Parameters
[in]dstEntry destination
[out]entryThe Entry found (if any).
Returns
true on success

Definition at line 104 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:

◆ DropPacketWithNextHop()

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

Remove all packets with next hop IP address dst.

Parameters
nextHopNext hop in the route.

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

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

+ Here is the call graph for this function:

◆ Enqueue()

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

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

Parameters
entryMaintain Buffer Entry
Returns
true on success adding the Entry.

Definition at line 56 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(), m_maintainBuffer, m_maintainBufferTimeout, m_maxLen, NS_LOG_DEBUG, Purge(), and ns3::dsr::DsrMaintainBuffEntry::SetExpireTime().

Referenced by ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::dsr::DsrRouting::ForwardPacket(), ns3::dsr::DsrRouting::PacketNewRoute(), ns3::dsr::DsrRouting::ScheduleNetworkPacketRetry(), ns3::dsr::DsrRouting::Send(), and ns3::dsr::DsrRouting::SendPacketFromBuffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Find()

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

Finds whether a packet with next hop dst exists in the queue.

Parameters
nextHopNext hop in the route.
Returns
true if there is a packet directed to the next hop.

Definition at line 121 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:

◆ GetMaintainBufferTimeout()

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

Get maintain buffer timeout.

Returns
the maintain buffer timeout

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

References m_maintainBufferTimeout.

◆ GetMaxQueueLen()

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

Get maximum queue length.

Returns
the maximum queue length

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

References m_maxLen.

◆ GetSize()

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

Number of entries.

Returns
The number of entries.

Definition at line 49 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:

◆ LinkEqual()

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

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

Parameters
entryThe Entry to check
Returns
true if an Entry was found and removed.

Definition at line 208 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:

◆ NetworkEqual()

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

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

Parameters
entryThe Entry to check
Returns
true if an Entry was found and removed.

Definition at line 159 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:

◆ PromiscEqual()

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

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

Parameters
entryThe Entry to check
Returns
true if an Entry was found and removed.

Definition at line 183 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:

◆ Purge()

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

Remove all expired entries.

Definition at line 247 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:

◆ SetMaintainBufferTimeout()

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

Set maintain buffer timeout.

Parameters
tthe maintain buffer timeoout

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

References m_maintainBufferTimeout.

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

+ Here is the caller graph for this function:

◆ SetMaxQueueLen()

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

Set maximum queue length.

Parameters
lenthe maximum queue length

Definition at line 464 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

◆ m_allNetworkKey

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

The vector of network keys.

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

◆ m_maintainBuffer

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

The vector of maintain buffer entries.

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

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

◆ m_maintainBufferTimeout

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 517 of file dsr-maintain-buff.h.

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

◆ m_maxLen

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

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

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

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


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