A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
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 "ns3/sequence-number.h"
29
#include "ns3/tcp-option.h"
30
31
namespace
ns3
32
{
33
49
class
TcpOptionSack
:
public
TcpOption
50
{
51
public
:
56
static
TypeId
GetTypeId
();
57
TypeId
GetInstanceTypeId
()
const override
;
58
59
typedef
std::pair<SequenceNumber32, SequenceNumber32>
SackBlock
;
60
typedef
std::list<SackBlock>
SackList
;
61
62
TcpOptionSack
();
63
~TcpOptionSack
()
override
;
64
65
void
Print
(std::ostream& os)
const override
;
66
void
Serialize
(
Buffer::Iterator
start)
const override
;
67
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
68
69
uint8_t
GetKind
()
const override
;
70
uint32_t
GetSerializedSize
()
const override
;
71
76
void
AddSackBlock
(
SackBlock
s);
77
82
uint32_t
GetNumSackBlocks
()
const
;
83
87
void
ClearSackList
();
88
93
SackList
GetSackList
()
const
;
94
95
friend
std::ostream&
operator<<
(std::ostream& os,
const
TcpOptionSack
& sackOption);
96
97
protected
:
98
SackList
m_sackList
;
99
};
100
107
std::ostream&
operator<<
(std::ostream& os,
const
TcpOptionSack
& sackOption);
108
115
std::ostream&
operator<<
(std::ostream& os,
const
TcpOptionSack::SackBlock
& sackBlock);
116
117
}
// namespace ns3
118
119
#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:50
ns3::TcpOptionSack::operator<<
friend std::ostream & operator<<(std::ostream &os, const TcpOptionSack &sackOption)
Output operator.
Definition:
tcp-option-sack.cc:160
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:60
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::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:59
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:98
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
uint32_t
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:129
src
internet
model
tcp-option-sack.h
Generated on Sun Jul 2 2023 18:21:41 for ns-3 by
1.9.6