author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Thu, 13 Aug 2015 12:10:01 -0700 | |
changeset 11577 | 0210ca11dad1 |
parent 11274 | 609de51c9b88 |
permissions | -rw-r--r-- |
7886 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
3 |
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
7886 | 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 |
||
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
22 |
#include "lte-radio-bearer-tag.h" |
7886 | 23 |
#include "ns3/tag.h" |
24 |
#include "ns3/uinteger.h" |
|
25 |
||
26 |
namespace ns3 { |
|
27 |
||
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10410
diff
changeset
|
28 |
NS_OBJECT_ENSURE_REGISTERED (LteRadioBearerTag); |
7886 | 29 |
|
30 |
TypeId |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
31 |
LteRadioBearerTag::GetTypeId (void) |
7886 | 32 |
{ |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
33 |
static TypeId tid = TypeId ("ns3::LteRadioBearerTag") |
7886 | 34 |
.SetParent<Tag> () |
11274
609de51c9b88
SetGroupName for lte module
Mohit Goyal <mohit.bits2011@gmail.com>
parents:
10652
diff
changeset
|
35 |
.SetGroupName("Lte") |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
36 |
.AddConstructor<LteRadioBearerTag> () |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
37 |
.AddAttribute ("rnti", "The rnti that indicates the UE to which packet belongs", |
7886 | 38 |
UintegerValue (0), |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
39 |
MakeUintegerAccessor (&LteRadioBearerTag::GetRnti), |
7886 | 40 |
MakeUintegerChecker<uint16_t> ()) |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
41 |
.AddAttribute ("lcid", "The id whithin the UE identifying the logical channel to which the packet belongs", |
7886 | 42 |
UintegerValue (0), |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
43 |
MakeUintegerAccessor (&LteRadioBearerTag::GetLcid), |
7886 | 44 |
MakeUintegerChecker<uint8_t> ()) |
45 |
; |
|
46 |
return tid; |
|
47 |
} |
|
48 |
||
49 |
TypeId |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
50 |
LteRadioBearerTag::GetInstanceTypeId (void) const |
7886 | 51 |
{ |
52 |
return GetTypeId (); |
|
53 |
} |
|
54 |
||
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
55 |
LteRadioBearerTag::LteRadioBearerTag () |
7886 | 56 |
: m_rnti (0), |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
57 |
m_lcid (0), |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
58 |
m_layer (0) |
7886 | 59 |
{ |
60 |
} |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
61 |
LteRadioBearerTag::LteRadioBearerTag (uint16_t rnti, uint8_t lcid) |
7886 | 62 |
: m_rnti (rnti), |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
63 |
m_lcid (lcid) |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
64 |
{ |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
65 |
} |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
66 |
|
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
67 |
LteRadioBearerTag::LteRadioBearerTag (uint16_t rnti, uint8_t lcid, uint8_t layer) |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
68 |
: m_rnti (rnti), |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
69 |
m_lcid (lcid), |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
70 |
m_layer (layer) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
71 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
72 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
73 |
|
7886 | 74 |
void |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
75 |
LteRadioBearerTag::SetRnti (uint16_t rnti) |
7886 | 76 |
{ |
77 |
m_rnti = rnti; |
|
78 |
} |
|
79 |
||
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
7886
diff
changeset
|
80 |
void |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
81 |
LteRadioBearerTag::SetLcid (uint8_t lcid) |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
7886
diff
changeset
|
82 |
{ |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
83 |
m_lcid = lcid; |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
84 |
} |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
85 |
|
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
86 |
void |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
87 |
LteRadioBearerTag::SetLayer (uint8_t layer) |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
88 |
{ |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
89 |
m_layer = layer; |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
90 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
91 |
|
7886 | 92 |
uint32_t |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
93 |
LteRadioBearerTag::GetSerializedSize (void) const |
7886 | 94 |
{ |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
95 |
return 4; |
7886 | 96 |
} |
97 |
||
98 |
void |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
99 |
LteRadioBearerTag::Serialize (TagBuffer i) const |
7886 | 100 |
{ |
101 |
i.WriteU16 (m_rnti); |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
102 |
i.WriteU8 (m_lcid); |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
103 |
i.WriteU8 (m_layer); |
7886 | 104 |
} |
105 |
||
106 |
void |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
107 |
LteRadioBearerTag::Deserialize (TagBuffer i) |
7886 | 108 |
{ |
109 |
m_rnti = (uint16_t) i.ReadU16 (); |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
110 |
m_lcid = (uint8_t) i.ReadU8 (); |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
111 |
m_layer = (uint8_t) i.ReadU8 (); |
7886 | 112 |
} |
113 |
||
114 |
uint16_t |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
115 |
LteRadioBearerTag::GetRnti () const |
7886 | 116 |
{ |
117 |
return m_rnti; |
|
118 |
} |
|
119 |
||
120 |
uint8_t |
|
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
121 |
LteRadioBearerTag::GetLcid () const |
7886 | 122 |
{ |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
123 |
return m_lcid; |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
124 |
} |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
125 |
|
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
126 |
uint8_t |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
127 |
LteRadioBearerTag::GetLayer () const |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
128 |
{ |
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
129 |
return m_layer; |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
130 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
131 |
|
7886 | 132 |
void |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
133 |
LteRadioBearerTag::Print (std::ostream &os) const |
7886 | 134 |
{ |
9763
038d5627c5a9
Trim excess copies from PacketTagList::Remove, add PacketTagList::Replace, documentation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9414
diff
changeset
|
135 |
os << "rnti=" << m_rnti << ", lcid=" << (uint16_t) m_lcid << ", layer=" << (uint16_t)m_layer; |
7886 | 136 |
} |
137 |
||
138 |
} // namespace ns3 |