A Discrete-Event Network Simulator
API
lte-as-sap.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Nicola Baldo <nbaldo@cttc.es>
18  */
19 
20 #ifndef LTE_AS_SAP_H
21 #define LTE_AS_SAP_H
22 
23 #include <ns3/packet.h>
24 #include <ns3/ptr.h>
25 
26 #include <stdint.h>
27 
28 namespace ns3
29 {
30 
39 {
40  public:
41  virtual ~LteAsSapProvider();
42 
49  virtual void SetCsgWhiteList(uint32_t csgId) = 0;
50 
56  virtual void StartCellSelection(uint32_t dlEarfcn) = 0;
57 
64  virtual void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn) = 0;
65 
74  virtual void Connect() = 0;
75 
82  virtual void SendData(Ptr<Packet> packet, uint8_t bid) = 0;
83 
87  virtual void Disconnect() = 0;
88 };
89 
98 {
99  public:
100  virtual ~LteAsSapUser();
101 
105  virtual void NotifyConnectionSuccessful() = 0;
106 
110  virtual void NotifyConnectionFailed() = 0;
111 
115  virtual void NotifyConnectionReleased() = 0;
116 
122  virtual void RecvData(Ptr<Packet> packet) = 0;
123 };
124 
129 template <class C>
131 {
132  public:
138  MemberLteAsSapProvider(C* owner);
139 
140  // Delete default constructor to avoid misuse
142 
143  // inherited from LteAsSapProvider
144  void SetCsgWhiteList(uint32_t csgId) override;
145  void StartCellSelection(uint32_t dlEarfcn) override;
146  void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn) override;
147  void Connect() override;
148  void SendData(Ptr<Packet> packet, uint8_t bid) override;
149  void Disconnect() override;
150 
151  private:
152  C* m_owner;
153 };
154 
155 template <class C>
157  : m_owner(owner)
158 {
159 }
160 
161 template <class C>
162 void
164 {
165  m_owner->DoSetCsgWhiteList(csgId);
166 }
167 
168 template <class C>
169 void
171 {
172  m_owner->DoStartCellSelection(dlEarfcn);
173 }
174 
175 template <class C>
176 void
177 MemberLteAsSapProvider<C>::ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)
178 {
179  m_owner->DoForceCampedOnEnb(cellId, dlEarfcn);
180 }
181 
182 template <class C>
183 void
185 {
186  m_owner->DoConnect();
187 }
188 
189 template <class C>
190 void
192 {
193  m_owner->DoSendData(packet, bid);
194 }
195 
196 template <class C>
197 void
199 {
200  m_owner->DoDisconnect();
201 }
202 
207 template <class C>
209 {
210  public:
216  MemberLteAsSapUser(C* owner);
217 
218  // Delete default constructor to avoid misuse
219  MemberLteAsSapUser() = delete;
220 
221  // inherited from LteAsSapUser
222  void NotifyConnectionSuccessful() override;
223  void NotifyConnectionFailed() override;
224  void RecvData(Ptr<Packet> packet) override;
225  void NotifyConnectionReleased() override;
226 
227  private:
228  C* m_owner;
229 };
230 
231 template <class C>
233  : m_owner(owner)
234 {
235 }
236 
237 template <class C>
238 void
240 {
241  m_owner->DoNotifyConnectionSuccessful();
242 }
243 
244 template <class C>
245 void
247 {
248  m_owner->DoNotifyConnectionFailed();
249 }
250 
251 template <class C>
252 void
254 {
255  m_owner->DoRecvData(packet);
256 }
257 
258 template <class C>
259 void
261 {
262  m_owner->DoNotifyConnectionReleased();
263 }
264 
265 } // namespace ns3
266 
267 #endif // LTE_AS_SAP_H
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:39
virtual void SetCsgWhiteList(uint32_t csgId)=0
Set the selected Closed Subscriber Group subscription list to be used for cell selection.
virtual void Connect()=0
Tell the RRC entity to enter Connected mode.
virtual void StartCellSelection(uint32_t dlEarfcn)=0
Initiate Idle mode cell selection procedure.
virtual void Disconnect()=0
Tell the RRC entity to release the connection.
virtual void SendData(Ptr< Packet > packet, uint8_t bid)=0
Send a data packet.
virtual void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)=0
Force the RRC entity to stay camped on a certain eNodeB.
virtual ~LteAsSapProvider()
Definition: lte-as-sap.cc:25
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:98
virtual void NotifyConnectionFailed()=0
Notify the NAS that RRC Connection Establishment failed.
virtual ~LteAsSapUser()
Definition: lte-as-sap.cc:29
virtual void NotifyConnectionSuccessful()=0
Notify the NAS that RRC Connection Establishment was successful.
virtual void NotifyConnectionReleased()=0
Notify the NAS that RRC Connection was released.
virtual void RecvData(Ptr< Packet > packet)=0
receive a data packet
Template for the implementation of the LteAsSapProvider as a member of an owner class of type C to wh...
Definition: lte-as-sap.h:131
void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn) override
Force the RRC entity to stay camped on a certain eNodeB.
Definition: lte-as-sap.h:177
void SetCsgWhiteList(uint32_t csgId) override
Set the selected Closed Subscriber Group subscription list to be used for cell selection.
Definition: lte-as-sap.h:163
C * m_owner
the owner class
Definition: lte-as-sap.h:152
void StartCellSelection(uint32_t dlEarfcn) override
Initiate Idle mode cell selection procedure.
Definition: lte-as-sap.h:170
void SendData(Ptr< Packet > packet, uint8_t bid) override
Send a data packet.
Definition: lte-as-sap.h:191
void Disconnect() override
Tell the RRC entity to release the connection.
Definition: lte-as-sap.h:198
void Connect() override
Tell the RRC entity to enter Connected mode.
Definition: lte-as-sap.h:184
Template for the implementation of the LteAsSapUser as a member of an owner class of type C to which ...
Definition: lte-as-sap.h:209
void NotifyConnectionReleased() override
Notify the NAS that RRC Connection was released.
Definition: lte-as-sap.h:260
void NotifyConnectionFailed() override
Notify the NAS that RRC Connection Establishment failed.
Definition: lte-as-sap.h:246
void RecvData(Ptr< Packet > packet) override
receive a data packet
Definition: lte-as-sap.h:253
void NotifyConnectionSuccessful() override
Notify the NAS that RRC Connection Establishment was successful.
Definition: lte-as-sap.h:239
C * m_owner
the owner class
Definition: lte-as-sap.h:228
Every class exported by the ns3 library is enclosed in the ns3 namespace.