A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-rlc-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Manuel Requena <manuel.requena@cttc.es>
7 */
8
9#ifndef LTE_RLC_HEADER_H
10#define LTE_RLC_HEADER_H
11
13
14#include "ns3/header.h"
15
16#include <list>
17
18namespace ns3
19{
20
21/**
22 * \ingroup lte
23 * \brief The packet header for the Radio Link Control (RLC) protocol packets
24 *
25 * This class has fields corresponding to those in an RLC header as well as
26 * methods for serialization to and deserialization from a byte buffer.
27 * It follows 3GPP TS 36.322 Radio Link Control (RLC) protocol specification.
28 */
29class LteRlcHeader : public Header
30{
31 public:
32 /**
33 * \brief Constructor
34 *
35 * Creates a null header
36 */
38 ~LteRlcHeader() override;
39
40 /**
41 * Set framing info
42 *
43 * \param framingInfo framing info
44 */
45 void SetFramingInfo(uint8_t framingInfo);
46 /**
47 * Set sequence number
48 *
49 * \param sequenceNumber sequence number
50 */
51 void SetSequenceNumber(SequenceNumber10 sequenceNumber);
52
53 /**
54 * Get framing info
55 *
56 * \returns framing info
57 */
58 uint8_t GetFramingInfo() const;
59 /**
60 * Get sequence number
61 *
62 * \returns sequence number
63 */
65
66 /**
67 * Push extension bit
68 *
69 * \param extensionBit the extension bit
70 */
71 void PushExtensionBit(uint8_t extensionBit);
72 /**
73 * Push length indicator
74 *
75 * \param lengthIndicator the length indicator
76 */
77 void PushLengthIndicator(uint16_t lengthIndicator);
78
79 /**
80 * Pop extension bit
81 *
82 * \returns the extension bit
83 */
84 uint8_t PopExtensionBit();
85 /**
86 * Pop length indicator
87 *
88 * \returns the length indicator
89 */
90 uint16_t PopLengthIndicator();
91
92 /// ExtensionBit_t typedef
98
99 /// FramingInfoByte_t typedef
101 {
104 LAST_BYTE = 0x00,
105 NO_LAST_BYTE = 0x01
106 };
107
108 /**
109 * \brief Get the type ID.
110 * \return the object TypeId
111 */
112 static TypeId GetTypeId();
113 TypeId GetInstanceTypeId() const override;
114 void Print(std::ostream& os) const override;
115 uint32_t GetSerializedSize() const override;
116 void Serialize(Buffer::Iterator start) const override;
117 uint32_t Deserialize(Buffer::Iterator start) override;
118
119 private:
120 uint16_t m_headerLength; ///< header length
121 uint8_t m_framingInfo; ///< 2 bits
122 SequenceNumber10 m_sequenceNumber; ///< sequence number
123
124 std::list<uint8_t> m_extensionBits; ///< Includes extensionBit of the fixed part
125 std::list<uint16_t> m_lengthIndicators; ///< length indicators
126};
127
128}; // namespace ns3
129
130#endif // LTE_RLC_HEADER_H
iterator in a Buffer instance
Definition buffer.h:89
Protocol header serialization and deserialization.
Definition header.h:33
The packet header for the Radio Link Control (RLC) protocol packets.
void Serialize(Buffer::Iterator start) const override
uint8_t m_framingInfo
2 bits
FramingInfoByte_t
FramingInfoByte_t typedef.
std::list< uint8_t > m_extensionBits
Includes extensionBit of the fixed part.
uint32_t GetSerializedSize() const override
void PushExtensionBit(uint8_t extensionBit)
Push extension bit.
SequenceNumber10 m_sequenceNumber
sequence number
void Print(std::ostream &os) const override
ExtensionBit_t
ExtensionBit_t typedef.
SequenceNumber10 GetSequenceNumber() const
Get sequence number.
uint16_t m_headerLength
header length
void SetSequenceNumber(SequenceNumber10 sequenceNumber)
Set sequence number.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetFramingInfo(uint8_t framingInfo)
Set framing info.
std::list< uint16_t > m_lengthIndicators
length indicators
uint32_t Deserialize(Buffer::Iterator start) override
uint8_t PopExtensionBit()
Pop extension bit.
~LteRlcHeader() override
LteRlcHeader()
Constructor.
uint16_t PopLengthIndicator()
Pop length indicator.
static TypeId GetTypeId()
Get the type ID.
uint8_t GetFramingInfo() const
Get framing info.
void PushLengthIndicator(uint16_t lengthIndicator)
Push length indicator.
SequenceNumber10 class.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.