31 #include "ns3/ipv4-route.h"
32 #include "ns3/socket.h"
52 for (std::vector<QueueEntry>::const_iterator i =
m_queue.begin (); i
56 && (i->GetIpv4Header ().GetDestination ()
63 Drop (
m_queue.front (),
"Drop the most aged packet");
75 for (std::vector<QueueEntry>::iterator i =
m_queue.begin (); i
80 Drop (*i,
"DropPacketWithDst ");
91 for (std::vector<QueueEntry>::iterator i =
m_queue.begin (); i !=
m_queue.end (); ++i)
93 if (i->GetIpv4Header ().GetDestination () == dst)
106 for (std::vector<QueueEntry>::const_iterator i =
m_queue.begin (); i
109 if (i->GetIpv4Header ().GetDestination () == dst)
128 for (std::vector<QueueEntry>::iterator i =
m_queue.begin (); i
133 Drop (*i,
"Drop outdated packet ");
#define NS_LOG_FUNCTION(parameters)
Ipv4Header GetIpv4Header() const
void Drop(QueueEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
uint64_t GetUid(void) const
A packet is allocated a new uid when it is created empty or with zero-filled payload.
void SetExpireTime(Time exp)
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
std::vector< QueueEntry > m_queue
Ptr< const Packet > GetPacket() const
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
#define NS_LOG_LOGIC(msg)
NS_LOG_COMPONENT_DEFINE("AodvRequestQueue")
ErrorCallback GetErrorCallback() const
uint32_t GetSize()
Number of entries.
Time m_queueTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
Time GetExpireTime() const
Ipv4 addresses are stored in host order in this class.
void Purge()
Remove all expired entries.
static bool IsEqual(QueueEntry en, const Ipv4Address dst)
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
bool operator()(QueueEntry const &e) const
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.