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 (uint16_t dlEarfcn) = 0;
60 
67  virtual void ForceCampedOnEnb (uint16_t cellId, uint16_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:
150  MemberLteAsSapProvider (C* owner);
151 
152  // inherited from LteAsSapProvider
153  virtual void SetCsgWhiteList (uint32_t csgId);
154  virtual void StartCellSelection (uint16_t dlEarfcn);
155  virtual void ForceCampedOnEnb (uint16_t cellId, uint16_t dlEarfcn);
156  virtual void Connect (void);
157  virtual void SendData (Ptr<Packet> packet, uint8_t bid);
158  virtual void Disconnect ();
159 
160 private:
163 };
164 
165 template <class C>
167  : m_owner (owner)
168 {
169 }
170 
171 template <class C>
173 {
174 }
175 
176 template <class C>
177 void
179 {
180  m_owner->DoSetCsgWhiteList (csgId);
181 }
182 
183 template <class C>
184 void
186 {
187  m_owner->DoStartCellSelection (dlEarfcn);
188 }
189 
190 template <class C>
191 void
192 MemberLteAsSapProvider<C>::ForceCampedOnEnb (uint16_t cellId, uint16_t dlEarfcn)
193 {
194  m_owner->DoForceCampedOnEnb (cellId, dlEarfcn);
195 }
196 
197 template <class C>
198 void
200 {
201  m_owner->DoConnect ();
202 }
203 
204 template <class C>
205 void
207 {
208  m_owner->DoSendData (packet, bid);
209 }
210 
211 template <class C>
212 void
214 {
215  m_owner->DoDisconnect ();
216 }
217 
218 
224 template <class C>
226 {
227 public:
228  MemberLteAsSapUser (C* owner);
229 
230  // inherited from LteAsSapUser
231  virtual void NotifyConnectionSuccessful ();
232  virtual void NotifyConnectionFailed ();
233  virtual void RecvData (Ptr<Packet> packet);
234  virtual void NotifyConnectionReleased ();
235 
236 private:
239 };
240 
241 template <class C>
243  : m_owner (owner)
244 {
245 }
246 
247 template <class C>
249 {
250 }
251 
252 template <class C>
253 void
255 {
256  m_owner->DoNotifyConnectionSuccessful ();
257 }
258 
259 template <class C>
260 void
262 {
263  m_owner->DoNotifyConnectionFailed ();
264 }
265 
266 template <class C>
267 void
269 {
270  m_owner->DoRecvData (packet);
271 }
272 
273 template <class C>
274 void
276 {
277  m_owner->DoNotifyConnectionReleased ();
278 }
279 
280 
281 } // namespace ns3
282 
283 #endif // LTE_AS_SAP_H
virtual void StartCellSelection(uint16_t dlEarfcn)=0
Initiate Idle mode cell selection procedure.
virtual void ForceCampedOnEnb(uint16_t cellId, uint16_t dlEarfcn)=0
Force the RRC entity to stay camped on a certain eNodeB.
virtual void StartCellSelection(uint16_t dlEarfcn)
Initiate Idle mode cell selection procedure.
Definition: lte-as-sap.h:185
virtual void NotifyConnectionSuccessful()=0
Notify the NAS that RRC Connection Establishment was successful.
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:41
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:178
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:225
virtual void RecvData(Ptr< Packet > packet)
receive a data packet
Definition: lte-as-sap.h:268
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:254
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:275
virtual void Disconnect()
Tell the RRC entity to release the connection.
Definition: lte-as-sap.h:213
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:105
virtual void NotifyConnectionFailed()
Notify the NAS that RRC Connection Establishment failed.
Definition: lte-as-sap.h:261
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 ForceCampedOnEnb(uint16_t cellId, uint16_t dlEarfcn)
Force the RRC entity to stay camped on a certain eNodeB.
Definition: lte-as-sap.h:192
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:206
virtual void Connect(void)
Tell the RRC entity to enter Connected mode.
Definition: lte-as-sap.h:199
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