A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-radio-bearer-tag.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 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: Author: Marco Miozzo <marco.miozzo@cttc.es>
18 */
19#ifndef LTE_RADIO_BEARER_TAG_H
20#define LTE_RADIO_BEARER_TAG_H
21
22#include "ns3/tag.h"
23
24namespace ns3
25{
26
27class Tag;
28
29/**
30 * Tag used to define the RNTI and LC id for each MAC packet transmitted
31 */
32
33class LteRadioBearerTag : public Tag
34{
35 public:
36 /**
37 * \brief Get the type ID.
38 * \return the object TypeId
39 */
40 static TypeId GetTypeId();
41 TypeId GetInstanceTypeId() const override;
42
43 /**
44 * Create an empty LteRadioBearerTag
45 */
47
48 /**
49 * Create a LteRadioBearerTag with the given RNTI and LC id
50 * \param rnti the RNTI
51 * \param lcId the LCID
52 */
53 LteRadioBearerTag(uint16_t rnti, uint8_t lcId);
54
55 /**
56 * Create a LteRadioBearerTag with the given RNTI, LC id and layer
57 * \param rnti the RNTI
58 * \param lcId the LCID
59 * \param layer the layer
60 */
61 LteRadioBearerTag(uint16_t rnti, uint8_t lcId, uint8_t layer);
62
63 /**
64 * Set the RNTI to the given value.
65 *
66 * @param rnti the value of the RNTI to set
67 */
68 void SetRnti(uint16_t rnti);
69
70 /**
71 * Set the LC id to the given value.
72 *
73 * @param lcid the value of the RNTI to set
74 */
75 void SetLcid(uint8_t lcid);
76
77 /**
78 * Set the layer id to the given value.
79 *
80 * @param layer the value of the layer to set
81 */
82 void SetLayer(uint8_t layer);
83
84 void Serialize(TagBuffer i) const override;
85 void Deserialize(TagBuffer i) override;
86 uint32_t GetSerializedSize() const override;
87 void Print(std::ostream& os) const override;
88
89 /**
90 * Get RNTI function
91 *
92 * \returns RNTI
93 */
94 uint16_t GetRnti() const;
95 /**
96 * Get LCID function
97 *
98 * \returns LCID
99 */
100 uint8_t GetLcid() const;
101 /**
102 * Get layer function
103 *
104 * \returns layer
105 */
106 uint8_t GetLayer() const;
107
108 private:
109 uint16_t m_rnti; ///< RNTI
110 uint8_t m_lcid; ///< LCID
111 uint8_t m_layer; ///< layer
112};
113
114} // namespace ns3
115
116#endif /* LTE_RADIO_BEARER_TAG_H */
Tag used to define the RNTI and LC id for each MAC packet transmitted.
uint32_t GetSerializedSize() const override
void Serialize(TagBuffer i) const override
void SetLayer(uint8_t layer)
Set the layer id to the given value.
uint16_t GetRnti() const
Get RNTI function.
void Print(std::ostream &os) const override
uint8_t GetLcid() const
Get LCID function.
static TypeId GetTypeId()
Get the type ID.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
LteRadioBearerTag()
Create an empty LteRadioBearerTag.
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
void SetLcid(uint8_t lcid)
Set the LC id to the given value.
uint8_t GetLayer() const
Get layer function.
void Deserialize(TagBuffer i) override
read and write tag data
Definition: tag-buffer.h:52
tag a set of bytes in a packet
Definition: tag.h:39
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.