A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
51
void
SetDataPdu
(
void
);
52
void
SetControlPdu
(uint8_t controlPduType);
53
bool
IsDataPdu
(
void
)
const
;
54
bool
IsControlPdu
(
void
)
const
;
55
56
typedef
enum
{
57
CONTROL_PDU
= 0,
58
DATA_PDU
= 1
59
}
DataControlPdu_t
;
60
61
typedef
enum
{
62
STATUS_PDU
= 000,
63
}
ControPduType_t
;
64
65
//
66
// DATA PDU
67
//
68
69
void
SetSequenceNumber
(
SequenceNumber10
sequenceNumber);
70
SequenceNumber10
GetSequenceNumber
()
const
;
71
72
void
SetFramingInfo
(uint8_t framingInfo);
73
uint8_t
GetFramingInfo
()
const
;
74
75
typedef
enum
{
76
FIRST_BYTE
= 0x00,
77
NO_FIRST_BYTE
= 0x02
78
}
FramingInfoFirstByte_t
;
79
80
typedef
enum
{
81
LAST_BYTE
= 0x00,
82
NO_LAST_BYTE
= 0x01
83
}
FramingInfoLastByte_t
;
84
85
void
PushExtensionBit
(uint8_t extensionBit);
86
void
PushLengthIndicator
(uint16_t lengthIndicator);
87
88
uint8_t
PopExtensionBit
(
void
);
89
uint16_t
PopLengthIndicator
(
void
);
90
91
typedef
enum
{
92
DATA_FIELD_FOLLOWS
= 0,
93
E_LI_FIELDS_FOLLOWS
= 1
94
}
ExtensionBit_t
;
95
96
void
SetResegmentationFlag
(uint8_t resegFlag);
97
uint8_t
GetResegmentationFlag
()
const
;
98
99
typedef
enum
{
100
PDU
= 0,
101
SEGMENT
= 1
102
}
ResegmentationFlag_t
;
103
104
void
SetPollingBit
(uint8_t pollingBit);
105
uint8_t
GetPollingBit
()
const
;
106
107
typedef
enum
{
108
STATUS_REPORT_NOT_REQUESTED
= 0,
109
STATUS_REPORT_IS_REQUESTED
= 1
110
}
PollingBit_t
;
111
112
void
SetLastSegmentFlag
(uint8_t lsf);
113
uint8_t
GetLastSegmentFlag
()
const
;
114
115
typedef
enum
{
116
NO_LAST_PDU_SEGMENT
= 0,
117
LAST_PDU_SEGMENT
= 1
118
}
LastSegmentFlag_t
;
119
120
void
SetSegmentOffset
(uint16_t segmentOffset);
121
uint16_t
GetSegmentOffset
()
const
;
122
uint16_t
GetLastOffset
()
const
;
123
124
//
125
// CONTROL PDU
126
//
127
128
void
SetAckSn
(
SequenceNumber10
ackSn);
129
SequenceNumber10
GetAckSn
()
const
;
130
131
132
static
TypeId
GetTypeId
(
void
);
133
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
134
virtual
void
Print
(std::ostream &os)
const
;
135
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
136
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
137
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
138
139
private
:
140
uint16_t
m_headerLength
;
141
uint8_t
m_dataControlBit
;
142
143
// Data PDU fields
144
uint8_t
m_resegmentationFlag
;
145
uint8_t
m_pollingBit
;
146
uint8_t
m_framingInfo
;
// 2 bits
147
SequenceNumber10
m_sequenceNumber
;
148
uint8_t
m_lastSegmentFlag
;
149
uint16_t
m_segmentOffset
;
150
uint16_t
m_lastOffset
;
151
152
std::list <uint8_t>
m_extensionBits
;
// Includes extensionBit of the fixed part
153
std::list <uint16_t>
m_lengthIndicators
;
154
155
// Control PDU fields
156
uint8_t
m_controlPduType
;
157
158
// Status PDU fields
159
SequenceNumber10
m_ackSn
;
160
SequenceNumber10
m_nackSn
;
161
162
std::list <uint8_t>
m_extensionBits1
;
// Includes E1 after ACK_SN
163
std::list <uint8_t>
m_extensionBits2
;
164
165
};
166
167
};
// namespace ns3
168
169
#endif // LTE_RLC_AM_HEADER_H
src
lte
model
lte-rlc-am-header.h
Generated on Tue Oct 9 2012 16:45:40 for ns-3 by
1.8.1.2