21#include "ns3/ipv4-route.h"
23#include "ns3/socket.h"
57 NS_LOG_DEBUG(
"Number of packets with this destination: " << numPacketswithdst);
61 NS_LOG_DEBUG(
"Max packets reached for this destination. Not queuing any further packets");
80 if (i->GetIpv4Header().GetDestination() == dst)
82 Drop(*i,
"DropPacketWithDst ");
86 return en.GetIpv4Header().GetDestination() == dst;
98 if (i->GetIpv4Header().GetDestination() == dst)
113 if (i->GetIpv4Header().GetDestination() == dst)
128 if (i->GetIpv4Header().GetDestination() == dst)
163 Drop(*i,
"Drop outdated packet ");
Ipv4 addresses are stored in host order in this class.
uint64_t GetUid() const
Returns the packet's Uid.
std::vector< QueueEntry > m_queue
the queue
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
uint32_t GetSize()
Get the number of entries.
void Drop(QueueEntry en, std::string reason)
Notify that the packet is dropped from queue due to timeout.
uint32_t GetCountForPacketsWithDst(Ipv4Address dst)
Get count of packets with destination dst in the queue.
uint32_t m_maxLenPerDst
The maximum number of packets that we allow per destination to buffer.
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
void Purge()
Remove all expired entries.
Time m_queueTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
Ptr< const Packet > GetPacket() const
Get packet.
void SetExpireTime(Time exp)
Set expire time.
Time GetExpireTime() const
Get expire time.
Ipv4Header GetIpv4Header() const
Get IP header.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator()(const QueueEntry &e) const
Check for expired entry.