A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
41
class
LteAsSapProvider
42
{
43
public
:
44
virtual
~LteAsSapProvider
();
45
53
virtual
void
ForceCampedOnEnb
(uint16_t cellId, uint16_t earfcn) = 0;
54
59
virtual
void
Connect
(
void
) = 0;
60
67
virtual
void
SendData
(
Ptr<Packet>
packet, uint8_t bid) = 0;
68
69
74
virtual
void
Disconnect
() = 0;
75
76
};
77
78
87
class
LteAsSapUser
88
{
89
public
:
90
virtual
~LteAsSapUser
();
91
96
virtual
void
NotifyConnectionSuccessful
() = 0;
97
102
virtual
void
NotifyConnectionFailed
() = 0;
103
104
109
virtual
void
NotifyConnectionReleased
() = 0;
110
116
virtual
void
RecvData
(
Ptr<Packet>
packet) = 0;
117
118
};
119
120
121
122
128
template
<
class
C>
129
class
MemberLteAsSapProvider
:
public
LteAsSapProvider
130
{
131
public
:
132
MemberLteAsSapProvider
(C* owner);
133
134
// inherited from LteAsSapProvider
135
virtual
void
Connect
(
void
);
136
virtual
void
ForceCampedOnEnb
(uint16_t cellId, uint16_t earfcn);
137
virtual
void
SendData
(
Ptr<Packet>
packet, uint8_t bid);
138
virtual
void
Disconnect
();
139
140
private
:
141
MemberLteAsSapProvider
();
142
C*
m_owner
;
143
};
144
145
template
<
class
C>
146
MemberLteAsSapProvider<C>::MemberLteAsSapProvider
(C* owner)
147
: m_owner (owner)
148
{
149
}
150
151
template
<
class
C>
152
MemberLteAsSapProvider<C>::MemberLteAsSapProvider
()
153
{
154
}
155
156
template
<
class
C>
157
void
158
MemberLteAsSapProvider<C>::ForceCampedOnEnb
(uint16_t cellId, uint16_t earfcn)
159
{
160
m_owner->DoForceCampedOnEnb (cellId, earfcn);
161
}
162
163
164
template
<
class
C>
165
void
166
MemberLteAsSapProvider<C>::Connect
()
167
{
168
m_owner->DoConnect ();
169
}
170
171
template
<
class
C>
172
void
173
MemberLteAsSapProvider<C>::SendData
(
Ptr<Packet>
packet, uint8_t bid)
174
{
175
m_owner->DoSendData (packet, bid);
176
}
177
178
template
<
class
C>
179
void
180
MemberLteAsSapProvider<C>::Disconnect
()
181
{
182
m_owner->DoDisconnect ();
183
}
184
185
191
template
<
class
C>
192
class
MemberLteAsSapUser
:
public
LteAsSapUser
193
{
194
public
:
195
MemberLteAsSapUser
(C* owner);
196
197
// inherited from LteAsSapUser
198
virtual
void
NotifyConnectionSuccessful
();
199
virtual
void
NotifyConnectionFailed
();
200
virtual
void
RecvData
(
Ptr<Packet>
packet);
201
virtual
void
NotifyConnectionReleased
();
202
203
private
:
204
MemberLteAsSapUser
();
205
C*
m_owner
;
206
};
207
208
template
<
class
C>
209
MemberLteAsSapUser<C>::MemberLteAsSapUser
(C* owner)
210
: m_owner (owner)
211
{
212
}
213
214
template
<
class
C>
215
MemberLteAsSapUser<C>::MemberLteAsSapUser
()
216
{
217
}
218
219
template
<
class
C>
220
void
221
MemberLteAsSapUser<C>::NotifyConnectionSuccessful
()
222
{
223
m_owner->DoNotifyConnectionSuccessful ();
224
}
225
226
template
<
class
C>
227
void
228
MemberLteAsSapUser<C>::NotifyConnectionFailed
()
229
{
230
m_owner->DoNotifyConnectionFailed ();
231
}
232
233
template
<
class
C>
234
void
235
MemberLteAsSapUser<C>::RecvData
(
Ptr<Packet>
packet)
236
{
237
m_owner->DoRecvData (packet);
238
}
239
240
template
<
class
C>
241
void
242
MemberLteAsSapUser<C>::NotifyConnectionReleased
()
243
{
244
m_owner->DoNotifyConnectionReleased ();
245
}
246
247
248
}
// namespace ns3
249
250
#endif // LTE_AS_SAP_H
src
lte
model
lte-as-sap.h
Generated on Tue May 14 2013 11:08:25 for ns-3 by
1.8.1.2