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
eps-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,2012 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
* Nicola Baldo <nbaldo@cttc.es>
20
*/
21
22
23
#include "
eps-bearer-tag.h
"
24
#include "ns3/tag.h"
25
#include "ns3/uinteger.h"
26
27
namespace
ns3 {
28
29
NS_OBJECT_ENSURE_REGISTERED
(EpsBearerTag);
30
31
TypeId
32
EpsBearerTag::GetTypeId
(
void
)
33
{
34
static
TypeId
tid =
TypeId
(
"ns3::EpsBearerTag"
)
35
.
SetParent
<
Tag
> ()
36
.AddConstructor<EpsBearerTag> ()
37
.AddAttribute (
"rnti"
,
"The rnti that indicates the UE which packet belongs"
,
38
UintegerValue
(0),
39
MakeUintegerAccessor (&
EpsBearerTag::GetRnti
),
40
MakeUintegerChecker<uint16_t> ())
41
.AddAttribute (
"bid"
,
"The EPS bearer id within the UE to which the packet belongs"
,
42
UintegerValue
(0),
43
MakeUintegerAccessor (&
EpsBearerTag::GetBid
),
44
MakeUintegerChecker<uint8_t> ())
45
;
46
return
tid;
47
}
48
49
TypeId
50
EpsBearerTag::GetInstanceTypeId
(
void
)
const
51
{
52
return
GetTypeId
();
53
}
54
55
EpsBearerTag::EpsBearerTag
()
56
: m_rnti (0),
57
m_bid (0)
58
{
59
}
60
EpsBearerTag::EpsBearerTag
(uint16_t rnti, uint8_t bid)
61
: m_rnti (rnti),
62
m_bid (bid)
63
{
64
}
65
66
void
67
EpsBearerTag::SetRnti
(uint16_t rnti)
68
{
69
m_rnti
= rnti;
70
}
71
72
void
73
EpsBearerTag::SetBid
(uint8_t bid)
74
{
75
m_bid
= bid;
76
}
77
78
uint32_t
79
EpsBearerTag::GetSerializedSize
(
void
)
const
80
{
81
return
3;
82
}
83
84
void
85
EpsBearerTag::Serialize
(
TagBuffer
i)
const
86
{
87
i.
WriteU16
(
m_rnti
);
88
i.
WriteU8
(
m_bid
);
89
}
90
91
void
92
EpsBearerTag::Deserialize
(
TagBuffer
i)
93
{
94
m_rnti
= (uint16_t) i.
ReadU16
();
95
m_bid
= (uint8_t) i.
ReadU8
();
96
}
97
98
uint16_t
99
EpsBearerTag::GetRnti
()
const
100
{
101
return
m_rnti
;
102
}
103
104
uint8_t
105
EpsBearerTag::GetBid
()
const
106
{
107
return
m_bid
;
108
}
109
110
void
111
EpsBearerTag::Print
(std::ostream &os)
const
112
{
113
os <<
"rnti="
<<
m_rnti
<<
", bid="
<< (uint16_t)
m_bid
;
114
}
115
116
}
// namespace ns3
src
lte
model
eps-bearer-tag.cc
Generated on Tue May 14 2013 11:08:24 for ns-3 by
1.8.1.2