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