31 #include "ns3/ipv4-route.h" 32 #include "ns3/socket.h" 51 for (std::vector<QueueEntry>::const_iterator i =
m_queue.begin (); i
55 && (i->GetIpv4Header ().GetDestination ()
64 Drop (
m_queue.front (),
"Drop the most aged packet");
76 for (std::vector<QueueEntry>::iterator i =
m_queue.begin (); i
81 Drop (*i,
"DropPacketWithDst ");
92 for (std::vector<QueueEntry>::iterator i =
m_queue.begin (); i !=
m_queue.end (); ++i)
94 if (i->GetIpv4Header ().GetDestination () == dst)
107 for (std::vector<QueueEntry>::const_iterator i =
m_queue.begin (); i
110 if (i->GetIpv4Header ().GetDestination () == dst)
140 for (std::vector<QueueEntry>::iterator i =
m_queue.begin (); i
145 Drop (*i,
"Drop outdated packet ");
uint64_t GetUid(void) const
Returns the packet's Uid.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
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.
bool operator()(QueueEntry const &e) const
Check if the entry is expired.
void SetExpireTime(Time exp)
Set expire time.
Time GetExpireTime() const
Get expire time.
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
The queue.
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time m_queueTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
Ipv4 addresses are stored in host order in this class.
Ipv4Header GetIpv4Header() const
Get IPv4 header.
void Purge()
Remove all expired entries.
static bool IsEqual(QueueEntry en, const Ipv4Address dst)
Determine if queue matches a destination address.
ErrorCallback GetErrorCallback() const
Get error callback.
Time Seconds(double value)
Construct a Time in the indicated unit.
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.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.
Ptr< const Packet > GetPacket() const
Get packet from entry.