|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
32 #ifndef DSR_PASSIVEBUFF_H
33 #define DSR_PASSIVEBUFF_H
36 #include "ns3/ipv4-routing-protocol.h"
37 #include "ns3/simulator.h"
a unique identifier for an interface.
uint8_t m_segsLeft
Segments left.
void SetNextHop(Ipv4Address n)
Set next hop address function.
std::vector< DsrPassiveBuffEntry > m_passiveBuffer
The send buffer to cache unsent packet.
DSR Passive Buffer Entry.
void Drop(DsrPassiveBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static bool LinkEqual(DsrPassiveBuffEntry en, const std::vector< Ipv4Address > link)
Check if the send buffer entry is the same or not.
Ptr< const Packet > GetPacket() const
Get packet function.
void SetPacket(Ptr< const Packet > p)
Set packet function.
Time m_expire
Expire time for queue entry.
void SetSource(Ipv4Address s)
Set surce address function.
DsrPassiveBuffEntry(Ptr< const Packet > pa=0, Ipv4Address d=Ipv4Address(), Ipv4Address s=Ipv4Address(), Ipv4Address n=Ipv4Address(), uint16_t i=0, uint16_t f=0, uint8_t seg=0, Time exp=Simulator::Now(), uint8_t p=0)
Construct a DsrPassiveBuffEntry with the given parameters.
uint32_t GetSize()
Number of entries.
Ipv4 addresses are stored in host order in this class.
uint16_t m_identification
Identification.
void SetExpireTime(Time exp)
Set expire time.
Ipv4Address m_source
Source address.
static TypeId GetTypeId()
Get the type ID.
void SetSegsLeft(uint8_t seg)
Set segments left.
Ptr< const Packet > m_packet
Data packet.
Time GetPassiveBufferTimeout() const
Get passive buffer timeout.
uint8_t GetSegsLeft() const
Get segments left function.
bool operator==(DsrPassiveBuffEntry const &o) const
Compare send buffer entries.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
A base class which provides memory management and object aggregation.
Ipv4Address GetNextHop() const
Get next hop address function.
Time GetExpireTime() const
Get expire time.
uint8_t GetProtocol() const
Get protocol.
Simulation virtual time values and global simulation resolution.
bool Enqueue(DsrPassiveBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
void SetMaxQueueLen(uint32_t len)
Set maximum queue length.
void SetFragmentOffset(uint16_t f)
Set fragment offset function.
void SetDestination(Ipv4Address d)
Set destination address function.
uint16_t m_fragmentOffset
Fragment offset.
void SetProtocol(uint8_t p)
Set protocol function.
virtual ~DsrPassiveBuffer()
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
void SetPassiveBufferTimeout(Time t)
Set passive buffer timeout.
uint8_t m_protocol
The protocol number.
Control the scheduling of simulation events.
double f(double x, void *params)
void SetIdentification(uint16_t i)
Set identification function.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
void DropLink(DsrPassiveBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
uint16_t GetFragmentOffset() const
Get fragment offset function.
void Purge()
Remove all expired entries.
uint32_t GetMaxQueueLen() const
Get maximum queue length.
Ipv4Address GetSource() const
Get source address function.
Time m_passiveBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
bool Dequeue(Ipv4Address dst, DsrPassiveBuffEntry &entry)
Return first found (the earliest) entry for given destination.
uint16_t GetIdentification() const
Get identification function.
Ipv4Address m_dst
Destination address.
bool AllEqual(DsrPassiveBuffEntry &entry)
Check if all the entries in passive buffer entry is all equal or not.
Ipv4Address GetDestination() const
Get destination address function.
Ipv4Address m_nextHop
Nexthop address.