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