20#ifndef DSR_NETWORK_QUEUE_H
21#define DSR_NETWORK_QUEUE_H
25#include "ns3/ipv4-header.h"
26#include "ns3/ipv4-routing-protocol.h"
27#include "ns3/simulator.h"
Ipv4 addresses are stored in host order in this class.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Ptr< Ipv4Route > GetIpv4Route() const
Get IP route function.
Ptr< Ipv4Route > m_ipv4Route
Ipv4Route.
bool operator==(const DsrNetworkQueueEntry &o) const
Compare send buffer entries.
Ipv4Address m_srcAddr
source address
Ptr< const Packet > GetPacket() const
Get packet function.
Ipv4Address GetSourceAddress() const
Get source address function.
void SetIpv4Route(Ptr< Ipv4Route > route)
Set IP route function.
void SetNextHopAddress(Ipv4Address addr)
Set next hop address function.
DsrNetworkQueueEntry(Ptr< const Packet > pa=nullptr, Ipv4Address s=Ipv4Address(), Ipv4Address n=Ipv4Address(), Time exp=Simulator::Now(), Ptr< Ipv4Route > r=nullptr)
Construct a DsrNetworkQueueEntry with the given parameters.
void SetInsertedTimeStamp(Time time)
Set inserted time stamp function.
void SetSourceAddress(Ipv4Address addr)
Set source address function.
Ipv4Address m_nextHopAddr
next hop address
Ipv4Address GetNextHopAddress() const
Get next hop address function.
void SetPacket(Ptr< const Packet > p)
Set packet function.
Time GetInsertedTimeStamp() const
Get inserted time stamp function.
Ptr< const Packet > m_packet
Data packet.
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.
std::vector< DsrNetworkQueueEntry > & GetQueue()
Return the current queue entry.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.