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.
uint8_t GetSegsLeft() const
Get segments left.
Time GetMaintainBufferTimeout() const
Get maintain buffer timeout.
Ipv4Address m_ourAdd
local address
Simulation virtual time values and global simulation resolution.
Control the scheduling of simulation events.
uint16_t m_ackId
acknowledge ID
void SetMaxQueueLen(uint32_t len)
Set maximum queue length.
Ipv4Address m_source
source address
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
destination address
void SetDst(Ipv4Address n)
Set destination address.
void DropPacketWithNextHop(Ipv4Address nextHop)
Remove all packets with next hop IP address dst.
Ipv4Address GetDst() const
Get destination address.
bool AllEqual(DsrMaintainBuffEntry &entry)
Verify if all the elements in the maintenance buffer entry is the same.
void SetNextHop(Ipv4Address n)
Set next hop of entry.
Ipv4Address m_source
source address
void SetSegsLeft(uint8_t segs)
Set segments left.
bool operator<(const NetworkKey &o) const
Compare maintain Buffer entries.
Ipv4Address m_nextHop
next hop
Ipv4Address m_destination
destination address
Ipv4Address m_destination
destination address
uint16_t m_ackId
The data ack id.
uint32_t GetSize()
Number of entries.
uint8_t m_segsLeft
segments left
bool Find(Ipv4Address nextHop)
Finds whether a packet with next hop dst exists in the queue.
bool operator<(const LinkKey &o) const
Compare maintain Buffer entries.
uint8_t m_segsLeft
The segments left field.
Ipv4Address m_ourAdd
Our own ip address.
std::vector< NetworkKey > m_allNetworkKey
The vector of network keys.
Ptr< const Packet > GetPacket() const
Get packet.
Ipv4Address GetSrc() const
Get source address.
bool PromiscEqual(DsrMaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for promiscuous ack.
Ipv4Address m_nextHop
next hop address
void SetExpireTime(Time exp)
Set expiration time.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetMaintainBufferTimeout(Time t)
Set maintain buffer timeout.
void SetAckId(uint16_t ackId)
Set acknowledge ID.
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.
Ipv4Address m_source
source address
Time GetExpireTime() const
Get expiration time.
void Purge()
Remove all expired entries.
void SetOurAdd(Ipv4Address us)
Set local address of entry.
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 GetOurAdd() const
Get local address of entry.
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)
Set packet.
Ipv4 addresses are stored in host order in this class.
Ipv4Address GetNextHop() const
Get next hop of entry.
Time m_expire
Expire time for queue entry.
bool operator<(const PassiveKey &o) const
Compare maintain Buffer entries.
bool Enqueue(DsrMaintainBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
uint16_t m_ackId
acknowledge ID
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.
Ipv4Address m_ourAdd
local address
void SetSrc(Ipv4Address s)
Set source address.
uint16_t GetAckId() const
Get acknowledge ID.
uint32_t GetMaxQueueLen() const
Get maximum queue length.
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.