A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
seq-ts-size-header.h
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#ifndef SEQ_TS_SIZE_HEADER_H
10#define SEQ_TS_SIZE_HEADER_H
11
12#include "seq-ts-header.h"
13
14namespace ns3
15{
16/**
17 * @ingroup applications
18 * @brief Header with a sequence, a timestamp, and a "size" attribute
19 *
20 * This header adds a size attribute to the sequence number and timestamp
21 * of class \c SeqTsHeader. The size attribute can be used to track
22 * application data units for stream-based sockets such as TCP.
23 *
24 * \sa ns3::SeqTsHeader
25 */
27{
28 public:
29 /**
30 * @brief Get the type ID.
31 * @return the object TypeId
32 */
33 static TypeId GetTypeId();
34
35 /**
36 * @brief constructor
37 */
39
40 /**
41 * @brief Set the size information that the header will carry
42 * @param size the size
43 */
44 void SetSize(uint64_t size);
45
46 /**
47 * @brief Get the size information that the header is carrying
48 * @return the size
49 */
50 uint64_t GetSize() const;
51
52 // Inherited
53 TypeId GetInstanceTypeId() const override;
54 void Print(std::ostream& os) const override;
55 uint32_t GetSerializedSize() const override;
56 void Serialize(Buffer::Iterator start) const override;
58
59 private:
60 uint64_t m_size{0}; //!< The 'size' information that the header is carrying
61};
62
63} // namespace ns3
64
65#endif /* SEQ_TS_SIZE_HEADER */
iterator in a Buffer instance
Definition buffer.h:89
Packet header to carry sequence number and timestamp.
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
Every class exported by the ns3 library is enclosed in the ns3 namespace.