26#include "ns3/fatal-error.h"
56 data.push_back(Create<Packet>(d,
size));
61 : size(s.length() + 1),
67 data.push_back(Create<Packet>((uint8_t*)s.c_str(),
size));
74 responseSize(c.responseSize)
117 data.push_back(Create<Packet>(d, s));
146 return size - offset;
153 if (seqOffset < seqFront)
157 return seqOffset - seqFront;
168 return Create<Packet>();
170 if (
data.size() != 0)
173 std::vector<Ptr<Packet>>::size_type begin = 0;
174 bool beginFound =
false;
175 std::vector<Ptr<Packet>>::size_type end = 0;
180 count +=
data[i]->GetSize();
189 uint32_t packetOffset = o - packetStart;
197 uint32_t packetOffset = o - packetStart;
198 uint32_t fragmentLength = count - o;
199 outPacket = toFragment->
CreateFragment(packetOffset, fragmentLength);
209 uint32_t fragmentLength = o + s1 - packetStart;
215 for (std::vector<
Ptr<Packet>>::size_type i = begin + 1; i < end; ++i)
228 return Create<Packet>(s1);
253 std::vector<Ptr<Packet>>::iterator endI =
data.begin();
258 if (current + (*dataI)->GetSize() > count)
262 current += (*dataI)->GetSize();
double f(double x, void *params)
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
class for managing I/O between applications and TCP
uint32_t responseSize
Size of response requested.
uint32_t msgSize
Total size of message.
virtual void Clear()
Remove all associated data.
uint32_t Size() const
Returns the size of the pending data.
virtual uint32_t SizeFromOffset(uint32_t offset)
uint32_t size
Number of data bytes.
virtual uint32_t RemoveToSeq(const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
Permits object to clear any pending data between seqFront and seqOffset - 1).
virtual uint32_t SizeFromSeq(const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
This method returns the number of bytes in the PendingData buffer beyond the sequence number specifie...
PendingData * Copy() const
Create a copy of self.
virtual Ptr< Packet > CopyFromOffset(uint32_t s, uint32_t o)
Copy data starting from a give offset.
PendingData * CopyS(uint32_t s)
Create a copy of self with new size.
std::vector< Ptr< Packet > > data
Corresponding data (may be null)
virtual void Add(uint32_t s, const uint8_t *d=nullptr)
Add some data to end.
PendingData * CopySD(uint32_t s, uint8_t *d)
Create a copy of self with new size, new data.
virtual Ptr< Packet > CopyFromSeq(uint32_t s, const SequenceNumber32 &f, const SequenceNumber32 &o)
Copy data starting from a give offset.
virtual uint32_t OffsetFromSeq(const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
Subtracts seqFront from seqOffset after enforcing seqFront is less than seqOffset.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Every class exported by the ns3 library is enclosed in the ns3 namespace.