A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
pending-data.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
//
3
// Copyright (c) 2006 Georgia Tech Research Corporation
4
//
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License version 2 as
7
// published by the Free Software Foundation;
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
//
18
// Author: Rajib Bhattacharjea<raj.b@gatech.edu>
19
//
20
21
// Georgia Tech Network Simulator - Data Descriptors
22
// George F. Riley. Georgia Tech, Spring 2002
23
24
#ifndef PENDING_DATA_H
25
#define PENDING_DATA_H
26
27
#include "ns3/packet.h"
28
#include "
pending-data.h
"
29
#include "ns3/sequence-number.h"
30
31
#include "ns3/ptr.h"
32
namespace
ns3
33
{
34
class
Packet;
35
41
class
PendingData
{
42
public
:
43
PendingData
();
51
PendingData
(uint32_t s, uint8_t* d = NULL, uint32_t msg = 0, uint32_t resp = 0);
56
PendingData
(
const
std::string& s);
// Construct from string
57
62
PendingData
(
const
PendingData
& o);
// Copy constructor
63
virtual
~PendingData
();
// Destructor
64
69
uint32_t
Size
()
const
{
return
size
; }
70
74
virtual
void
Clear
();
75
81
virtual
void
Add
(uint32_t s,
const
uint8_t* d = 0);
//
86
virtual
void
Add
(
Ptr<Packet>
p);
106
virtual
uint32_t
SizeFromSeq
(
const
SequenceNumber32
& seqFront,
const
SequenceNumber32
& seqOffset);
107
// Inquire available data from offset
112
virtual
uint32_t
SizeFromOffset
(uint32_t offset);
113
// Available size from sequence difference
122
virtual
uint32_t
OffsetFromSeq
(
const
SequenceNumber32
& seqFront,
const
SequenceNumber32
& seqOffset);
123
130
virtual
Ptr<Packet>
CopyFromOffset
(uint32_t s, uint32_t o);
// Size, offset, ret packet
140
virtual
Ptr<Packet>
CopyFromSeq
(uint32_t s,
const
SequenceNumber32
&
f
,
const
SequenceNumber32
& o);
150
virtual
uint32_t
RemoveToSeq
(
const
SequenceNumber32
& seqFront,
const
SequenceNumber32
& seqOffset);
151
156
PendingData
*
Copy
()
const
;
164
PendingData
*
CopyS
(uint32_t s);
// Copy
173
PendingData
*
CopySD
(uint32_t s, uint8_t* d);
174
public
:
175
uint32_t
size
;
176
std::vector<Ptr<Packet> >
data
;
177
// The next two fields allow simulated applications to exchange some info
178
uint32_t
msgSize
;
179
uint32_t
responseSize
;
180
};
181
182
}
//namespace ns3
183
184
#endif
/* PENDING_DATA_H */
ns3::PendingData
class for managing I/O between applications and TCP
Definition:
pending-data.h:41
ns3::PendingData::OffsetFromSeq
virtual uint32_t OffsetFromSeq(const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
Subtracts seqFront from seqOffset after enforcing seqFront is less than seqOffset.
Definition:
pending-data.cc:132
ns3::PendingData::data
std::vector< Ptr< Packet > > data
Corresponding data (may be null)
Definition:
pending-data.h:176
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PendingData::SizeFromOffset
virtual uint32_t SizeFromOffset(uint32_t offset)
Definition:
pending-data.cc:124
ns3::PendingData::responseSize
uint32_t responseSize
Size of response requested.
Definition:
pending-data.h:179
ns3::PendingData::CopyFromOffset
virtual Ptr< Packet > CopyFromOffset(uint32_t s, uint32_t o)
Copy data starting from a give offset.
Definition:
pending-data.cc:142
ns3::PendingData::Copy
PendingData * Copy() const
Create a copy of self.
Definition:
pending-data.cc:78
ns3::PendingData::SizeFromSeq
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...
Definition:
pending-data.cc:117
ns3::PendingData::CopyS
PendingData * CopyS(uint32_t s)
Create a copy of self with new size.
Definition:
pending-data.cc:84
ns3::PendingData::size
uint32_t size
Number of data bytes.
Definition:
pending-data.h:175
ns3::Ptr< Packet >
ns3::PendingData::Size
uint32_t Size() const
Returns the size of the pending data.
Definition:
pending-data.h:69
ns3::PendingData::msgSize
uint32_t msgSize
Total size of message.
Definition:
pending-data.h:178
ns3::PendingData::Add
virtual void Add(uint32_t s, const uint8_t *d=0)
Add some data to end.
Definition:
pending-data.cc:103
ns3::PendingData::~PendingData
virtual ~PendingData()
Definition:
pending-data.cc:73
ns3::PendingData::Clear
virtual void Clear()
Remove all associated data.
Definition:
pending-data.cc:96
f
double f(double x, void *params)
Definition:
80211b.c:70
ns3::PendingData::CopyFromSeq
virtual Ptr< Packet > CopyFromSeq(uint32_t s, const SequenceNumber32 &f, const SequenceNumber32 &o)
Copy data starting from a give offset.
Definition:
pending-data.cc:213
ns3::PendingData::RemoveToSeq
virtual uint32_t RemoveToSeq(const SequenceNumber32 &seqFront, const SequenceNumber32 &seqOffset)
Permits object to clear any pending data between seqFront and seqOffset - 1).
Definition:
pending-data.cc:220
pending-data.h
ns3::PendingData::PendingData
PendingData()
Definition:
pending-data.cc:42
ns3::SequenceNumber< uint32_t, int32_t >
ns3::PendingData::CopySD
PendingData * CopySD(uint32_t s, uint8_t *d)
Create a copy of self with new size, new data.
Definition:
pending-data.cc:90
src
internet
model
pending-data.h
Generated on Fri Oct 1 2021 17:03:08 for ns-3 by
1.8.20