ns-3
ns3::TcpTxBuffer Class Reference

class for keeping the data sent by the application to the TCP socket, i.e. the sending buffer. More...

#include <tcp-tx-buffer.h>

Inheritance diagram for ns3::TcpTxBuffer:
Collaboration diagram for ns3::TcpTxBuffer:

List of all members.

Public Member Functions

 TcpTxBuffer (uint32_t n=0)
SequenceNumber32 HeadSequence (void) const
SequenceNumber32 TailSequence (void) const
uint32_t Size (void) const
uint32_t MaxBufferSize (void) const
void SetMaxBufferSize (uint32_t n)
uint32_t Available (void) const
bool Add (Ptr< Packet > p)
uint32_t SizeFromSequence (const SequenceNumber32 &seq) const
Ptr< PacketCopyFromSequence (uint32_t numBytes, const SequenceNumber32 &seq)
void SetHeadSequence (const SequenceNumber32 &seq)
void DiscardUpTo (const SequenceNumber32 &seq)
- 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.

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 keeping the data sent by the application to the TCP socket, i.e. the sending buffer.


Member Function Documentation

bool ns3::TcpTxBuffer::Add ( Ptr< Packet p)

Append a data packet to the end of the buffer

Parameters:
pThe packet to be appended to the Tx buffer
Returns:
Boolean to indicate success

References Available(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

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

uint32_t ns3::TcpTxBuffer::Available ( void  ) const

Returns the available capacity in this Tx window

Referenced by Add(), and ns3::TcpSocketBase::GetTxAvailable().

Ptr< Packet > ns3::TcpTxBuffer::CopyFromSequence ( uint32_t  numBytes,
const SequenceNumber32 seq 
)

Copy data of size numBytes into a packet, data from the range [seq, seq+numBytes)

References ns3::Packet::AddAtEnd(), ns3::Packet::CreateFragment(), ns3::Packet::GetSize(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and SizeFromSequence().

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

void ns3::TcpTxBuffer::DiscardUpTo ( const SequenceNumber32 seq)

Discard data up to but not including this sequence number.

Parameters:
seqThe sequence number of the head byte

References NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

TypeId ns3::TcpTxBuffer::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().

uint32_t ns3::TcpTxBuffer::MaxBufferSize ( void  ) const

Returns the Tx window size

void ns3::TcpTxBuffer::SetHeadSequence ( const SequenceNumber32 seq)

Set the m_firstByteSeq to seq. Supposed to be called only when the connection is just set up and we did not send any data out yet.

References NS_LOG_FUNCTION.

Referenced by ns3::TcpSocketBase::ProcessSynRcvd(), and ns3::TcpSocketBase::ProcessSynSent().

void ns3::TcpTxBuffer::SetMaxBufferSize ( uint32_t  n)

Set the Tx window size

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

uint32_t ns3::TcpTxBuffer::Size ( void  ) const

Returns total number of bytes in this Tx buffer

Referenced by ns3::TcpSocketBase::ProcessWait(), ns3::TcpSocketBase::Send(), and ns3::TcpSocketBase::SendPendingData().

uint32_t ns3::TcpTxBuffer::SizeFromSequence ( const SequenceNumber32 seq) const

Returns the number of bytes from the buffer in the range [seq, tailSequence)

References NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::TcpSocketBase::Close(), CopyFromSequence(), ns3::TcpNewReno::DupAck(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendPendingData().

SequenceNumber32 ns3::TcpTxBuffer::TailSequence ( void  ) const

Returns the last byte's sequence number + 1


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