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