class for the reordering buffer that keeps the data from lower layer, i.e. TcpL4Protocol, sent to the application More...
#include <tcp-rx-buffer.h>
Public Types | |
typedef std::map < SequenceNumber32, Ptr < Packet > >::iterator | BufIterator |
Public Member Functions | |
TcpRxBuffer (uint32_t n=0) | |
virtual | ~TcpRxBuffer () |
bool | Add (Ptr< Packet > p, TcpHeader const &tcph) |
uint32_t | Available () const |
Ptr< Packet > | Extract (uint32_t maxSize) |
bool | Finished (void) |
void | IncNextRxSequence (void) |
uint32_t | MaxBufferSize (void) const |
SequenceNumber32 | MaxRxSequence (void) const |
SequenceNumber32 | NextRxSequence (void) const |
void | SetFinSequence (const SequenceNumber32 &s) |
void | SetMaxBufferSize (uint32_t s) |
void | SetNextRxSequence (const SequenceNumber32 &s) |
uint32_t | Size (void) const |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Object. |
Public Attributes | |
uint32_t | m_availBytes |
std::map< SequenceNumber32, Ptr< Packet > > | m_data |
SequenceNumber32 | m_finSeq |
bool | m_gotFin |
uint32_t | m_maxBuffer |
TracedValue< SequenceNumber32 > | m_nextRxSeq |
uint32_t | m_size |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
class for the reordering buffer that keeps the data from lower layer, i.e. TcpL4Protocol, sent to the application
Definition at line 40 of file tcp-rx-buffer.h.
typedef std::map<SequenceNumber32, Ptr<Packet> >::iterator ns3::TcpRxBuffer::BufIterator |
Definition at line 76 of file tcp-rx-buffer.h.
ns3::TcpRxBuffer::TcpRxBuffer | ( | uint32_t | n = 0 | ) |
Definition at line 50 of file tcp-rx-buffer.cc.
|
virtual |
Definition at line 55 of file tcp-rx-buffer.cc.
Insert a packet into the buffer and update the availBytes counter to reflect the number of bytes ready to send to the application. This function handles overlap by triming the head of the inputted packet and removing data from the buffer that overlaps the tail of the inputted packet
Definition at line 137 of file tcp-rx-buffer.cc.
References ns3::Packet::CreateFragment(), ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), m_availBytes, m_data, m_finSeq, m_gotFin, m_maxBuffer, m_nextRxSeq, m_size, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and visualizer.core::start().
Referenced by ns3::TcpSocketBase::ReceivedData().
uint32_t ns3::TcpRxBuffer::Available | ( | ) | const |
Definition at line 90 of file tcp-rx-buffer.cc.
References m_availBytes.
Referenced by ns3::TcpSocketBase::GetRxAvailable(), and ns3::TcpSocketBase::ReceivedData().
Extract data from the head of the buffer as indicated by nextRxSeq. The extracted data is going to be forwarded to the application.
Definition at line 220 of file tcp-rx-buffer.cc.
References m_availBytes, m_data, m_nextRxSeq, m_size, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by ns3::TcpSocketBase::Recv().
bool ns3::TcpRxBuffer::Finished | ( | void | ) |
Definition at line 131 of file tcp-rx-buffer.cc.
References m_finSeq, m_gotFin, and m_nextRxSeq.
Referenced by ns3::TcpSocketBase::PeerClose(), ns3::TcpSocketBase::ProcessEstablished(), ns3::TcpSocketBase::ProcessWait(), and ns3::TcpSocketBase::ReceivedData().
|
static |
This method returns the TypeId associated to ns3::Object.
No Attributes defined for this type.
No TraceSources defined for this type.
Reimplemented from ns3::Object.
Definition at line 31 of file tcp-rx-buffer.cc.
References m_nextRxSeq, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
void ns3::TcpRxBuffer::IncNextRxSequence | ( | void | ) |
Definition at line 96 of file tcp-rx-buffer.cc.
References m_nextRxSeq, m_size, NS_ASSERT, and NS_LOG_FUNCTION.
uint32_t ns3::TcpRxBuffer::MaxBufferSize | ( | void | ) | const |
Definition at line 72 of file tcp-rx-buffer.cc.
References m_maxBuffer.
Referenced by ns3::TcpSocketBase::AdvertisedWindowSize(), and ns3::TcpSocketBase::GetRcvBufSize().
SequenceNumber32 ns3::TcpRxBuffer::MaxRxSequence | ( | void | ) | const |
Definition at line 107 of file tcp-rx-buffer.cc.
References m_data, m_finSeq, m_gotFin, m_maxBuffer, and m_nextRxSeq.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::TcpSocketBase::OutOfRange(), and ns3::TcpSocketBase::PeerClose().
SequenceNumber32 ns3::TcpRxBuffer::NextRxSequence | ( | void | ) | const |
Definition at line 60 of file tcp-rx-buffer.cc.
References m_nextRxSeq.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::TcpSocketBase::OutOfRange(), ns3::TcpSocketBase::PeerClose(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::ProcessClosing(), ns3::TcpSocketBase::ProcessLastAck(), ns3::TcpSocketBase::ProcessSynRcvd(), ns3::TcpSocketBase::ReceivedData(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendEmptyPacket().
void ns3::TcpRxBuffer::SetFinSequence | ( | const SequenceNumber32 & | s | ) |
Definition at line 121 of file tcp-rx-buffer.cc.
References m_finSeq, m_gotFin, m_nextRxSeq, and NS_LOG_FUNCTION.
Referenced by ns3::TcpSocketBase::PeerClose(), and ns3::TcpSocketBase::ProcessWait().
void ns3::TcpRxBuffer::SetMaxBufferSize | ( | uint32_t | s | ) |
Definition at line 78 of file tcp-rx-buffer.cc.
References m_maxBuffer.
Referenced by ns3::TcpSocketBase::SetRcvBufSize().
void ns3::TcpRxBuffer::SetNextRxSequence | ( | const SequenceNumber32 & | s | ) |
Definition at line 66 of file tcp-rx-buffer.cc.
References m_nextRxSeq.
Referenced by ns3::TcpSocketBase::CompleteFork(), ns3::TcpSocketBase::ProcessSynRcvd(), and ns3::TcpSocketBase::ProcessSynSent().
uint32_t ns3::TcpRxBuffer::Size | ( | void | ) | const |
Definition at line 84 of file tcp-rx-buffer.cc.
References m_size.
Referenced by ns3::TcpSocketBase::AdvertisedWindowSize(), ns3::TcpSocketBase::Close(), ns3::TcpSocketBase::ReceivedData(), and ns3::TcpSocketBase::Recv().
uint32_t ns3::TcpRxBuffer::m_availBytes |
Definition at line 82 of file tcp-rx-buffer.h.
Referenced by Add(), Available(), and Extract().
std::map<SequenceNumber32, Ptr<Packet> > ns3::TcpRxBuffer::m_data |
Definition at line 83 of file tcp-rx-buffer.h.
Referenced by Add(), Extract(), and MaxRxSequence().
SequenceNumber32 ns3::TcpRxBuffer::m_finSeq |
Definition at line 78 of file tcp-rx-buffer.h.
Referenced by Add(), Finished(), MaxRxSequence(), and SetFinSequence().
bool ns3::TcpRxBuffer::m_gotFin |
Definition at line 79 of file tcp-rx-buffer.h.
Referenced by Add(), Finished(), MaxRxSequence(), and SetFinSequence().
uint32_t ns3::TcpRxBuffer::m_maxBuffer |
Definition at line 81 of file tcp-rx-buffer.h.
Referenced by Add(), MaxBufferSize(), MaxRxSequence(), and SetMaxBufferSize().
TracedValue<SequenceNumber32> ns3::TcpRxBuffer::m_nextRxSeq |
Definition at line 77 of file tcp-rx-buffer.h.
Referenced by Add(), Extract(), Finished(), GetTypeId(), IncNextRxSequence(), MaxRxSequence(), NextRxSequence(), SetFinSequence(), and SetNextRxSequence().
uint32_t ns3::TcpRxBuffer::m_size |
Definition at line 80 of file tcp-rx-buffer.h.
Referenced by Add(), Extract(), IncNextRxSequence(), and Size().