A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
lte-radio-bearer-tag.cc
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: Marco Miozzo <marco.miozzo@cttc.es>
18
*/
19
20
#include "
lte-radio-bearer-tag.h
"
21
22
#include "ns3/tag.h"
23
#include "ns3/uinteger.h"
24
25
namespace
ns3
26
{
27
28
NS_OBJECT_ENSURE_REGISTERED
(LteRadioBearerTag);
29
30
TypeId
31
LteRadioBearerTag::GetTypeId
()
32
{
33
static
TypeId
tid =
34
TypeId
(
"ns3::LteRadioBearerTag"
)
35
.
SetParent
<
Tag
>()
36
.SetGroupName(
"Lte"
)
37
.AddConstructor<
LteRadioBearerTag
>()
38
.AddAttribute(
"rnti"
,
39
"The rnti that indicates the UE to which packet belongs"
,
40
UintegerValue
(0),
41
MakeUintegerAccessor
(&
LteRadioBearerTag::GetRnti
),
42
MakeUintegerChecker<uint16_t>())
43
.AddAttribute(
44
"lcid"
,
45
"The id within the UE identifying the logical channel to which the packet belongs"
,
46
UintegerValue
(0),
47
MakeUintegerAccessor
(&
LteRadioBearerTag::GetLcid
),
48
MakeUintegerChecker<uint8_t>());
49
return
tid;
50
}
51
52
TypeId
53
LteRadioBearerTag::GetInstanceTypeId
()
const
54
{
55
return
GetTypeId
();
56
}
57
58
LteRadioBearerTag::LteRadioBearerTag
()
59
: m_rnti(0),
60
m_lcid(0),
61
m_layer(0)
62
{
63
}
64
65
LteRadioBearerTag::LteRadioBearerTag
(uint16_t rnti, uint8_t lcid)
66
: m_rnti(rnti),
67
m_lcid(lcid)
68
{
69
}
70
71
LteRadioBearerTag::LteRadioBearerTag
(uint16_t rnti, uint8_t lcid, uint8_t layer)
72
: m_rnti(rnti),
73
m_lcid(lcid),
74
m_layer(layer)
75
{
76
}
77
78
void
79
LteRadioBearerTag::SetRnti
(uint16_t rnti)
80
{
81
m_rnti
= rnti;
82
}
83
84
void
85
LteRadioBearerTag::SetLcid
(uint8_t lcid)
86
{
87
m_lcid
= lcid;
88
}
89
90
void
91
LteRadioBearerTag::SetLayer
(uint8_t layer)
92
{
93
m_layer
= layer;
94
}
95
96
uint32_t
97
LteRadioBearerTag::GetSerializedSize
()
const
98
{
99
return
4;
100
}
101
102
void
103
LteRadioBearerTag::Serialize
(
TagBuffer
i)
const
104
{
105
i.
WriteU16
(
m_rnti
);
106
i.
WriteU8
(
m_lcid
);
107
i.
WriteU8
(
m_layer
);
108
}
109
110
void
111
LteRadioBearerTag::Deserialize
(
TagBuffer
i)
112
{
113
m_rnti
= (uint16_t)i.
ReadU16
();
114
m_lcid
= (uint8_t)i.
ReadU8
();
115
m_layer
= (uint8_t)i.
ReadU8
();
116
}
117
118
uint16_t
119
LteRadioBearerTag::GetRnti
()
const
120
{
121
return
m_rnti
;
122
}
123
124
uint8_t
125
LteRadioBearerTag::GetLcid
()
const
126
{
127
return
m_lcid
;
128
}
129
130
uint8_t
131
LteRadioBearerTag::GetLayer
()
const
132
{
133
return
m_layer
;
134
}
135
136
void
137
LteRadioBearerTag::Print
(std::ostream& os)
const
138
{
139
os <<
"rnti="
<<
m_rnti
<<
", lcid="
<< (uint16_t)
m_lcid
<<
", layer="
<< (uint16_t)
m_layer
;
140
}
141
142
}
// namespace ns3
ns3::LteRadioBearerTag
Tag used to define the RNTI and LC id for each MAC packet transmitted.
Definition:
lte-radio-bearer-tag.h:34
ns3::LteRadioBearerTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
lte-radio-bearer-tag.cc:97
ns3::LteRadioBearerTag::Serialize
void Serialize(TagBuffer i) const override
Definition:
lte-radio-bearer-tag.cc:103
ns3::LteRadioBearerTag::SetLayer
void SetLayer(uint8_t layer)
Set the layer id to the given value.
Definition:
lte-radio-bearer-tag.cc:91
ns3::LteRadioBearerTag::GetRnti
uint16_t GetRnti() const
Get RNTI function.
Definition:
lte-radio-bearer-tag.cc:119
ns3::LteRadioBearerTag::Print
void Print(std::ostream &os) const override
Definition:
lte-radio-bearer-tag.cc:137
ns3::LteRadioBearerTag::GetLcid
uint8_t GetLcid() const
Get LCID function.
Definition:
lte-radio-bearer-tag.cc:125
ns3::LteRadioBearerTag::m_rnti
uint16_t m_rnti
RNTI.
Definition:
lte-radio-bearer-tag.h:109
ns3::LteRadioBearerTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
lte-radio-bearer-tag.cc:31
ns3::LteRadioBearerTag::m_layer
uint8_t m_layer
layer
Definition:
lte-radio-bearer-tag.h:111
ns3::LteRadioBearerTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
lte-radio-bearer-tag.cc:53
ns3::LteRadioBearerTag::LteRadioBearerTag
LteRadioBearerTag()
Create an empty LteRadioBearerTag.
Definition:
lte-radio-bearer-tag.cc:58
ns3::LteRadioBearerTag::SetRnti
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
Definition:
lte-radio-bearer-tag.cc:79
ns3::LteRadioBearerTag::SetLcid
void SetLcid(uint8_t lcid)
Set the LC id to the given value.
Definition:
lte-radio-bearer-tag.cc:85
ns3::LteRadioBearerTag::m_lcid
uint8_t m_lcid
LCID.
Definition:
lte-radio-bearer-tag.h:110
ns3::LteRadioBearerTag::GetLayer
uint8_t GetLayer() const
Get layer function.
Definition:
lte-radio-bearer-tag.cc:131
ns3::LteRadioBearerTag::Deserialize
void Deserialize(TagBuffer i) override
Definition:
lte-radio-bearer-tag.cc:111
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:52
ns3::TagBuffer::WriteU8
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition:
tag-buffer.h:172
ns3::TagBuffer::ReadU8
TAG_BUFFER_INLINE uint8_t ReadU8()
Definition:
tag-buffer.h:196
ns3::TagBuffer::ReadU16
TAG_BUFFER_INLINE uint16_t ReadU16()
Definition:
tag-buffer.h:206
ns3::TagBuffer::WriteU16
TAG_BUFFER_INLINE void WriteU16(uint16_t v)
Definition:
tag-buffer.h:180
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:39
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:931
ns3::UintegerValue
Hold an unsigned integer type.
Definition:
uinteger.h:45
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:46
lte-radio-bearer-tag.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MakeUintegerAccessor
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition:
uinteger.h:46
src
lte
model
lte-radio-bearer-tag.cc
Generated on Sun Mar 3 2024 17:11:02 for ns-3 by
1.9.1