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
seq-ts-header.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
9
#ifndef SEQ_TS_HEADER_H
10
#define SEQ_TS_HEADER_H
11
12
#include "ns3/header.h"
13
#include "ns3/nstime.h"
14
15
namespace
ns3
16
{
17
/**
18
* @ingroup applications
19
*
20
* @brief Packet header to carry sequence number and timestamp
21
*
22
* The header is used as a payload in applications (typically UDP) to convey
23
* a 32 bit sequence number followed by a 64 bit timestamp (12 bytes total).
24
*
25
* The timestamp is not set explicitly but automatically set to the
26
* simulation time upon creation.
27
*
28
* If you need space for an application data unit size field (e.g. for
29
* stream-based protocols like TCP), use ns3::SeqTsSizeHeader.
30
*
31
* \sa ns3::SeqTsSizeHeader
32
*/
33
class
SeqTsHeader
:
public
Header
34
{
35
public
:
36
SeqTsHeader
();
37
38
/**
39
* @param seq the sequence number
40
*/
41
void
SetSeq
(
uint32_t
seq);
42
/**
43
* @return the sequence number
44
*/
45
uint32_t
GetSeq
()
const
;
46
/**
47
* @return the time stamp
48
*/
49
Time
GetTs
()
const
;
50
51
/**
52
* @brief Get the type ID.
53
* @return the object TypeId
54
*/
55
static
TypeId
GetTypeId
();
56
57
TypeId
GetInstanceTypeId
()
const override
;
58
void
Print
(std::ostream& os)
const override
;
59
uint32_t
GetSerializedSize
()
const override
;
60
void
Serialize
(
Buffer::Iterator
start)
const override
;
61
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
62
63
private
:
64
uint32_t
m_seq
;
//!< Sequence number
65
uint64_t
m_ts
;
//!< Timestamp
66
};
67
68
}
// namespace ns3
69
70
#endif
/* SEQ_TS_HEADER_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Header
Protocol header serialization and deserialization.
Definition
header.h:33
ns3::SeqTsHeader
Packet header to carry sequence number and timestamp.
Definition
seq-ts-header.h:34
ns3::SeqTsHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
seq-ts-header.cc:52
ns3::SeqTsHeader::m_ts
uint64_t m_ts
Timestamp.
Definition
seq-ts-header.h:65
ns3::SeqTsHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
seq-ts-header.cc:82
ns3::SeqTsHeader::m_seq
uint32_t m_seq
Sequence number.
Definition
seq-ts-header.h:64
ns3::SeqTsHeader::Print
void Print(std::ostream &os) const override
Definition
seq-ts-header.cc:68
ns3::SeqTsHeader::SeqTsHeader
SeqTsHeader()
Definition
seq-ts-header.cc:23
ns3::SeqTsHeader::SetSeq
void SetSeq(uint32_t seq)
Definition
seq-ts-header.cc:31
ns3::SeqTsHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
seq-ts-header.cc:62
ns3::SeqTsHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
seq-ts-header.cc:75
ns3::SeqTsHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
seq-ts-header.cc:91
ns3::SeqTsHeader::GetTs
Time GetTs() const
Definition
seq-ts-header.cc:45
ns3::SeqTsHeader::GetSeq
uint32_t GetSeq() const
Definition
seq-ts-header.cc:38
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
applications
model
seq-ts-header.h
Generated on Tue Dec 3 2024 18:20:40 for ns-3 by
1.11.0