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
ns3::EpsBearerTag::m_rnti
uint16_t m_rnti
Definition:
eps-bearer-tag.h:75
ns3::EpsBearerTag::SetBid
void SetBid(uint8_t bid)
Definition:
eps-bearer-tag.cc:73
ns3::EpsBearerTag::GetBid
uint8_t GetBid(void) const
Definition:
eps-bearer-tag.cc:105
ns3::EpsBearerTag::GetRnti
uint16_t GetRnti(void) const
Definition:
eps-bearer-tag.cc:99
eps-bearer-tag.h
ns3::EpsBearerTag::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
eps-bearer-tag.cc:50
ns3::TagBuffer::ReadU8
TAG_BUFFER_INLINE uint8_t ReadU8(void)
Definition:
tag-buffer.h:179
ns3::UintegerValue
Hold an unsigned integer type.
Definition:
uinteger.h:46
ns3::NS_OBJECT_ENSURE_REGISTERED
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
ns3::TagBuffer::WriteU16
TAG_BUFFER_INLINE void WriteU16(uint16_t v)
Definition:
tag-buffer.h:164
ns3::EpsBearerTag::EpsBearerTag
EpsBearerTag()
Definition:
eps-bearer-tag.cc:55
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:36
ns3::EpsBearerTag::GetTypeId
static TypeId GetTypeId(void)
Definition:
eps-bearer-tag.cc:32
ns3::TagBuffer::WriteU8
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition:
tag-buffer.h:156
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:51
ns3::EpsBearerTag::Serialize
virtual void Serialize(TagBuffer i) const
Definition:
eps-bearer-tag.cc:85
ns3::EpsBearerTag::Deserialize
virtual void Deserialize(TagBuffer i)
Definition:
eps-bearer-tag.cc:92
ns3::EpsBearerTag::SetRnti
void SetRnti(uint16_t tid)
Definition:
eps-bearer-tag.cc:67
ns3::EpsBearerTag::m_bid
uint8_t m_bid
Definition:
eps-bearer-tag.h:76
ns3::TagBuffer::ReadU16
TAG_BUFFER_INLINE uint16_t ReadU16(void)
Definition:
tag-buffer.h:189
ns3::EpsBearerTag::Print
virtual void Print(std::ostream &os) const
Definition:
eps-bearer-tag.cc:111
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Definition:
type-id.cc:610
ns3::EpsBearerTag::GetSerializedSize
virtual uint32_t GetSerializedSize() const
Definition:
eps-bearer-tag.cc:79
src
lte
model
eps-bearer-tag.cc
Generated on Sun Apr 20 2014 11:14:54 for ns-3 by
1.8.6