DSR error buffer. More...
#include <dsr-errorbuff.h>
Public Member Functions | |
ErrorBuffer () | |
Default constructor. More... | |
bool | Dequeue (Ipv4Address dst, ErrorBuffEntry &entry) |
Return first found (the earliest) entry for given destination. More... | |
void | DropPacketForErrLink (Ipv4Address source, Ipv4Address nextHop) |
Remove all packets with the error link. More... | |
bool | Enqueue (ErrorBuffEntry &entry) |
Push entry in queue, if there is no entry with the same packet and destination address in queue. More... | |
bool | Find (Ipv4Address dst) |
Finds whether a packet with destination dst exists in the queue. More... | |
std::vector< ErrorBuffEntry > & | GetBuffer () |
uint32_t | GetSize () |
Number of entries. More... | |
Fields | |
uint32_t | GetMaxQueueLen () const |
void | SetMaxQueueLen (uint32_t len) |
Time | GetErrorBufferTimeout () const |
void | SetErrorBufferTimeout (Time t) |
Private Member Functions | |
void | Drop (ErrorBuffEntry en, std::string reason) |
Notify that packet is dropped from queue by timeout. More... | |
void | DropLink (ErrorBuffEntry en, std::string reason) |
Notify that packet is dropped from queue by timeout. More... | |
void | Purge () |
Remove all expired entries. More... | |
Static Private Member Functions | |
static bool | LinkEqual (ErrorBuffEntry en, const std::vector< Ipv4Address > link) |
Check if the send buffer entry is the same or not. More... | |
Private Attributes | |
std::vector< ErrorBuffEntry > | m_errorBuffer |
The send buffer to cache unsent packet. More... | |
Time | m_errorBufferTimeout |
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds. More... | |
uint32_t | m_maxLen |
The maximum number of packets that we allow a routing protocol to buffer. More... | |
DSR error buffer.
Definition at line 148 of file dsr-errorbuff.h.
|
inline |
Default constructor.
Definition at line 154 of file dsr-errorbuff.h.
bool ns3::dsr::ErrorBuffer::Dequeue | ( | Ipv4Address | dst, |
ErrorBuffEntry & | entry | ||
) |
Return first found (the earliest) entry for given destination.
Definition at line 108 of file dsr-errorbuff.cc.
References ns3::dsr::ErrorBuffEntry::GetPacket(), ns3::Packet::GetSize(), m_errorBuffer, NS_LOG_DEBUG, and Purge().
Referenced by ns3::dsr::DsrRouting::SendPacketFromBuffer().
|
private |
Notify that packet is dropped from queue by timeout.
Definition at line 177 of file dsr-errorbuff.cc.
References ns3::dsr::ErrorBuffEntry::GetDestination(), ns3::dsr::ErrorBuffEntry::GetPacket(), ns3::Packet::GetUid(), and NS_LOG_LOGIC.
Referenced by Enqueue(), and Purge().
|
private |
Notify that packet is dropped from queue by timeout.
Definition at line 186 of file dsr-errorbuff.cc.
References ns3::dsr::ErrorBuffEntry::GetNextHop(), ns3::dsr::ErrorBuffEntry::GetPacket(), ns3::dsr::ErrorBuffEntry::GetSource(), ns3::Packet::GetUid(), and NS_LOG_LOGIC.
Referenced by DropPacketForErrLink().
void ns3::dsr::ErrorBuffer::DropPacketForErrLink | ( | Ipv4Address | source, |
Ipv4Address | nextHop | ||
) |
Remove all packets with the error link.
Definition at line 84 of file dsr-errorbuff.cc.
References DropLink(), LinkEqual(), list, m_errorBuffer, NS_LOG_FUNCTION, and Purge().
Referenced by ns3::dsr::DsrRouting::AddRoute(), and ns3::dsr::DsrRouting::AddRoute_Link().
bool ns3::dsr::ErrorBuffer::Enqueue | ( | ErrorBuffEntry & | entry | ) |
Push entry in queue, if there is no entry with the same packet and destination address in queue.
Definition at line 52 of file dsr-errorbuff.cc.
References Drop(), ns3::dsr::ErrorBuffEntry::GetDestination(), ns3::dsr::ErrorBuffEntry::GetNextHop(), ns3::dsr::ErrorBuffEntry::GetPacket(), ns3::dsr::ErrorBuffEntry::GetSource(), ns3::Packet::GetUid(), m_errorBuffer, m_errorBufferTimeout, m_maxLen, NS_LOG_INFO, Purge(), and ns3::dsr::ErrorBuffEntry::SetExpireTime().
Referenced by ns3::dsr::DsrRouting::SendUnreachError().
bool ns3::dsr::ErrorBuffer::Find | ( | Ipv4Address | dst | ) |
Finds whether a packet with destination dst exists in the queue.
Definition at line 128 of file dsr-errorbuff.cc.
References m_errorBuffer, and NS_LOG_DEBUG.
Referenced by ns3::dsr::DsrRouting::SendPacketFromBuffer().
|
inline |
Definition at line 187 of file dsr-errorbuff.h.
References m_errorBuffer.
|
inline |
Definition at line 177 of file dsr-errorbuff.h.
References m_errorBufferTimeout.
|
inline |
Definition at line 169 of file dsr-errorbuff.h.
References m_maxLen.
uint32_t ns3::dsr::ErrorBuffer::GetSize | ( | ) |
Number of entries.
Definition at line 45 of file dsr-errorbuff.cc.
References m_errorBuffer, and Purge().
Referenced by ns3::dsr::DsrRouting::SendPacketFromBuffer().
|
inlinestaticprivate |
Check if the send buffer entry is the same or not.
Definition at line 206 of file dsr-errorbuff.h.
References ns3::dsr::ErrorBuffEntry::GetNextHop(), and ns3::dsr::ErrorBuffEntry::GetSource().
Referenced by DropPacketForErrLink().
|
private |
Remove all expired entries.
Definition at line 156 of file dsr-errorbuff.cc.
References Drop(), m_errorBuffer, and NS_LOG_DEBUG.
Referenced by Dequeue(), DropPacketForErrLink(), Enqueue(), and GetSize().
|
inline |
Definition at line 181 of file dsr-errorbuff.h.
References m_errorBufferTimeout.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 173 of file dsr-errorbuff.h.
References m_maxLen.
Referenced by ns3::dsr::DsrRouting::Start().
|
private |
The send buffer to cache unsent packet.
Definition at line 194 of file dsr-errorbuff.h.
Referenced by Dequeue(), DropPacketForErrLink(), Enqueue(), Find(), GetBuffer(), GetSize(), and Purge().
|
private |
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
Definition at line 204 of file dsr-errorbuff.h.
Referenced by Enqueue(), GetErrorBufferTimeout(), and SetErrorBufferTimeout().
|
private |
The maximum number of packets that we allow a routing protocol to buffer.
Definition at line 202 of file dsr-errorbuff.h.
Referenced by Enqueue(), GetMaxQueueLen(), and SetMaxQueueLen().