22#include "ns3/ipv4-route.h"
24#include "ns3/socket.h"
101 if (i->GetNextHopAddress() == nextHop)
117 if (i->GetNextHopAddress() == nextHop)
172 if (i->GetInsertedTimeStamp() +
m_maxDelay > now)
Ipv4 addresses are stored in host order in this class.
A base class which provides memory management and object aggregation.
static Time Now()
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void SetInsertedTimeStamp(Time time)
Set inserted time stamp function.
void Flush()
Clear the queue.
uint32_t m_maxSize
Maximum queue size.
uint32_t GetMaxNetworkSize() const
Return the maximum queue size.
bool FindPacketWithNexthop(Ipv4Address nextHop, DsrNetworkQueueEntry &entry)
Find the packet entry with a given next hop.
uint32_t GetSize()
Number of entries.
void SetMaxNetworkDelay(Time delay)
Set the maximum entry lifetime in the queue.
bool Enqueue(DsrNetworkQueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
static TypeId GetTypeId()
Get the type ID.
std::vector< DsrNetworkQueueEntry > m_dsrNetworkQueue
Queue (vector) of entries.
Time m_maxDelay
Maximum entry lifetime.
void Cleanup()
Clean the queue by removing entries that exceeded lifetime.
void SetMaxNetworkSize(uint32_t maxSize)
Set the maximum queue size.
uint32_t m_size
Current queue size.
bool Find(Ipv4Address nextHop)
Try to find an entry with a particular next hop, and return true if found.
Time GetMaxNetworkDelay() const
Return the maximum entry lifetime for this queue.
~DsrNetworkQueue() override
bool Dequeue(DsrNetworkQueueEntry &entry)
Return first found (the earliest) entry for given destination.
#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 ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.