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

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

#include <pending-data.h>

Public Member Functions

 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 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.

Member Function Documentation

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 139 of file pending-data.cc.

References NS_LOG_FUNCTION.

Referenced by RemoveToSeq(), and SizeFromSeq().

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 227 of file pending-data.cc.

References NS_ASSERT_MSG, NS_LOG_FUNCTION, and OffsetFromSeq().

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 131 of file pending-data.cc.

References NS_LOG_FUNCTION.

Referenced by SizeFromSeq().

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 124 of file pending-data.cc.

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


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