A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-enb-rrc.h
Go to the documentation of this file.
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: Nicola Baldo <nbaldo@cttc.es>
19  * Modified by: Marco Miozzo <mmiozzo@cttc.es>
20  * add transmission Mode and SRS related functionalities
21  */
22 
23 #ifndef LTE_ENB_RRC_H
24 #define LTE_ENB_RRC_H
25 
26 #include <ns3/object.h>
27 #include <ns3/packet.h>
28 #include <ns3/lte-enb-cmac-sap.h>
29 #include <ns3/ff-mac-common.h>
30 #include <ns3/lte-pdcp-sap.h>
31 
32 #include <map>
33 #include <set>
34 
35 namespace ns3 {
36 
37 class FfMacSchedSapProvider;
38 class LteMacSapProvider;
39 class LteRadioBearerInfo;
40 class LtePdcpSapUser;
41 class LtePdcpSapProvider;
42 
43 
49 class UeInfo : public Object
50 {
51 public:
59  uint8_t AddRadioBearer (Ptr<LteRadioBearerInfo> radioBearerInfo);
60 
69 
70 
76  void RemoveRadioBearer (uint8_t lcid);
77 
78  UeInfo (void);
79  UeInfo (uint64_t imsi);
80  UeInfo (uint64_t imsi, uint16_t srsConfIndex);
81  virtual ~UeInfo (void);
82 
83  static TypeId GetTypeId (void);
84 
85  uint64_t GetImsi (void);
86  uint16_t GetSrsConfigurationIndex (void);
87  uint8_t GetTransmissionMode (void);
88  void SetSrsConfigurationIndex (uint16_t srsConfIndex);
89  void SetTransmissionMode (uint8_t txMode);
90 
91 private:
92  std::map <uint8_t, Ptr<LteRadioBearerInfo> > m_rbMap;
94  uint64_t m_imsi;
97 };
98 
99 
104 class LteEnbRrc : public Object
105 {
106 
109 
110 public:
115  LteEnbRrc ();
116 
120  virtual ~LteEnbRrc ();
121 
122 
123  // inherited from Object
124  virtual void DoDispose (void);
125  static TypeId GetTypeId (void);
126 
127 
134 
140 
141 
150 
151 
160 
161 
162 
169  void ConfigureCell (uint8_t ulBandwidth,
170  uint8_t dlBandwidth);
171 
178  uint16_t AddUe (uint64_t imsi);
179 
180  void SetCellId (uint16_t m_cellId);
181 
187  void RemoveUe (uint16_t rnti);
188 
189  uint16_t GetLastAllocatedRnti () const;
190  void SetLastAllocatedRnti (uint16_t lastAllocatedRnti);
191  void SetUeMap (std::map<uint16_t,Ptr<UeInfo> > ueMap);
192  std::map<uint16_t,Ptr<UeInfo> > GetUeMap (void) const;
193 
203  uint8_t SetupRadioBearer (uint16_t rnti, EpsBearer bearer, TypeId rlcTypeId);
204 
205 
213  void ReleaseRadioBearer (uint16_t rnti, uint8_t lcId);
214 
215 
223  bool Send (Ptr<Packet> p);
224 
231  void SetForwardUpCallback (Callback <void, Ptr<Packet> > cb);
232 
238  void ConfigureNewUe (uint16_t rnti);
239 
240 
241 private:
242 
246 
247  void DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success);
248  LtePdcpSapProvider* GetLtePdcpSapProvider (uint16_t rnti, uint8_t lcid);
249 
250  // management of multiple UE info instances
251  uint16_t CreateUeInfo (uint64_t imsi);
252  Ptr<UeInfo> GetUeInfo (uint16_t rnti);
253  void RemoveUeInfo (uint16_t rnti);
254  uint16_t GetNewSrsConfigurationIndex (void);
255  void RemoveSrsConfigurationIndex (uint16_t srcCi);
256 
258 
261 
265 
268 
269  std::map<uint16_t, Ptr<UeInfo> > m_ueMap;
270 
272 
273  uint16_t m_cellId;
274 
275  // SRS related attributes
277  std::set<uint16_t> m_ueSrsConfigurationIndexSet;
280 
281 };
282 
283 
284 } // namespace ns3
285 
286 #endif // LTE_ENB_RRC_H