LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2014 University of Washington | 3 * Copyright (c) 2014 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 ipHeader.SetDscp (dscp); | 242 ipHeader.SetDscp (dscp); |
243 Address dest; | 243 Address dest; |
244 Ptr<Ipv4QueueDiscItem> item = Create<Ipv4QueueDiscItem> (p, dest, 0, ipHeader)
; | 244 Ptr<Ipv4QueueDiscItem> item = Create<Ipv4QueueDiscItem> (p, dest, 0, ipHeader)
; |
245 queue->Enqueue (item); | 245 queue->Enqueue (item); |
246 } | 246 } |
247 | 247 |
248 void | 248 void |
249 PfifoFastQueueDiscOverflow::DoRun (void) | 249 PfifoFastQueueDiscOverflow::DoRun (void) |
250 { | 250 { |
251 Ptr<PfifoFastQueueDisc> queueDisc = CreateObjectWithAttributes<PfifoFastQueueD
isc> ("Limit", UintegerValue (6)); | 251 Ptr<PfifoFastQueueDisc> queueDisc = CreateObjectWithAttributes<PfifoFastQueueD
isc> ("Limit", UintegerValue (6)); |
252 Ptr<DropTailQueue> band0 = CreateObjectWithAttributes<DropTailQueue> ("MaxPack
ets", UintegerValue (2)); | 252 Ptr<DropTailQueue> band0 = CreateObjectWithAttributes<DropTailQueue> ("MaxPack
ets", UintegerValue (6)); |
253 Ptr<DropTailQueue> band1 = CreateObjectWithAttributes<DropTailQueue> ("MaxPack
ets", UintegerValue (2)); | 253 Ptr<DropTailQueue> band1 = CreateObjectWithAttributes<DropTailQueue> ("MaxPack
ets", UintegerValue (6)); |
254 Ptr<DropTailQueue> band2 = CreateObjectWithAttributes<DropTailQueue> ("MaxPack
ets", UintegerValue (2)); | 254 Ptr<DropTailQueue> band2 = CreateObjectWithAttributes<DropTailQueue> ("MaxPack
ets", UintegerValue (6)); |
255 queueDisc->AddInternalQueue (band0); | 255 queueDisc->AddInternalQueue (band0); |
256 queueDisc->AddInternalQueue (band1); | 256 queueDisc->AddInternalQueue (band1); |
257 queueDisc->AddInternalQueue (band2); | 257 queueDisc->AddInternalQueue (band2); |
258 Ptr<PfifoFastIpv4PacketFilter> filter = CreateObject<PfifoFastIpv4PacketFilter
> (); | 258 Ptr<PfifoFastIpv4PacketFilter> filter = CreateObject<PfifoFastIpv4PacketFilter
> (); |
259 bool ok = filter->SetAttributeFailSafe ("Mode", EnumValue (PfifoFastIpv4Packet
Filter::PF_MODE_DSCP)); | 259 bool ok = filter->SetAttributeFailSafe ("Mode", EnumValue (PfifoFastIpv4Packet
Filter::PF_MODE_DSCP)); |
260 NS_TEST_ASSERT_MSG_EQ (ok, true, "unable to set attribute"); | 260 NS_TEST_ASSERT_MSG_EQ (ok, true, "unable to set attribute"); |
261 queueDisc->AddPacketFilter (filter); | 261 queueDisc->AddPacketFilter (filter); |
262 | 262 |
263 // Add two packets per each band | 263 // Add two packets per each band |
264 AddPacket (queueDisc, Ipv4Header::DSCP_AF42); // 0 | 264 AddPacket (queueDisc, Ipv4Header::DSCP_AF42); // 0 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 PfifoFastQueueDiscTestSuite::PfifoFastQueueDiscTestSuite () | 355 PfifoFastQueueDiscTestSuite::PfifoFastQueueDiscTestSuite () |
356 : TestSuite ("pfifo-fast-queue-disc", UNIT) | 356 : TestSuite ("pfifo-fast-queue-disc", UNIT) |
357 { | 357 { |
358 AddTestCase (new PfifoFastQueueDiscTosPrioritization, TestCase::QUICK); | 358 AddTestCase (new PfifoFastQueueDiscTosPrioritization, TestCase::QUICK); |
359 AddTestCase (new PfifoFastQueueDiscDscpPrioritization, TestCase::QUICK); | 359 AddTestCase (new PfifoFastQueueDiscDscpPrioritization, TestCase::QUICK); |
360 AddTestCase (new PfifoFastQueueDiscOverflow, TestCase::QUICK); | 360 AddTestCase (new PfifoFastQueueDiscOverflow, TestCase::QUICK); |
361 AddTestCase (new PfifoFastQueueDiscNonIpHeader, TestCase::QUICK); | 361 AddTestCase (new PfifoFastQueueDiscNonIpHeader, TestCase::QUICK); |
362 } | 362 } |
363 | 363 |
364 static PfifoFastQueueDiscTestSuite pfifoFastQueueTestSuite; | 364 static PfifoFastQueueDiscTestSuite pfifoFastQueueTestSuite; |
LEFT | RIGHT |