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)
Set next hop address function.
void DropLink(DsrPassiveBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
Time GetExpireTime() const
Get expire time.
uint32_t GetSize()
Number of entries.
Time GetPassiveBufferTimeout() const
Get passive buffer timeout.
uint16_t m_fragmentOffset
Fragment offset.
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
void SetExpireTime(Time exp)
Set expire time.
static bool LinkEqual(DsrPassiveBuffEntry en, const std::vector< Ipv4Address > link)
Check if the send buffer entry is the same or not.
uint16_t GetFragmentOffset() const
Get fragment offset function.
std::vector< DsrPassiveBuffEntry > m_passiveBuffer
The send buffer to cache unsent packet.
void SetDestination(Ipv4Address d)
Set destination address function.
void SetProtocol(uint8_t p)
Set protocol function.
uint8_t GetProtocol() const
Get protocol.
void SetPassiveBufferTimeout(Time t)
Set passive buffer timeout.
uint16_t m_identification
Identification.
uint32_t GetMaxQueueLen() const
Get maximum queue length.
bool operator==(DsrPassiveBuffEntry const &o) const
Compare send buffer entries.
void Purge()
Remove all expired entries.
void SetFragmentOffset(uint16_t f)
Set fragment offset function.
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)
void SetMaxQueueLen(uint32_t len)
Set maximum queue length.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ipv4Address GetSource() const
Get source address function.
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 m_expire
Expire time for queue entry.
uint16_t GetIdentification() const
Get identification function.
uint8_t m_segsLeft
Segments left.
static Time Now(void)
Return the current simulation virtual time.
void SetSegsLeft(uint8_t seg)
Set segments left.
Ipv4Address GetNextHop() const
Get next hop address function.
void SetSource(Ipv4Address s)
Set surce address function.
uint8_t GetSegsLeft() const
Get segments left function.
Ipv4 addresses are stored in host order in this class.
virtual ~DsrPassiveBuffer()
void SetPacket(Ptr< const Packet > p)
Set packet function.
Ipv4Address m_source
Source address.
Ptr< const Packet > GetPacket() const
Get packet function.
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.
void SetIdentification(uint16_t i)
Set identification function.
uint8_t m_protocol
The protocol number.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
a unique identifier for an interface.
static TypeId GetTypeId()
Get the type ID.
Ipv4Address GetDestination() const
Get destination address function.