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
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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Marco Miozzo <marco.miozzo@cttc.es>
7
* Nicola Baldo <nbaldo@cttc.es>
8
*/
9
10
#include "
eps-bearer-tag.h
"
11
12
#include "ns3/tag.h"
13
#include "ns3/uinteger.h"
14
15
namespace
ns3
16
{
17
18
NS_OBJECT_ENSURE_REGISTERED
(EpsBearerTag);
19
20
TypeId
21
EpsBearerTag::GetTypeId
()
22
{
23
static
TypeId
tid =
24
TypeId
(
"ns3::EpsBearerTag"
)
25
.
SetParent
<
Tag
>()
26
.SetGroupName(
"Lte"
)
27
.AddConstructor<
EpsBearerTag
>()
28
.AddAttribute(
"rnti"
,
29
"The rnti that indicates the UE which packet belongs"
,
30
UintegerValue
(0),
31
MakeUintegerAccessor
(&
EpsBearerTag::GetRnti
),
32
MakeUintegerChecker<uint16_t>
())
33
.AddAttribute(
"bid"
,
34
"The EPS bearer id within the UE to which the packet belongs"
,
35
UintegerValue
(0),
36
MakeUintegerAccessor
(&
EpsBearerTag::GetBid
),
37
MakeUintegerChecker<uint8_t>
());
38
return
tid;
39
}
40
41
TypeId
42
EpsBearerTag::GetInstanceTypeId
()
const
43
{
44
return
GetTypeId
();
45
}
46
47
EpsBearerTag::EpsBearerTag
()
48
: m_rnti(0),
49
m_bid(0)
50
{
51
}
52
53
EpsBearerTag::EpsBearerTag
(uint16_t rnti, uint8_t bid)
54
: m_rnti(rnti),
55
m_bid(bid)
56
{
57
}
58
59
void
60
EpsBearerTag::SetRnti
(uint16_t rnti)
61
{
62
m_rnti
= rnti;
63
}
64
65
void
66
EpsBearerTag::SetBid
(uint8_t bid)
67
{
68
m_bid
= bid;
69
}
70
71
uint32_t
72
EpsBearerTag::GetSerializedSize
()
const
73
{
74
return
3;
75
}
76
77
void
78
EpsBearerTag::Serialize
(
TagBuffer
i)
const
79
{
80
i.
WriteU16
(
m_rnti
);
81
i.
WriteU8
(
m_bid
);
82
}
83
84
void
85
EpsBearerTag::Deserialize
(
TagBuffer
i)
86
{
87
m_rnti
= (uint16_t)i.
ReadU16
();
88
m_bid
= (uint8_t)i.
ReadU8
();
89
}
90
91
uint16_t
92
EpsBearerTag::GetRnti
()
const
93
{
94
return
m_rnti
;
95
}
96
97
uint8_t
98
EpsBearerTag::GetBid
()
const
99
{
100
return
m_bid
;
101
}
102
103
void
104
EpsBearerTag::Print
(std::ostream& os)
const
105
{
106
os <<
"rnti="
<<
m_rnti
<<
", bid="
<< (uint16_t)
m_bid
;
107
}
108
109
}
// 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:25
ns3::EpsBearerTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
eps-bearer-tag.cc:42
ns3::EpsBearerTag::m_rnti
uint16_t m_rnti
RNTI value.
Definition
eps-bearer-tag.h:78
ns3::EpsBearerTag::Deserialize
void Deserialize(TagBuffer i) override
Definition
eps-bearer-tag.cc:85
ns3::EpsBearerTag::GetBid
uint8_t GetBid() const
Get Bearer Id function.
Definition
eps-bearer-tag.cc:98
ns3::EpsBearerTag::Serialize
void Serialize(TagBuffer i) const override
Definition
eps-bearer-tag.cc:78
ns3::EpsBearerTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
eps-bearer-tag.cc:21
ns3::EpsBearerTag::m_bid
uint8_t m_bid
Bearer Id value.
Definition
eps-bearer-tag.h:79
ns3::EpsBearerTag::Print
void Print(std::ostream &os) const override
Definition
eps-bearer-tag.cc:104
ns3::EpsBearerTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
eps-bearer-tag.cc:72
ns3::EpsBearerTag::GetRnti
uint16_t GetRnti() const
Get RNTI function.
Definition
eps-bearer-tag.cc:92
ns3::EpsBearerTag::SetRnti
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
Definition
eps-bearer-tag.cc:60
ns3::EpsBearerTag::SetBid
void SetBid(uint8_t bid)
Set the bearer id to the given value.
Definition
eps-bearer-tag.cc:66
ns3::EpsBearerTag::EpsBearerTag
EpsBearerTag()
Create an empty EpsBearerTag.
Definition
eps-bearer-tag.cc:47
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
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:35
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
eps-bearer-tag.cc
Generated on Fri Nov 8 2024 13:59:03 for ns-3 by
1.11.0