A Discrete-Event Network Simulator
API
traffic-control-helper.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Universita' degli Studi di Napoli Federico II
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: Stefano Avallone <stavallo@unina.it>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/abort.h"
23 #include "ns3/queue-disc.h"
24 #include "ns3/queue-limits.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/pointer.h"
27 #include "ns3/traffic-control-layer.h"
28 #include "traffic-control-helper.h"
29 
30 namespace ns3 {
31 
32 NS_LOG_COMPONENT_DEFINE ("TrafficControlHelper");
33 
35  : m_queueDiscFactory (factory)
36 {
37 }
38 
39 void
41 {
42  m_internalQueuesFactory.push_back (factory);
43 }
44 
45 void
47 {
48  m_packetFiltersFactory.push_back (factory);
49 }
50 
51 uint16_t
53 {
54  m_queueDiscClassesFactory.push_back (factory);
55  return m_queueDiscClassesFactory.size () - 1;
56 }
57 
58 void
59 QueueDiscFactory::SetChildQueueDisc (uint16_t classId, uint16_t handle)
60 {
61  NS_ABORT_MSG_IF (classId >= m_queueDiscClassesFactory.size (),
62  "Cannot attach a queue disc to a non existing class");
63  m_classIdChildHandleMap[classId] = handle;
64 }
65 
67 QueueDiscFactory::CreateQueueDisc (const std::vector<Ptr<QueueDisc> > & queueDiscs)
68 {
69  // create the queue disc
71 
72  // create and add the internal queues
73  for (std::vector<ObjectFactory>::iterator i = m_internalQueuesFactory.begin ();
74  i != m_internalQueuesFactory.end (); i++ )
75  {
76  qd->AddInternalQueue (i->Create<Queue> ());
77  }
78 
79  // create and add the packet filters
80  for (std::vector<ObjectFactory>::iterator i = m_packetFiltersFactory.begin ();
81  i != m_packetFiltersFactory.end (); i++ )
82  {
83  qd->AddPacketFilter (i->Create<PacketFilter> ());
84  }
85 
86  // create and add the queue disc classes
87  for (uint32_t i = 0; i < m_queueDiscClassesFactory.size (); i++)
88  {
89  // the class ID is given by the index i of the vector
91  "Cannot create a queue disc class with no attached queue disc");
92 
93  uint16_t handle = m_classIdChildHandleMap[i];
94  NS_ABORT_MSG_IF (handle >= queueDiscs.size () || queueDiscs[handle] == 0,
95  "A queue disc with handle " << handle << " has not been created yet");
96 
97  m_queueDiscClassesFactory[i].Set ("QueueDisc", PointerValue (queueDiscs[handle]));
98  qd->AddQueueDiscClass (m_queueDiscClassesFactory[i].Create<QueueDiscClass> ());
99  }
100 
101  return qd;
102 }
103 
104 
106 {
107 }
108 
111 {
112  TrafficControlHelper helper;
113  uint16_t handle = helper.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
114  helper.AddInternalQueues (handle, 3, "ns3::DropTailQueue", "MaxPackets", UintegerValue (1000));
115  return helper;
116 }
117 
118 uint16_t
120  std::string n01, const AttributeValue& v01,
121  std::string n02, const AttributeValue& v02,
122  std::string n03, const AttributeValue& v03,
123  std::string n04, const AttributeValue& v04,
124  std::string n05, const AttributeValue& v05,
125  std::string n06, const AttributeValue& v06,
126  std::string n07, const AttributeValue& v07,
127  std::string n08, const AttributeValue& v08,
128  std::string n09, const AttributeValue& v09,
129  std::string n10, const AttributeValue& v10,
130  std::string n11, const AttributeValue& v11,
131  std::string n12, const AttributeValue& v12,
132  std::string n13, const AttributeValue& v13,
133  std::string n14, const AttributeValue& v14,
134  std::string n15, const AttributeValue& v15)
135 {
136  NS_ABORT_MSG_UNLESS (m_queueDiscFactory.empty (), "A root queue disc has been already added to this factory");
137 
138  ObjectFactory factory;
139  factory.SetTypeId (type);
140  factory.Set (n01, v01);
141  factory.Set (n02, v02);
142  factory.Set (n03, v03);
143  factory.Set (n04, v04);
144  factory.Set (n05, v05);
145  factory.Set (n06, v06);
146  factory.Set (n07, v07);
147  factory.Set (n08, v08);
148  factory.Set (n09, v09);
149  factory.Set (n10, v10);
150  factory.Set (n11, v11);
151  factory.Set (n12, v12);
152  factory.Set (n13, v13);
153  factory.Set (n14, v14);
154  factory.Set (n15, v15);
155 
156  m_queueDiscFactory.push_back (QueueDiscFactory (factory));
157  return 0;
158 }
159 
160 void
161 TrafficControlHelper::AddInternalQueues (uint16_t handle, uint16_t count, std::string type,
162  std::string n01, const AttributeValue& v01,
163  std::string n02, const AttributeValue& v02,
164  std::string n03, const AttributeValue& v03,
165  std::string n04, const AttributeValue& v04,
166  std::string n05, const AttributeValue& v05,
167  std::string n06, const AttributeValue& v06,
168  std::string n07, const AttributeValue& v07,
169  std::string n08, const AttributeValue& v08)
170 {
171  NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle "
172  << handle << " does not exist");
173 
174  ObjectFactory factory;
175  factory.SetTypeId (type);
176  factory.Set (n01, v01);
177  factory.Set (n02, v02);
178  factory.Set (n03, v03);
179  factory.Set (n04, v04);
180  factory.Set (n05, v05);
181  factory.Set (n06, v06);
182  factory.Set (n07, v07);
183  factory.Set (n08, v08);
184 
185  for (int i = 0; i < count; i++)
186  {
187  m_queueDiscFactory[handle].AddInternalQueue (factory);
188  }
189 }
190 
191 void
192 TrafficControlHelper::AddPacketFilter (uint16_t handle, std::string type,
193  std::string n01, const AttributeValue& v01,
194  std::string n02, const AttributeValue& v02,
195  std::string n03, const AttributeValue& v03,
196  std::string n04, const AttributeValue& v04,
197  std::string n05, const AttributeValue& v05,
198  std::string n06, const AttributeValue& v06,
199  std::string n07, const AttributeValue& v07,
200  std::string n08, const AttributeValue& v08)
201 {
202  NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle "
203  << handle << " does not exist");
204 
205  ObjectFactory factory;
206  factory.SetTypeId (type);
207  factory.Set (n01, v01);
208  factory.Set (n02, v02);
209  factory.Set (n03, v03);
210  factory.Set (n04, v04);
211  factory.Set (n05, v05);
212  factory.Set (n06, v06);
213  factory.Set (n07, v07);
214  factory.Set (n08, v08);
215 
216  m_queueDiscFactory[handle].AddPacketFilter (factory);
217 }
218 
220 TrafficControlHelper::AddQueueDiscClasses (uint16_t handle, uint16_t count, std::string type,
221  std::string n01, const AttributeValue& v01,
222  std::string n02, const AttributeValue& v02,
223  std::string n03, const AttributeValue& v03,
224  std::string n04, const AttributeValue& v04,
225  std::string n05, const AttributeValue& v05,
226  std::string n06, const AttributeValue& v06,
227  std::string n07, const AttributeValue& v07,
228  std::string n08, const AttributeValue& v08)
229 {
230  NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle "
231  << handle << " does not exist");
232 
233  ObjectFactory factory;
234  factory.SetTypeId (type);
235  factory.Set (n01, v01);
236  factory.Set (n02, v02);
237  factory.Set (n03, v03);
238  factory.Set (n04, v04);
239  factory.Set (n05, v05);
240  factory.Set (n06, v06);
241  factory.Set (n07, v07);
242  factory.Set (n08, v08);
243 
245  uint16_t classId;
246 
247  for (int i = 0; i < count; i++)
248  {
249  classId = m_queueDiscFactory[handle].AddQueueDiscClass (factory);
250  list.push_back (classId);
251  }
252  return list;
253 }
254 
255 uint16_t
256 TrafficControlHelper::AddChildQueueDisc (uint16_t handle, uint16_t classId, std::string type,
257  std::string n01, const AttributeValue& v01,
258  std::string n02, const AttributeValue& v02,
259  std::string n03, const AttributeValue& v03,
260  std::string n04, const AttributeValue& v04,
261  std::string n05, const AttributeValue& v05,
262  std::string n06, const AttributeValue& v06,
263  std::string n07, const AttributeValue& v07,
264  std::string n08, const AttributeValue& v08,
265  std::string n09, const AttributeValue& v09,
266  std::string n10, const AttributeValue& v10,
267  std::string n11, const AttributeValue& v11,
268  std::string n12, const AttributeValue& v12,
269  std::string n13, const AttributeValue& v13,
270  std::string n14, const AttributeValue& v14,
271  std::string n15, const AttributeValue& v15)
272 {
273  NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle "
274  << handle << " does not exist");
275 
276  ObjectFactory factory;
277  factory.SetTypeId (type);
278  factory.Set (n01, v01);
279  factory.Set (n02, v02);
280  factory.Set (n03, v03);
281  factory.Set (n04, v04);
282  factory.Set (n05, v05);
283  factory.Set (n06, v06);
284  factory.Set (n07, v07);
285  factory.Set (n08, v08);
286  factory.Set (n09, v09);
287  factory.Set (n10, v10);
288  factory.Set (n11, v11);
289  factory.Set (n12, v12);
290  factory.Set (n13, v13);
291  factory.Set (n14, v14);
292  factory.Set (n15, v15);
293 
294  uint16_t childHandle = m_queueDiscFactory.size ();
295  m_queueDiscFactory.push_back (QueueDiscFactory (factory));
296  m_queueDiscFactory[handle].SetChildQueueDisc (classId, childHandle);
297 
298  return childHandle;
299 }
300 
303  std::string type,
304  std::string n01, const AttributeValue& v01,
305  std::string n02, const AttributeValue& v02,
306  std::string n03, const AttributeValue& v03,
307  std::string n04, const AttributeValue& v04,
308  std::string n05, const AttributeValue& v05,
309  std::string n06, const AttributeValue& v06,
310  std::string n07, const AttributeValue& v07,
311  std::string n08, const AttributeValue& v08,
312  std::string n09, const AttributeValue& v09,
313  std::string n10, const AttributeValue& v10,
314  std::string n11, const AttributeValue& v11,
315  std::string n12, const AttributeValue& v12,
316  std::string n13, const AttributeValue& v13,
317  std::string n14, const AttributeValue& v14,
318  std::string n15, const AttributeValue& v15)
319 {
321  for (ClassIdList::const_iterator c = classes.begin (); c != classes.end (); c++)
322  {
323  uint16_t childHandle = AddChildQueueDisc (handle, *c, type, n01, v01, n02, v02, n03, v03,
324  n04, v04, n05, v05, n06, v06, n07, v07, n08, v08, n09, v09,
325  n10, v10, n11, v11, n12, v12, n13, v13, n14, v14, n15, v15);
326  list.push_back (childHandle);
327  }
328  return list;
329 }
330 
331 void
333  std::string n01, const AttributeValue& v01,
334  std::string n02, const AttributeValue& v02,
335  std::string n03, const AttributeValue& v03,
336  std::string n04, const AttributeValue& v04,
337  std::string n05, const AttributeValue& v05,
338  std::string n06, const AttributeValue& v06,
339  std::string n07, const AttributeValue& v07,
340  std::string n08, const AttributeValue& v08)
341 {
343  m_queueLimitsFactory.Set (n01, v01);
344  m_queueLimitsFactory.Set (n02, v02);
345  m_queueLimitsFactory.Set (n03, v03);
346  m_queueLimitsFactory.Set (n04, v04);
347  m_queueLimitsFactory.Set (n05, v05);
348  m_queueLimitsFactory.Set (n06, v06);
349  m_queueLimitsFactory.Set (n07, v07);
350  m_queueLimitsFactory.Set (n08, v08);
351 }
352 
355 {
356  QueueDiscContainer container;
357 
358  // A TrafficControlLayer object is aggregated by the InternetStackHelper, but check
359  // anyway because a queue disc has no effect without a TrafficControlLayer object
360  Ptr<TrafficControlLayer> tc = d->GetNode ()->GetObject<TrafficControlLayer> ();
361  NS_ASSERT (tc != 0);
362 
363  // Start from an empty vector of queue discs
364  m_queueDiscs.clear ();
365  m_queueDiscs.resize (m_queueDiscFactory.size ());
366 
367  // Create queue discs (from leaves to root)
368  for (int i = m_queueDiscFactory.size () - 1; i >= 0; i--)
369  {
370  Ptr<QueueDisc> q = m_queueDiscFactory[i].CreateQueueDisc (m_queueDiscs);
371  q->SetNetDevice (d);
372  m_queueDiscs[i] = q;
373  container.Add (q);
374  }
375 
376  // Set the root queue disc (if any has been created) on the device
377  if (!m_queueDiscs.empty () && m_queueDiscs[0])
378  {
379  tc->SetRootQueueDiscOnDevice (d, m_queueDiscs[0]);
380  }
381 
382  // SetRootQueueDiscOnDevice calls SetupDevice (if it has not been called yet),
383  // which aggregates a netdevice queue interface to the device and creates the
384  // device transmission queues. Hence, we can install a queue limits object (if
385  // required) on all the device transmission queues
387  {
389  NS_ASSERT (ndqi);
390  for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
391  {
393  ndqi->GetTxQueue (i)->SetQueueLimits (ql);
394  }
395  }
396 
397  return container;
398 }
399 
402 {
403  QueueDiscContainer container;
404 
405  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
406  {
407  container.Add (Install (*i));
408  }
409 
410  return container;
411 }
412 
413 void
415 {
416  Ptr<TrafficControlLayer> tc = d->GetNode ()->GetObject<TrafficControlLayer> ();
417  NS_ASSERT (tc != 0);
418 
419  tc->DeleteRootQueueDiscOnDevice (d);
420  // remove the queue limits objects installed on the device transmission queues
422  // if a queue disc has been installed on the device, a netdevice queue interface
423  // must have been aggregated to the device
424  NS_ASSERT (ndqi);
425  for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
426  {
427  ndqi->GetTxQueue (i)->SetQueueLimits (0);
428  }
429 }
430 
431 void
433 {
434  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
435  {
436  Uninstall (*i);
437  }
438 }
439 
440 
441 } // namespace ns3
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
TypeId GetTypeId(void) const
Get the TypeId which will be created by this ObjectFactory.
QueueDiscContainer Install(NetDeviceContainer c)
QueueDiscFactory()
Default constructor.
void AddQueueDiscClass(Ptr< QueueDiscClass > qdClass)
Add a queue disc class to the tail of the list of classes.
Definition: queue-disc.cc:357
Introspection did not find any typical Config paths.
Hold a value for an Attribute.
Definition: attribute.h:68
std::vector< ObjectFactory > m_queueDiscClassesFactory
Vector of factories to create queue disc classes.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition: queue-disc.h:205
std::vector< Ptr< QueueDisc > > m_queueDiscs
Vector of all the created queue discs.
void Uninstall(NetDeviceContainer c)
ClassIdList AddQueueDiscClasses(uint16_t handle, uint16_t count, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add the given number of queue disc classes (of the given type and with the gi...
void AddPacketFilter(uint16_t handle, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add a packet filter (of the given type and with the given attributes) to the ...
Abstract base class for NetDevice queue length controller.
Definition: queue-limits.h:43
void SetChildQueueDisc(uint16_t classId, uint16_t handle)
Set the (child) queue disc to attach to a class.
Holds a vector of ns3::QueueDisc pointers.
Abstract base class for packet Queues.
Definition: queue.h:44
ObjectFactory m_queueDiscFactory
Factory to create this queue disc.
TrafficControlHelper()
Create a TrafficControlHelper to make life easier when creating QueueDisc objects.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Hold an unsigned integer type.
Definition: uinteger.h:44
void AddInternalQueue(Ptr< Queue > queue)
Add an internal queue to the tail of the list of queues.
Definition: queue-disc.cc:314
holds a vector of ns3::NetDevice pointers
Build a set of QueueDisc objects.
void SetQueueLimits(std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add a queue limits object to the transmission queues of the devices...
Ptr< QueueDisc > CreateQueueDisc(const std::vector< Ptr< QueueDisc > > &queueDiscs)
Create a queue disc with the currently stored configuration.
Network device transmission queue interface.
Definition: net-device.h:262
#define list
HandleList AddChildQueueDiscs(uint16_t handle, const ClassIdList &classes, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue(), std::string n09="", const AttributeValue &v09=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue(), std::string n11="", const AttributeValue &v11=EmptyAttributeValue(), std::string n12="", const AttributeValue &v12=EmptyAttributeValue(), std::string n13="", const AttributeValue &v13=EmptyAttributeValue(), std::string n14="", const AttributeValue &v14=EmptyAttributeValue(), std::string n15="", const AttributeValue &v15=EmptyAttributeValue())
Helper function used to attach a child queue disc (of the given type and with the given attributes) t...
uint16_t AddChildQueueDisc(uint16_t handle, uint16_t classId, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue(), std::string n09="", const AttributeValue &v09=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue(), std::string n11="", const AttributeValue &v11=EmptyAttributeValue(), std::string n12="", const AttributeValue &v12=EmptyAttributeValue(), std::string n13="", const AttributeValue &v13=EmptyAttributeValue(), std::string n14="", const AttributeValue &v14=EmptyAttributeValue(), std::string n15="", const AttributeValue &v15=EmptyAttributeValue())
Helper function used to attach a child queue disc (of the given type and with the given attributes) t...
std::vector< uint16_t > ClassIdList
Container type for Class IDs.
uint16_t AddQueueDiscClass(ObjectFactory factory)
Add a factory to create a queue disc class.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr.
Definition: pointer.h:36
uint16_t SetRootQueueDisc(std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue(), std::string n09="", const AttributeValue &v09=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue(), std::string n11="", const AttributeValue &v11=EmptyAttributeValue(), std::string n12="", const AttributeValue &v12=EmptyAttributeValue(), std::string n13="", const AttributeValue &v13=EmptyAttributeValue(), std::string n14="", const AttributeValue &v14=EmptyAttributeValue(), std::string n15="", const AttributeValue &v15=EmptyAttributeValue())
Helper function used to set a root queue disc of the given type and with the given attributes...
std::vector< ObjectFactory > m_internalQueuesFactory
Vector of factories to create internal queues.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
uint16_t GetUid(void) const
Get the internal id of this TypeId.
Definition: type-id.cc:1172
void AddInternalQueue(ObjectFactory factory)
Add a factory to create an internal queue.
ObjectFactory m_queueLimitsFactory
Factory to create a queue limits object.
void AddPacketFilter(ObjectFactory factory)
Add a factory to create a packet filter.
Instantiate subclasses of ns3::Object.
std::vector< ObjectFactory > m_packetFiltersFactory
Vector of factories to create packet filters.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
Definition: abort.h:144
std::vector< QueueDiscFactory > m_queueDiscFactory
QueueDisc factory, stores the configuration of all the queue discs.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
void AddInternalQueues(uint16_t handle, uint16_t count, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add the given number of internal queues (of the given type and with the given...
std::map< uint16_t, uint16_t > m_classIdChildHandleMap
Map storing the associations between class IDs and child queue disc handles.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
PacketFilter is the abstract base class for filters used by queue discs to classify packets...
Definition: packet-filter.h:34
void AddPacketFilter(Ptr< PacketFilter > filter)
Add a packet filter to the tail of the list of filters used to classify packets.
Definition: queue-disc.cc:337
This class stores object factories required to create a queue disc and all of its components (packet ...
static TrafficControlHelper Default(void)
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
void Add(QueueDiscContainer other)
Append the contents of another QueueDiscContainer to the end of this container.
std::vector< uint16_t > HandleList
Container type for Handlers.
void SetNetDevice(Ptr< NetDevice > device)
Set the NetDevice on which this queue discipline is installed.
Definition: queue-disc.cc:286