|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
32 #ifndef DSR_ERRORBUFF_H
33 #define DSR_ERRORBUFF_H
36 #include "ns3/ipv4-routing-protocol.h"
37 #include "ns3/simulator.h"
Ipv4Address GetNextHop() const
Get next hop.
uint8_t m_protocol
The protocol number.
void Purge()
Remove all expired entries.
Ipv4Address GetDestination() const
Get destination address.
void DropLink(DsrErrorBuffEntry en, std::string reason)
Notify that packet is dropped from queue by link error.
Ptr< const Packet > GetPacket() const
Get packet from 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 operator==(DsrErrorBuffEntry const &o) const
Compare send buffer entries.
Ipv4Address m_nextHop
Nexthop address.
Ptr< const Packet > m_packet
Data packet.
void SetExpireTime(Time exp)
Set expire time.
void SetProtocol(uint8_t p)
Set protocol number.
Ipv4 addresses are stored in host order in this class.
void SetSource(Ipv4Address s)
Set source address.
bool Dequeue(Ipv4Address dst, DsrErrorBuffEntry &entry)
Return first found (the earliest) entry for given destination.
uint32_t GetMaxQueueLen() const
Get maximum queue length.
std::vector< DsrErrorBuffEntry > & GetBuffer()
Get error buffer entry.
DsrErrorBuffer()
Default constructor.
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
void SetErrorBufferTimeout(Time t)
Set error buffer timeout.
DsrErrorBuffEntry(Ptr< const Packet > pa=0, Ipv4Address d=Ipv4Address(), Ipv4Address s=Ipv4Address(), Ipv4Address n=Ipv4Address(), Time exp=Simulator::Now(), uint8_t p=0)
Create an DsrErrorBuffEntry with the given parameters.
Time m_errorBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Ipv4Address m_dst
Destination address.
uint32_t GetSize()
Returns the number of entries in the queue.
void Drop(DsrErrorBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
void SetNextHop(Ipv4Address n)
Set next hop.
void SetMaxQueueLen(uint32_t len)
Set maximum queue length.
void SetPacket(Ptr< const Packet > p)
Set packet for entry.
Ipv4Address m_source
Source address.
Simulation virtual time values and global simulation resolution.
Time m_expire
Expire time for queue entry.
Ipv4Address GetSource() const
Get source address.
void DropPacketForErrLink(Ipv4Address source, Ipv4Address nextHop)
Remove all packets with the error link.
void SetDestination(Ipv4Address d)
Set destination address.
Time GetErrorBufferTimeout() const
Get error buffer timeout.
Control the scheduling of simulation events.
std::vector< DsrErrorBuffEntry > m_errorBuffer
The send buffer to cache unsent packet.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
uint8_t GetProtocol() const
Get protocol number.
Time GetExpireTime() const
Get expire time.
bool Enqueue(DsrErrorBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.