A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef LTE_AS_SAP_H
10#define LTE_AS_SAP_H
11
12#include <ns3/packet.h>
13#include <ns3/ptr.h>
14
15#include <stdint.h>
16
17namespace ns3
18{
19
20/**
21 * This class implements the Access Stratum (AS) Service Access Point
22 * (SAP), i.e., the interface between the EpcUeNas and the LteUeRrc.
23 * In particular, this class implements the
24 * Provider part of the SAP, i.e., the methods exported by the
25 * LteUeRrc and called by the EpcUeNas.
26 */
28{
29 public:
30 virtual ~LteAsSapProvider();
31
32 /**
33 * \brief Set the selected Closed Subscriber Group subscription list to be
34 * used for cell selection.
35 *
36 * \param csgId identity of the subscribed CSG
37 */
38 virtual void SetCsgWhiteList(uint32_t csgId) = 0;
39
40 /**
41 * \brief Initiate Idle mode cell selection procedure.
42 *
43 * \param dlEarfcn the downlink carrier frequency (EARFCN)
44 */
45 virtual void StartCellSelection(uint32_t dlEarfcn) = 0;
46
47 /**
48 * \brief Force the RRC entity to stay camped on a certain eNodeB.
49 *
50 * \param cellId the cell ID identifying the eNodeB
51 * \param dlEarfcn the downlink carrier frequency (EARFCN)
52 */
53 virtual void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn) = 0;
54
55 /**
56 * \brief Tell the RRC entity to enter Connected mode.
57 *
58 * If this function is called when the UE is in a situation where connecting
59 * is not possible (e.g. before the simulation begin), then the UE will
60 * attempt to connect at the earliest possible time (e.g. after it camps to a
61 * suitable cell).
62 */
63 virtual void Connect() = 0;
64
65 /**
66 * \brief Send a data packet.
67 *
68 * \param packet the packet
69 * \param bid the EPS bearer ID
70 */
71 virtual void SendData(Ptr<Packet> packet, uint8_t bid) = 0;
72
73 /**
74 * \brief Tell the RRC entity to release the connection.
75 */
76 virtual void Disconnect() = 0;
77};
78
79/**
80 * This class implements the Access Stratum (AS) Service Access Point
81 * (SAP), i.e., the interface between the EpcUeNas and the LteUeRrc
82 * In particular, this class implements the
83 * User part of the SAP, i.e., the methods exported by the
84 * EpcUeNas and called by the LteUeRrc.
85 */
87{
88 public:
89 virtual ~LteAsSapUser();
90
91 /**
92 * \brief Notify the NAS that RRC Connection Establishment was successful.
93 */
94 virtual void NotifyConnectionSuccessful() = 0;
95
96 /**
97 * \brief Notify the NAS that RRC Connection Establishment failed.
98 */
99 virtual void NotifyConnectionFailed() = 0;
100
101 /**
102 * Notify the NAS that RRC Connection was released
103 */
104 virtual void NotifyConnectionReleased() = 0;
105
106 /**
107 * receive a data packet
108 *
109 * \param packet the packet
110 */
111 virtual void RecvData(Ptr<Packet> packet) = 0;
112};
113
114/**
115 * Template for the implementation of the LteAsSapProvider as a member
116 * of an owner class of type C to which all methods are forwarded
117 */
118template <class C>
120{
121 public:
122 /**
123 * Constructor
124 *
125 * \param owner the owner class
126 */
127 MemberLteAsSapProvider(C* owner);
128
129 // Delete default constructor to avoid misuse
131
132 // inherited from LteAsSapProvider
133 void SetCsgWhiteList(uint32_t csgId) override;
134 void StartCellSelection(uint32_t dlEarfcn) override;
135 void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn) override;
136 void Connect() override;
137 void SendData(Ptr<Packet> packet, uint8_t bid) override;
138 void Disconnect() override;
139
140 private:
141 C* m_owner; ///< the owner class
142};
143
144template <class C>
146 : m_owner(owner)
147{
148}
149
150template <class C>
151void
153{
154 m_owner->DoSetCsgWhiteList(csgId);
155}
156
157template <class C>
158void
160{
161 m_owner->DoStartCellSelection(dlEarfcn);
162}
163
164template <class C>
165void
167{
168 m_owner->DoForceCampedOnEnb(cellId, dlEarfcn);
169}
170
171template <class C>
172void
174{
175 m_owner->DoConnect();
176}
177
178template <class C>
179void
181{
182 m_owner->DoSendData(packet, bid);
183}
184
185template <class C>
186void
188{
189 m_owner->DoDisconnect();
190}
191
192/**
193 * Template for the implementation of the LteAsSapUser as a member
194 * of an owner class of type C to which all methods are forwarded
195 */
196template <class C>
198{
199 public:
200 /**
201 * Constructor
202 *
203 * \param owner the owner class
204 */
205 MemberLteAsSapUser(C* owner);
206
207 // Delete default constructor to avoid misuse
209
210 // inherited from LteAsSapUser
211 void NotifyConnectionSuccessful() override;
212 void NotifyConnectionFailed() override;
213 void RecvData(Ptr<Packet> packet) override;
214 void NotifyConnectionReleased() override;
215
216 private:
217 C* m_owner; ///< the owner class
218};
219
220template <class C>
222 : m_owner(owner)
223{
224}
225
226template <class C>
227void
229{
230 m_owner->DoNotifyConnectionSuccessful();
231}
232
233template <class C>
234void
236{
237 m_owner->DoNotifyConnectionFailed();
238}
239
240template <class C>
241void
243{
244 m_owner->DoRecvData(packet);
245}
246
247template <class C>
248void
250{
251 m_owner->DoNotifyConnectionReleased();
252}
253
254} // namespace ns3
255
256#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:28
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:14
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition lte-as-sap.h:87
virtual void NotifyConnectionFailed()=0
Notify the NAS that RRC Connection Establishment failed.
virtual ~LteAsSapUser()
Definition lte-as-sap.cc:18
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:120
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:166
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:152
C * m_owner
the owner class
Definition lte-as-sap.h:141
void StartCellSelection(uint32_t dlEarfcn) override
Initiate Idle mode cell selection procedure.
Definition lte-as-sap.h:159
void SendData(Ptr< Packet > packet, uint8_t bid) override
Send a data packet.
Definition lte-as-sap.h:180
void Disconnect() override
Tell the RRC entity to release the connection.
Definition lte-as-sap.h:187
void Connect() override
Tell the RRC entity to enter Connected mode.
Definition lte-as-sap.h:173
Template for the implementation of the LteAsSapUser as a member of an owner class of type C to which ...
Definition lte-as-sap.h:198
void NotifyConnectionReleased() override
Notify the NAS that RRC Connection was released.
Definition lte-as-sap.h:249
void NotifyConnectionFailed() override
Notify the NAS that RRC Connection Establishment failed.
Definition lte-as-sap.h:235
void RecvData(Ptr< Packet > packet) override
receive a data packet
Definition lte-as-sap.h:242
void NotifyConnectionSuccessful() override
Notify the NAS that RRC Connection Establishment was successful.
Definition lte-as-sap.h:228
C * m_owner
the owner class
Definition lte-as-sap.h:217
Smart pointer class similar to boost::intrusive_ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.