AODV route request queue. More...
#include <aodv-rqueue.h>
Public Member Functions | |
RequestQueue (uint32_t maxLen, Time routeToQueueTimeout) | |
Default c-tor. More... | |
bool | Dequeue (Ipv4Address dst, QueueEntry &entry) |
Return first found (the earliest) entry for given destination. More... | |
void | DropPacketWithDst (Ipv4Address dst) |
Remove all packets with destination IP address dst. More... | |
bool | Enqueue (QueueEntry &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... | |
uint32_t | GetSize () |
Number of entries. More... | |
Fields | |
uint32_t | GetMaxQueueLen () const |
void | SetMaxQueueLen (uint32_t len) |
Time | GetQueueTimeout () const |
void | SetQueueTimeout (Time t) |
Private Member Functions | |
void | Drop (QueueEntry 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 (QueueEntry en, const Ipv4Address dst) |
Private Attributes | |
uint32_t | m_maxLen |
The maximum number of packets that we allow a routing protocol to buffer. More... | |
std::vector< QueueEntry > | m_queue |
Time | m_queueTimeout |
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds. More... | |
AODV route request queue.
Since AODV is an on demand routing we queue requests while looking for route.
Definition at line 95 of file aodv-rqueue.h.
|
inline |
Default c-tor.
Definition at line 99 of file aodv-rqueue.h.
bool ns3::aodv::RequestQueue::Dequeue | ( | Ipv4Address | dst, |
QueueEntry & | entry | ||
) |
Return first found (the earliest) entry for given destination.
Definition at line 88 of file aodv-rqueue.cc.
References m_queue, and Purge().
Referenced by ns3::aodv::AodvRqueueTest::DoRun(), and ns3::aodv::RoutingProtocol::SendPacketFromQueue().
|
private |
Notify that packet is dropped from queue by timeout.
Definition at line 141 of file aodv-rqueue.cc.
References ns3::Socket::ERROR_NOROUTETOHOST, ns3::Ipv4Header::GetDestination(), ns3::aodv::QueueEntry::GetErrorCallback(), ns3::aodv::QueueEntry::GetIpv4Header(), ns3::aodv::QueueEntry::GetPacket(), ns3::Packet::GetUid(), and NS_LOG_LOGIC.
Referenced by DropPacketWithDst(), Enqueue(), and Purge().
void ns3::aodv::RequestQueue::DropPacketWithDst | ( | Ipv4Address | dst | ) |
Remove all packets with destination IP address dst.
Definition at line 71 of file aodv-rqueue.cc.
References Drop(), IsEqual(), m_queue, NS_LOG_FUNCTION, and Purge().
Referenced by ns3::aodv::AodvRqueueTest::DoRun(), and ns3::aodv::RoutingProtocol::RouteRequestTimerExpire().
bool ns3::aodv::RequestQueue::Enqueue | ( | QueueEntry & | entry | ) |
Push entry in queue, if there is no entry with the same packet and destination address in queue.
Definition at line 49 of file aodv-rqueue.cc.
References Drop(), ns3::Ipv4Header::GetDestination(), ns3::aodv::QueueEntry::GetIpv4Header(), ns3::aodv::QueueEntry::GetPacket(), ns3::Packet::GetUid(), m_maxLen, m_queue, m_queueTimeout, Purge(), and ns3::aodv::QueueEntry::SetExpireTime().
Referenced by ns3::aodv::AodvRqueueTest::CheckSizeLimit(), ns3::aodv::RoutingProtocol::DeferredRouteOutput(), and ns3::aodv::AodvRqueueTest::DoRun().
bool ns3::aodv::RequestQueue::Find | ( | Ipv4Address | dst | ) |
Finds whether a packet with destination dst exists in the queue.
Definition at line 104 of file aodv-rqueue.cc.
References m_queue.
Referenced by ns3::aodv::AodvRqueueTest::DoRun().
|
inline |
Definition at line 115 of file aodv-rqueue.h.
References m_maxLen.
Referenced by ns3::aodv::AodvRqueueTest::CheckSizeLimit(), and ns3::aodv::AodvRqueueTest::DoRun().
|
inline |
Definition at line 117 of file aodv-rqueue.h.
References m_queueTimeout.
Referenced by ns3::aodv::AodvRqueueTest::DoRun().
uint32_t ns3::aodv::RequestQueue::GetSize | ( | ) |
Number of entries.
Definition at line 42 of file aodv-rqueue.cc.
References m_queue, and Purge().
Referenced by ns3::aodv::AodvRqueueTest::CheckSizeLimit(), ns3::aodv::AodvRqueueTest::CheckTimeout(), and ns3::aodv::AodvRqueueTest::DoRun().
|
inlinestaticprivate |
Definition at line 131 of file aodv-rqueue.h.
References ns3::Ipv4Header::GetDestination(), and ns3::aodv::QueueEntry::GetIpv4Header().
Referenced by DropPacketWithDst().
|
private |
Remove all expired entries.
Definition at line 125 of file aodv-rqueue.cc.
References Drop(), and m_queue.
Referenced by Dequeue(), DropPacketWithDst(), Enqueue(), and GetSize().
|
inline |
Definition at line 116 of file aodv-rqueue.h.
References m_maxLen.
Referenced by ns3::aodv::AodvRqueueTest::DoRun(), and ns3::aodv::RoutingProtocol::SetMaxQueueLen().
|
inline |
Definition at line 118 of file aodv-rqueue.h.
References m_queueTimeout.
Referenced by ns3::aodv::AodvRqueueTest::DoRun(), and ns3::aodv::RoutingProtocol::SetMaxQueueTime().
|
private |
The maximum number of packets that we allow a routing protocol to buffer.
Definition at line 128 of file aodv-rqueue.h.
Referenced by Enqueue(), GetMaxQueueLen(), and SetMaxQueueLen().
|
private |
Definition at line 122 of file aodv-rqueue.h.
Referenced by Dequeue(), DropPacketWithDst(), Enqueue(), Find(), GetSize(), and Purge().
|
private |
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
Definition at line 130 of file aodv-rqueue.h.
Referenced by Enqueue(), GetQueueTimeout(), and SetQueueTimeout().