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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Manuel Requena <manuel.requena@cttc.es>
18 */
19
20#ifndef LTE_RLC_HEADER_H
21#define LTE_RLC_HEADER_H
22
24
25#include "ns3/header.h"
26
27#include <list>
28
29namespace ns3
30{
31
32/**
33 * \ingroup lte
34 * \brief The packet header for the Radio Link Control (RLC) protocol packets
35 *
36 * This class has fields corresponding to those in an RLC header as well as
37 * methods for serialization to and deserialization from a byte buffer.
38 * It follows 3GPP TS 36.322 Radio Link Control (RLC) protocol specification.
39 */
40class LteRlcHeader : public Header
41{
42 public:
43 /**
44 * \brief Constructor
45 *
46 * Creates a null header
47 */
49 ~LteRlcHeader() override;
50
51 /**
52 * Set framing info
53 *
54 * \param framingInfo framing info
55 */
56 void SetFramingInfo(uint8_t framingInfo);
57 /**
58 * Set sequence number
59 *
60 * \param sequenceNumber sequence number
61 */
62 void SetSequenceNumber(SequenceNumber10 sequenceNumber);
63
64 /**
65 * Get framing info
66 *
67 * \returns framing info
68 */
69 uint8_t GetFramingInfo() const;
70 /**
71 * Get sequence number
72 *
73 * \returns sequence number
74 */
76
77 /**
78 * Push extension bit
79 *
80 * \param extensionBit the extension bit
81 */
82 void PushExtensionBit(uint8_t extensionBit);
83 /**
84 * Push length indicator
85 *
86 * \param lengthIndicator the length indicator
87 */
88 void PushLengthIndicator(uint16_t lengthIndicator);
89
90 /**
91 * Pop extension bit
92 *
93 * \returns the extension bit
94 */
95 uint8_t PopExtensionBit();
96 /**
97 * Pop length indicator
98 *
99 * \returns the length indicator
100 */
101 uint16_t PopLengthIndicator();
102
103 /// ExtensionBit_t typedef
105 {
108 };
109
110 /// FramingInfoByte_t typedef
112 {
115 LAST_BYTE = 0x00,
116 NO_LAST_BYTE = 0x01
117 };
118
119 /**
120 * \brief Get the type ID.
121 * \return the object TypeId
122 */
123 static TypeId GetTypeId();
124 TypeId GetInstanceTypeId() const override;
125 void Print(std::ostream& os) const override;
126 uint32_t GetSerializedSize() const override;
127 void Serialize(Buffer::Iterator start) const override;
128 uint32_t Deserialize(Buffer::Iterator start) override;
129
130 private:
131 uint16_t m_headerLength; ///< header length
132 uint8_t m_framingInfo; ///< 2 bits
133 SequenceNumber10 m_sequenceNumber; ///< sequence number
134
135 std::list<uint8_t> m_extensionBits; ///< Includes extensionBit of the fixed part
136 std::list<uint16_t> m_lengthIndicators; ///< length indicators
137};
138
139}; // namespace ns3
140
141#endif // LTE_RLC_HEADER_H
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
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:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.