A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
tcp-option-ts.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Adrian Sai-wah Tam
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
18
*/
19
20
#ifndef TCP_OPTION_TS_H
21
#define TCP_OPTION_TS_H
22
23
#include "ns3/tcp-option.h"
24
#include "ns3/timer.h"
25
26
namespace
ns3
27
{
28
35
class
TcpOptionTS
:
public
TcpOption
36
{
37
public
:
38
TcpOptionTS
();
39
~TcpOptionTS
()
override
;
40
45
static
TypeId
GetTypeId
();
46
TypeId
GetInstanceTypeId
()
const override
;
47
48
void
Print
(std::ostream& os)
const override
;
49
void
Serialize
(
Buffer::Iterator
start
)
const override
;
50
uint32_t
Deserialize
(
Buffer::Iterator
start
)
override
;
51
52
uint8_t
GetKind
()
const override
;
53
uint32_t
GetSerializedSize
()
const override
;
54
59
uint32_t
GetTimestamp
()
const
;
64
uint32_t
GetEcho
()
const
;
69
void
SetTimestamp
(uint32_t ts);
74
void
SetEcho
(uint32_t ts);
75
90
static
uint32_t
NowToTsValue
();
91
101
static
Time
ElapsedTimeFromTsValue
(uint32_t echoTime);
102
103
protected
:
104
uint32_t
m_timestamp
;
105
uint32_t
m_echo
;
106
};
107
108
}
// namespace ns3
109
110
#endif
/* TCP_OPTION_TS */
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::TcpOptionTS
Defines the TCP option of kind 8 (timestamp option) as in RFC 1323
Definition:
tcp-option-ts.h:36
ns3::TcpOptionTS::GetKind
uint8_t GetKind() const override
Get the ‘kind’ (as in RFC 793) of this option.
Definition:
tcp-option-ts.cc:104
ns3::TcpOptionTS::SetTimestamp
void SetTimestamp(uint32_t ts)
Set the timestamp stored in the Option.
Definition:
tcp-option-ts.cc:122
ns3::TcpOptionTS::TcpOptionTS
TcpOptionTS()
Definition:
tcp-option-ts.cc:31
ns3::TcpOptionTS::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
tcp-option-ts.cc:53
ns3::TcpOptionTS::ElapsedTimeFromTsValue
static Time ElapsedTimeFromTsValue(uint32_t echoTime)
Estimate the Time elapsed from a TS echo value.
Definition:
tcp-option-ts.cc:144
ns3::TcpOptionTS::GetSerializedSize
uint32_t GetSerializedSize() const override
Returns number of bytes required for Option serialization.
Definition:
tcp-option-ts.cc:65
ns3::TcpOptionTS::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
tcp-option-ts.cc:43
ns3::TcpOptionTS::GetTimestamp
uint32_t GetTimestamp() const
Get the timestamp stored in the Option.
Definition:
tcp-option-ts.cc:110
ns3::TcpOptionTS::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the Option from a buffer iterator.
Definition:
tcp-option-ts.cc:81
ns3::TcpOptionTS::m_timestamp
uint32_t m_timestamp
local timestamp
Definition:
tcp-option-ts.h:104
ns3::TcpOptionTS::~TcpOptionTS
~TcpOptionTS() override
Definition:
tcp-option-ts.cc:38
ns3::TcpOptionTS::GetEcho
uint32_t GetEcho() const
Get the timestamp echo stored in the Option.
Definition:
tcp-option-ts.cc:116
ns3::TcpOptionTS::NowToTsValue
static uint32_t NowToTsValue()
Return an uint32_t value which represent "now".
Definition:
tcp-option-ts.cc:134
ns3::TcpOptionTS::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the Option to a buffer iterator.
Definition:
tcp-option-ts.cc:71
ns3::TcpOptionTS::m_echo
uint32_t m_echo
echo timestamp
Definition:
tcp-option-ts.h:105
ns3::TcpOptionTS::SetEcho
void SetEcho(uint32_t ts)
Set the timestamp echo stored in the Option.
Definition:
tcp-option-ts.cc:128
ns3::TcpOptionTS::Print
void Print(std::ostream &os) const override
Print the Option contents.
Definition:
tcp-option-ts.cc:59
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:60
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
two-ray-to-three-gpp-ch-calibration.start
start
Definition:
two-ray-to-three-gpp-ch-calibration.py:474
src
internet
model
tcp-option-ts.h
Generated on Fri Mar 31 2023 13:30:42 for ns-3 by
1.9.1