A Discrete-Event Network Simulator
API
lte-rlc-am-header.h
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Manuel Requena <manuel.requena@cttc.es>
19 */
20
21#ifndef LTE_RLC_AM_HEADER_H
22#define LTE_RLC_AM_HEADER_H
23
24#include "ns3/header.h"
25#include "ns3/lte-rlc-sequence-number.h"
26
27#include <list>
28
29namespace ns3 {
30
39class LteRlcAmHeader : public Header
40{
41public:
42
50
52 void SetDataPdu (void);
58 void SetControlPdu (uint8_t controlPduType);
63 bool IsDataPdu (void) const;
68 bool IsControlPdu (void) const;
69
71 typedef enum {
73 DATA_PDU = 1
75
77 typedef enum {
80
81 //
82 // DATA PDU
83 //
84
90 void SetSequenceNumber (SequenceNumber10 sequenceNumber);
97
103 void SetFramingInfo (uint8_t framingInfo);
109 uint8_t GetFramingInfo () const;
110
112 typedef enum {
114 NO_FIRST_BYTE = 0x02
116
118 typedef enum {
119 LAST_BYTE = 0x00,
120 NO_LAST_BYTE = 0x01
122
128 void PushExtensionBit (uint8_t extensionBit);
134 void PushLengthIndicator (uint16_t lengthIndicator);
135
141 uint8_t PopExtensionBit (void);
147 uint16_t PopLengthIndicator (void);
148
150 typedef enum {
154
160 void SetResegmentationFlag (uint8_t resegFlag);
166 uint8_t GetResegmentationFlag () const;
167
169 typedef enum {
170 PDU = 0,
171 SEGMENT = 1
173
179 void SetPollingBit (uint8_t pollingBit);
185 uint8_t GetPollingBit () const;
186
188 typedef enum {
192
198 void SetLastSegmentFlag (uint8_t lsf);
204 uint8_t GetLastSegmentFlag () const;
205
207 typedef enum {
211
217 void SetSegmentOffset (uint16_t segmentOffset);
223 uint16_t GetSegmentOffset () const;
229 uint16_t GetLastOffset () const;
230
231 //
232 // CONTROL PDU
233 //
234
240 void SetAckSn (SequenceNumber10 ackSn);
246 SequenceNumber10 GetAckSn () const;
247
248
253 static TypeId GetTypeId (void);
254 virtual TypeId GetInstanceTypeId (void) const;
255 virtual void Print (std::ostream &os) const;
256 virtual uint32_t GetSerializedSize (void) const;
257 virtual void Serialize (Buffer::Iterator start) const;
259
267 bool OneMoreNackWouldFitIn (uint16_t bytes);
268
274 void PushNack (int nack);
275
284
285
292 int PopNack (void);
293
294
295private:
296 uint16_t m_headerLength;
298
299 // Data PDU fields
301 uint8_t m_pollingBit;
306 uint16_t m_lastOffset;
307
308 std::list <uint8_t> m_extensionBits;
309 std::list <uint16_t> m_lengthIndicators;
310
311 // Control PDU fields
313
314 // Status PDU fields
316 std::list <int> m_nackSnList;
317
318 std::list <uint8_t> m_extensionBits1;
319 std::list <uint8_t> m_extensionBits2;
320
321};
322
323}; // namespace ns3
324
325#endif // LTE_RLC_AM_HEADER_H
iterator in a Buffer instance
Definition: buffer.h:99
Protocol header serialization and deserialization.
Definition: header.h:43
The packet header for the AM Radio Link Control (RLC) protocol packets.
uint8_t GetPollingBit() const
Get polling bit function.
LastSegmentFlag_t
LastSegmentFlag_t typedef.
PollingBit_t
PollingBit_t enumeration.
void SetSegmentOffset(uint16_t segmentOffset)
Set segment offset function.
void PushExtensionBit(uint8_t extensionBit)
Push extension bit function.
SequenceNumber10 GetAckSn() const
Get ack sn function.
void SetPollingBit(uint8_t pollingBit)
Set polling bit function.
bool OneMoreNackWouldFitIn(uint16_t bytes)
uint16_t m_headerLength
header length
virtual void Serialize(Buffer::Iterator start) const
void SetLastSegmentFlag(uint8_t lsf)
Set last segment flag function.
ExtensionBit_t
ExtensionBit_t typedef.
uint16_t GetLastOffset() const
Get last offset function.
SequenceNumber10 m_sequenceNumber
sequence number
uint8_t PopExtensionBit(void)
Pop extension bit function.
uint16_t m_lastOffset
last offset
LteRlcAmHeader()
Constructor.
void PushNack(int nack)
Add one more NACK to the CONTROL PDU.
static TypeId GetTypeId(void)
Get the type ID.
bool IsControlPdu(void) const
Is control PDU function.
void SetDataPdu(void)
Set data PDU function.
uint8_t m_dataControlBit
data control bit
std::list< uint8_t > m_extensionBits
Includes extensionBit of the fixed part.
void SetFramingInfo(uint8_t framingInfo)
Set sequence number.
int PopNack(void)
Retrieve one NACK from the CONTROL PDU.
virtual uint32_t GetSerializedSize(void) const
bool IsDataPdu(void) const
Is data PDU function.
DataControlPdu_t
DataControlPdu_t enumeration.
uint8_t GetLastSegmentFlag() const
Get last segment flag function.
ControPduType_t
ControlPduType_t enumeration.
SequenceNumber10 m_ackSn
ack sn
uint8_t m_controlPduType
control PDU type
ResegmentationFlag_t
ResegmentationFlag_t typedef.
virtual void Print(std::ostream &os) const
uint16_t m_segmentOffset
segment offset
uint16_t PopLengthIndicator(void)
Pop length indicator function.
std::list< uint8_t > m_extensionBits2
extension bits 2
void SetAckSn(SequenceNumber10 ackSn)
Set ack sn function.
virtual uint32_t Deserialize(Buffer::Iterator start)
std::list< uint8_t > m_extensionBits1
Includes E1 after ACK_SN.
uint8_t m_framingInfo
2 bits
uint8_t m_resegmentationFlag
resegmentation flag
void PushLengthIndicator(uint16_t lengthIndicator)
Push length indicator function.
uint8_t GetResegmentationFlag() const
Get resegmentation flag function.
void SetResegmentationFlag(uint8_t resegFlag)
Pop extension bit function.
uint16_t GetSegmentOffset() const
Get segment offset function.
uint8_t m_pollingBit
polling bit
uint8_t m_lastSegmentFlag
last segment flag
bool IsNackPresent(SequenceNumber10 nack)
std::list< int > m_nackSnList
nack sn list
uint8_t GetFramingInfo() const
Get framing info.
SequenceNumber10 GetSequenceNumber() const
Get sequence number.
FramingInfoLastByte_t
FramingInfoLastByte_t enumeration.
void SetControlPdu(uint8_t controlPduType)
Set control PDU function.
FramingInfoFirstByte_t
FramingInfoFirstByte_t enumeration.
std::list< uint16_t > m_lengthIndicators
length indicators
void SetSequenceNumber(SequenceNumber10 sequenceNumber)
Set sequence number.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
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.
def start()
Definition: core.py:1853