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