A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::PendingData Class Reference

class for managing I/O between applications and TCP More...

#include <pending-data.h>

+ Collaboration diagram for ns3::PendingData:

Public Member Functions

 PendingData ()
 PendingData (uint32_t s, uint8_t *d=NULL, uint32_t msg=0, uint32_t resp=0)
 PendingData (const std::string &)
 PendingData (uint8_t *, uint32_t &, Packet *)
 PendingData (const PendingData &)
virtual ~PendingData ()
virtual void Add (uint32_t s, const uint8_t *d=0)
virtual void Add (Ptr< Packet > p)
virtual void Clear ()
uint8_t * Construct (uint8_t *, uint32_t &)
PendingDataCopy () const
virtual Ptr< PacketCopyFromOffset (uint32_t, uint32_t)
virtual Ptr< PacketCopyFromSeq (uint32_t, const SequenceNumber32 &, const SequenceNumber32 &)
PendingDataCopyS (uint32_t)
PendingDataCopySD (uint32_t, uint8_t *)
virtual uint32_t OffsetFromSeq (const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
virtual uint32_t RemoveToSeq (const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
uint8_t * Serialize (uint8_t *, uint32_t &)
uint32_t Size () const
virtual uint32_t SizeFromOffset (uint32_t offset)
virtual uint32_t SizeFromSeq (const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)

Public Attributes

std::vector< Ptr< Packet > > data
uint32_t msgSize
uint32_t responseSize
uint32_t size

Detailed Description

class for managing I/O between applications and TCP

Definition at line 41 of file pending-data.h.

Constructor & Destructor Documentation

ns3::PendingData::PendingData ( )

Definition at line 40 of file pending-data.cc.

References NS_LOG_FUNCTION.

Referenced by Copy(), CopyS(), and CopySD().

+ Here is the caller graph for this function:

ns3::PendingData::PendingData ( uint32_t  s,
uint8_t *  d = NULL,
uint32_t  msg = 0,
uint32_t  resp = 0 
)

Definition at line 46 of file pending-data.cc.

References data, NS_LOG_FUNCTION, and size.

ns3::PendingData::PendingData ( const std::string &  s)

Definition at line 56 of file pending-data.cc.

References data, NS_LOG_FUNCTION, and size.

ns3::PendingData::PendingData ( uint8_t *  ,
uint32_t &  ,
Packet  
)
ns3::PendingData::PendingData ( const PendingData c)

Definition at line 64 of file pending-data.cc.

References NS_LOG_FUNCTION, and Size().

+ Here is the call graph for this function:

ns3::PendingData::~PendingData ( )
virtual

Definition at line 71 of file pending-data.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::PendingData::Add ( uint32_t  s,
const uint8_t *  d = 0 
)
virtual

Definition at line 101 of file pending-data.cc.

References data, NS_LOG_FUNCTION, and size.

void ns3::PendingData::Add ( Ptr< Packet p)
virtual

Definition at line 115 of file pending-data.cc.

References data, ns3::Packet::GetSize(), NS_LOG_FUNCTION, and size.

+ Here is the call graph for this function:

void ns3::PendingData::Clear ( void  )
virtual

Definition at line 94 of file pending-data.cc.

References data, NS_LOG_FUNCTION, and size.

Referenced by RemoveToSeq().

+ Here is the caller graph for this function:

uint8_t* ns3::PendingData::Construct ( uint8_t *  ,
uint32_t &   
)
PendingData * ns3::PendingData::Copy ( void  ) const

Definition at line 76 of file pending-data.cc.

References NS_LOG_FUNCTION, and PendingData().

+ Here is the call graph for this function:

Ptr< Packet > ns3::PendingData::CopyFromOffset ( uint32_t  s,
uint32_t  o 
)
virtual

Definition at line 147 of file pending-data.cc.

References ns3::Packet::AddAtEnd(), ns3::Packet::CreateFragment(), data, ns3::Packet::GetSize(), NS_ASSERT, NS_LOG_FUNCTION, and SizeFromOffset().

Referenced by CopyFromSeq().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr< Packet > ns3::PendingData::CopyFromSeq ( uint32_t  s,
const SequenceNumber32 f,
const SequenceNumber32 o 
)
virtual

Definition at line 218 of file pending-data.cc.

References CopyFromOffset(), NS_LOG_FUNCTION, and OffsetFromSeq().

+ Here is the call graph for this function:

PendingData * ns3::PendingData::CopyS ( uint32_t  s)

Definition at line 82 of file pending-data.cc.

References msgSize, NS_LOG_FUNCTION, PendingData(), and responseSize.

+ Here is the call graph for this function:

PendingData * ns3::PendingData::CopySD ( uint32_t  s,
uint8_t *  d 
)

Definition at line 88 of file pending-data.cc.

References msgSize, NS_LOG_FUNCTION, PendingData(), and responseSize.

+ Here is the call graph for this function:

uint32_t ns3::PendingData::OffsetFromSeq ( const SequenceNumber32 seqFront,
const SequenceNumber32 seqOffset 
)
virtual

Subtracts seqFront from seqOffset after enforcing seqFront is less than seqOffset

Parameters
seqFrontsequence number to be subtracted from seqOffset
seqOffsethigher sequence number
Returns
seqOffset-seqFront

Definition at line 137 of file pending-data.cc.

References NS_LOG_FUNCTION.

Referenced by CopyFromSeq(), RemoveToSeq(), and SizeFromSeq().

+ Here is the caller graph for this function:

uint32_t ns3::PendingData::RemoveToSeq ( const SequenceNumber32 seqFront,
const SequenceNumber32 seqOffset 
)
virtual

Permits object to clear any pending data between seqFront and seqOffset - 1). Callers should check the return value to determine whether any data was removed from the front.

Parameters
seqFrontsequence number to start to try to remove from
seqOffsetfirst sequence number in buffer that should be retained
Returns
number of bytes from the front that were removed from the buffer

Definition at line 225 of file pending-data.cc.

References Clear(), data, NS_ASSERT_MSG, NS_LOG_FUNCTION, OffsetFromSeq(), and size.

+ Here is the call graph for this function:

uint8_t* ns3::PendingData::Serialize ( uint8_t *  ,
uint32_t &   
)
uint32_t ns3::PendingData::Size ( void  ) const
inline

Definition at line 49 of file pending-data.h.

References size.

Referenced by PendingData().

+ Here is the caller graph for this function:

uint32_t ns3::PendingData::SizeFromOffset ( uint32_t  offset)
virtual
Returns
number of bytes in the data buffer beyond the offset specified
Parameters
offsetoffset (from zero)

Definition at line 129 of file pending-data.cc.

References NS_LOG_FUNCTION, and size.

Referenced by CopyFromOffset(), and SizeFromSeq().

+ Here is the caller graph for this function:

uint32_t ns3::PendingData::SizeFromSeq ( const SequenceNumber32 seqFront,
const SequenceNumber32 seqOffset 
)
virtual

This method returns the number of bytes in the PendingData buffer beyond the sequence number specified by seqOffset.

The variables seqFront and seqOffset correspond to a sequence number space in use by the user. What is significant in this method is the difference between them; i.e. the quantity (seqOffset - seqFront). This difference is subtracted from Size(), yielding the number of bytes beyond seqOffset, from the user perspective, in the PendingData buffer.

If the first number specified is not a sequence number that corresponds to the first data byte in the PendingData buffer, the computation returned will be in error.

Returns
number of bytes
Parameters
seqFrontsequence number of assumed first byte in the PendingData
seqOffsetsequence number of offset

Definition at line 122 of file pending-data.cc.

References NS_LOG_FUNCTION, OffsetFromSeq(), and SizeFromOffset().

+ Here is the call graph for this function:

Member Data Documentation

std::vector<Ptr<Packet> > ns3::PendingData::data

Definition at line 110 of file pending-data.h.

Referenced by Add(), Clear(), CopyFromOffset(), PendingData(), and RemoveToSeq().

uint32_t ns3::PendingData::msgSize

Definition at line 112 of file pending-data.h.

Referenced by CopyS(), and CopySD().

uint32_t ns3::PendingData::responseSize

Definition at line 113 of file pending-data.h.

Referenced by CopyS(), and CopySD().

uint32_t ns3::PendingData::size

Definition at line 109 of file pending-data.h.

Referenced by Add(), Clear(), PendingData(), RemoveToSeq(), Size(), and SizeFromOffset().


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