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