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-radio-bearer-tag.cc
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: Marco Miozzo <marco.miozzo@cttc.es>
19
*/
20
21
22
#include "
lte-radio-bearer-tag.h
"
23
#include "ns3/tag.h"
24
#include "ns3/uinteger.h"
25
26
namespace
ns3 {
27
28
NS_OBJECT_ENSURE_REGISTERED
(LteRadioBearerTag);
29
30
TypeId
31
LteRadioBearerTag::GetTypeId
(
void
)
32
{
33
static
TypeId
tid =
TypeId
(
"ns3::LteRadioBearerTag"
)
34
.
SetParent
<
Tag
> ()
35
.AddConstructor<LteRadioBearerTag> ()
36
.AddAttribute (
"rnti"
,
"The rnti that indicates the UE to which packet belongs"
,
37
UintegerValue
(0),
38
MakeUintegerAccessor (&
LteRadioBearerTag::GetRnti
),
39
MakeUintegerChecker<uint16_t> ())
40
.AddAttribute (
"lcid"
,
"The id whithin the UE identifying the logical channel to which the packet belongs"
,
41
UintegerValue
(0),
42
MakeUintegerAccessor (&
LteRadioBearerTag::GetLcid
),
43
MakeUintegerChecker<uint8_t> ())
44
;
45
return
tid;
46
}
47
48
TypeId
49
LteRadioBearerTag::GetInstanceTypeId
(
void
)
const
50
{
51
return
GetTypeId
();
52
}
53
54
LteRadioBearerTag::LteRadioBearerTag
()
55
: m_rnti (0),
56
m_lcid (0),
57
m_layer (0)
58
{
59
}
60
LteRadioBearerTag::LteRadioBearerTag
(uint16_t rnti, uint8_t lcid)
61
: m_rnti (rnti),
62
m_lcid (lcid)
63
{
64
}
65
66
LteRadioBearerTag::LteRadioBearerTag
(uint16_t rnti, uint8_t lcid, uint8_t layer)
67
: m_rnti (rnti),
68
m_lcid (lcid),
69
m_layer (layer)
70
{
71
}
72
73
void
74
LteRadioBearerTag::SetRnti
(uint16_t rnti)
75
{
76
m_rnti
= rnti;
77
}
78
79
void
80
LteRadioBearerTag::SetLcid
(uint8_t lcid)
81
{
82
m_lcid
= lcid;
83
}
84
85
void
86
LteRadioBearerTag::SetLayer
(uint8_t layer)
87
{
88
m_layer
= layer;
89
}
90
91
uint32_t
92
LteRadioBearerTag::GetSerializedSize
(
void
)
const
93
{
94
return
4;
95
}
96
97
void
98
LteRadioBearerTag::Serialize
(
TagBuffer
i)
const
99
{
100
i.
WriteU16
(
m_rnti
);
101
i.
WriteU8
(
m_lcid
);
102
i.
WriteU8
(
m_layer
);
103
}
104
105
void
106
LteRadioBearerTag::Deserialize
(
TagBuffer
i)
107
{
108
m_rnti
= (uint16_t) i.
ReadU16
();
109
m_lcid
= (uint8_t) i.
ReadU8
();
110
m_layer
= (uint8_t) i.
ReadU8
();
111
}
112
113
uint16_t
114
LteRadioBearerTag::GetRnti
()
const
115
{
116
return
m_rnti
;
117
}
118
119
uint8_t
120
LteRadioBearerTag::GetLcid
()
const
121
{
122
return
m_lcid
;
123
}
124
125
uint8_t
126
LteRadioBearerTag::GetLayer
()
const
127
{
128
return
m_layer
;
129
}
130
131
void
132
LteRadioBearerTag::Print
(std::ostream &os)
const
133
{
134
os <<
"rnti="
<<
m_rnti
<<
", lcid="
<< (uint16_t)
m_lcid
<<
", layer="
<< (uint16_t)
m_layer
;
135
}
136
137
}
// namespace ns3
src
lte
model
lte-radio-bearer-tag.cc
Generated on Tue May 14 2013 11:08:25 for ns-3 by
1.8.1.2