A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
seq-ts-echo-header.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 INRIA
4
* Copyright (c) 2016 Universita' di Firenze (added echo fields)
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
20
*/
21
22
#ifndef SEQ_TS_ECHO_HEADER_H
23
#define SEQ_TS_ECHO_HEADER_H
24
25
#include "ns3/header.h"
26
#include "ns3/nstime.h"
27
28
namespace
ns3
{
37
class
SeqTsEchoHeader
:
public
Header
38
{
39
public
:
44
static
TypeId
GetTypeId
(
void
);
45
49
SeqTsEchoHeader
();
50
54
void
SetSeq
(uint32_t seq);
55
59
uint32_t
GetSeq
(
void
)
const
;
60
64
Time
GetTsValue
(
void
)
const
;
65
69
Time
GetTsEchoReply
(
void
)
const
;
70
75
void
SetTsValue
(
Time
ts);
76
82
void
SetTsEchoReply
(
Time
ts);
83
84
// Inherited
85
virtual
TypeId
GetInstanceTypeId
(
void
)
const override
;
86
virtual
void
Print
(std::ostream &os)
const override
;
87
virtual
uint32_t
GetSerializedSize
(
void
)
const override
;
88
virtual
void
Serialize
(
Buffer::Iterator
start
)
const override
;
89
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
)
override
;
90
91
private
:
92
uint32_t
m_seq
;
93
Time
m_tsValue
;
94
Time
m_tsEchoReply
;
95
};
96
97
}
// namespace ns3
98
99
#endif
/* SEQ_TS_ECHO_HEADER_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:99
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:43
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::SeqTsEchoHeader
Packet header to carry sequence number and two timestamps.
Definition:
seq-ts-echo-header.h:38
ns3::SeqTsEchoHeader::GetTsValue
Time GetTsValue(void) const
Definition:
seq-ts-echo-header.cc:64
ns3::SeqTsEchoHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition:
seq-ts-echo-header.cc:96
ns3::SeqTsEchoHeader::m_tsEchoReply
Time m_tsEchoReply
Receiver's timestamp.
Definition:
seq-ts-echo-header.h:94
ns3::SeqTsEchoHeader::m_tsValue
Time m_tsValue
Sender's timestamp.
Definition:
seq-ts-echo-header.h:93
ns3::SeqTsEchoHeader::SetTsValue
void SetTsValue(Time ts)
Set the sender's time value.
Definition:
seq-ts-echo-header.cc:57
ns3::SeqTsEchoHeader::m_seq
uint32_t m_seq
Sequence number.
Definition:
seq-ts-echo-header.h:92
ns3::SeqTsEchoHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const override
Definition:
seq-ts-echo-header.cc:109
ns3::SeqTsEchoHeader::SetSeq
void SetSeq(uint32_t seq)
Definition:
seq-ts-echo-header.cc:43
ns3::SeqTsEchoHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const override
Definition:
seq-ts-echo-header.cc:116
ns3::SeqTsEchoHeader::GetTsEchoReply
Time GetTsEchoReply(void) const
Definition:
seq-ts-echo-header.cc:78
ns3::SeqTsEchoHeader::SeqTsEchoHeader
SeqTsEchoHeader()
constructor
Definition:
seq-ts-echo-header.cc:34
ns3::SeqTsEchoHeader::GetSeq
uint32_t GetSeq(void) const
Definition:
seq-ts-echo-header.cc:50
ns3::SeqTsEchoHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
seq-ts-echo-header.cc:85
ns3::SeqTsEchoHeader::SetTsEchoReply
void SetTsEchoReply(Time ts)
Upon SeqTsEchoHeader reception, the host answers via echoing back the received timestamp.
Definition:
seq-ts-echo-header.cc:71
ns3::SeqTsEchoHeader::Print
virtual void Print(std::ostream &os) const override
Definition:
seq-ts-echo-header.cc:102
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:103
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.
visualizer.core.start
def start()
Definition:
core.py:1853
src
applications
model
seq-ts-echo-header.h
Generated on Tue Feb 6 2024 19:21:15 for ns-3 by
1.9.1