1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ 2 /* 3 * Copyright (c) 2011 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: Author: Marco Miozzo <marco.miozzo@cttc.es> 19 */ 20 #ifndef LTE_RADIO_BEARER_TAG_H 21 #define LTE_RADIO_BEARER_TAG_H 22 23 #include "ns3/tag.h" 24 25 namespace ns3 { 26 27 class Tag; 28 29 30 /** 31 * Tag used to define the RNTI and LC id for each MAC packet trasmitted 32 */ 33 34 class LteRadioBearerTag : public Tag 35 { 36 public: 37 /** 38 * \brief Get the type ID. 39 * \return the object TypeId 40 */ 41 static TypeId GetTypeId (void); 42 virtual TypeId GetInstanceTypeId (void) const; 43 44 /** 45 * Create an empty LteRadioBearerTag 46 */ 47 LteRadioBearerTag (); 48 49 /** 50 * Create a LteRadioBearerTag with the given RNTI and LC id 51 * \param rnti the RNTI 52 * \param lcId the LCID 53 */ 54 LteRadioBearerTag (uint16_t rnti, uint8_t lcId); 55 56 /** 57 * Create a LteRadioBearerTag with the given RNTI, LC id and layer 58 * \param rnti the RNTI 59 * \param lcId the LCID 60 * \param layer the layer 61 */ 62 LteRadioBearerTag (uint16_t rnti, uint8_t lcId, uint8_t layer); 63 64 /** 65 * Set the RNTI to the given value. 66 * 67 * @param rnti the value of the RNTI to set 68 */ 69 void SetRnti (uint16_t rnti); 70 71 /** 72 * Set the LC id to the given value. 73 * 74 * @param lcid the value of the RNTI to set 75 */ 76 void SetLcid (uint8_t lcid); 77 78 /** 79 * Set the layer id to the given value. 80 * 81 * @param layer the value of the layer to set 82 */ 83 void SetLayer (uint8_t layer); 84 85 86 virtual void Serialize (TagBuffer i) const; 87 virtual void Deserialize (TagBuffer i); 88 virtual uint32_t GetSerializedSize () const; 89 virtual void Print (std::ostream &os) const; 90 91 /** 92 * Get RNTI function 93 * 94 * \returns RNTI 95 */ 96 uint16_t GetRnti (void) const; 97 /** 98 * Get LCID function 99 * 100 * \returns LCID 101 */ 102 uint8_t GetLcid (void) const; 103 /** 104 * Get layer function 105 * 106 * \returns layer 107 */ 108 uint8_t GetLayer (void) const; 109 110 private: 111 uint16_t m_rnti; ///< RNTI 112 uint8_t m_lcid; ///< LCID 113 uint8_t m_layer; ///< layer 114 115 }; 116 117 118 119 } // namespace ns3 120 121 #endif /* LTE_RADIO_BEARER_TAG_H */ 122