class for keeping the data sent by the application to the TCP socket, i.e. More...
#include "tcp-tx-buffer.h"
Public Member Functions | |
TcpTxBuffer (uint32_t n=0) | |
Constructor. More... | |
virtual | ~TcpTxBuffer (void) |
bool | Add (Ptr< Packet > p) |
Append a data packet to the end of the buffer. More... | |
uint32_t | Available (void) const |
Returns the available capacity in this Tx window. More... | |
Ptr< Packet > | CopyFromSequence (uint32_t numBytes, const SequenceNumber32 &seq) |
Copy data of size numBytes into a packet, data from the range [seq, seq+numBytes) More... | |
void | DiscardUpTo (const SequenceNumber32 &seq) |
Discard data up to but not including this sequence number. More... | |
SequenceNumber32 | HeadSequence (void) const |
Returns the first byte's sequence number. More... | |
uint32_t | MaxBufferSize (void) const |
Returns the Tx window size. More... | |
void | SetHeadSequence (const SequenceNumber32 &seq) |
Set the m_firstByteSeq to seq. More... | |
void | SetMaxBufferSize (uint32_t n) |
Set the Tx window size. More... | |
uint32_t | Size (void) const |
Returns total number of bytes in this Tx buffer. More... | |
uint32_t | SizeFromSequence (const SequenceNumber32 &seq) const |
Returns the number of bytes from the buffer in the range [seq, tailSequence) More... | |
SequenceNumber32 | TailSequence (void) const |
Returns the last byte's sequence number + 1. More... | |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Implement the GetInstanceTypeId method defined in ObjectBase. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Types | |
typedef std::list< Ptr< Packet > >::iterator | BufIterator |
container for data stored in the buffer More... | |
Private Attributes | |
std::list< Ptr< Packet > > | m_data |
Corresponding data (may be null) More... | |
TracedValue< SequenceNumber32 > | m_firstByteSeq |
Sequence number of the first byte in data (SND.UNA) More... | |
uint32_t | m_maxBuffer |
Max number of data bytes in buffer (SND.WND) More... | |
uint32_t | m_size |
Number of data bytes. More... | |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
class for keeping the data sent by the application to the TCP socket, i.e.
the sending buffer.
ns3::TcpTxBuffer is accessible through the following paths with Config::Set and Config::Connect:
No Attributes are defined for this type.
Size of this type is 80 bytes (on a 64-bit architecture).
Definition at line 40 of file tcp-tx-buffer.h.
|
private |
container for data stored in the buffer
Definition at line 132 of file tcp-tx-buffer.h.
ns3::TcpTxBuffer::TcpTxBuffer | ( | uint32_t | n = 0 | ) |
Constructor.
n | initial Sequence number to be transmitted |
Definition at line 59 of file tcp-tx-buffer.cc.
|
virtual |
Definition at line 64 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 105 of file tcp-tx-buffer.cc.
References Available(), ns3::Packet::GetSize(), m_data, m_firstByteSeq, m_size, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
uint32_t ns3::TcpTxBuffer::Available | ( | void | ) | const |
Returns the available capacity in this Tx window.
Definition at line 99 of file tcp-tx-buffer.cc.
References m_maxBuffer, and m_size.
Referenced by Add().
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)
numBytes | number of bytes to copy |
seq | start sequence number to extract |
Definition at line 137 of file tcp-tx-buffer.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::CreateFragment(), ns3::TracedValue< T >::Get(), ns3::Packet::GetSize(), m_data, m_firstByteSeq, min, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and SizeFromSequence().
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 212 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.
|
static |
Get the type ID.
Definition at line 38 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 69 of file tcp-tx-buffer.cc.
References m_firstByteSeq.
uint32_t ns3::TcpTxBuffer::MaxBufferSize | ( | void | ) | const |
Returns the Tx window size.
Definition at line 87 of file tcp-tx-buffer.cc.
References m_maxBuffer.
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.
seq | The sequence number of the head byte |
Definition at line 205 of file tcp-tx-buffer.cc.
References m_firstByteSeq, and NS_LOG_FUNCTION.
void ns3::TcpTxBuffer::SetMaxBufferSize | ( | uint32_t | n | ) |
Set the Tx window size.
n | Tx window size (in bytes) |
Definition at line 93 of file tcp-tx-buffer.cc.
References m_maxBuffer.
uint32_t ns3::TcpTxBuffer::Size | ( | void | ) | const |
Returns total number of bytes in this Tx buffer.
Definition at line 81 of file tcp-tx-buffer.cc.
References m_size.
uint32_t ns3::TcpTxBuffer::SizeFromSequence | ( | const SequenceNumber32 & | seq | ) | const |
Returns the number of bytes from the buffer in the range [seq, tailSequence)
seq | initial sequence number |
Definition at line 125 of file tcp-tx-buffer.cc.
References m_firstByteSeq, m_size, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by CopyFromSequence().
SequenceNumber32 ns3::TcpTxBuffer::TailSequence | ( | void | ) | const |
Returns the last byte's sequence number + 1.
Definition at line 75 of file tcp-tx-buffer.cc.
References m_firstByteSeq, and m_size.
Corresponding data (may be null)
Definition at line 137 of file tcp-tx-buffer.h.
Referenced by Add(), CopyFromSequence(), and DiscardUpTo().
|
private |
Sequence number of the first byte in data (SND.UNA)
Definition at line 134 of file tcp-tx-buffer.h.
Referenced by Add(), CopyFromSequence(), DiscardUpTo(), GetTypeId(), HeadSequence(), SetHeadSequence(), SizeFromSequence(), and TailSequence().
|
private |
Max number of data bytes in buffer (SND.WND)
Definition at line 136 of file tcp-tx-buffer.h.
Referenced by Available(), DiscardUpTo(), MaxBufferSize(), and SetMaxBufferSize().
|
private |
Number of data bytes.
Definition at line 135 of file tcp-tx-buffer.h.
Referenced by Add(), Available(), DiscardUpTo(), Size(), SizeFromSequence(), and TailSequence().