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
28namespace 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
129template <class C>
131{
132 public:
138 MemberLteAsSapProvider(C* owner);
139
140 // inherited from LteAsSapProvider
141 void SetCsgWhiteList(uint32_t csgId) override;
142 void StartCellSelection(uint32_t dlEarfcn) override;
143 void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn) override;
144 void Connect() override;
145 void SendData(Ptr<Packet> packet, uint8_t bid) override;
146 void Disconnect() override;
147
148 private:
151};
152
153template <class C>
155 : m_owner(owner)
156{
157}
158
159template <class C>
161{
162}
163
164template <class C>
165void
167{
168 m_owner->DoSetCsgWhiteList(csgId);
169}
170
171template <class C>
172void
174{
175 m_owner->DoStartCellSelection(dlEarfcn);
176}
177
178template <class C>
179void
181{
182 m_owner->DoForceCampedOnEnb(cellId, dlEarfcn);
183}
184
185template <class C>
186void
188{
189 m_owner->DoConnect();
190}
191
192template <class C>
193void
195{
196 m_owner->DoSendData(packet, bid);
197}
198
199template <class C>
200void
202{
203 m_owner->DoDisconnect();
204}
205
210template <class C>
212{
213 public:
219 MemberLteAsSapUser(C* owner);
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:
230};
231
232template <class C>
234 : m_owner(owner)
235{
236}
237
238template <class C>
240{
241}
242
243template <class C>
244void
246{
247 m_owner->DoNotifyConnectionSuccessful();
248}
249
250template <class C>
251void
253{
254 m_owner->DoNotifyConnectionFailed();
255}
256
257template <class C>
258void
260{
261 m_owner->DoRecvData(packet);
262}
263
264template <class C>
265void
267{
268 m_owner->DoNotifyConnectionReleased();
269}
270
271} // namespace ns3
272
273#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:180
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:166
C * m_owner
the owner class
Definition: lte-as-sap.h:150
void StartCellSelection(uint32_t dlEarfcn) override
Initiate Idle mode cell selection procedure.
Definition: lte-as-sap.h:173
void SendData(Ptr< Packet > packet, uint8_t bid) override
Send a data packet.
Definition: lte-as-sap.h:194
void Disconnect() override
Tell the RRC entity to release the connection.
Definition: lte-as-sap.h:201
void Connect() override
Tell the RRC entity to enter Connected mode.
Definition: lte-as-sap.h:187
Template for the implementation of the LteAsSapUser as a member of an owner class of type C to which ...
Definition: lte-as-sap.h:212
void NotifyConnectionReleased() override
Notify the NAS that RRC Connection was released.
Definition: lte-as-sap.h:266
void NotifyConnectionFailed() override
Notify the NAS that RRC Connection Establishment failed.
Definition: lte-as-sap.h:252
void RecvData(Ptr< Packet > packet) override
receive a data packet
Definition: lte-as-sap.h:259
void NotifyConnectionSuccessful() override
Notify the NAS that RRC Connection Establishment was successful.
Definition: lte-as-sap.h:245
C * m_owner
the owner class
Definition: lte-as-sap.h:229
Every class exported by the ns3 library is enclosed in the ns3 namespace.