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-limits.h"
24 #include "ns3/queue.h"
25 #include "ns3/net-device-queue-interface.h"
26 #include "ns3/uinteger.h"
27 #include "ns3/pointer.h"
28 #include "ns3/traffic-control-layer.h"
29 #include "traffic-control-helper.h"
30 
31 namespace ns3 {
32 
33 NS_LOG_COMPONENT_DEFINE ("TrafficControlHelper");
34 
36  : m_queueDiscFactory (factory)
37 {
38 }
39 
40 void
42 {
43  m_internalQueuesFactory.push_back (factory);
44 }
45 
46 void
48 {
49  m_packetFiltersFactory.push_back (factory);
50 }
51 
52 uint16_t
54 {
55  m_queueDiscClassesFactory.push_back (factory);
56  return static_cast<uint16_t>(m_queueDiscClassesFactory.size () - 1);
57 }
58 
59 void
60 QueueDiscFactory::SetChildQueueDisc (uint16_t classId, uint16_t handle)
61 {
62  NS_ABORT_MSG_IF (classId >= m_queueDiscClassesFactory.size (),
63  "Cannot attach a queue disc to a non existing class");
64  m_classIdChildHandleMap[classId] = handle;
65 }
66 
68 QueueDiscFactory::CreateQueueDisc (const std::vector<Ptr<QueueDisc> > & queueDiscs)
69 {
70  // create the queue disc
72 
73  // create and add the internal queues
74  for (std::vector<ObjectFactory>::iterator i = m_internalQueuesFactory.begin ();
75  i != m_internalQueuesFactory.end (); i++ )
76  {
77  qd->AddInternalQueue (i->Create<QueueDisc::InternalQueue> ());
78  }
79 
80  // create and add the packet filters
81  for (std::vector<ObjectFactory>::iterator i = m_packetFiltersFactory.begin ();
82  i != m_packetFiltersFactory.end (); i++ )
83  {
84  qd->AddPacketFilter (i->Create<PacketFilter> ());
85  }
86 
87  // create and add the queue disc classes
88  for (uint16_t i = 0; i < m_queueDiscClassesFactory.size (); i++)
89  {
90  // the class ID is given by the index i of the vector
92  "Cannot create a queue disc class with no attached queue disc");
93 
94  uint16_t handle = m_classIdChildHandleMap[i];
95  NS_ABORT_MSG_IF (handle >= queueDiscs.size () || queueDiscs[handle] == 0,
96  "A queue disc with handle " << handle << " has not been created yet");
97 
98  m_queueDiscClassesFactory[i].Set ("QueueDisc", PointerValue (queueDiscs[handle]));
99  qd->AddQueueDiscClass (m_queueDiscClassesFactory[i].Create<QueueDiscClass> ());
100  }
101 
102  return qd;
103 }
104 
105 
107 {
108 }
109 
112 {
113  TrafficControlHelper helper;
114  helper.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
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  QueueBase::AppendItemTypeIfNotPresent (type, "QueueDiscItem");
175 
176  ObjectFactory factory;
177  factory.SetTypeId (type);
178  factory.Set (n01, v01);
179  factory.Set (n02, v02);
180  factory.Set (n03, v03);
181  factory.Set (n04, v04);
182  factory.Set (n05, v05);
183  factory.Set (n06, v06);
184  factory.Set (n07, v07);
185  factory.Set (n08, v08);
186 
187  for (int i = 0; i < count; i++)
188  {
189  m_queueDiscFactory[handle].AddInternalQueue (factory);
190  }
191 }
192 
193 void
194 TrafficControlHelper::AddPacketFilter (uint16_t handle, std::string type,
195  std::string n01, const AttributeValue& v01,
196  std::string n02, const AttributeValue& v02,
197  std::string n03, const AttributeValue& v03,
198  std::string n04, const AttributeValue& v04,
199  std::string n05, const AttributeValue& v05,
200  std::string n06, const AttributeValue& v06,
201  std::string n07, const AttributeValue& v07,
202  std::string n08, const AttributeValue& v08)
203 {
204  NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle "
205  << handle << " does not exist");
206 
207  ObjectFactory factory;
208  factory.SetTypeId (type);
209  factory.Set (n01, v01);
210  factory.Set (n02, v02);
211  factory.Set (n03, v03);
212  factory.Set (n04, v04);
213  factory.Set (n05, v05);
214  factory.Set (n06, v06);
215  factory.Set (n07, v07);
216  factory.Set (n08, v08);
217 
218  m_queueDiscFactory[handle].AddPacketFilter (factory);
219 }
220 
222 TrafficControlHelper::AddQueueDiscClasses (uint16_t handle, uint16_t count, std::string type,
223  std::string n01, const AttributeValue& v01,
224  std::string n02, const AttributeValue& v02,
225  std::string n03, const AttributeValue& v03,
226  std::string n04, const AttributeValue& v04,
227  std::string n05, const AttributeValue& v05,
228  std::string n06, const AttributeValue& v06,
229  std::string n07, const AttributeValue& v07,
230  std::string n08, const AttributeValue& v08)
231 {
232  NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle "
233  << handle << " does not exist");
234 
235  ObjectFactory factory;
236  factory.SetTypeId (type);
237  factory.Set (n01, v01);
238  factory.Set (n02, v02);
239  factory.Set (n03, v03);
240  factory.Set (n04, v04);
241  factory.Set (n05, v05);
242  factory.Set (n06, v06);
243  factory.Set (n07, v07);
244  factory.Set (n08, v08);
245 
247  uint16_t classId;
248 
249  for (int i = 0; i < count; i++)
250  {
251  classId = m_queueDiscFactory[handle].AddQueueDiscClass (factory);
252  list.push_back (classId);
253  }
254  return list;
255 }
256 
257 uint16_t
258 TrafficControlHelper::AddChildQueueDisc (uint16_t handle, uint16_t classId, std::string type,
259  std::string n01, const AttributeValue& v01,
260  std::string n02, const AttributeValue& v02,
261  std::string n03, const AttributeValue& v03,
262  std::string n04, const AttributeValue& v04,
263  std::string n05, const AttributeValue& v05,
264  std::string n06, const AttributeValue& v06,
265  std::string n07, const AttributeValue& v07,
266  std::string n08, const AttributeValue& v08,
267  std::string n09, const AttributeValue& v09,
268  std::string n10, const AttributeValue& v10,
269  std::string n11, const AttributeValue& v11,
270  std::string n12, const AttributeValue& v12,
271  std::string n13, const AttributeValue& v13,
272  std::string n14, const AttributeValue& v14,
273  std::string n15, const AttributeValue& v15)
274 {
275  NS_ABORT_MSG_IF (handle >= m_queueDiscFactory.size (), "A queue disc with handle "
276  << handle << " does not exist");
277 
278  ObjectFactory factory;
279  factory.SetTypeId (type);
280  factory.Set (n01, v01);
281  factory.Set (n02, v02);
282  factory.Set (n03, v03);
283  factory.Set (n04, v04);
284  factory.Set (n05, v05);
285  factory.Set (n06, v06);
286  factory.Set (n07, v07);
287  factory.Set (n08, v08);
288  factory.Set (n09, v09);
289  factory.Set (n10, v10);
290  factory.Set (n11, v11);
291  factory.Set (n12, v12);
292  factory.Set (n13, v13);
293  factory.Set (n14, v14);
294  factory.Set (n15, v15);
295 
296  uint16_t childHandle = static_cast<uint16_t>(m_queueDiscFactory.size ());
297  m_queueDiscFactory.push_back (QueueDiscFactory (factory));
298  m_queueDiscFactory[handle].SetChildQueueDisc (classId, childHandle);
299 
300  return childHandle;
301 }
302 
305  std::string type,
306  std::string n01, const AttributeValue& v01,
307  std::string n02, const AttributeValue& v02,
308  std::string n03, const AttributeValue& v03,
309  std::string n04, const AttributeValue& v04,
310  std::string n05, const AttributeValue& v05,
311  std::string n06, const AttributeValue& v06,
312  std::string n07, const AttributeValue& v07,
313  std::string n08, const AttributeValue& v08,
314  std::string n09, const AttributeValue& v09,
315  std::string n10, const AttributeValue& v10,
316  std::string n11, const AttributeValue& v11,
317  std::string n12, const AttributeValue& v12,
318  std::string n13, const AttributeValue& v13,
319  std::string n14, const AttributeValue& v14,
320  std::string n15, const AttributeValue& v15)
321 {
323  for (ClassIdList::const_iterator c = classes.begin (); c != classes.end (); c++)
324  {
325  uint16_t childHandle = AddChildQueueDisc (handle, *c, type, n01, v01, n02, v02, n03, v03,
326  n04, v04, n05, v05, n06, v06, n07, v07, n08, v08, n09, v09,
327  n10, v10, n11, v11, n12, v12, n13, v13, n14, v14, n15, v15);
328  list.push_back (childHandle);
329  }
330  return list;
331 }
332 
333 void
335  std::string n01, const AttributeValue& v01,
336  std::string n02, const AttributeValue& v02,
337  std::string n03, const AttributeValue& v03,
338  std::string n04, const AttributeValue& v04,
339  std::string n05, const AttributeValue& v05,
340  std::string n06, const AttributeValue& v06,
341  std::string n07, const AttributeValue& v07,
342  std::string n08, const AttributeValue& v08)
343 {
344  m_queueLimitsFactory.SetTypeId (type);
345  m_queueLimitsFactory.Set (n01, v01);
346  m_queueLimitsFactory.Set (n02, v02);
347  m_queueLimitsFactory.Set (n03, v03);
348  m_queueLimitsFactory.Set (n04, v04);
349  m_queueLimitsFactory.Set (n05, v05);
350  m_queueLimitsFactory.Set (n06, v06);
351  m_queueLimitsFactory.Set (n07, v07);
352  m_queueLimitsFactory.Set (n08, v08);
353 }
354 
357 {
358  QueueDiscContainer container;
359 
360  // A TrafficControlLayer object is aggregated by the InternetStackHelper, but check
361  // anyway because a queue disc has no effect without a TrafficControlLayer object
362  Ptr<TrafficControlLayer> tc = d->GetNode ()->GetObject<TrafficControlLayer> ();
363  NS_ASSERT (tc != 0);
364 
365  // Start from an empty vector of queue discs
366  m_queueDiscs.clear ();
367  m_queueDiscs.resize (m_queueDiscFactory.size ());
368 
369  // Create queue discs (from leaves to root)
370  for (auto i = m_queueDiscFactory.size (); i-- > 0; )
371  {
372  Ptr<QueueDisc> q = m_queueDiscFactory[i].CreateQueueDisc (m_queueDiscs);
373  q->SetNetDevice (d);
374  m_queueDiscs[i] = q;
375  }
376 
377  // Set the root queue disc (if any has been created) on the device
378  if (!m_queueDiscs.empty () && m_queueDiscs[0])
379  {
380  tc->SetRootQueueDiscOnDevice (d, m_queueDiscs[0]);
381  container.Add (m_queueDiscs[0]);
382  }
383 
384  // SetRootQueueDiscOnDevice calls SetupDevice (if it has not been called yet),
385  // which aggregates a netdevice queue interface to the device and creates the
386  // device transmission queues. Hence, we can install a queue limits object (if
387  // required) on all the device transmission queues
388  if (m_queueLimitsFactory.GetTypeId ().GetUid ())
389  {
391  NS_ASSERT (ndqi);
392  NS_ABORT_MSG_IF (ndqi->GetNTxQueues () == 0, "Could not install QueueLimits"
393  << "because the TX queues have not been created yet");
394  for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
395  {
396  Ptr<QueueLimits> ql = m_queueLimitsFactory.Create<QueueLimits> ();
397  ndqi->GetTxQueue (i)->SetQueueLimits (ql);
398  }
399  }
400 
401  return container;
402 }
403 
406 {
407  QueueDiscContainer container;
408 
409  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
410  {
411  container.Add (Install (*i));
412  }
413 
414  return container;
415 }
416 
417 void
419 {
420  Ptr<TrafficControlLayer> tc = d->GetNode ()->GetObject<TrafficControlLayer> ();
421  NS_ASSERT (tc != 0);
422 
423  tc->DeleteRootQueueDiscOnDevice (d);
424  // remove the queue limits objects installed on the device transmission queues
426  // if a queue disc has been installed on the device, a netdevice queue interface
427  // must have been aggregated to the device
428  NS_ASSERT (ndqi);
429  for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
430  {
431  ndqi->GetTxQueue (i)->SetQueueLimits (0);
432  }
433 }
434 
435 void
437 {
438  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
439  {
440  Uninstall (*i);
441  }
442 }
443 
444 
445 } // namespace ns3
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
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:622
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:202
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:182
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
static void AppendItemTypeIfNotPresent(std::string &typeId, const std::string &itemType)
Append the item type to the provided type ID if the latter does not end with &#39;>&#39;. ...
Definition: queue.cc:77
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.
ObjectFactory m_queueDiscFactory
Factory to create this queue disc.
void AddInternalQueue(Ptr< InternalQueue > queue)
Add an internal queue to the tail of the list of queues.
Definition: queue-disc.cc:569
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.
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.
#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<T>.
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.
void AddInternalQueue(ObjectFactory factory)
Add a factory to create an internal queue.
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
#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...
Introspection did not find any typical Config paths.
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:602
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:540