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