32 #ifndef DSR_MAINTAIN_BUFF_H
33 #define DSR_MAINTAIN_BUFF_H
36 #include "ns3/ipv4-routing-protocol.h"
37 #include "ns3/simulator.h"
38 #include "ns3/ipv4-header.h"
DsrMaintainBuffer()
Default constructor.
Simulation virtual time values and global simulation resolution.
Ipv4Address GetDst() const
Control the scheduling of simulation events.
uint8_t GetSegsLeft() const
Ipv4Address GetOurAdd() const
void SetMaxQueueLen(uint32_t len)
bool NetworkEqual(DsrMaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for network ack.
DSR Maintain Buffer Entry.
Ipv4Address m_destination
Ipv4Address GetSrc() const
void SetDst(Ipv4Address n)
void DropPacketWithNextHop(Ipv4Address nextHop)
Remove all packets with destination IP address dst.
bool AllEqual(DsrMaintainBuffEntry &entry)
Verify if all the elements in the maintainence buffer entry is the same.
uint16_t GetAckId() const
void SetNextHop(Ipv4Address n)
Ipv4Address GetNextHop() const
void SetSegsLeft(uint8_t segs)
Ipv4Address m_destination
bool operator<(const NetworkKey &o) const
Compare maintain Buffer entries.
Ipv4Address m_destination
uint16_t m_ackId
The data ack id.
uint32_t GetSize()
Number of entries.
bool Find(Ipv4Address nextHop)
Finds whether a packet with destination dst exists in the queue.
uint8_t m_segsLeft
The segments left field.
Ptr< const Packet > GetPacket() const
Ipv4Address m_ourAdd
Our own ip address.
std::vector< NetworkKey > m_allNetworkKey
bool PromiscEqual(DsrMaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for promiscuous ack.
void SetExpireTime(Time exp)
The maintenance buffer is responsible for maintaining packet next hop delivery The data packet is sav...
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
void SetMaintainBufferTimeout(Time t)
void SetAckId(uint16_t ackId)
Time m_maintainBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
static bool IsEqual(DsrMaintainBuffEntry en, const Ipv4Address nextHop)
Verify if the maintain buffer is equal or not.
void Purge()
Remove all expired entries.
void SetOurAdd(Ipv4Address us)
std::vector< DsrMaintainBuffEntry > m_maintainBuffer
The vector of maintain buffer entries.
Ipv4Address m_src
The source address.
static Time Now(void)
Return the current simulation virtual time.
Ipv4Address m_nextHop
Next hop Ip address.
bool Dequeue(Ipv4Address dst, DsrMaintainBuffEntry &entry)
Return first found (the earliest) entry for given destination.
void SetPacket(Ptr< const Packet > p)
bool operator<(const PassiveKey &o) const
Compare maintain Buffer entries.
Ipv4 addresses are stored in host order in this class.
Time m_expire
Expire time for queue entry.
bool Enqueue(DsrMaintainBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
bool operator<(const LinkKey &o) const
Compare maintain Buffer entries.
bool LinkEqual(DsrMaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for link ack.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Ptr< const Packet > m_packet
Data packet.
Ipv4Address m_dst
The destination address.
uint32_t GetMaxQueueLen() const
Time GetExpireTime() const
void SetSrc(Ipv4Address s)
Time GetMaintainBufferTimeout() const
DsrMaintainBuffEntry(Ptr< const Packet > pa=0, Ipv4Address us=Ipv4Address(), Ipv4Address n=Ipv4Address(), Ipv4Address s=Ipv4Address(), Ipv4Address dst=Ipv4Address(), uint16_t ackId=0, uint8_t segs=0, Time exp=Simulator::Now())
Construct a DsrMaintainBuffEntry with the given parameters.