ns-3
ns3::TcpRxBuffer Class Reference

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>

Inheritance diagram for ns3::TcpRxBuffer:
Collaboration diagram for ns3::TcpRxBuffer:

List of all members.

Public Types

typedef std::map
< SequenceNumber32, Ptr
< Packet > >::iterator 
BufIterator

Public Member Functions

 TcpRxBuffer (uint32_t n=0)
SequenceNumber32 NextRxSequence (void) const
SequenceNumber32 MaxRxSequence (void) const
void IncNextRxSequence (void)
void SetNextRxSequence (const SequenceNumber32 &s)
void SetFinSequence (const SequenceNumber32 &s)
uint32_t MaxBufferSize (void) const
void SetMaxBufferSize (uint32_t s)
uint32_t Size (void) const
uint32_t Available () const
bool Finished (void)
bool Add (Ptr< Packet > p, TcpHeader const &tcph)
Ptr< PacketExtract (uint32_t maxSize)
- Public Member Functions inherited from ns3::Object
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Dispose (void)
void AggregateObject (Ptr< Object > other)
AggregateIterator GetAggregateIterator (void) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const
- Public Member Functions inherited from ns3::ObjectBase
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
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

TracedValue< SequenceNumber32m_nextRxSeq
SequenceNumber32 m_finSeq
bool m_gotFin
uint32_t m_size
uint32_t m_maxBuffer
uint32_t m_availBytes
std::map< SequenceNumber32,
Ptr< Packet > > 
m_data

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
virtual void NotifyNewAggregate (void)
virtual void DoStart (void)
virtual void DoDispose (void)
 Object (const Object &o)

Detailed Description

class for the reordering buffer that keeps the data from lower layer, i.e. TcpL4Protocol, sent to the application


Member Function Documentation

bool ns3::TcpRxBuffer::Add ( Ptr< Packet p,
TcpHeader const &  tcph 
)

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

Returns:
True when success, false otherwise.

References ns3::Packet::CreateFragment(), ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Ptr< Packet > ns3::TcpRxBuffer::Extract ( uint32_t  maxSize)

Extract data from the head of the buffer as indicated by nextRxSeq. The extracted data is going to be forwarded to the application.

References NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::TcpSocketBase::Recv().

TypeId ns3::TcpRxBuffer::GetTypeId ( void  )
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.

References ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().


The documentation for this class was generated from the following files: