32 #include "ns3/ipv4-routing-protocol.h"
33 #include "ns3/simulator.h"
66 UnicastForwardCallback GetUnicastForwardCallback ()
const {
return m_ucb; }
67 void SetUnicastForwardCallback (UnicastForwardCallback ucb) {
m_ucb = ucb; }
68 ErrorCallback GetErrorCallback ()
const {
return m_ecb; }
69 void SetErrorCallback (ErrorCallback ecb) {
m_ecb = ecb; }
70 Ptr<const Packet> GetPacket ()
const {
return m_packet; }
71 void SetPacket (Ptr<const Packet> p) {
m_packet = p; }
72 Ipv4Header GetIpv4Header ()
const {
return m_header; }
73 void SetIpv4Header (Ipv4Header h) {
m_header = h; }
115 uint32_t GetMaxQueueLen ()
const {
return m_maxLen; }
116 void SetMaxQueueLen (uint32_t len) {
m_maxLen = len; }
122 std::vector<QueueEntry> m_queue;
126 void Drop (QueueEntry en, std::string reason);
Control the scheduling of simulation events.
AODV route request queue.
void Drop(QueueEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
QueueEntry(Ptr< const Packet > pa=0, Ipv4Header const &h=Ipv4Header(), UnicastForwardCallback ucb=UnicastForwardCallback(), ErrorCallback ecb=ErrorCallback(), Time exp=Simulator::Now())
c-tor
UnicastForwardCallback m_ucb
Unicast forward callback.
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
bool operator==(QueueEntry const &o) const
Time m_expire
Expire time for queue entry.
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
Ptr< const Packet > m_packet
Data packet.
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.
ErrorCallback m_ecb
Error callback.
Ipv4Header m_header
IP header.
Ipv4 addresses are stored in host order in this class.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
void Purge()
Remove all expired entries.
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
RequestQueue(uint32_t maxLen, Time routeToQueueTimeout)
Default c-tor.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.