31 #include "ns3/fatal-error.h" 43 msgSize (0), responseSize (0)
49 : size (s),
data (0), msgSize (msg), responseSize (resp)
54 data.push_back (Create<Packet> (d,
size));
59 : size (s.length () + 1),
data (0),
60 msgSize (0), responseSize (0)
63 data.push_back (Create<Packet> ((uint8_t*)s.c_str (),
size));
68 msgSize (c.msgSize), responseSize (c.responseSize)
106 data.push_back (Create<Packet> (d,s));
128 if (offset >
size)
return 0;
129 return size - offset;
135 if (seqOffset < seqFront)
139 return seqOffset - seqFront;
149 return Create<Packet> ();
151 if (
data.size () != 0)
154 std::vector<Ptr<Packet> >::size_type begin = 0;
155 bool beginFound =
false;
156 std::vector<Ptr<Packet> >::size_type end = 0;
161 count+=
data[i]->GetSize ();
169 uint32_t packetStart = count - toFragment->
GetSize ();
170 uint32_t packetOffset = o - packetStart;
177 uint32_t packetStart = count - toFragment->
GetSize ();
178 uint32_t packetOffset = o - packetStart;
179 uint32_t fragmentLength = count - o;
180 outPacket = toFragment->
CreateFragment (packetOffset, fragmentLength);
189 uint32_t packetStart = count - toFragment->
GetSize ();
190 uint32_t fragmentLength = o + s1 - packetStart;
196 for (std::vector<
Ptr<Packet> >::size_type i=begin+1; i<end; ++i)
209 return Create<Packet> (s1);
233 std::vector<Ptr<Packet> >::iterator endI =
data.begin ();
234 uint32_t current = 0;
236 for (std::vector<
Ptr<Packet> >::iterator dataI =
data.begin (); dataI <
data.end (); dataI++)
238 if (current + (*dataI)->GetSize () > count)
242 current += (*dataI)->GetSize ();
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual Ptr< Packet > CopyFromSeq(uint32_t s, const SequenceNumber32 &f, const SequenceNumber32 &o)
Copy data starting from a give offset.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
PendingData * CopySD(uint32_t s, uint8_t *d)
Create a copy of self with new size, new data.
uint32_t responseSize
Size of response requested.
virtual void Add(uint32_t s, const uint8_t *d=0)
Add some data to end.
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
virtual uint32_t RemoveToSeq(const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
Permits object to clear any pending data between seqFront and seqOffset - 1).
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual uint32_t SizeFromOffset(uint32_t offset)
PendingData * Copy() const
Create a copy of self.
PendingData * CopyS(uint32_t s)
Create a copy of self with new size.
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
class for managing I/O between applications and TCP
virtual void Clear()
Remove all associated data.
uint32_t size
Number of data bytes.
double f(double x, void *params)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual Ptr< Packet > CopyFromOffset(uint32_t s, uint32_t o)
Copy data starting from a give offset.
uint32_t Size() const
Returns the size of the pending data.
uint32_t msgSize
Total size of message.
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...
virtual uint32_t OffsetFromSeq(const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
Subtracts seqFront from seqOffset after enforcing seqFront is less than seqOffset.
std::vector< Ptr< Packet > > data
Corresponding data (may be null)