class for keeping the data sent by the application to the TCP socket, i.e. the sending buffer. More...
#include <tcp-tx-buffer.h>
Public Member Functions | |
TcpTxBuffer (uint32_t n=0) | |
virtual | ~TcpTxBuffer (void) |
bool | Add (Ptr< Packet > p) |
uint32_t | Available (void) const |
Ptr< Packet > | CopyFromSequence (uint32_t numBytes, const SequenceNumber32 &seq) |
void | DiscardUpTo (const SequenceNumber32 &seq) |
SequenceNumber32 | HeadSequence (void) const |
uint32_t | MaxBufferSize (void) const |
void | SetHeadSequence (const SequenceNumber32 &seq) |
void | SetMaxBufferSize (uint32_t n) |
uint32_t | Size (void) const |
uint32_t | SizeFromSequence (const SequenceNumber32 &seq) const |
SequenceNumber32 | TailSequence (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) |
Private Types | |
typedef std::list< Ptr< Packet > >::iterator | BufIterator |
Private Attributes | |
std::list< Ptr< Packet > > | m_data |
TracedValue< SequenceNumber32 > | m_firstByteSeq |
uint32_t | m_maxBuffer |
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 keeping the data sent by the application to the TCP socket, i.e. the sending buffer.
Definition at line 40 of file tcp-tx-buffer.h.
|
private |
Definition at line 111 of file tcp-tx-buffer.h.
ns3::TcpTxBuffer::TcpTxBuffer | ( | uint32_t | n = 0 | ) |
Definition at line 55 of file tcp-tx-buffer.cc.
|
virtual |
Definition at line 60 of file tcp-tx-buffer.cc.
Append a data packet to the end of the buffer
p | The packet to be appended to the Tx buffer |
Definition at line 101 of file tcp-tx-buffer.cc.
References Available(), ns3::Packet::GetSize(), m_data, m_firstByteSeq, m_size, 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
Definition at line 95 of file tcp-tx-buffer.cc.
References m_maxBuffer, and m_size.
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)
Definition at line 133 of file tcp-tx-buffer.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::CreateFragment(), ns3::TracedValue< T >::Get(), ns3::Packet::GetSize(), m_data, m_firstByteSeq, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and SizeFromSequence().
Referenced by ns3::TcpSocketBase::PersistTimeout(), and ns3::TcpSocketBase::SendDataPacket().
void ns3::TcpTxBuffer::DiscardUpTo | ( | const SequenceNumber32 & | seq | ) |
Discard data up to but not including this sequence number.
seq | The sequence number of the head byte |
Definition at line 208 of file tcp-tx-buffer.cc.
References ns3::TracedValue< T >::Get(), m_data, m_firstByteSeq, m_maxBuffer, m_size, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by ns3::TcpSocketBase::NewAck().
|
static |
Reimplemented from ns3::Object.
Definition at line 36 of file tcp-tx-buffer.cc.
References m_firstByteSeq, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
SequenceNumber32 ns3::TcpTxBuffer::HeadSequence | ( | void | ) | const |
Returns the first byte's sequence number
Definition at line 65 of file tcp-tx-buffer.cc.
References m_firstByteSeq.
Referenced by ns3::TcpSocketBase::BytesInFlight(), ns3::TcpSocketBase::DoRetransmit(), ns3::TcpTahoe::DupAck(), ns3::TcpNewReno::NewAck(), ns3::TcpSocketBase::NewAck(), ns3::TcpSocketBase::ReceivedAck(), ns3::TcpNewReno::Retransmit(), ns3::TcpReno::Retransmit(), ns3::TcpTahoe::Retransmit(), ns3::TcpSocketBase::Retransmit(), ns3::TcpSocketBase::ReTxTimeout(), ns3::TcpSocketBase::SendPendingData(), and ns3::TcpSocketBase::UnAckDataCount().
uint32_t ns3::TcpTxBuffer::MaxBufferSize | ( | void | ) | const |
Returns the Tx window size
Definition at line 83 of file tcp-tx-buffer.cc.
References m_maxBuffer.
Referenced by ns3::TcpSocketBase::GetSndBufSize().
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.
Definition at line 201 of file tcp-tx-buffer.cc.
References m_firstByteSeq, and NS_LOG_FUNCTION.
Referenced by ns3::TcpSocketBase::ProcessSynRcvd(), and ns3::TcpSocketBase::ProcessSynSent().
void ns3::TcpTxBuffer::SetMaxBufferSize | ( | uint32_t | n | ) |
Set the Tx window size
Definition at line 89 of file tcp-tx-buffer.cc.
References m_maxBuffer.
Referenced by ns3::TcpSocketBase::SetSndBufSize().
uint32_t ns3::TcpTxBuffer::Size | ( | void | ) | const |
Returns total number of bytes in this Tx buffer
Definition at line 77 of file tcp-tx-buffer.cc.
References m_size.
Referenced by ns3::TcpSocketBase::DoRetransmit(), ns3::TcpSocketBase::NewAck(), 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)
Definition at line 121 of file tcp-tx-buffer.cc.
References m_firstByteSeq, m_size, 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
Definition at line 71 of file tcp-tx-buffer.cc.
References m_firstByteSeq, and m_size.
Definition at line 116 of file tcp-tx-buffer.h.
Referenced by Add(), CopyFromSequence(), and DiscardUpTo().
|
private |
Definition at line 113 of file tcp-tx-buffer.h.
Referenced by Add(), CopyFromSequence(), DiscardUpTo(), GetTypeId(), HeadSequence(), SetHeadSequence(), SizeFromSequence(), and TailSequence().
|
private |
Definition at line 115 of file tcp-tx-buffer.h.
Referenced by Available(), DiscardUpTo(), MaxBufferSize(), and SetMaxBufferSize().
|
private |
Definition at line 114 of file tcp-tx-buffer.h.
Referenced by Add(), Available(), DiscardUpTo(), Size(), SizeFromSequence(), and TailSequence().