A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
lte
model
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
29
namespace
ns3
{
30
39
class
LteRlcAmHeader
:
public
Header
40
{
41
public
:
42
48
LteRlcAmHeader
();
49
~LteRlcAmHeader
();
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
{
72
CONTROL_PDU
= 0,
73
DATA_PDU
= 1
74
}
DataControlPdu_t
;
75
77
typedef
enum
{
78
STATUS_PDU
= 000,
79
}
ControPduType_t
;
80
81
//
82
// DATA PDU
83
//
84
90
void
SetSequenceNumber
(
SequenceNumber10
sequenceNumber);
96
SequenceNumber10
GetSequenceNumber
()
const
;
97
103
void
SetFramingInfo
(uint8_t framingInfo);
109
uint8_t
GetFramingInfo
()
const
;
110
112
typedef
enum
{
113
FIRST_BYTE
= 0x00,
114
NO_FIRST_BYTE
= 0x02
115
}
FramingInfoFirstByte_t
;
116
118
typedef
enum
{
119
LAST_BYTE
= 0x00,
120
NO_LAST_BYTE
= 0x01
121
}
FramingInfoLastByte_t
;
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
{
151
DATA_FIELD_FOLLOWS
= 0,
152
E_LI_FIELDS_FOLLOWS
= 1
153
}
ExtensionBit_t
;
154
160
void
SetResegmentationFlag
(uint8_t resegFlag);
166
uint8_t
GetResegmentationFlag
()
const
;
167
169
typedef
enum
{
170
PDU
= 0,
171
SEGMENT
= 1
172
}
ResegmentationFlag_t
;
173
179
void
SetPollingBit
(uint8_t pollingBit);
185
uint8_t
GetPollingBit
()
const
;
186
188
typedef
enum
{
189
STATUS_REPORT_NOT_REQUESTED
= 0,
190
STATUS_REPORT_IS_REQUESTED
= 1
191
}
PollingBit_t
;
192
198
void
SetLastSegmentFlag
(uint8_t lsf);
204
uint8_t
GetLastSegmentFlag
()
const
;
205
207
typedef
enum
{
208
NO_LAST_PDU_SEGMENT
= 0,
209
LAST_PDU_SEGMENT
= 1
210
}
LastSegmentFlag_t
;
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
;
258
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
259
267
bool
OneMoreNackWouldFitIn
(uint16_t bytes);
268
274
void
PushNack
(
int
nack);
275
283
bool
IsNackPresent
(
SequenceNumber10
nack);
284
285
292
int
PopNack
(
void
);
293
294
295
private
:
296
uint16_t
m_headerLength
;
297
uint8_t
m_dataControlBit
;
298
299
// Data PDU fields
300
uint8_t
m_resegmentationFlag
;
301
uint8_t
m_pollingBit
;
302
uint8_t
m_framingInfo
;
303
SequenceNumber10
m_sequenceNumber
;
304
uint8_t
m_lastSegmentFlag
;
305
uint16_t
m_segmentOffset
;
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
312
uint8_t
m_controlPduType
;
313
314
// Status PDU fields
315
SequenceNumber10
m_ackSn
;
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
ns3::LteRlcAmHeader::PopExtensionBit
uint8_t PopExtensionBit(void)
Pop extension bit function.
Definition:
lte-rlc-am-header.cc:133
ns3::LteRlcAmHeader::GetLastSegmentFlag
uint8_t GetLastSegmentFlag() const
Get last segment flag function.
Definition:
lte-rlc-am-header.cc:184
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::LteRlcAmHeader::m_controlPduType
uint8_t m_controlPduType
control PDU type
Definition:
lte-rlc-am-header.h:312
ns3::LteRlcAmHeader::m_extensionBits2
std::list< uint8_t > m_extensionBits2
extension bits 2
Definition:
lte-rlc-am-header.h:319
ns3::LteRlcAmHeader::m_headerLength
uint16_t m_headerLength
header length
Definition:
lte-rlc-am-header.h:296
ns3::LteRlcAmHeader::SetResegmentationFlag
void SetResegmentationFlag(uint8_t resegFlag)
Pop extension bit function.
Definition:
lte-rlc-am-header.cc:152
ns3::LteRlcAmHeader::m_extensionBits
std::list< uint8_t > m_extensionBits
Includes extensionBit of the fixed part.
Definition:
lte-rlc-am-header.h:308
ns3::LteRlcAmHeader::m_dataControlBit
uint8_t m_dataControlBit
data control bit
Definition:
lte-rlc-am-header.h:297
visualizer.core.start
def start()
Definition:
core.py:1844
ns3::LteRlcAmHeader::SetSequenceNumber
void SetSequenceNumber(SequenceNumber10 sequenceNumber)
Set sequence number.
Definition:
lte-rlc-am-header.cc:90
ns3::LteRlcAmHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
lte-rlc-am-header.cc:304
ns3::LteRlcAmHeader::SetDataPdu
void SetDataPdu(void)
Set data PDU function.
Definition:
lte-rlc-am-header.cc:60
ns3::LteRlcAmHeader::SetPollingBit
void SetPollingBit(uint8_t pollingBit)
Set polling bit function.
Definition:
lte-rlc-am-header.cc:165
ns3::LteRlcAmHeader::CONTROL_PDU
Definition:
lte-rlc-am-header.h:72
ns3::LteRlcAmHeader::m_lastSegmentFlag
uint8_t m_lastSegmentFlag
last segment flag
Definition:
lte-rlc-am-header.h:304
ns3::LteRlcAmHeader::SEGMENT
Definition:
lte-rlc-am-header.h:171
ns3::LteRlcAmHeader::LAST_PDU_SEGMENT
Definition:
lte-rlc-am-header.h:209
ns3::LteRlcAmHeader::FramingInfoLastByte_t
FramingInfoLastByte_t
FramingInfoLastByte_t enumeration.
Definition:
lte-rlc-am-header.h:118
ns3::LteRlcAmHeader::m_lengthIndicators
std::list< uint16_t > m_lengthIndicators
length indicators
Definition:
lte-rlc-am-header.h:309
ns3::LteRlcAmHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
lte-rlc-am-header.cc:364
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::LteRlcAmHeader::GetSequenceNumber
SequenceNumber10 GetSequenceNumber() const
Get sequence number.
Definition:
lte-rlc-am-header.cc:102
ns3::LteRlcAmHeader::m_pollingBit
uint8_t m_pollingBit
polling bit
Definition:
lte-rlc-am-header.h:301
ns3::LteRlcAmHeader::PollingBit_t
PollingBit_t
PollingBit_t enumeration.
Definition:
lte-rlc-am-header.h:188
ns3::LteRlcAmHeader::IsNackPresent
bool IsNackPresent(SequenceNumber10 nack)
Definition:
lte-rlc-am-header.cc:250
ns3::LteRlcAmHeader::DATA_FIELD_FOLLOWS
Definition:
lte-rlc-am-header.h:151
ns3::LteRlcAmHeader::PushNack
void PushNack(int nack)
Add one more NACK to the CONTROL PDU.
Definition:
lte-rlc-am-header.cc:232
ns3::LteRlcAmHeader::m_framingInfo
uint8_t m_framingInfo
2 bits
Definition:
lte-rlc-am-header.h:302
ns3::LteRlcAmHeader::SetFramingInfo
void SetFramingInfo(uint8_t framingInfo)
Set sequence number.
Definition:
lte-rlc-am-header.cc:84
ns3::LteRlcAmHeader::IsControlPdu
bool IsControlPdu(void) const
Is control PDU function.
Definition:
lte-rlc-am-header.cc:78
ns3::LteRlcAmHeader::m_nackSnList
std::list< int > m_nackSnList
nack sn list
Definition:
lte-rlc-am-header.h:316
ns3::LteRlcAmHeader::SetSegmentOffset
void SetSegmentOffset(uint16_t segmentOffset)
Set segment offset function.
Definition:
lte-rlc-am-header.cc:191
ns3::LteRlcAmHeader::m_resegmentationFlag
uint8_t m_resegmentationFlag
resegmentation flag
Definition:
lte-rlc-am-header.h:300
ns3::LteRlcAmHeader::NO_FIRST_BYTE
Definition:
lte-rlc-am-header.h:114
ns3::LteRlcAmHeader::Print
virtual void Print(std::ostream &os) const
Definition:
lte-rlc-am-header.cc:310
ns3::LteRlcAmHeader::NO_LAST_PDU_SEGMENT
Definition:
lte-rlc-am-header.h:208
ns3::LteRlcAmHeader::m_sequenceNumber
SequenceNumber10 m_sequenceNumber
sequence number
Definition:
lte-rlc-am-header.h:303
ns3::LteRlcAmHeader::PushLengthIndicator
void PushLengthIndicator(uint16_t lengthIndicator)
Push length indicator function.
Definition:
lte-rlc-am-header.cc:126
ns3::LteRlcAmHeader::DATA_PDU
Definition:
lte-rlc-am-header.h:73
ns3::LteRlcAmHeader::SetControlPdu
void SetControlPdu(uint8_t controlPduType)
Set control PDU function.
Definition:
lte-rlc-am-header.cc:66
ns3::LteRlcAmHeader
The packet header for the AM Radio Link Control (RLC) protocol packets.
Definition:
lte-rlc-am-header.h:39
ns3::LteRlcAmHeader::LAST_BYTE
Definition:
lte-rlc-am-header.h:119
ns3::LteRlcAmHeader::m_ackSn
SequenceNumber10 m_ackSn
ack sn
Definition:
lte-rlc-am-header.h:315
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::LteRlcAmHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
lte-rlc-am-header.cc:502
ns3::LteRlcAmHeader::GetResegmentationFlag
uint8_t GetResegmentationFlag() const
Get resegmentation flag function.
Definition:
lte-rlc-am-header.cc:158
ns3::LteRlcAmHeader::IsDataPdu
bool IsDataPdu(void) const
Is data PDU function.
Definition:
lte-rlc-am-header.cc:73
ns3::LteRlcAmHeader::GetFramingInfo
uint8_t GetFramingInfo() const
Get framing info.
Definition:
lte-rlc-am-header.cc:96
ns3::LteRlcAmHeader::GetPollingBit
uint8_t GetPollingBit() const
Get polling bit function.
Definition:
lte-rlc-am-header.cc:171
ns3::LteRlcAmHeader::ResegmentationFlag_t
ResegmentationFlag_t
ResegmentationFlag_t typedef.
Definition:
lte-rlc-am-header.h:169
ns3::LteRlcAmHeader::LastSegmentFlag_t
LastSegmentFlag_t
LastSegmentFlag_t typedef.
Definition:
lte-rlc-am-header.h:207
ns3::LteRlcAmHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
lte-rlc-am-header.cc:293
ns3::LteRlcAmHeader::m_extensionBits1
std::list< uint8_t > m_extensionBits1
Includes E1 after ACK_SN.
Definition:
lte-rlc-am-header.h:318
ns3::LteRlcAmHeader::PDU
Definition:
lte-rlc-am-header.h:170
ns3::LteRlcAmHeader::GetAckSn
SequenceNumber10 GetAckSn() const
Get ack sn function.
Definition:
lte-rlc-am-header.cc:286
ns3::LteRlcAmHeader::DataControlPdu_t
DataControlPdu_t
DataControlPdu_t enumeration.
Definition:
lte-rlc-am-header.h:71
ns3::LteRlcAmHeader::NO_LAST_BYTE
Definition:
lte-rlc-am-header.h:120
ns3::LteRlcAmHeader::GetLastOffset
uint16_t GetLastOffset() const
Get last offset function.
Definition:
lte-rlc-am-header.cc:203
ns3::LteRlcAmHeader::STATUS_REPORT_NOT_REQUESTED
Definition:
lte-rlc-am-header.h:189
ns3::LteRlcAmHeader::m_lastOffset
uint16_t m_lastOffset
last offset
Definition:
lte-rlc-am-header.h:306
ns3::LteRlcAmHeader::PopLengthIndicator
uint16_t PopLengthIndicator(void)
Pop length indicator function.
Definition:
lte-rlc-am-header.cc:142
ns3::LteRlcAmHeader::STATUS_REPORT_IS_REQUESTED
Definition:
lte-rlc-am-header.h:190
ns3::LteRlcAmHeader::OneMoreNackWouldFitIn
bool OneMoreNackWouldFitIn(uint16_t bytes)
Definition:
lte-rlc-am-header.cc:216
ns3::LteRlcAmHeader::FramingInfoFirstByte_t
FramingInfoFirstByte_t
FramingInfoFirstByte_t enumeration.
Definition:
lte-rlc-am-header.h:112
ns3::LteRlcAmHeader::PopNack
int PopNack(void)
Retrieve one NACK from the CONTROL PDU.
Definition:
lte-rlc-am-header.cc:268
ns3::LteRlcAmHeader::ExtensionBit_t
ExtensionBit_t
ExtensionBit_t typedef.
Definition:
lte-rlc-am-header.h:150
ns3::SequenceNumber10
SequenceNumber10 class.
Definition:
lte-rlc-sequence-number.h:36
ns3::LteRlcAmHeader::SetAckSn
void SetAckSn(SequenceNumber10 ackSn)
Set ack sn function.
Definition:
lte-rlc-am-header.cc:210
ns3::LteRlcAmHeader::STATUS_PDU
Definition:
lte-rlc-am-header.h:78
ns3::LteRlcAmHeader::FIRST_BYTE
Definition:
lte-rlc-am-header.h:113
ns3::LteRlcAmHeader::GetSegmentOffset
uint16_t GetSegmentOffset() const
Get segment offset function.
Definition:
lte-rlc-am-header.cc:197
ns3::LteRlcAmHeader::SetLastSegmentFlag
void SetLastSegmentFlag(uint8_t lsf)
Set last segment flag function.
Definition:
lte-rlc-am-header.cc:178
ns3::LteRlcAmHeader::PushExtensionBit
void PushExtensionBit(uint8_t extensionBit)
Push extension bit function.
Definition:
lte-rlc-am-header.cc:109
ns3::LteRlcAmHeader::m_segmentOffset
uint16_t m_segmentOffset
segment offset
Definition:
lte-rlc-am-header.h:305
ns3::LteRlcAmHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
lte-rlc-am-header.cc:369
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::LteRlcAmHeader::~LteRlcAmHeader
~LteRlcAmHeader()
Definition:
lte-rlc-am-header.cc:45
ns3::LteRlcAmHeader::LteRlcAmHeader
LteRlcAmHeader()
Constructor.
Definition:
lte-rlc-am-header.cc:31
ns3::LteRlcAmHeader::ControPduType_t
ControPduType_t
ControlPduType_t enumeration.
Definition:
lte-rlc-am-header.h:77
ns3::LteRlcAmHeader::E_LI_FIELDS_FOLLOWS
Definition:
lte-rlc-am-header.h:152
Generated on Wed Nov 7 2018 10:02:01 for ns-3 by
1.8.14