35 #include "ns3/ipv4-route.h"
36 #include "ns3/socket.h"
55 for (std::vector<MaintainBuffEntry>::const_iterator i =
m_maintainBuffer.begin (); i
63 if ((i->GetNextHop () == entry.
GetNextHop ()) && (i->GetOurAdd () == entry.
GetOurAdd ()) && (i->GetSrc () == entry.
GetSrc ())
64 && (i->GetDst () == entry.
GetDst ()) && (i->GetAckId () == entry.
GetAckId ()) && (i->GetSegsLeft () == entry.
GetSegsLeft ()))
86 NS_LOG_INFO (
"Drop Packet With next hop " << nextHop);
97 if (i->GetNextHop () == nextHop)
111 for (std::vector<MaintainBuffEntry>::const_iterator i =
m_maintainBuffer.begin (); i
114 if (i->GetNextHop () == nextHop)
116 NS_LOG_DEBUG (
"Found the packet in maintenance buffer");
126 for (std::vector<MaintainBuffEntry>::iterator i =
m_maintainBuffer.begin (); i
134 && (i->GetSrc () == entry.
GetSrc ()) && (i->GetDst () == entry.
GetDst ())
147 for (std::vector<MaintainBuffEntry>::iterator i =
m_maintainBuffer.begin (); i
155 && (i->GetSrc () == entry.
GetSrc ()) && (i->GetDst () == entry.
GetDst ())
156 && (i->GetAckId () == entry.
GetAckId ()))
169 for (std::vector<MaintainBuffEntry>::iterator i =
m_maintainBuffer.begin (); i
177 if ((i->GetSrc () == entry.
GetSrc ()) && (i->GetDst () == entry.
GetDst ())
192 for (std::vector<MaintainBuffEntry>::iterator i =
m_maintainBuffer.begin (); i
200 if ((i->GetSrc () == entry.
GetSrc ()) && (i->GetDst () == entry.
GetDst ()) && (i->GetOurAdd () == entry.
GetOurAdd ())
bool operator()(ErrorBuffEntry const &e) const
void SetExpireTime(Time exp)
bool NetworkEqual(MaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for network ack.
#define NS_LOG_FUNCTION(parameters)
static bool IsEqual(MaintainBuffEntry en, const Ipv4Address nextHop)
Verify if the maintain buffer is equal or not.
Time GetExpireTime() const
uint32_t GetSize(void) const
bool AllEqual(MaintainBuffEntry &entry)
Verify if all the elements in the maintainence buffer entry is the same.
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.
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 PromiscEqual(MaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for promiscuous ack.
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.
NS_LOG_COMPONENT_DEFINE("DsrMaintainBuffer")
Ipv4Address GetDst() const
DSR Maintain Buffer Entry.
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.
#define NS_LOG_DEBUG(msg)
void Purge()
Remove all expired entries.
Ptr< const Packet > GetPacket() const
bool Dequeue(Ipv4Address dst, MaintainBuffEntry &entry)
Return first found (the earliest) entry for given destination.
uint8_t GetSegsLeft() const
std::vector< MaintainBuffEntry > m_maintainBuffer
The vector of maintain buffer entries.
Ipv4Address GetNextHop() const