class for managing I/O between applications and TCP More...
#include <pending-data.h>
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 &) |
PendingData * | Copy () const |
virtual Ptr< Packet > | CopyFromOffset (uint32_t, uint32_t) |
virtual Ptr< Packet > | CopyFromSeq (uint32_t, const SequenceNumber32 &, const SequenceNumber32 &) |
PendingData * | CopyS (uint32_t) |
PendingData * | CopySD (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 |
class for managing I/O between applications and TCP
Definition at line 41 of file pending-data.h.
ns3::PendingData::PendingData | ( | ) |
Definition at line 40 of file pending-data.cc.
References NS_LOG_FUNCTION.
Referenced by Copy(), CopyS(), and CopySD().
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().
|
virtual |
Definition at line 71 of file pending-data.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 101 of file pending-data.cc.
References data, NS_LOG_FUNCTION, and size.
Definition at line 115 of file pending-data.cc.
References data, ns3::Packet::GetSize(), NS_LOG_FUNCTION, and size.
|
virtual |
Definition at line 94 of file pending-data.cc.
References data, NS_LOG_FUNCTION, and size.
Referenced by RemoveToSeq().
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().
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().
|
virtual |
Definition at line 218 of file pending-data.cc.
References CopyFromOffset(), NS_LOG_FUNCTION, and OffsetFromSeq().
PendingData * ns3::PendingData::CopyS | ( | uint32_t | s | ) |
Definition at line 82 of file pending-data.cc.
References msgSize, NS_LOG_FUNCTION, PendingData(), and responseSize.
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.
|
virtual |
Subtracts seqFront from seqOffset after enforcing seqFront is less than seqOffset
seqFront | sequence number to be subtracted from seqOffset |
seqOffset | higher sequence number |
Definition at line 137 of file pending-data.cc.
References NS_LOG_FUNCTION.
Referenced by CopyFromSeq(), RemoveToSeq(), and SizeFromSeq().
|
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.
seqFront | sequence number to start to try to remove from |
seqOffset | first sequence number in buffer that should be retained |
Definition at line 225 of file pending-data.cc.
References Clear(), data, NS_ASSERT_MSG, NS_LOG_FUNCTION, OffsetFromSeq(), and size.
uint8_t* ns3::PendingData::Serialize | ( | uint8_t * | , |
uint32_t & | |||
) |
|
inline |
Definition at line 49 of file pending-data.h.
References size.
Referenced by PendingData().
|
virtual |
offset | offset (from zero) |
Definition at line 129 of file pending-data.cc.
References NS_LOG_FUNCTION, and size.
Referenced by CopyFromOffset(), and SizeFromSeq().
|
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.
seqFront | sequence number of assumed first byte in the PendingData |
seqOffset | sequence number of offset |
Definition at line 122 of file pending-data.cc.
References NS_LOG_FUNCTION, OffsetFromSeq(), and SizeFromOffset().
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.
uint32_t ns3::PendingData::responseSize |
Definition at line 113 of file pending-data.h.
uint32_t ns3::PendingData::size |
Definition at line 109 of file pending-data.h.
Referenced by Add(), Clear(), PendingData(), RemoveToSeq(), Size(), and SizeFromOffset().