22#include "ns3/ipv4-route.h"
24#include "ns3/socket.h"
81 if ((
i->GetPacket()->GetUid() ==
entry.GetPacket()->GetUid()) &&
82 (
i->GetSource() ==
entry.GetSource()) && (
i->GetNextHop() ==
entry.GetNextHop()) &&
83 (
i->GetDestination() ==
entry.GetDestination()) &&
84 (
i->GetIdentification() ==
entry.GetIdentification()) &&
85 (
i->GetFragmentOffset() ==
entry.GetFragmentOffset()) &&
86 (
i->GetSegsLeft() ==
entry.GetSegsLeft() + 1))
122 if ((
i->GetPacket()->GetUid() ==
entry.GetPacket()->GetUid()) &&
123 (
i->GetSource() ==
entry.GetSource()) && (
i->GetNextHop() ==
entry.GetNextHop()) &&
124 (
i->GetDestination() ==
entry.GetDestination()) &&
125 (
i->GetIdentification() ==
entry.GetIdentification()) &&
126 (
i->GetFragmentOffset() ==
entry.GetFragmentOffset()) &&
127 (
i->GetSegsLeft() ==
entry.GetSegsLeft() + 1))
146 if (
i->GetDestination() == dst)
165 if (
i->GetDestination() == dst)
202 Drop(*
i,
"Drop out-dated packet ");
212 NS_LOG_LOGIC(reason <<
en.GetPacket()->GetUid() <<
" " <<
en.GetDestination());
220 NS_LOG_LOGIC(reason <<
en.GetPacket()->GetUid() <<
" " <<
en.GetSource() <<
" "
Ipv4 addresses are stored in host order in this class.
A base class which provides memory management and object aggregation.
bool IsStrictlyNegative() const
Exactly equivalent to t < 0.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
DSR Passive Buffer Entry.
Time GetExpireTime() const
Get expire time.
bool Enqueue(DsrPassiveBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
uint32_t GetSize()
Number of entries.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
bool Dequeue(Ipv4Address dst, DsrPassiveBuffEntry &entry)
Return first found (the earliest) entry for given destination.
void DropLink(DsrPassiveBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
~DsrPassiveBuffer() override
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
Time m_passiveBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
void Purge()
Remove all expired entries.
std::vector< DsrPassiveBuffEntry > m_passiveBuffer
The send buffer to cache unsent packet.
void Drop(DsrPassiveBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
static TypeId GetTypeId()
Get the type ID.
bool AllEqual(DsrPassiveBuffEntry &entry)
Check if all the entries in passive buffer entry is all equal or not.
#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_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
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 DsrPassiveBuffEntry &e) const
Check for an expired entry.