32 #ifndef DSR_NETWORK_QUEUE_H 33 #define DSR_NETWORK_QUEUE_H 36 #include "ns3/ipv4-routing-protocol.h" 37 #include "ns3/simulator.h" 38 #include "ns3/ipv4-header.h" Simulation virtual time values and global simulation resolution.
DsrNetworkQueueEntry(Ptr< const Packet > pa=0, Ipv4Address s=Ipv4Address(), Ipv4Address n=Ipv4Address(), Time exp=Simulator::Now(), Ptr< Ipv4Route > r=0)
Construct a DsrNetworkQueueEntry with the given parameters.
uint32_t GetSize()
Number of entries.
bool Enqueue(DsrNetworkQueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
uint32_t m_maxSize
Maximum queue size.
Introspection did not find any typical Config paths.
void SetPacket(Ptr< const Packet > p)
Set packet function.
bool Dequeue(DsrNetworkQueueEntry &entry)
Return first found (the earliest) entry for given destination.
Ipv4Address GetNextHopAddress() const
Get next hop address function.
Time GetMaxNetworkDelay(void) const
Return the maximum entry lifetime for this queue.
Ptr< const Packet > m_packet
Data packet.
void SetIpv4Route(Ptr< Ipv4Route > route)
Set IP route function.
uint32_t GetMaxNetworkSize(void) const
Return the maximum queue size.
void SetMaxNetworkDelay(Time delay)
Set the maximum entry lifetime in the queue.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< Ipv4Route > m_ipv4Route
Ipv4Route.
Ipv4Address m_srcAddr
source address
static Time Now(void)
Return the current simulation virtual time.
std::vector< DsrNetworkQueueEntry > & GetQueue()
Return the current queue entry.
bool FindPacketWithNexthop(Ipv4Address nextHop, DsrNetworkQueueEntry &entry)
Find the packet entry with a given next hop.
void Cleanup(void)
Clean the queue by removing entries that exceeded lifetime.
uint32_t m_size
Current queue size.
void SetInsertedTimeStamp(Time time)
Set inserted time stamp function.
Ipv4 addresses are stored in host order in this class.
void SetSourceAddress(Ipv4Address addr)
Set source address function.
void Flush(void)
Clear the queue.
std::vector< DsrNetworkQueueEntry > m_dsrNetworkQueue
Queue (vector) of entries.
Time m_maxDelay
Maximum entry lifetime.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< Ipv4Route > GetIpv4Route() const
Get IP route function.
void SetMaxNetworkSize(uint32_t maxSize)
Set the maximum queue size.
Time GetInsertedTimeStamp(void) const
Get inserted time stamp function.
A base class which provides memory management and object aggregation.
bool operator==(DsrNetworkQueueEntry const &o) const
Compare send buffer entries.
Ptr< const Packet > GetPacket() const
Get packet function.
a unique identifier for an interface.
Ipv4Address m_nextHopAddr
next hop address
bool Find(Ipv4Address nextHop)
Try to find an entry with a particular next hop, and return true if found.
void SetNextHopAddress(Ipv4Address addr)
Set next hop address function.
Ipv4Address GetSourceAddress() const
Get source address function.