A Discrete-Event Network Simulator
API
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 
29 namespace ns3
30 {
31 
40 class LteRlcHeader : public Header
41 {
42  public:
48  LteRlcHeader();
49  ~LteRlcHeader() override;
50 
56  void SetFramingInfo(uint8_t framingInfo);
62  void SetSequenceNumber(SequenceNumber10 sequenceNumber);
63 
69  uint8_t GetFramingInfo() const;
76 
82  void PushExtensionBit(uint8_t extensionBit);
88  void PushLengthIndicator(uint16_t lengthIndicator);
89 
95  uint8_t PopExtensionBit();
101  uint16_t PopLengthIndicator();
102 
105  {
108  };
109 
112  {
113  FIRST_BYTE = 0x00,
115  LAST_BYTE = 0x00,
116  NO_LAST_BYTE = 0x01
117  };
118 
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;
132  uint8_t m_framingInfo;
134 
135  std::list<uint8_t> m_extensionBits;
136  std::list<uint16_t> m_lengthIndicators;
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
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
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
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.