A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
tcp-option-sack.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Adrian Sai-wah Tam
3
* Copyright (c) 2015 ResiliNets, ITTC, University of Kansas
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
* Original Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
19
* Documentation, test cases: Truc Anh N. Nguyen <annguyen@ittc.ku.edu>
20
* ResiliNets Research Group https://resilinets.org/
21
* The University of Kansas
22
* James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
23
*/
24
25
#ifndef TCP_OPTION_SACK_H
26
#define TCP_OPTION_SACK_H
27
28
#include "
tcp-option.h
"
29
30
#include "ns3/sequence-number.h"
31
32
namespace
ns3
33
{
34
50
class
TcpOptionSack
:
public
TcpOption
51
{
52
public
:
57
static
TypeId
GetTypeId
();
58
TypeId
GetInstanceTypeId
()
const override
;
59
60
typedef
std::pair<SequenceNumber32, SequenceNumber32>
SackBlock
;
61
typedef
std::list<SackBlock>
SackList
;
62
63
TcpOptionSack
();
64
~TcpOptionSack
()
override
;
65
66
void
Print
(std::ostream& os)
const override
;
67
void
Serialize
(
Buffer::Iterator
start
)
const override
;
68
uint32_t
Deserialize
(
Buffer::Iterator
start
)
override
;
69
70
uint8_t
GetKind
()
const override
;
71
uint32_t
GetSerializedSize
()
const override
;
72
77
void
AddSackBlock
(
SackBlock
s);
78
83
uint32_t
GetNumSackBlocks
()
const
;
84
88
void
ClearSackList
();
89
94
SackList
GetSackList
()
const
;
95
96
friend
std::ostream&
operator<<
(std::ostream& os,
const
TcpOptionSack
& sackOption);
97
98
protected
:
99
SackList
m_sackList
;
100
};
101
108
std::ostream&
operator<<
(std::ostream& os,
const
TcpOptionSack
& sackOption);
109
116
std::ostream&
operator<<
(std::ostream& os,
const
TcpOptionSack::SackBlock
& sackBlock);
117
118
}
// namespace ns3
119
120
#endif
/* TCP_OPTION_SACK */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:100
ns3::TcpOption
Base class for all kinds of TCP options.
Definition:
tcp-option.h:38
ns3::TcpOptionSack
Defines the TCP option of kind 5 (selective acknowledgment option) as in RFC 2018
Definition:
tcp-option-sack.h:51
ns3::TcpOptionSack::ClearSackList
void ClearSackList()
Clear the SACK list.
Definition:
tcp-option-sack.cc:147
ns3::TcpOptionSack::SackList
std::list< SackBlock > SackList
SACK list definition.
Definition:
tcp-option-sack.h:61
ns3::TcpOptionSack::GetNumSackBlocks
uint32_t GetNumSackBlocks() const
Count the total number of SACK blocks.
Definition:
tcp-option-sack.cc:139
ns3::TcpOptionSack::GetKind
uint8_t GetKind() const override
Get the ‘kind’ (as in RFC 793) of this option.
Definition:
tcp-option-sack.cc:126
ns3::TcpOptionSack::operator<<
friend std::ostream & operator<<(std::ostream &os, const TcpOptionSack &sackOption)
Output operator.
Definition:
tcp-option-sack.cc:160
ns3::TcpOptionSack::Print
void Print(std::ostream &os) const override
Print the Option contents.
Definition:
tcp-option-sack.cc:62
ns3::TcpOptionSack::TcpOptionSack
TcpOptionSack()
Definition:
tcp-option-sack.cc:36
ns3::TcpOptionSack::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the Option to a buffer iterator.
Definition:
tcp-option-sack.cc:80
ns3::TcpOptionSack::SackBlock
std::pair< SequenceNumber32, SequenceNumber32 > SackBlock
SACK block definition.
Definition:
tcp-option-sack.h:60
ns3::TcpOptionSack::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
tcp-option-sack.cc:56
ns3::TcpOptionSack::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
tcp-option-sack.cc:46
ns3::TcpOptionSack::AddSackBlock
void AddSackBlock(SackBlock s)
Add a SACK block.
Definition:
tcp-option-sack.cc:132
ns3::TcpOptionSack::~TcpOptionSack
~TcpOptionSack() override
Definition:
tcp-option-sack.cc:41
ns3::TcpOptionSack::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the Option from a buffer iterator.
Definition:
tcp-option-sack.cc:98
ns3::TcpOptionSack::GetSerializedSize
uint32_t GetSerializedSize() const override
Returns number of bytes required for Option serialization.
Definition:
tcp-option-sack.cc:72
ns3::TcpOptionSack::m_sackList
SackList m_sackList
the list of SACK blocks
Definition:
tcp-option-sack.h:99
ns3::TcpOptionSack::GetSackList
SackList GetSackList() const
Get the SACK list.
Definition:
tcp-option-sack.cc:153
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:159
two-ray-to-three-gpp-ch-calibration.start
start
Definition:
two-ray-to-three-gpp-ch-calibration.py:520
tcp-option.h
src
internet
model
tcp-option-sack.h
Generated on Sun Mar 3 2024 17:10:59 for ns-3 by
1.9.1