18#include "ns3/ipv4-route.h"
20#include "ns3/socket.h"
45 if ((
i->GetPacket()->GetUid() ==
entry.GetPacket()->GetUid()) &&
46 (
i->GetIpv4Header().GetDestination() ==
entry.GetIpv4Header().GetDestination()))
68 if (
i->GetIpv4Header().GetDestination() == dst)
70 Drop(*
i,
"DropPacketWithDst ");
74 return en.GetIpv4Header().GetDestination() == dst;
85 if (
i->GetIpv4Header().GetDestination() == dst)
100 if (
i->GetIpv4Header().GetDestination() == dst)
133 Drop(*
i,
"Drop outdated packet ");
142 NS_LOG_LOGIC(reason <<
en.GetPacket()->GetUid() <<
" " <<
en.GetIpv4Header().GetDestination());
Ipv4 addresses are stored in host order in this class.
bool IsStrictlyNegative() const
Exactly equivalent to t < 0.
Time GetExpireTime() const
Get expire time.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.
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.
void Purge()
Remove all expired entries.
std::vector< QueueEntry > m_queue
The queue.
Time m_queueTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
void Drop(QueueEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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 ",...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator()(const QueueEntry &e) const
Check if the entry is expired.