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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Author: Marco Miozzo <marco.miozzo@cttc.es>
7 */
8#ifndef LTE_RADIO_BEARER_TAG_H
9#define LTE_RADIO_BEARER_TAG_H
10
11#include "ns3/tag.h"
12
13namespace ns3
14{
15
16class Tag;
17
18/**
19 * Tag used to define the RNTI and LC id for each MAC packet transmitted
20 */
21
22class LteRadioBearerTag : public Tag
23{
24 public:
25 /**
26 * \brief Get the type ID.
27 * \return the object TypeId
28 */
29 static TypeId GetTypeId();
30 TypeId GetInstanceTypeId() const override;
31
32 /**
33 * Create an empty LteRadioBearerTag
34 */
36
37 /**
38 * Create a LteRadioBearerTag with the given RNTI and LC id
39 * \param rnti the RNTI
40 * \param lcId the LCID
41 */
42 LteRadioBearerTag(uint16_t rnti, uint8_t lcId);
43
44 /**
45 * Create a LteRadioBearerTag with the given RNTI, LC id and layer
46 * \param rnti the RNTI
47 * \param lcId the LCID
48 * \param layer the layer
49 */
50 LteRadioBearerTag(uint16_t rnti, uint8_t lcId, uint8_t layer);
51
52 /**
53 * Set the RNTI to the given value.
54 *
55 * @param rnti the value of the RNTI to set
56 */
57 void SetRnti(uint16_t rnti);
58
59 /**
60 * Set the LC id to the given value.
61 *
62 * @param lcid the value of the RNTI to set
63 */
64 void SetLcid(uint8_t lcid);
65
66 /**
67 * Set the layer id to the given value.
68 *
69 * @param layer the value of the layer to set
70 */
71 void SetLayer(uint8_t layer);
72
73 void Serialize(TagBuffer i) const override;
74 void Deserialize(TagBuffer i) override;
75 uint32_t GetSerializedSize() const override;
76 void Print(std::ostream& os) const override;
77
78 /**
79 * Get RNTI function
80 *
81 * \returns RNTI
82 */
83 uint16_t GetRnti() const;
84 /**
85 * Get LCID function
86 *
87 * \returns LCID
88 */
89 uint8_t GetLcid() const;
90 /**
91 * Get layer function
92 *
93 * \returns layer
94 */
95 uint8_t GetLayer() const;
96
97 private:
98 uint16_t m_rnti; ///< RNTI
99 uint8_t m_lcid; ///< LCID
100 uint8_t m_layer; ///< layer
101};
102
103} // namespace ns3
104
105#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:41
tag a set of bytes in a packet
Definition tag.h:28
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.