35 #include "ns3/ipv4-route.h"
36 #include "ns3/socket.h"
55 for (std::vector<SendBuffEntry>::const_iterator i =
m_sendBuffer.begin (); i
90 for (std::vector<SendBuffEntry>::iterator i =
m_sendBuffer.begin (); i
95 Drop (*i,
"DropPacketWithDst");
111 if (i->GetDestination () == dst)
128 for (std::vector<SendBuffEntry>::const_iterator i =
m_sendBuffer.begin (); i
131 if (i->GetDestination () == dst)
158 for (std::vector<SendBuffEntry>::iterator i =
m_sendBuffer.begin (); i
164 Drop (*i,
"Drop out-dated packet ");
bool operator()(ErrorBuffEntry const &e) const
Time m_sendBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
NS_LOG_COMPONENT_DEFINE("DsrSendBuffer")
bool Find(Ipv4Address dst)
Check if a packet with destination dst exists in the queue.
void Drop(SendBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
uint32_t GetSize()
Number of entries.
#define NS_LOG_FUNCTION(parameters)
uint64_t GetUid(void) const
A packet is allocated a new uid when it is created empty or with zero-filled payload.
uint32_t GetSize(void) const
Ipv4Address GetDestination() const
void Purge()
Remove all expired entries.
bool Dequeue(Ipv4Address dst, SendBuffEntry &entry)
Return first found (the earliest) entry for the given destination.
#define NS_LOG_LOGIC(msg)
Ptr< const Packet > GetPacket() const
void SetExpireTime(Time exp)
Ipv4 addresses are stored in host order in this class.
#define NS_LOG_DEBUG(msg)
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
std::vector< SendBuffEntry > m_sendBuffer
The send buffer to cache unsent packet.
static bool IsEqual(SendBuffEntry en, const Ipv4Address dst)
Check if the send buffer entry is the same or not.
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
bool Enqueue(SendBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
Time GetExpireTime() const