DSR maintain buffer. More...
#include <dsr-maintain-buff.h>
Public Member Functions | |
MaintainBuffer () | |
Default constructor. More... | |
bool | AllEqual (MaintainBuffEntry &entry) |
Verify if all the elements in the maintainence buffer entry is the same. More... | |
bool | Dequeue (Ipv4Address dst, MaintainBuffEntry &entry) |
Return first found (the earliest) entry for given destination. More... | |
void | DropPacketWithNextHop (Ipv4Address nextHop) |
Remove all packets with destination IP address dst. More... | |
bool | Enqueue (MaintainBuffEntry &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 destination dst exists in the queue. More... | |
Time | GetMaintainBufferTimeout () const |
uint32_t | GetMaxQueueLen () const |
uint32_t | GetSize () |
Number of entries. More... | |
bool | LinkEqual (MaintainBuffEntry &entry) |
Verify if the maintain buffer entry is the same in every field for link ack. More... | |
bool | NetworkEqual (MaintainBuffEntry &entry) |
Verify if the maintain buffer entry is the same in every field for network ack. More... | |
bool | PromiscEqual (MaintainBuffEntry &entry) |
Verify if the maintain buffer entry is the same in every field for promiscuous ack. More... | |
void | SetMaintainBufferTimeout (Time t) |
void | SetMaxQueueLen (uint32_t len) |
Private Member Functions | |
void | Purge () |
Remove all expired entries. More... | |
Static Private Member Functions | |
static bool | IsEqual (MaintainBuffEntry en, const Ipv4Address nextHop) |
Verify if the maintain buffer is equal or not. More... | |
Private Attributes | |
std::vector< NetworkKey > | m_allNetworkKey |
std::vector< MaintainBuffEntry > | 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 250 of file dsr-maintain-buff.h.
|
inline |
Default constructor.
Definition at line 256 of file dsr-maintain-buff.h.
bool ns3::dsr::MaintainBuffer::AllEqual | ( | MaintainBuffEntry & | entry | ) |
Verify if all the elements in the maintainence buffer entry is the same.
Definition at line 125 of file dsr-maintain-buff.cc.
References ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::GetSrc(), and m_maintainBuffer.
Referenced by ns3::dsr::DsrRouting::ScheduleNetworkPacketRetry().
bool ns3::dsr::MaintainBuffer::Dequeue | ( | Ipv4Address | dst, |
MaintainBuffEntry & | entry | ||
) |
Return first found (the earliest) entry for given destination.
Definition at line 93 of file dsr-maintain-buff.cc.
References ns3::dsr::MaintainBuffEntry::GetPacket(), ns3::Packet::GetSize(), m_maintainBuffer, NS_LOG_DEBUG, and Purge().
Referenced by ns3::dsr::DsrRouting::CancelPacketTimerNextHop().
void ns3::dsr::MaintainBuffer::DropPacketWithNextHop | ( | Ipv4Address | nextHop | ) |
Remove all packets with destination IP address dst.
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::MaintainBuffer::Enqueue | ( | MaintainBuffEntry & | entry | ) |
Push entry in queue, if there is no entry with the same packet and destination address in queue.
Definition at line 53 of file dsr-maintain-buff.cc.
References ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::GetSrc(), m_maintainBuffer, m_maintainBufferTimeout, m_maxLen, NS_LOG_DEBUG, Purge(), and ns3::dsr::MaintainBuffEntry::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::MaintainBuffer::Find | ( | Ipv4Address | nextHop | ) |
Finds whether a packet with destination dst exists in the queue.
Definition at line 110 of file dsr-maintain-buff.cc.
References m_maintainBuffer, and NS_LOG_DEBUG.
Referenced by ns3::dsr::DsrRouting::CancelPacketTimerNextHop().
|
inline |
Definition at line 279 of file dsr-maintain-buff.h.
References m_maintainBufferTimeout.
|
inline |
Definition at line 271 of file dsr-maintain-buff.h.
References m_maxLen.
uint32_t ns3::dsr::MaintainBuffer::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.
Definition at line 307 of file dsr-maintain-buff.h.
References ns3::dsr::MaintainBuffEntry::GetNextHop().
Referenced by DropPacketWithNextHop().
bool ns3::dsr::MaintainBuffer::LinkEqual | ( | MaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for link ack.
Definition at line 190 of file dsr-maintain-buff.cc.
References ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetSrc(), m_maintainBuffer, and NS_LOG_DEBUG.
Referenced by ns3::dsr::DsrRouting::CancelLinkPacketTimer().
bool ns3::dsr::MaintainBuffer::NetworkEqual | ( | MaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for network ack.
Definition at line 146 of file dsr-maintain-buff.cc.
References ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetSrc(), and m_maintainBuffer.
Referenced by ns3::dsr::DsrRouting::CancelNetworkPacketTimer().
bool ns3::dsr::MaintainBuffer::PromiscEqual | ( | MaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for promiscuous ack.
Definition at line 167 of file dsr-maintain-buff.cc.
References ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::GetSrc(), m_maintainBuffer, and NS_LOG_DEBUG.
Referenced by ns3::dsr::DsrRouting::CancelPassiveTimer().
|
private |
Remove all expired entries.
Definition at line 223 of file dsr-maintain-buff.cc.
References m_maintainBuffer, and NS_LOG_DEBUG.
Referenced by Dequeue(), DropPacketWithNextHop(), Enqueue(), and GetSize().
|
inline |
Definition at line 283 of file dsr-maintain-buff.h.
References m_maintainBufferTimeout.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 275 of file dsr-maintain-buff.h.
References m_maxLen.
Referenced by ns3::dsr::DsrRouting::Start().
|
private |
Definition at line 299 of file dsr-maintain-buff.h.
|
private |
The vector of maintain buffer entries.
Definition at line 298 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 305 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 303 of file dsr-maintain-buff.h.
Referenced by Enqueue(), GetMaxQueueLen(), and SetMaxQueueLen().