A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lte-rrc-protocol-real.h
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 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  * Authors: Nicola Baldo <nbaldo@cttc.es>
19  * Lluis Parcerisa <lparcerisa@cttc.cat>
20  */
21 
22 
23 #ifndef LTE_RRC_PROTOCOL_REAL_H
24 #define LTE_RRC_PROTOCOL_REAL_H
25 
26 #include <stdint.h>
27 #include <map>
28 
29 #include <ns3/ptr.h>
30 #include <ns3/object.h>
31 #include <ns3/lte-rrc-sap.h>
32 #include <ns3/lte-pdcp-sap.h>
33 #include <ns3/lte-rlc-sap.h>
34 #include <ns3/lte-rrc-header.h>
35 
36 namespace ns3 {
37 
38 class LteUeRrcSapProvider;
39 class LteUeRrcSapUser;
40 class LteEnbRrcSapProvider;
41 class LteUeRrc;
42 
43 
52 {
53  friend class MemberLteUeRrcSapUser<LteUeRrcProtocolReal>;
54  friend class LteRlcSpecificLteRlcSapUser<LteUeRrcProtocolReal>;
55  friend class LtePdcpSpecificLtePdcpSapUser<LteUeRrcProtocolReal>;
56 
57 public:
58  LteUeRrcProtocolReal ();
59  virtual ~LteUeRrcProtocolReal ();
60 
61  // inherited from Object
62  virtual void DoDispose (void);
63  static TypeId GetTypeId (void);
64 
65  void SetLteUeRrcSapProvider (LteUeRrcSapProvider* p);
66  LteUeRrcSapUser* GetLteUeRrcSapUser ();
67 
68  void SetUeRrc (Ptr<LteUeRrc> rrc);
69 
70 
71 private:
72  // methods forwarded from LteUeRrcSapUser
73  void DoSetup (LteUeRrcSapUser::SetupParameters params);
74  void DoSendRrcConnectionRequest (LteRrcSap::RrcConnectionRequest msg);
75  void DoSendRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg);
76  void DoSendRrcConnectionReconfigurationCompleted (LteRrcSap::RrcConnectionReconfigurationCompleted msg);
77  void DoSendRrcConnectionReestablishmentRequest (LteRrcSap::RrcConnectionReestablishmentRequest msg);
78  void DoSendRrcConnectionReestablishmentComplete (LteRrcSap::RrcConnectionReestablishmentComplete msg);
79  void DoSendMeasurementReport (LteRrcSap::MeasurementReport msg);
80 
81  void SetEnbRrcSapProvider ();
82  void DoReceivePdcpPdu (Ptr<Packet> p);
83  void DoReceivePdcpSdu (LtePdcpSapUser::ReceivePdcpSduParameters params);
84 
85  Ptr<LteUeRrc> m_rrc;
86  uint16_t m_rnti;
87  LteUeRrcSapProvider* m_ueRrcSapProvider;
88  LteUeRrcSapUser* m_ueRrcSapUser;
89  LteEnbRrcSapProvider* m_enbRrcSapProvider;
90 
91  LteUeRrcSapUser::SetupParameters m_setupParameters;
92  LteUeRrcSapProvider::CompleteSetupParameters m_completeSetupParameters;
93 
94 };
95 
96 
105 {
106  friend class MemberLteEnbRrcSapUser<LteEnbRrcProtocolReal>;
107  friend class LtePdcpSpecificLtePdcpSapUser<LteEnbRrcProtocolReal>;
108  friend class LteRlcSpecificLteRlcSapUser<LteEnbRrcProtocolReal>;
109  friend class RealProtocolRlcSapUser;
110 
111 public:
112  LteEnbRrcProtocolReal ();
113  virtual ~LteEnbRrcProtocolReal ();
114 
115  // inherited from Object
116  virtual void DoDispose (void);
117  static TypeId GetTypeId (void);
118 
119  void SetLteEnbRrcSapProvider (LteEnbRrcSapProvider* p);
120  LteEnbRrcSapUser* GetLteEnbRrcSapUser ();
121 
122  void SetCellId (uint16_t cellId);
123 
124  LteUeRrcSapProvider* GetUeRrcSapProvider (uint16_t rnti);
125  void SetUeRrcSapProvider (uint16_t rnti, LteUeRrcSapProvider* p);
126 
127 private:
128  // methods forwarded from LteEnbRrcSapUser
129  void DoSetupUe (uint16_t rnti, LteEnbRrcSapUser::SetupUeParameters params);
130  void DoRemoveUe (uint16_t rnti);
131  void DoSendMasterInformationBlock (LteRrcSap::MasterInformationBlock msg);
132  void DoSendSystemInformationBlockType1 (LteRrcSap::SystemInformationBlockType1 msg);
133  void DoSendSystemInformation (LteRrcSap::SystemInformation msg);
134  void SendSystemInformation (LteRrcSap::SystemInformation msg);
135  void DoSendRrcConnectionSetup (uint16_t rnti, LteRrcSap::RrcConnectionSetup msg);
136  void DoSendRrcConnectionReconfiguration (uint16_t rnti, LteRrcSap::RrcConnectionReconfiguration msg);
137  void DoSendRrcConnectionReestablishment (uint16_t rnti, LteRrcSap::RrcConnectionReestablishment msg);
138  void DoSendRrcConnectionReestablishmentReject (uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentReject msg);
139  void DoSendRrcConnectionRelease (uint16_t rnti, LteRrcSap::RrcConnectionRelease msg);
140  void DoSendRrcConnectionReject (uint16_t rnti, LteRrcSap::RrcConnectionReject msg);
141  Ptr<Packet> DoEncodeHandoverPreparationInformation (LteRrcSap::HandoverPreparationInfo msg);
142  LteRrcSap::HandoverPreparationInfo DoDecodeHandoverPreparationInformation (Ptr<Packet> p);
143  Ptr<Packet> DoEncodeHandoverCommand (LteRrcSap::RrcConnectionReconfiguration msg);
144  LteRrcSap::RrcConnectionReconfiguration DoDecodeHandoverCommand (Ptr<Packet> p);
145 
146  void DoReceivePdcpSdu (LtePdcpSapUser::ReceivePdcpSduParameters params);
147  void DoReceivePdcpPdu (uint16_t rnti, Ptr<Packet> p);
148 
149  uint16_t m_rnti;
150  uint16_t m_cellId;
151  LteEnbRrcSapProvider* m_enbRrcSapProvider;
152  LteEnbRrcSapUser* m_enbRrcSapUser;
153  std::map<uint16_t, LteUeRrcSapProvider*> m_enbRrcSapProviderMap;
154  std::map<uint16_t, LteEnbRrcSapUser::SetupUeParameters> m_setupUeParametersMap;
155  std::map<uint16_t, LteEnbRrcSapProvider::CompleteSetupUeParameters> m_completeSetupUeParametersMap;
156 
157 };
158 
160 
162 {
163 public:
164  RealProtocolRlcSapUser (LteEnbRrcProtocolReal* pdcp, uint16_t rnti);
165 
166  // Interface implemented from LteRlcSapUser
167  virtual void ReceivePdcpPdu (Ptr<Packet> p);
168 
169 private:
171  LteEnbRrcProtocolReal* m_pdcp;
172  uint16_t m_rnti;
173 };
174 
175 
176 }
177 
178 
179 #endif // LTE_RRC_PROTOCOL_REAL_H
virtual void ReceivePdcpPdu(Ptr< Packet > p)
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
a base class which provides memory management and object aggregation
Definition: object.h:63
a unique identifier for an interface.
Definition: type-id.h:44