A Discrete-Event Network Simulator
API
lte-as-sap.h
Go to the documentation of this file.
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_AS_SAP_H
23 #define LTE_AS_SAP_H
24 
25 #include <stdint.h>
26 #include <ns3/ptr.h>
27 #include <ns3/packet.h>
28 
29 namespace ns3 {
30 
40 {
41 public:
42  virtual ~LteAsSapProvider ();
43 
50  virtual void SetCsgWhiteList (uint32_t csgId) = 0;
51 
57  virtual void StartCellSelection (uint32_t dlEarfcn) = 0;
58 
65  virtual void ForceCampedOnEnb (uint16_t cellId, uint32_t dlEarfcn) = 0;
66 
75  virtual void Connect (void) = 0;
76 
83  virtual void SendData (Ptr<Packet> packet, uint8_t bid) = 0;
84 
85 
90  virtual void Disconnect () = 0;
91 
92 };
93 
94 
104 {
105 public:
106  virtual ~LteAsSapUser ();
107 
112  virtual void NotifyConnectionSuccessful () = 0;
113 
118  virtual void NotifyConnectionFailed () = 0;
119 
120 
125  virtual void NotifyConnectionReleased () = 0;
126 
132  virtual void RecvData (Ptr<Packet> packet) = 0;
133 
134 };
135 
136 
137 
138 
144 template <class C>
146 {
147 public:
153  MemberLteAsSapProvider (C* owner);
154 
155  // inherited from LteAsSapProvider
156  virtual void SetCsgWhiteList (uint32_t csgId);
157  virtual void StartCellSelection (uint32_t dlEarfcn);
158  virtual void ForceCampedOnEnb (uint16_t cellId, uint32_t dlEarfcn);
159  virtual void Connect (void);
160  virtual void SendData (Ptr<Packet> packet, uint8_t bid);
161  virtual void Disconnect ();
162 
163 private:
165  C* m_owner;
166 };
167 
168 template <class C>
170  : m_owner (owner)
171 {
172 }
173 
174 template <class C>
176 {
177 }
178 
179 template <class C>
180 void
182 {
183  m_owner->DoSetCsgWhiteList (csgId);
184 }
185 
186 template <class C>
187 void
189 {
190  m_owner->DoStartCellSelection (dlEarfcn);
191 }
192 
193 template <class C>
194 void
195 MemberLteAsSapProvider<C>::ForceCampedOnEnb (uint16_t cellId, uint32_t dlEarfcn)
196 {
197  m_owner->DoForceCampedOnEnb (cellId, dlEarfcn);
198 }
199 
200 template <class C>
201 void
203 {
204  m_owner->DoConnect ();
205 }
206 
207 template <class C>
208 void
210 {
211  m_owner->DoSendData (packet, bid);
212 }
213 
214 template <class C>
215 void
217 {
218  m_owner->DoDisconnect ();
219 }
220 
221 
227 template <class C>
229 {
230 public:
236  MemberLteAsSapUser (C* owner);
237 
238  // inherited from LteAsSapUser
239  virtual void NotifyConnectionSuccessful ();
240  virtual void NotifyConnectionFailed ();
241  virtual void RecvData (Ptr<Packet> packet);
242  virtual void NotifyConnectionReleased ();
243 
244 private:
246  C* m_owner;
247 };
248 
249 template <class C>
251  : m_owner (owner)
252 {
253 }
254 
255 template <class C>
257 {
258 }
259 
260 template <class C>
261 void
263 {
264  m_owner->DoNotifyConnectionSuccessful ();
265 }
266 
267 template <class C>
268 void
270 {
271  m_owner->DoNotifyConnectionFailed ();
272 }
273 
274 template <class C>
275 void
277 {
278  m_owner->DoRecvData (packet);
279 }
280 
281 template <class C>
282 void
284 {
285  m_owner->DoNotifyConnectionReleased ();
286 }
287 
288 
289 } // namespace ns3
290 
291 #endif // LTE_AS_SAP_H
virtual void NotifyConnectionSuccessful()=0
Notify the NAS that RRC Connection Establishment was successful.
C * m_owner
the owner class
Definition: lte-as-sap.h:246
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:39
C * m_owner
the owner class
Definition: lte-as-sap.h:165
virtual void SetCsgWhiteList(uint32_t csgId)
Set the selected Closed Subscriber Group subscription list to be used for cell selection.
Definition: lte-as-sap.h:181
virtual void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)
Force the RRC entity to stay camped on a certain eNodeB.
Definition: lte-as-sap.h:195
virtual void SendData(Ptr< Packet > packet, uint8_t bid)=0
Send a data packet.
virtual ~LteAsSapUser()
Definition: lte-as-sap.cc:29
Template for the implementation of the LteAsSapUser as a member of an owner class of type C to which ...
Definition: lte-as-sap.h:228
virtual void StartCellSelection(uint32_t dlEarfcn)=0
Initiate Idle mode cell selection procedure.
virtual void RecvData(Ptr< Packet > packet)
receive a data packet
Definition: lte-as-sap.h:276
Template for the implementation of the LteAsSapProvider as a member of an owner class of type C to wh...
Definition: lte-as-sap.h:145
virtual void NotifyConnectionSuccessful()
Notify the NAS that RRC Connection Establishment was successful.
Definition: lte-as-sap.h:262
virtual void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)=0
Force the RRC entity to stay camped on a certain eNodeB.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void NotifyConnectionReleased()
Notify the NAS that RRC Connection was released.
Definition: lte-as-sap.h:283
virtual void Disconnect()
Tell the RRC entity to release the connection.
Definition: lte-as-sap.h:216
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:103
virtual void StartCellSelection(uint32_t dlEarfcn)
Initiate Idle mode cell selection procedure.
Definition: lte-as-sap.h:188
virtual void NotifyConnectionFailed()
Notify the NAS that RRC Connection Establishment failed.
Definition: lte-as-sap.h:269
virtual void Disconnect()=0
Tell the RRC entity to release the connection.
virtual void NotifyConnectionReleased()=0
Notify the NAS that RRC Connection was released.
virtual void NotifyConnectionFailed()=0
Notify the NAS that RRC Connection Establishment failed.
virtual void Connect(void)=0
Tell the RRC entity to enter Connected mode.
virtual void SendData(Ptr< Packet > packet, uint8_t bid)
Send a data packet.
Definition: lte-as-sap.h:209
virtual void Connect(void)
Tell the RRC entity to enter Connected mode.
Definition: lte-as-sap.h:202
virtual void RecvData(Ptr< Packet > packet)=0
receive a data packet
virtual void SetCsgWhiteList(uint32_t csgId)=0
Set the selected Closed Subscriber Group subscription list to be used for cell selection.
virtual ~LteAsSapProvider()
Definition: lte-as-sap.cc:25