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
test-epc-tft-classifier.cc
Go to the documentation of this file.
1
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2011 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
23
#include "ns3/test.h"
24
#include "ns3/log.h"
25
#include "ns3/packet.h"
26
#include "ns3/ipv4-header.h"
27
#include "ns3/udp-header.h"
28
#include "ns3/tcp-header.h"
29
#include "ns3/udp-l4-protocol.h"
30
#include "ns3/tcp-l4-protocol.h"
31
32
#include "ns3/epc-tft-classifier.h"
33
34
#include <iomanip>
35
36
NS_LOG_COMPONENT_DEFINE
(
"TestEpcTftClassifier"
);
37
38
namespace
ns3 {
39
40
class
EpcTftClassifierTestCase
:
public
TestCase
41
{
42
public
:
43
EpcTftClassifierTestCase
(
Ptr<EpcTftClassifier>
c,
44
EpcTft::Direction
d,
45
Ipv4Address
sa,
46
Ipv4Address
da,
47
uint16_t sp,
48
uint16_t dp,
49
uint8_t tos,
50
uint32_t tftId);
51
virtual
~EpcTftClassifierTestCase
();
52
53
private
:
54
55
Ptr<EpcTftClassifier>
m_c
;
56
EpcTft::Direction
m_d
;
57
uint8_t
m_tftId
;
58
Ipv4Header
m_ipHeader
;
59
UdpHeader
m_udpHeader
;
60
TcpHeader
m_tcpHeader
;
61
62
static
std::string
BuildNameString
(
Ptr<EpcTftClassifier>
c,
63
EpcTft::Direction
d,
64
Ipv4Address
sa,
65
Ipv4Address
da,
66
uint16_t sp,
67
uint16_t dp,
68
uint8_t tos,
69
uint32_t tftId);
70
virtual
void
DoRun
(
void
);
71
};
72
73
EpcTftClassifierTestCase::EpcTftClassifierTestCase
(
Ptr<EpcTftClassifier>
c,
74
EpcTft::Direction
d,
75
Ipv4Address
sa,
76
Ipv4Address
da,
77
uint16_t sp,
78
uint16_t dp,
79
uint8_t tos,
80
uint32_t tftId)
81
:
TestCase
(BuildNameString (c, d, sa, da, sp, dp, tos, tftId)),
82
m_c (c),
83
m_d (d),
84
m_tftId (tftId)
85
{
86
NS_LOG_FUNCTION
(
this
);
87
88
m_ipHeader
.
SetSource
(sa);
89
m_ipHeader
.
SetDestination
(da);
90
m_ipHeader
.
SetTos
(tos);
91
92
m_udpHeader
.
SetSourcePort
(sp);
93
m_udpHeader
.
SetDestinationPort
(dp);
94
}
95
96
EpcTftClassifierTestCase::~EpcTftClassifierTestCase
()
97
{
98
}
99
100
std::string
101
EpcTftClassifierTestCase::BuildNameString
(
Ptr<EpcTftClassifier>
c,
102
EpcTft::Direction
d,
103
Ipv4Address
sa,
104
Ipv4Address
da,
105
uint16_t sp,
106
uint16_t dp,
107
uint8_t tos,
108
uint32_t tftId)
109
{
110
std::ostringstream oss;
111
oss << c
112
<<
" d = "
<< d
113
<<
", sa = "
<< sa
114
<<
", da = "
<< da
115
<<
", sp = "
<< sp
116
<<
", dp = "
<< dp
117
<<
", tos = 0x"
<< std::hex << (int) tos
118
<<
" --> tftId = "
<< tftId;
119
return
oss.str ();
120
}
121
122
void
123
EpcTftClassifierTestCase::DoRun
(
void
)
124
{
125
ns3::PacketMetadata::Enable
();
126
127
Ptr<Packet>
udpPacket = Create<Packet> ();
128
m_ipHeader
.
SetProtocol
(
UdpL4Protocol::PROT_NUMBER
);
129
udpPacket->
AddHeader
(
m_udpHeader
);
130
udpPacket->
AddHeader
(
m_ipHeader
);
131
NS_LOG_LOGIC
(
this
<< *udpPacket);
132
uint32_t obtainedTftId =
m_c
->
Classify
(udpPacket,
m_d
);
133
NS_TEST_ASSERT_MSG_EQ
(obtainedTftId,
m_tftId
,
"bad classification of UDP packet"
);
134
}
135
136
137
138
139
class
EpcTftClassifierTestSuite
:
public
TestSuite
140
{
141
public
:
142
EpcTftClassifierTestSuite
();
143
};
144
145
static
EpcTftClassifierTestSuite
g_lteTftClassifierTestSuite
;
146
147
EpcTftClassifierTestSuite::EpcTftClassifierTestSuite
()
148
:
TestSuite
(
"eps-tft-classifier"
, UNIT)
149
{
150
NS_LOG_FUNCTION
(
this
);
151
152
154
// check some TFT matches
156
157
158
Ptr<EpcTftClassifier>
c1 = Create<EpcTftClassifier> ();
159
160
161
Ptr<EpcTft>
tft1_1 = Create<EpcTft> ();
162
163
EpcTft::PacketFilter
pf1_1_1;
164
pf1_1_1.
remoteAddress
.
Set
(
"1.0.0.0"
);
165
pf1_1_1.localAddress.Set (
"2.0.0.0"
);
166
pf1_1_1.remoteMask.Set (0xFF000000);
167
pf1_1_1.localMask.Set (0xFF000000);
168
tft1_1->Add (pf1_1_1);
169
170
EpcTft::PacketFilter
pf1_1_2;
171
pf1_1_2.
remoteAddress
.
Set
(
"3.3.3.0"
);
172
pf1_1_2.
localAddress
.
Set
(
"4.4.4.0"
);
173
pf1_1_2.
remoteMask
.
Set
(0xFFFFFF00);
174
pf1_1_2.
localMask
.
Set
(0xFFFFFF00);
175
tft1_1->Add (pf1_1_2);
176
177
c1->
Add
(tft1_1, 1);
178
179
180
181
Ptr<EpcTft>
tft1_2 = Create<EpcTft> ();
182
183
EpcTft::PacketFilter
pf1_2_1;
184
pf1_2_1.
remotePortStart
= 1024;
185
pf1_2_1.remotePortEnd = 1035;
186
tft1_2->
Add
(pf1_2_1);
187
188
EpcTft::PacketFilter
pf1_2_2;
189
pf1_2_2.
localPortStart
= 3456;
190
pf1_2_2.
localPortEnd
= 3489;
191
tft1_2->
Add
(pf1_2_2);
192
193
194
EpcTft::PacketFilter
pf1_2_3;
195
pf1_2_3.
localPortStart
= 7895;
196
pf1_2_3.
localPortEnd
= 7895;
197
tft1_2->
Add
(pf1_2_3);
198
199
200
EpcTft::PacketFilter
pf1_2_4;
201
pf1_2_4.
remotePortStart
= 5897;
202
pf1_2_4.
remotePortEnd
= 5897;
203
tft1_2->
Add
(pf1_2_4);
204
205
206
c1->
Add
(tft1_2, 2);
207
208
// ------------------------------------classifier---direction--------------src address---------------dst address---src port--dst port--ToS--TFT id
209
210
// test IP addresses
211
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"2.2.3.4"
),
Ipv4Address
(
"1.1.1.1"
), 4, 1234, 0, 1));
212
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"2.2.3.4"
),
Ipv4Address
(
"1.0.0.0"
), 2, 123, 5, 1));
213
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"6.2.3.4"
),
Ipv4Address
(
"1.1.1.1"
), 4, 1234, 0, 0));
214
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"3.3.3.4"
),
Ipv4Address
(
"4.4.4.1"
), 4, 1234, 0, 1));
215
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"3.3.4.4"
),
Ipv4Address
(
"4.4.4.1"
), 4, 1234, 0, 0));
216
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"3.3.3.4"
),
Ipv4Address
(
"4.4.2.1"
), 4, 1234, 0, 0));
217
218
// test remote port
219
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1024, 0, 2));
220
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1025, 0, 2));
221
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1035, 0, 2));
222
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1234, 0, 0));
223
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1024, 0, 0));
224
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1025, 0, 0));
225
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1035, 0, 0));
226
227
// test local port
228
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3456, 0, 0));
229
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3457, 0, 0));
230
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3489, 0, 0));
231
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 3456, 6, 0, 2));
232
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 3461, 3461, 0, 2));
233
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 9, 3489, 0, 2));
234
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 9, 7895, 0, 2));
235
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 7895, 10, 0, 2));
236
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 9, 5897, 0, 2));
237
AddTestCase
(
new
EpcTftClassifierTestCase
(c1,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 5897, 10, 0, 2));
238
239
241
// check default TFT
243
244
Ptr<EpcTftClassifier>
c2 = Create<EpcTftClassifier> ();
245
c2->
Add
(
EpcTft::Default
(), 1);
246
247
// ------------------------------------classifier---direction--------------src address---------------dst address---src port--dst port--ToS--TFT id
248
249
// test IP addresses
250
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"2.2.3.4"
),
Ipv4Address
(
"1.1.1.1"
), 4, 1234, 0, 1));
251
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"2.2.3.4"
),
Ipv4Address
(
"1.0.0.0"
), 2, 123, 5, 1));
252
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"6.2.3.4"
),
Ipv4Address
(
"1.1.1.1"
), 4, 1234, 0, 1));
253
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::DOWNLINK
,
Ipv4Address
(
"3.3.3.4"
),
Ipv4Address
(
"4.4.4.1"
), 4, 1234, 0, 1));
254
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::DOWNLINK
,
Ipv4Address
(
"3.3.4.4"
),
Ipv4Address
(
"4.4.4.1"
), 4, 1234, 0, 1));
255
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"3.3.3.4"
),
Ipv4Address
(
"4.4.2.1"
), 4, 1234, 0, 1));
256
257
// test remote port
258
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1024, 0, 1));
259
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1025, 0, 1));
260
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1035, 0, 1));
261
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1234, 0, 1));
262
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1024, 0, 1));
263
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1025, 0, 1));
264
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1035, 0, 1));
265
266
// test local port
267
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3456, 0, 1));
268
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3457, 0, 1));
269
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3489, 0, 1));
270
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 3456, 6, 0, 1));
271
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 3461, 3461, 0, 1));
272
AddTestCase
(
new
EpcTftClassifierTestCase
(c2,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 9, 3489, 0, 1));
273
274
275
277
// check default TFT plus dedicated ones
279
280
Ptr<EpcTftClassifier>
c3 = Create<EpcTftClassifier> ();
281
c3->
Add
(
EpcTft::Default
(), 1);
282
c3->
Add
(tft1_1, 2);
283
c3->
Add
(tft1_2, 3);
284
285
// ------------------------------------classifier---direction--------------src address---------------dst address---src port--dst port--ToS--TFT id
286
287
// test IP addresses
288
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"2.2.3.4"
),
Ipv4Address
(
"1.1.1.1"
), 4, 1234, 0, 2));
289
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"2.2.3.4"
),
Ipv4Address
(
"1.0.0.0"
), 2, 123, 5, 2));
290
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"6.2.3.4"
),
Ipv4Address
(
"1.1.1.1"
), 4, 1234, 0, 1));
291
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::DOWNLINK
,
Ipv4Address
(
"3.3.3.4"
),
Ipv4Address
(
"4.4.4.1"
), 4, 1234, 0, 2));
292
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::DOWNLINK
,
Ipv4Address
(
"3.3.4.4"
),
Ipv4Address
(
"4.4.4.1"
), 4, 1234, 0, 1));
293
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"3.3.3.4"
),
Ipv4Address
(
"4.4.2.1"
), 4, 1234, 0, 1));
294
295
// test remote port
296
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1024, 0, 3));
297
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1025, 0, 3));
298
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1035, 0, 3));
299
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1234, 0, 1));
300
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1024, 0, 1));
301
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1025, 0, 1));
302
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 1035, 0, 1));
303
304
// test local port
305
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3456, 0, 1));
306
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3457, 0, 1));
307
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 4, 3489, 0, 1));
308
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 3456, 6, 0, 3));
309
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 3461, 3461, 0, 3));
310
AddTestCase
(
new
EpcTftClassifierTestCase
(c3,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 9, 3489, 0, 3));
311
312
313
315
// check two TFTs with different ports
317
318
Ptr<EpcTftClassifier>
c4 = Create<EpcTftClassifier> ();
319
Ptr<EpcTft>
tft4_1 = Create<EpcTft> ();
320
tft4_1->
Add
(pf1_2_3);
321
c4->
Add
(tft4_1, 1);
322
Ptr<EpcTft>
tft4_2 = Create<EpcTft> ();
323
tft4_2->
Add
(pf1_2_4);
324
c4->
Add
(tft4_2, 2);
325
AddTestCase
(
new
EpcTftClassifierTestCase
(c4,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 9, 3489, 0, 0));
326
AddTestCase
(
new
EpcTftClassifierTestCase
(c4,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 9, 7895, 0, 1));
327
AddTestCase
(
new
EpcTftClassifierTestCase
(c4,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 7895, 10, 0, 1));
328
AddTestCase
(
new
EpcTftClassifierTestCase
(c4,
EpcTft::UPLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 9, 5897, 0, 2));
329
AddTestCase
(
new
EpcTftClassifierTestCase
(c4,
EpcTft::DOWNLINK
,
Ipv4Address
(
"9.1.1.1"
),
Ipv4Address
(
"8.1.1.1"
), 5897, 10, 0, 2));
330
331
}
332
333
334
}
// namespace ns3
src
lte
test
test-epc-tft-classifier.cc
Generated on Tue Oct 9 2012 16:45:41 for ns-3 by
1.8.1.2