DSR maintain buffer. More...
#include "dsr-maintain-buff.h"
Public Member Functions | |
| DsrMaintainBuffer () | |
| Default constructor. | |
| bool | AllEqual (DsrMaintainBuffEntry &entry) |
| Verify if all the elements in the maintenance buffer entry is the same. | |
| bool | Dequeue (Ipv4Address dst, DsrMaintainBuffEntry &entry) |
| Return first found (the earliest) entry for given destination. | |
| void | DropPacketWithNextHop (Ipv4Address nextHop) |
| Remove all packets with next hop IP address dst. | |
| bool | Enqueue (DsrMaintainBuffEntry &entry) |
| Push entry in queue, if there is no entry with the same packet and destination address in queue. | |
| bool | Find (Ipv4Address nextHop) |
| Finds whether a packet with next hop dst exists in the queue. | |
| Time | GetMaintainBufferTimeout () const |
| Get maintain buffer timeout. | |
| uint32_t | GetMaxQueueLen () const |
| Get maximum queue length. | |
| uint32_t | GetSize () |
| Number of entries. | |
| bool | LinkEqual (DsrMaintainBuffEntry &entry) |
| Verify if the maintain buffer entry is the same in every field for link ack. | |
| bool | NetworkEqual (DsrMaintainBuffEntry &entry) |
| Verify if the maintain buffer entry is the same in every field for network ack. | |
| bool | PromiscEqual (DsrMaintainBuffEntry &entry) |
| Verify if the maintain buffer entry is the same in every field for promiscuous ack. | |
| void | SetMaintainBufferTimeout (Time t) |
| Set maintain buffer timeout. | |
| void | SetMaxQueueLen (uint32_t len) |
| Set maximum queue length. | |
Private Member Functions | |
| void | Purge () |
| Remove all expired entries. | |
Private Attributes | |
| std::vector< NetworkKey > | m_allNetworkKey |
| The vector of network keys. | |
| std::vector< DsrMaintainBuffEntry > | m_maintainBuffer |
| The vector of maintain buffer entries. | |
| Time | m_maintainBufferTimeout |
| The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds. | |
| uint32_t | m_maxLen |
| The maximum number of packets that we allow a routing protocol to buffer. | |
DSR maintain buffer.
Definition at line 408 of file dsr-maintain-buff.h.
|
inline |
Default constructor.
Definition at line 414 of file dsr-maintain-buff.h.
| bool ns3::dsr::DsrMaintainBuffer::AllEqual | ( | DsrMaintainBuffEntry & | entry | ) |
Verify if all the elements in the maintenance buffer entry is the same.
| entry | The Entry to check |
Definition at line 124 of file dsr-maintain-buff.cc.
References ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), and m_maintainBuffer.
| bool ns3::dsr::DsrMaintainBuffer::Dequeue | ( | Ipv4Address | dst, |
| DsrMaintainBuffEntry & | entry ) |
Return first found (the earliest) entry for given destination.
| [in] | dst | Entry destination |
| [out] | entry | The Entry found (if any). |
Definition at line 93 of file dsr-maintain-buff.cc.
References ns3::dsr::DsrMaintainBuffEntry::GetPacket(), m_maintainBuffer, NS_LOG_DEBUG, and Purge().
| void ns3::dsr::DsrMaintainBuffer::DropPacketWithNextHop | ( | Ipv4Address | nextHop | ) |
Remove all packets with next hop IP address dst.
| nextHop | Next hop in the route. |
Definition at line 79 of file dsr-maintain-buff.cc.
References m_maintainBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, and Purge().
| bool ns3::dsr::DsrMaintainBuffer::Enqueue | ( | DsrMaintainBuffEntry & | entry | ) |
Push entry in queue, if there is no entry with the same packet and destination address in queue.
| entry | Maintain Buffer Entry |
Definition at line 45 of file dsr-maintain-buff.cc.
References ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), m_maintainBuffer, m_maintainBufferTimeout, m_maxLen, NS_LOG_DEBUG, Purge(), and ns3::dsr::DsrMaintainBuffEntry::SetExpireTime().
| bool ns3::dsr::DsrMaintainBuffer::Find | ( | Ipv4Address | nextHop | ) |
Finds whether a packet with next hop dst exists in the queue.
| nextHop | Next hop in the route. |
Definition at line 110 of file dsr-maintain-buff.cc.
References m_maintainBuffer, and NS_LOG_DEBUG.
|
inline |
Get maintain buffer timeout.
Definition at line 462 of file dsr-maintain-buff.h.
References m_maintainBufferTimeout.
|
inline |
Get maximum queue length.
Definition at line 444 of file dsr-maintain-buff.h.
References m_maxLen.
| uint32_t ns3::dsr::DsrMaintainBuffer::GetSize | ( | ) |
Number of entries.
Definition at line 38 of file dsr-maintain-buff.cc.
References m_maintainBuffer, and Purge().
| bool ns3::dsr::DsrMaintainBuffer::LinkEqual | ( | DsrMaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for link ack.
| entry | The Entry to check |
Definition at line 197 of file dsr-maintain-buff.cc.
References ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), m_maintainBuffer, and NS_LOG_DEBUG.
| bool ns3::dsr::DsrMaintainBuffer::NetworkEqual | ( | DsrMaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for network ack.
| entry | The Entry to check |
Definition at line 148 of file dsr-maintain-buff.cc.
References ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), and m_maintainBuffer.
| bool ns3::dsr::DsrMaintainBuffer::PromiscEqual | ( | DsrMaintainBuffEntry & | entry | ) |
Verify if the maintain buffer entry is the same in every field for promiscuous ack.
| entry | The Entry to check |
Definition at line 172 of file dsr-maintain-buff.cc.
References ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), m_maintainBuffer, and NS_LOG_DEBUG.
|
private |
Remove all expired entries.
Definition at line 236 of file dsr-maintain-buff.cc.
References m_maintainBuffer, and NS_LOG_DEBUG.
Referenced by Dequeue(), DropPacketWithNextHop(), Enqueue(), and GetSize().
|
inline |
Set maintain buffer timeout.
| t | the maintain buffer timeout |
Definition at line 471 of file dsr-maintain-buff.h.
References m_maintainBufferTimeout.
|
inline |
Set maximum queue length.
| len | the maximum queue length |
Definition at line 453 of file dsr-maintain-buff.h.
References m_maxLen.
|
private |
The vector of network keys.
Definition at line 499 of file dsr-maintain-buff.h.
|
private |
The vector of maintain buffer entries.
Definition at line 497 of file dsr-maintain-buff.h.
Referenced by AllEqual(), Dequeue(), DropPacketWithNextHop(), Enqueue(), Find(), GetSize(), LinkEqual(), NetworkEqual(), PromiscEqual(), and Purge().
|
private |
The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
Definition at line 506 of file dsr-maintain-buff.h.
Referenced by Enqueue(), GetMaintainBufferTimeout(), and SetMaintainBufferTimeout().
|
private |
The maximum number of packets that we allow a routing protocol to buffer.
Definition at line 503 of file dsr-maintain-buff.h.
Referenced by Enqueue(), GetMaxQueueLen(), and SetMaxQueueLen().