A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
tcp-option.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2011 Adrian Sai-wah Tam
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: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
19
*/
20
21
#ifndef TCP_OPTION_H
22
#define TCP_OPTION_H
23
24
#include <stdint.h>
25
#include "ns3/object.h"
26
#include "ns3/buffer.h"
27
#include "ns3/object-factory.h"
28
29
namespace
ns3
{
30
36
class
TcpOption
:
public
Object
37
{
38
public
:
39
TcpOption
();
40
virtual
~TcpOption
();
41
46
static
TypeId
GetTypeId
(
void
);
47
48
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
49
53
enum
Kind
54
{
55
// Remember to extend IsKindKnown() with new value, when adding values here
56
//
57
END
= 0,
58
NOP
= 1,
59
MSS
= 2,
60
WINSCALE
= 3,
61
SACKPERMITTED
= 4,
62
SACK
= 5,
63
TS
= 8,
64
UNKNOWN
= 255
65
};
66
71
virtual
void
Print
(std::ostream &os)
const
= 0;
76
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
= 0;
77
83
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
) = 0;
84
89
virtual
uint8_t
GetKind
(
void
)
const
= 0;
97
virtual
uint32_t
GetSerializedSize
(
void
)
const
= 0;
98
104
static
Ptr<TcpOption>
CreateOption
(uint8_t kind);
105
111
static
bool
IsKindKnown
(uint8_t kind);
112
};
113
122
class
TcpOptionUnknown
:
public
TcpOption
123
{
124
public
:
125
TcpOptionUnknown
();
126
virtual
~TcpOptionUnknown
();
127
132
static
TypeId
GetTypeId
(
void
);
133
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
134
135
virtual
void
Print
(std::ostream &os)
const
;
136
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
137
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
138
139
virtual
uint8_t
GetKind
(
void
)
const
;
140
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
141
142
private
:
143
uint8_t
m_kind
;
144
uint32_t
m_size
;
145
uint8_t
m_content
[40];
146
147
};
148
149
}
// namespace ns3
150
151
#endif
/* TCP_OPTION */
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::TcpOption::Kind
Kind
The option Kind, as defined in the respective RFCs.
Definition:
tcp-option.h:54
ns3::TcpOption::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
tcp-option.cc:49
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TcpOption::GetKind
virtual uint8_t GetKind(void) const =0
Get the ‘kind’ (as in RFC 793) of this option.
ns3::TcpOption::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the Option from a buffer iterator.
ns3::TcpOptionUnknown::~TcpOptionUnknown
virtual ~TcpOptionUnknown()
Definition:
tcp-option.cc:126
ns3::TcpOptionUnknown::m_size
uint32_t m_size
The unknown option size.
Definition:
tcp-option.h:144
ns3::TcpOption
Base class for all kinds of TCP options.
Definition:
tcp-option.h:37
ns3::TcpOptionUnknown::Serialize
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
Definition:
tcp-option.cc:160
ns3::TcpOption::Serialize
virtual void Serialize(Buffer::Iterator start) const =0
Serialize the Option to a buffer iterator.
ns3::TcpOptionUnknown::m_kind
uint8_t m_kind
The unknown option kind.
Definition:
tcp-option.h:143
ns3::TcpOptionUnknown::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
tcp-option.cc:142
ns3::TcpOption::TcpOption
TcpOption()
Definition:
tcp-option.cc:40
ns3::TcpOption::END
@ END
END.
Definition:
tcp-option.h:57
ns3::TcpOptionUnknown::GetKind
virtual uint8_t GetKind(void) const
Get the ‘kind’ (as in RFC 793) of this option.
Definition:
tcp-option.cc:194
ns3::TcpOption::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
tcp-option.cc:59
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
visualizer.core.start
def start()
Definition:
core.py:1855
ns3::TcpOption::~TcpOption
virtual ~TcpOption()
Definition:
tcp-option.cc:44
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:88
ns3::TcpOptionUnknown::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
Definition:
tcp-option.cc:154
ns3::TcpOption::Print
virtual void Print(std::ostream &os) const =0
Print the Option contents.
ns3::TcpOption::TS
@ TS
TS.
Definition:
tcp-option.h:63
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:99
ns3::TcpOption::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const =0
Returns number of bytes required for Option serialization.
ns3::TcpOption::MSS
@ MSS
MSS.
Definition:
tcp-option.h:59
ns3::TcpOptionUnknown::TcpOptionUnknown
TcpOptionUnknown()
Definition:
tcp-option.cc:119
ns3::TcpOption::CreateOption
static Ptr< TcpOption > CreateOption(uint8_t kind)
Creates an option.
Definition:
tcp-option.cc:65
ns3::TcpOption::SACK
@ SACK
SACK.
Definition:
tcp-option.h:62
ns3::TcpOptionUnknown::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
Definition:
tcp-option.cc:174
ns3::TcpOptionUnknown::m_content
uint8_t m_content[40]
The option data.
Definition:
tcp-option.h:145
ns3::TcpOptionUnknown::Print
virtual void Print(std::ostream &os) const
Print the Option contents.
Definition:
tcp-option.cc:148
ns3::TcpOption::WINSCALE
@ WINSCALE
WINSCALE.
Definition:
tcp-option.h:60
ns3::TcpOption::UNKNOWN
@ UNKNOWN
not a standardized value; for unknown recv'd options
Definition:
tcp-option.h:64
ns3::TcpOptionUnknown::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
tcp-option.cc:131
ns3::TcpOptionUnknown
An unknown TCP option.
Definition:
tcp-option.h:123
ns3::TcpOption::NOP
@ NOP
NOP.
Definition:
tcp-option.h:58
ns3::TcpOption::IsKindKnown
static bool IsKindKnown(uint8_t kind)
Check if the option is implemented.
Definition:
tcp-option.cc:99
ns3::TcpOption::SACKPERMITTED
@ SACKPERMITTED
SACKPERMITTED.
Definition:
tcp-option.h:61
src
internet
model
tcp-option.h
Generated on Fri Oct 1 2021 17:03:10 for ns-3 by
1.8.20