DSR maintain buffer. More...
#include "dsr-maintain-buff.h"
Public Member Functions | |
DsrMaintainBuffer () | |
Default constructor. More... | |
bool | AllEqual (DsrMaintainBuffEntry &entry) |
Verify if all the elements in the maintenance buffer entry is the same. More... | |
bool | Dequeue (Ipv4Address dst, DsrMaintainBuffEntry &entry) |
Return first found (the earliest) entry for given destination. More... | |
void | DropPacketWithNextHop (Ipv4Address nextHop) |
Remove all packets with next hop IP address dst. More... | |
bool | Enqueue (DsrMaintainBuffEntry &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 next hop dst exists in the queue. More... | |
Time | GetMaintainBufferTimeout () const |
Get maintain buffer timeout. More... | |
uint32_t | GetMaxQueueLen () const |
Get maximum queue length. More... | |
uint32_t | GetSize () |
Number of entries. More... | |
bool | LinkEqual (DsrMaintainBuffEntry &entry) |
Verify if the maintain buffer entry is the same in every field for link ack. More... | |
bool | NetworkEqual (DsrMaintainBuffEntry &entry) |
Verify if the maintain buffer entry is the same in every field for network ack. More... | |
bool | PromiscEqual (DsrMaintainBuffEntry &entry) |
Verify if the maintain buffer entry is the same in every field for promiscuous ack. More... | |
void | SetMaintainBufferTimeout (Time t) |
Set maintain buffer timeout. More... | |
void | SetMaxQueueLen (uint32_t len) |
Set maximum queue length. More... | |
Private Member Functions | |
void | Purge () |
Remove all expired entries. More... | |
Static Private Member Functions | |
static bool | IsEqual (DsrMaintainBuffEntry en, const Ipv4Address nextHop) |
Verify if the maintain buffer is equal or not. More... | |
Private Attributes | |
std::vector< NetworkKey > | m_allNetworkKey |
The vector of network keys. More... | |
std::vector< DsrMaintainBuffEntry > | m_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... | |
DSR maintain buffer.
Definition at line 394 of file dsr-maintain-buff.h.
|
inline |
Default constructor.
Definition at line 400 of file dsr-maintain-buff.h.
bool ns3::dsr::DsrMaintainBuffer::AllEqual | ( | DsrMaintainBuffEntry & | entry | ) |
Verify if all the elements in the maintenance buffer entry is the same.
entry | The Entry to check |
Definition at line 125 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().
bool ns3::dsr::DsrMaintainBuffer::Dequeue | ( | Ipv4Address | dst, |
DsrMaintainBuffEntry & | entry | ||
) |
Return first found (the earliest) entry for given destination.
[in] | dst | Entry destination |
[out] | entry | The Entry found (if any). |
Definition at line 93 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().
void ns3::dsr::DsrMaintainBuffer::DropPacketWithNextHop | ( | Ipv4Address | nextHop | ) |
Remove all packets with next hop IP address dst.
nextHop | Next hop in the route. |
Definition at line 83 of file dsr-maintain-buff.cc.
References IsEqual(), m_maintainBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, and Purge().
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.
entry | Maintain Buffer Entry |
Definition at line 53 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().
bool ns3::dsr::DsrMaintainBuffer::Find | ( | Ipv4Address | nextHop | ) |
Finds whether a packet with next hop dst exists in the queue.
nextHop | Next hop in the route. |
Definition at line 110 of file dsr-maintain-buff.cc.
References m_maintainBuffer, and NS_LOG_DEBUG.
Referenced by ns3::dsr::DsrRouting::CancelPacketTimerNextHop().
|
inline |
Get maintain buffer timeout.
Definition at line 444 of file dsr-maintain-buff.h.
References m_maintainBufferTimeout.
|
inline |
Get maximum queue length.
Definition at line 428 of file dsr-maintain-buff.h.
References m_maxLen.
uint32_t ns3::dsr::DsrMaintainBuffer::GetSize | ( | void | ) |
Number of entries.
Definition at line 46 of file dsr-maintain-buff.cc.
References m_maintainBuffer, and Purge().
Referenced by ns3::dsr::DsrRouting::CancelLinkPacketTimer(), and ns3::dsr::DsrRouting::CancelPacketTimerNextHop().
|
inlinestaticprivate |
Verify if the maintain buffer is equal or not.
en | The Entry to check |
nextHop | The next hop to check |
Definition at line 490 of file dsr-maintain-buff.h.
References ns3::dsr::DsrMaintainBuffEntry::GetNextHop().
Referenced by DropPacketWithNextHop().
bool ns3::dsr::DsrMaintainBuffer::LinkEqual | ( | DsrMaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for link ack.
entry | The Entry to check |
Definition at line 190 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().
bool ns3::dsr::DsrMaintainBuffer::NetworkEqual | ( | DsrMaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for network ack.
entry | The Entry to check |
Definition at line 146 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().
bool ns3::dsr::DsrMaintainBuffer::PromiscEqual | ( | DsrMaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for promiscuous ack.
entry | The Entry to check |
Definition at line 167 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().
|
private |
Remove all expired entries.
Definition at line 229 of file dsr-maintain-buff.cc.
References m_maintainBuffer, and NS_LOG_DEBUG.
Referenced by Dequeue(), DropPacketWithNextHop(), Enqueue(), and GetSize().
|
inline |
Set maintain buffer timeout.
t | the maintain buffer timeoout |
Definition at line 452 of file dsr-maintain-buff.h.
References m_maintainBufferTimeout.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Set maximum queue length.
len | the maximum queue length |
Definition at line 436 of file dsr-maintain-buff.h.
References m_maxLen.
Referenced by ns3::dsr::DsrRouting::Start().
|
private |
The vector of network keys.
Definition at line 479 of file dsr-maintain-buff.h.
|
private |
The vector of maintain buffer entries.
Definition at line 477 of file dsr-maintain-buff.h.
Referenced by AllEqual(), Dequeue(), DropPacketWithNextHop(), Enqueue(), Find(), GetSize(), LinkEqual(), NetworkEqual(), PromiscEqual(), and Purge().
|
private |
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
Definition at line 485 of file dsr-maintain-buff.h.
Referenced by Enqueue(), GetMaintainBufferTimeout(), and SetMaintainBufferTimeout().
|
private |
The maximum number of packets that we allow a routing protocol to buffer.
Definition at line 483 of file dsr-maintain-buff.h.
Referenced by Enqueue(), GetMaxQueueLen(), and SetMaxQueueLen().