|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
32 #ifndef DSDV_PACKETQUEUE_H
33 #define DSDV_PACKETQUEUE_H
36 #include "ns3/ipv4-routing-protocol.h"
37 #include "ns3/simulator.h"
uint32_t GetSize()
Get the number of entries.
uint32_t GetMaxPacketsPerDst() const
Get maximum packets per destination.
std::vector< QueueEntry > m_queue
the queue
Ipv4Header m_header
IP header.
Time GetExpireTime() const
Get expire time.
Time m_expire
Expire time for queue entry.
UnicastForwardCallback m_ucb
Unicast forward callback.
Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback
Unicast forward call back function typedef.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetMaxPacketsPerDst(uint32_t len)
Set maximum packets per destination.
uint32_t GetCountForPacketsWithDst(Ipv4Address dst)
Get count of packets with destination dst in the queue.
Time GetQueueTimeout() const
Get queue timeout.
Ipv4 addresses are stored in host order in this class.
Time m_queueTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
ErrorCallback GetErrorCallback() const
Get error callback function.
void SetQueueTimeout(Time t)
Set queue timeout.
Ipv4RoutingProtocol::ErrorCallback ErrorCallback
Error callback function typedef.
void SetIpv4Header(Ipv4Header h)
Set IP header.
Ipv4Header GetIpv4Header() const
Get IP header.
ErrorCallback m_ecb
Error callback.
Simulation virtual time values and global simulation resolution.
QueueEntry(Ptr< const Packet > pa=0, Ipv4Header const &h=Ipv4Header(), UnicastForwardCallback ucb=UnicastForwardCallback(), ErrorCallback ecb=ErrorCallback())
c-tor
PacketQueue()
Default c-tor.
void SetExpireTime(Time exp)
Set expire time.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.
void SetMaxQueueLen(uint32_t len)
Set maximum queue length.
void SetPacket(Ptr< const Packet > p)
Set packet.
Ptr< const Packet > GetPacket() const
Get packet.
Time Seconds(double value)
Construct a Time in the indicated unit.
uint32_t GetMaxQueueLen() const
Get maximum queue length.
void SetUnicastForwardCallback(UnicastForwardCallback ucb)
Set unicast forward callback function.
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
void Purge()
Remove all expired entries.
uint32_t m_maxLenPerDst
The maximum number of packets that we allow per destination to buffer.
UnicastForwardCallback GetUnicastForwardCallback() const
Get unicast forward callback function.
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
void SetErrorCallback(ErrorCallback ecb)
Set error callback function.
void Drop(QueueEntry en, std::string reason)
Notify that the packet is dropped from queue due to timeout.
bool operator==(QueueEntry const &o) const
Compare queue entries.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
Ptr< const Packet > m_packet
Data packet.