A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
seq-ts-size-header.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 INRIA
3 * Copyright (c) 2018 Natale Patriciello <natale.patriciello@gmail.com>
4 * (added timestamp and size fields)
5 *
6 * SPDX-License-Identifier: GPL-2.0-only
7 *
8 */
9
10#include "seq-ts-size-header.h"
11
12#include "ns3/log.h"
13
14namespace ns3
15{
16
17NS_LOG_COMPONENT_DEFINE("SeqTsSizeHeader");
18
19NS_OBJECT_ENSURE_REGISTERED(SeqTsSizeHeader);
20
26
29{
30 static TypeId tid = TypeId("ns3::SeqTsSizeHeader")
32 .SetGroupName("Applications")
33 .AddConstructor<SeqTsSizeHeader>();
34 return tid;
35}
36
39{
40 return GetTypeId();
41}
42
43void
45{
46 m_size = size;
47}
48
49uint64_t
51{
52 return m_size;
53}
54
55void
56SeqTsSizeHeader::Print(std::ostream& os) const
57{
58 NS_LOG_FUNCTION(this << &os);
59 os << "(size=" << m_size << ") AND ";
61}
62
68
69void
77
87
88} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
void WriteHtonU64(uint64_t data)
Definition buffer.cc:923
uint64_t ReadNtohU64()
Definition buffer.cc:1030
Packet header to carry sequence number and timestamp.
void Serialize(Buffer::Iterator start) const override
void Print(std::ostream &os) const override
uint32_t GetSerializedSize() const override
uint32_t Deserialize(Buffer::Iterator start) override
Header with a sequence, a timestamp, and a "size" attribute.
uint32_t GetSerializedSize() const override
uint64_t GetSize() const
Get the size information that the header is carrying.
uint32_t Deserialize(Buffer::Iterator start) override
void Print(std::ostream &os) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static TypeId GetTypeId()
Get the type ID.
void Serialize(Buffer::Iterator start) const override
void SetSize(uint64_t size)
Set the size information that the header will carry.
uint64_t m_size
The 'size' information that the header is carrying.
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.