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 
31 class LteEnbNetDevice;
32 
42 {
43 public:
44  virtual ~LteAsSapProvider ();
45 
52  virtual void SetCsgWhiteList (uint32_t csgId) = 0;
53 
59  virtual void StartCellSelection (uint32_t dlEarfcn) = 0;
60 
67  virtual void ForceCampedOnEnb (uint16_t cellId, uint32_t dlEarfcn) = 0;
68 
77  virtual void Connect (void) = 0;
78 
85  virtual void SendData (Ptr<Packet> packet, uint8_t bid) = 0;
86 
87 
92  virtual void Disconnect () = 0;
93 
94 };
95 
96 
106 {
107 public:
108  virtual ~LteAsSapUser ();
109 
114  virtual void NotifyConnectionSuccessful () = 0;
115 
120  virtual void NotifyConnectionFailed () = 0;
121 
122 
127  virtual void NotifyConnectionReleased () = 0;
128 
134  virtual void RecvData (Ptr<Packet> packet) = 0;
135 
136 };
137 
138 
139 
140 
146 template <class C>
148 {
149 public:
155  MemberLteAsSapProvider (C* owner);
156 
157  // inherited from LteAsSapProvider
158  virtual void SetCsgWhiteList (uint32_t csgId);
159  virtual void StartCellSelection (uint32_t dlEarfcn);
160  virtual void ForceCampedOnEnb (uint16_t cellId, uint32_t dlEarfcn);
161  virtual void Connect (void);
162  virtual void SendData (Ptr<Packet> packet, uint8_t bid);
163  virtual void Disconnect ();
164 
165 private:
167  C* m_owner;
168 };
169 
170 template <class C>
172  : m_owner (owner)
173 {
174 }
175 
176 template <class C>
178 {
179 }
180 
181 template <class C>
182 void
184 {
185  m_owner->DoSetCsgWhiteList (csgId);
186 }
187 
188 template <class C>
189 void
191 {
192  m_owner->DoStartCellSelection (dlEarfcn);
193 }
194 
195 template <class C>
196 void
197 MemberLteAsSapProvider<C>::ForceCampedOnEnb (uint16_t cellId, uint32_t dlEarfcn)
198 {
199  m_owner->DoForceCampedOnEnb (cellId, dlEarfcn);
200 }
201 
202 template <class C>
203 void
205 {
206  m_owner->DoConnect ();
207 }
208 
209 template <class C>
210 void
212 {
213  m_owner->DoSendData (packet, bid);
214 }
215 
216 template <class C>
217 void
219 {
220  m_owner->DoDisconnect ();
221 }
222 
223 
229 template <class C>
231 {
232 public:
238  MemberLteAsSapUser (C* owner);
239 
240  // inherited from LteAsSapUser
241  virtual void NotifyConnectionSuccessful ();
242  virtual void NotifyConnectionFailed ();
243  virtual void RecvData (Ptr<Packet> packet);
244  virtual void NotifyConnectionReleased ();
245 
246 private:
248  C* m_owner;
249 };
250 
251 template <class C>
253  : m_owner (owner)
254 {
255 }
256 
257 template <class C>
259 {
260 }
261 
262 template <class C>
263 void
265 {
266  m_owner->DoNotifyConnectionSuccessful ();
267 }
268 
269 template <class C>
270 void
272 {
273  m_owner->DoNotifyConnectionFailed ();
274 }
275 
276 template <class C>
277 void
279 {
280  m_owner->DoRecvData (packet);
281 }
282 
283 template <class C>
284 void
286 {
287  m_owner->DoNotifyConnectionReleased ();
288 }
289 
290 
291 } // namespace ns3
292 
293 #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:248
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:41
C * m_owner
the owner class
Definition: lte-as-sap.h:167
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:183
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:197
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:230
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:278
Template for the implementation of the LteAsSapProvider as a member of an owner class of type C to wh...
Definition: lte-as-sap.h:147
virtual void NotifyConnectionSuccessful()
Notify the NAS that RRC Connection Establishment was successful.
Definition: lte-as-sap.h:264
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:285
virtual void Disconnect()
Tell the RRC entity to release the connection.
Definition: lte-as-sap.h:218
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:105
virtual void StartCellSelection(uint32_t dlEarfcn)
Initiate Idle mode cell selection procedure.
Definition: lte-as-sap.h:190
virtual void NotifyConnectionFailed()
Notify the NAS that RRC Connection Establishment failed.
Definition: lte-as-sap.h:271
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:211
virtual void Connect(void)
Tell the RRC entity to enter Connected mode.
Definition: lte-as-sap.h:204
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