A Discrete-Event Network Simulator
API
 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 using namespace ns3;
39 
41 {
42 public:
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 
57  uint8_t m_tftId;
61 
62  static std::string BuildNameString (Ptr<EpcTftClassifier> c,
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 
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);
90  m_ipHeader.SetTos (tos);
91 
94 }
95 
97 {
98 }
99 
100 std::string
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
124 {
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 
140 {
141 public:
143 };
144 
146 
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), TestCase::QUICK);
212  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("2.2.3.4"), Ipv4Address ("1.0.0.0"), 2, 123, 5, 1), TestCase::QUICK);
213  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("6.2.3.4"), Ipv4Address ("1.1.1.1"), 4, 1234, 0, 0), TestCase::QUICK);
214  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("3.3.3.4"), Ipv4Address ("4.4.4.1"), 4, 1234, 0, 1), TestCase::QUICK);
215  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("3.3.4.4"), Ipv4Address ("4.4.4.1"), 4, 1234, 0, 0), TestCase::QUICK);
216  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("3.3.3.4"), Ipv4Address ("4.4.2.1"), 4, 1234, 0, 0), TestCase::QUICK);
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), TestCase::QUICK);
220  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1025, 0, 2), TestCase::QUICK);
221  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1035, 0, 2), TestCase::QUICK);
222  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1234, 0, 0), TestCase::QUICK);
223  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1024, 0, 0), TestCase::QUICK);
224  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1025, 0, 0), TestCase::QUICK);
225  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1035, 0, 0), TestCase::QUICK);
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), TestCase::QUICK);
229  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 3457, 0, 0), TestCase::QUICK);
230  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 3489, 0, 0), TestCase::QUICK);
231  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 3456, 6, 0, 2), TestCase::QUICK);
232  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 3461, 3461, 0, 2), TestCase::QUICK);
233  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 9, 3489, 0, 2), TestCase::QUICK);
234  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 9, 7895, 0, 2), TestCase::QUICK);
235  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 7895, 10, 0, 2), TestCase::QUICK);
236  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 9, 5897, 0, 2), TestCase::QUICK);
237  AddTestCase (new EpcTftClassifierTestCase (c1, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 5897, 10, 0, 2), TestCase::QUICK);
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), TestCase::QUICK);
251  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("2.2.3.4"), Ipv4Address ("1.0.0.0"), 2, 123, 5, 1), TestCase::QUICK);
252  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("6.2.3.4"), Ipv4Address ("1.1.1.1"), 4, 1234, 0, 1), TestCase::QUICK);
253  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::DOWNLINK, Ipv4Address ("3.3.3.4"), Ipv4Address ("4.4.4.1"), 4, 1234, 0, 1), TestCase::QUICK);
254  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::DOWNLINK, Ipv4Address ("3.3.4.4"), Ipv4Address ("4.4.4.1"), 4, 1234, 0, 1), TestCase::QUICK);
255  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("3.3.3.4"), Ipv4Address ("4.4.2.1"), 4, 1234, 0, 1), TestCase::QUICK);
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), TestCase::QUICK);
259  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1025, 0, 1), TestCase::QUICK);
260  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1035, 0, 1), TestCase::QUICK);
261  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1234, 0, 1), TestCase::QUICK);
262  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1024, 0, 1), TestCase::QUICK);
263  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1025, 0, 1), TestCase::QUICK);
264  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1035, 0, 1), TestCase::QUICK);
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), TestCase::QUICK);
268  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 3457, 0, 1), TestCase::QUICK);
269  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 3489, 0, 1), TestCase::QUICK);
270  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 3456, 6, 0, 1), TestCase::QUICK);
271  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 3461, 3461, 0, 1), TestCase::QUICK);
272  AddTestCase (new EpcTftClassifierTestCase (c2, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 9, 3489, 0, 1), TestCase::QUICK);
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), TestCase::QUICK);
289  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("2.2.3.4"), Ipv4Address ("1.0.0.0"), 2, 123, 5, 2), TestCase::QUICK);
290  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("6.2.3.4"), Ipv4Address ("1.1.1.1"), 4, 1234, 0, 1), TestCase::QUICK);
291  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::DOWNLINK, Ipv4Address ("3.3.3.4"), Ipv4Address ("4.4.4.1"), 4, 1234, 0, 2), TestCase::QUICK);
292  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::DOWNLINK, Ipv4Address ("3.3.4.4"), Ipv4Address ("4.4.4.1"), 4, 1234, 0, 1), TestCase::QUICK);
293  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("3.3.3.4"), Ipv4Address ("4.4.2.1"), 4, 1234, 0, 1), TestCase::QUICK);
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), TestCase::QUICK);
297  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1025, 0, 3), TestCase::QUICK);
298  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1035, 0, 3), TestCase::QUICK);
299  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1234, 0, 1), TestCase::QUICK);
300  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1024, 0, 1), TestCase::QUICK);
301  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1025, 0, 1), TestCase::QUICK);
302  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 1035, 0, 1), TestCase::QUICK);
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), TestCase::QUICK);
306  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 3457, 0, 1), TestCase::QUICK);
307  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 4, 3489, 0, 1), TestCase::QUICK);
308  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 3456, 6, 0, 3), TestCase::QUICK);
309  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 3461, 3461, 0, 3), TestCase::QUICK);
310  AddTestCase (new EpcTftClassifierTestCase (c3, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 9, 3489, 0, 3), TestCase::QUICK);
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), TestCase::QUICK);
326  AddTestCase (new EpcTftClassifierTestCase (c4, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 9, 7895, 0, 1), TestCase::QUICK);
327  AddTestCase (new EpcTftClassifierTestCase (c4, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 7895, 10, 0, 1), TestCase::QUICK);
328  AddTestCase (new EpcTftClassifierTestCase (c4, EpcTft::UPLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 9, 5897, 0, 2), TestCase::QUICK);
329  AddTestCase (new EpcTftClassifierTestCase (c4, EpcTft::DOWNLINK, Ipv4Address ("9.1.1.1"), Ipv4Address ("8.1.1.1"), 5897, 10, 0, 2), TestCase::QUICK);
330 
331 }
void SetSource(Ipv4Address source)
Definition: ipv4-header.cc:285
Direction
Indicates the direction of the traffic that is to be classified.
Definition: epc-tft.h:56
uint8_t Add(PacketFilter f)
add a PacketFilter to the Traffic Flow Template
Definition: epc-tft.cc:157
static EpcTftClassifierTestSuite g_lteTftClassifierTestSuite
void SetDestination(Ipv4Address destination)
Definition: ipv4-header.cc:298
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void Add(Ptr< EpcTft > tft, uint32_t id)
add a TFT to the Classifier
A suite of tests to run.
Definition: test.h:1105
void SetDestinationPort(uint16_t port)
Definition: udp-header.cc:55
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:170
uint16_t localPortEnd
end of the port number range of the UE
Definition: epc-tft.h:115
void SetSourcePort(uint16_t port)
Definition: udp-header.cc:60
Ptr< EpcTftClassifier > m_c
void SetProtocol(uint8_t num)
Definition: ipv4-header.cc:278
encapsulates test code
Definition: test.h:929
uint32_t Classify(Ptr< Packet > p, EpcTft::Direction direction)
classify an IP packet
Packet header for IPv4.
Definition: ipv4-header.h:31
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition: test.h:148
Ipv4Mask localMask
IPv4 address mask of the UE.
Definition: epc-tft.h:110
EpcTftClassifierTestCase(Ptr< EpcTftClassifier > c, EpcTft::Direction d, Ipv4Address sa, Ipv4Address da, uint16_t sp, uint16_t dp, uint8_t tos, uint32_t tftId)
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:233
Ipv4Address remoteAddress
IPv4 address of the remote host.
Definition: epc-tft.h:107
uint16_t remotePortEnd
end of the port number range of the remote host
Definition: epc-tft.h:113
static void Enable(void)
Enable the packet metadata.
Header for the Transmission Control Protocol.
Definition: tcp-header.h:43
Packet header for UDP packets.
Definition: udp-header.h:39
void SetTos(uint8_t tos)
Definition: ipv4-header.cc:82
Ipv4Address localAddress
IPv4 address of the UE.
Definition: epc-tft.h:109
void Set(uint32_t mask)
input mask is in host order.
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
Definition: test.cc:184
static std::string BuildNameString(Ptr< EpcTftClassifier > c, EpcTft::Direction d, Ipv4Address sa, Ipv4Address da, uint16_t sp, uint16_t dp, uint8_t tos, uint32_t tftId)
virtual void DoRun(void)
Implementation to actually run this TestCase.
void Set(uint32_t address)
input address is in host order.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
Ipv4Mask remoteMask
IPv4 address mask of the remote host.
Definition: epc-tft.h:108
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:253
uint16_t remotePortStart
start of the port number range of the remote host
Definition: epc-tft.h:112
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition: epc-tft.h:73
uint16_t localPortStart
start of the port number range of the UE
Definition: epc-tft.h:114