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