A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
eps-bearer-tag.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011,2012 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
* Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#include "
eps-bearer-tag.h
"
22
23
#include "ns3/tag.h"
24
#include "ns3/uinteger.h"
25
26
namespace
ns3
27
{
28
29
NS_OBJECT_ENSURE_REGISTERED
(EpsBearerTag);
30
31
TypeId
32
EpsBearerTag::GetTypeId
()
33
{
34
static
TypeId
tid =
35
TypeId
(
"ns3::EpsBearerTag"
)
36
.
SetParent
<
Tag
>()
37
.SetGroupName(
"Lte"
)
38
.AddConstructor<
EpsBearerTag
>()
39
.AddAttribute(
"rnti"
,
40
"The rnti that indicates the UE which packet belongs"
,
41
UintegerValue
(0),
42
MakeUintegerAccessor
(&
EpsBearerTag::GetRnti
),
43
MakeUintegerChecker<uint16_t>())
44
.AddAttribute(
"bid"
,
45
"The EPS bearer id within the UE to which the packet belongs"
,
46
UintegerValue
(0),
47
MakeUintegerAccessor
(&
EpsBearerTag::GetBid
),
48
MakeUintegerChecker<uint8_t>());
49
return
tid;
50
}
51
52
TypeId
53
EpsBearerTag::GetInstanceTypeId
()
const
54
{
55
return
GetTypeId
();
56
}
57
58
EpsBearerTag::EpsBearerTag
()
59
: m_rnti(0),
60
m_bid(0)
61
{
62
}
63
64
EpsBearerTag::EpsBearerTag
(uint16_t rnti, uint8_t bid)
65
: m_rnti(rnti),
66
m_bid(bid)
67
{
68
}
69
70
void
71
EpsBearerTag::SetRnti
(uint16_t rnti)
72
{
73
m_rnti
= rnti;
74
}
75
76
void
77
EpsBearerTag::SetBid
(uint8_t bid)
78
{
79
m_bid
= bid;
80
}
81
82
uint32_t
83
EpsBearerTag::GetSerializedSize
()
const
84
{
85
return
3;
86
}
87
88
void
89
EpsBearerTag::Serialize
(
TagBuffer
i)
const
90
{
91
i.
WriteU16
(
m_rnti
);
92
i.
WriteU8
(
m_bid
);
93
}
94
95
void
96
EpsBearerTag::Deserialize
(
TagBuffer
i)
97
{
98
m_rnti
= (uint16_t)i.
ReadU16
();
99
m_bid
= (uint8_t)i.
ReadU8
();
100
}
101
102
uint16_t
103
EpsBearerTag::GetRnti
()
const
104
{
105
return
m_rnti
;
106
}
107
108
uint8_t
109
EpsBearerTag::GetBid
()
const
110
{
111
return
m_bid
;
112
}
113
114
void
115
EpsBearerTag::Print
(std::ostream& os)
const
116
{
117
os <<
"rnti="
<<
m_rnti
<<
", bid="
<< (uint16_t)
m_bid
;
118
}
119
120
}
// namespace ns3
ns3::EpsBearerTag
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
Definition:
eps-bearer-tag.h:36
ns3::EpsBearerTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
eps-bearer-tag.cc:53
ns3::EpsBearerTag::m_rnti
uint16_t m_rnti
RNTI value.
Definition:
eps-bearer-tag.h:89
ns3::EpsBearerTag::Deserialize
void Deserialize(TagBuffer i) override
Definition:
eps-bearer-tag.cc:96
ns3::EpsBearerTag::GetBid
uint8_t GetBid() const
Get Bearer Id function.
Definition:
eps-bearer-tag.cc:109
ns3::EpsBearerTag::Serialize
void Serialize(TagBuffer i) const override
Definition:
eps-bearer-tag.cc:89
ns3::EpsBearerTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
eps-bearer-tag.cc:32
ns3::EpsBearerTag::m_bid
uint8_t m_bid
Bearer Id value.
Definition:
eps-bearer-tag.h:90
ns3::EpsBearerTag::Print
void Print(std::ostream &os) const override
Definition:
eps-bearer-tag.cc:115
ns3::EpsBearerTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
eps-bearer-tag.cc:83
ns3::EpsBearerTag::GetRnti
uint16_t GetRnti() const
Get RNTI function.
Definition:
eps-bearer-tag.cc:103
ns3::EpsBearerTag::SetRnti
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
Definition:
eps-bearer-tag.cc:71
ns3::EpsBearerTag::SetBid
void SetBid(uint8_t bid)
Set the bearer id to the given value.
Definition:
eps-bearer-tag.cc:77
ns3::EpsBearerTag::EpsBearerTag
EpsBearerTag()
Create an empty EpsBearerTag.
Definition:
eps-bearer-tag.cc:58
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
eps-bearer-tag.h
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:46
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
eps-bearer-tag.cc
Generated on Sun Mar 3 2024 17:11:01 for ns-3 by
1.9.1