|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
32 #ifndef DSR_SENDBUFF_H
33 #define DSR_SENDBUFF_H
36 #include "ns3/ipv4-routing-protocol.h"
37 #include "ns3/simulator.h"
Ipv4Address m_dst
Destination address.
Time m_sendBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
void SetExpireTime(Time exp)
Set expire time for entry.
Time m_expire
Expire time for queue entry.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool Enqueue(DsrSendBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
void SetPacket(Ptr< const Packet > p)
Set pointer to entry's packet.
std::vector< DsrSendBuffEntry > & GetBuffer()
Return a pointer to the internal queue.
Ipv4 addresses are stored in host order in this class.
uint8_t GetProtocol() const
Get protocol value.
void Drop(DsrSendBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
Ptr< const Packet > m_packet
Data packet.
Ipv4Address GetDestination() const
Get destination address of entry.
bool Find(Ipv4Address dst)
Check if a packet with destination dst exists in the queue.
std::vector< DsrSendBuffEntry > m_sendBuffer
The send buffer to cache unsent packet.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
DsrSendBuffer()
Default constructor.
uint32_t GetMaxQueueLen() const
Return the maximum queue length.
Simulation virtual time values and global simulation resolution.
bool Dequeue(Ipv4Address dst, DsrSendBuffEntry &entry)
Return first found (the earliest) entry for the given destination.
uint32_t GetSize()
Number of entries.
void SetSendBufferTimeout(Time t)
Set the entry lifetime in the queue.
void Purge()
Remove all expired entries.
Control the scheduling of simulation events.
void SetDestination(Ipv4Address d)
Set destination address of entry.
void SetProtocol(uint8_t p)
Set protocol value.
Time GetSendBufferTimeout() const
Return the entry lifetime in the queue.
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
uint8_t m_protocol
The protocol number.
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
void SetMaxQueueLen(uint32_t len)
Set the maximum queue length.
DsrSendBuffEntry(Ptr< const Packet > pa=0, Ipv4Address d=Ipv4Address(), Time exp=Simulator::Now(), uint8_t p=0)
Construct DsrSendBuffEntry with the given parameters.
Ptr< const Packet > GetPacket() const
Get pointer to entry's packet.
bool operator==(DsrSendBuffEntry const &o) const
Compare send buffer entries.
Time GetExpireTime() const
Get expire time for entry.