A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lte-rrc-protocol-ideal.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  * Author: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 
22 #ifndef LTE_RRC_PROTOCOL_IDEAL_H
23 #define LTE_RRC_PROTOCOL_IDEAL_H
24 
25 #include <stdint.h>
26 #include <map>
27 
28 #include <ns3/ptr.h>
29 #include <ns3/object.h>
30 #include <ns3/lte-rrc-sap.h>
31 
32 namespace ns3 {
33 
34 class LteUeRrcSapProvider;
35 class LteUeRrcSapUser;
36 class LteEnbRrcSapProvider;
37 class LteUeRrc;
38 
39 
47 {
48  friend class MemberLteUeRrcSapUser<LteUeRrcProtocolIdeal>;
49 
50 public:
51 
52  LteUeRrcProtocolIdeal ();
53  virtual ~LteUeRrcProtocolIdeal ();
54 
55  // inherited from Object
56  virtual void DoDispose (void);
57  static TypeId GetTypeId (void);
58 
59  void SetLteUeRrcSapProvider (LteUeRrcSapProvider* p);
60  LteUeRrcSapUser* GetLteUeRrcSapUser ();
61 
62  void SetUeRrc (Ptr<LteUeRrc> rrc);
63 
64 
65 private:
66 
67  // methods forwarded from LteUeRrcSapUser
68  void DoSetup (LteUeRrcSapUser::SetupParameters params);
69  void DoSendRrcConnectionRequest (LteRrcSap::RrcConnectionRequest msg);
70  void DoSendRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg);
71  void DoSendRrcConnectionReconfigurationCompleted (LteRrcSap::RrcConnectionReconfigurationCompleted msg);
72  void DoSendRrcConnectionReestablishmentRequest (LteRrcSap::RrcConnectionReestablishmentRequest msg);
73  void DoSendRrcConnectionReestablishmentComplete (LteRrcSap::RrcConnectionReestablishmentComplete msg);
74  void DoSendMeasurementReport (LteRrcSap::MeasurementReport msg);
75 
76  void SetEnbRrcSapProvider ();
77 
78  Ptr<LteUeRrc> m_rrc;
79  uint16_t m_rnti;
80  LteUeRrcSapProvider* m_ueRrcSapProvider;
81  LteUeRrcSapUser* m_ueRrcSapUser;
82  LteEnbRrcSapProvider* m_enbRrcSapProvider;
83 
84 };
85 
86 
94 {
95  friend class MemberLteEnbRrcSapUser<LteEnbRrcProtocolIdeal>;
96 
97 public:
98 
99  LteEnbRrcProtocolIdeal ();
100  virtual ~LteEnbRrcProtocolIdeal ();
101 
102  // inherited from Object
103  virtual void DoDispose (void);
104  static TypeId GetTypeId (void);
105 
106  void SetLteEnbRrcSapProvider (LteEnbRrcSapProvider* p);
107  LteEnbRrcSapUser* GetLteEnbRrcSapUser ();
108 
109  void SetCellId (uint16_t cellId);
110 
111  LteUeRrcSapProvider* GetUeRrcSapProvider (uint16_t rnti);
112  void SetUeRrcSapProvider (uint16_t rnti, LteUeRrcSapProvider* p);
113 
114 private:
115 
116  // methods forwarded from LteEnbRrcSapUser
117  void DoSetupUe (uint16_t rnti, LteEnbRrcSapUser::SetupUeParameters params);
118  void DoRemoveUe (uint16_t rnti);
119  void DoSendMasterInformationBlock (LteRrcSap::MasterInformationBlock msg);
120  void DoSendSystemInformationBlockType1 (LteRrcSap::SystemInformationBlockType1 msg);
121  void DoSendSystemInformation (LteRrcSap::SystemInformation msg);
122  void SendSystemInformation (LteRrcSap::SystemInformation msg);
123  void DoSendRrcConnectionSetup (uint16_t rnti, LteRrcSap::RrcConnectionSetup msg);
124  void DoSendRrcConnectionReconfiguration (uint16_t rnti, LteRrcSap::RrcConnectionReconfiguration msg);
125  void DoSendRrcConnectionReestablishment (uint16_t rnti, LteRrcSap::RrcConnectionReestablishment msg);
126  void DoSendRrcConnectionReestablishmentReject (uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentReject msg);
127  void DoSendRrcConnectionRelease (uint16_t rnti, LteRrcSap::RrcConnectionRelease msg);
128  void DoSendRrcConnectionReject (uint16_t rnti, LteRrcSap::RrcConnectionReject msg);
129  Ptr<Packet> DoEncodeHandoverPreparationInformation (LteRrcSap::HandoverPreparationInfo msg);
130  LteRrcSap::HandoverPreparationInfo DoDecodeHandoverPreparationInformation (Ptr<Packet> p);
131  Ptr<Packet> DoEncodeHandoverCommand (LteRrcSap::RrcConnectionReconfiguration msg);
132  LteRrcSap::RrcConnectionReconfiguration DoDecodeHandoverCommand (Ptr<Packet> p);
133 
134 
135  uint16_t m_rnti;
136  uint16_t m_cellId;
137  LteEnbRrcSapProvider* m_enbRrcSapProvider;
138  LteEnbRrcSapUser* m_enbRrcSapUser;
139  std::map<uint16_t, LteUeRrcSapProvider*> m_enbRrcSapProviderMap;
140 
141 };
142 
143 
144 
145 }
146 
147 
148 #endif // LTE_RRC_PROTOCOL_IDEAL_H
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