35 #include "ns3/ipv4-route.h"
36 #include "ns3/socket.h"
50 .AddConstructor<PassiveBuffer> ()
74 for (std::vector<PassiveBuffEntry>::const_iterator i =
m_passiveBuffer.begin (); i
107 for (std::vector<PassiveBuffEntry>::iterator i =
m_passiveBuffer.begin (); i
117 && (i->GetSegsLeft () == entry.
GetSegsLeft () + 1))
135 if (i->GetDestination () == dst)
152 for (std::vector<PassiveBuffEntry>::const_iterator i =
m_passiveBuffer.begin (); i
155 if (i->GetDestination () == dst)
182 for (std::vector<PassiveBuffEntry>::iterator i =
m_passiveBuffer.begin (); i
188 Drop (*i,
"Drop out-dated packet ");
bool operator()(ErrorBuffEntry const &e) const
void SetExpireTime(Time exp)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
DSR Passive Buffer Entry.
uint64_t GetUid(void) const
Returns the packet's Uid.
void Purge()
Remove all expired entries.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
uint16_t GetFragmentOffset() const
bool Enqueue(PassiveBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
bool Dequeue(Ipv4Address dst, PassiveBuffEntry &entry)
Return first found (the earliest) entry for given destination.
uint32_t GetSize()
Number of entries.
static TypeId GetTypeId()
Ipv4Address GetSource() const
bool AllEqual(PassiveBuffEntry &entry)
Check if all the entries in passive buffer entry is all equal or not.
Time m_passiveBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
uint8_t GetSegsLeft() const
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
uint16_t GetIdentification() const
void DropLink(PassiveBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
std::vector< PassiveBuffEntry > m_passiveBuffer
The send buffer to cache unsent packet.
void Drop(PassiveBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
Time GetExpireTime() const
Ipv4 addresses are stored in host order in this class.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const Packet > GetPacket() const
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
a base class which provides memory management and object aggregation
Ipv4Address GetDestination() const
Ipv4Address GetNextHop() const
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)