13#include "ns3/net-device-queue-interface.h"
14#include "ns3/pointer.h"
15#include "ns3/queue-limits.h"
16#include "ns3/traffic-control-layer.h"
17#include "ns3/uinteger.h"
52 "Cannot attach a queue disc to a non existing class");
79 "Cannot create a queue disc class with no attached queue disc");
83 "A queue disc with handle " << handle <<
" has not been created yet");
100 NS_ABORT_MSG_IF(nTxQueues == 0,
"The device must have at least one queue");
120 "A root queue disc has been already added to this factory");
130 "A queue disc with handle " << handle <<
" does not exist");
132 for (
int i = 0; i < count; i++)
142 "A queue disc with handle " << handle <<
" does not exist");
151 "A queue disc with handle " << handle <<
" does not exist");
156 for (
int i = 0; i < count; i++)
159 list.push_back(classId);
168 "A queue disc with handle " << handle <<
" does not exist");
183 for (
auto c = classes.begin(); c != classes.end(); c++)
186 list.push_back(childHandle);
225 "A NetDeviceQueueInterface object has not been"
226 "aggregated to the NetDevice");
227 for (std::size_t i = 0; i < ndqi->GetNTxQueues(); i++)
230 ndqi->GetTxQueue(i)->SetQueueLimits(ql);
242 for (
auto i = c.
Begin(); i != c.
End(); ++i)
256 tc->DeleteRootQueueDiscOnDevice(d);
262 for (std::size_t i = 0; i < ndqi->GetNTxQueues(); i++)
264 ndqi->GetTxQueue(i)->SetQueueLimits(
nullptr);
271 for (
auto i = c.
Begin(); i != c.
End(); ++i)
holds a vector of ns3::NetDevice pointers
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
Network device transmission queue interface.
Instantiate subclasses of ns3::Object.
PacketFilter is the abstract base class for filters used by queue discs to classify packets.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
Holds a vector of ns3::QueueDisc pointers.
std::vector< ObjectFactory > m_internalQueuesFactory
Vector of factories to create internal queues.
uint16_t AddQueueDiscClass(ObjectFactory factory)
Add a factory to create a queue disc class.
void AddInternalQueue(ObjectFactory factory)
Add a factory to create an internal queue.
void AddPacketFilter(ObjectFactory factory)
Add a factory to create a packet filter.
Ptr< QueueDisc > CreateQueueDisc(const std::vector< Ptr< QueueDisc > > &queueDiscs)
Create a queue disc with the currently stored configuration.
void SetChildQueueDisc(uint16_t classId, uint16_t handle)
Set the (child) queue disc to attach to a class.
QueueDiscFactory()=delete
std::map< uint16_t, uint16_t > m_classIdChildHandleMap
Map storing the associations between class IDs and child queue disc handles.
std::vector< ObjectFactory > m_packetFiltersFactory
Vector of factories to create packet filters.
ObjectFactory m_queueDiscFactory
Factory to create this queue disc.
std::vector< ObjectFactory > m_queueDiscClassesFactory
Vector of factories to create queue disc classes.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Queue< QueueDiscItem > InternalQueue
Internal queues store QueueDiscItem objects.
Abstract base class for NetDevice queue length controller.
Build a set of QueueDisc objects.
std::vector< uint16_t > HandleList
Container type for Handlers.
QueueDiscContainer Install(NetDeviceContainer c)
std::vector< Ptr< QueueDisc > > m_queueDiscs
Vector of all the created queue discs.
uint16_t DoSetRootQueueDisc(ObjectFactory factory)
Actual implementation of the SetRootQueueDisc method.
uint16_t DoAddChildQueueDisc(uint16_t handle, uint16_t classId, ObjectFactory factory)
Actual implementation of the AddChildQueueDisc method.
TrafficControlHelper()
Create a TrafficControlHelper to make life easier when creating QueueDisc objects.
uint16_t SetRootQueueDisc(const std::string &type, Args &&... args)
Helper function used to set a root queue disc of the given type and with the given attributes.
void DoAddInternalQueues(uint16_t handle, uint16_t count, ObjectFactory factory)
Actual implementation of the AddInternalQueues method.
void DoAddPacketFilter(uint16_t handle, ObjectFactory factory)
Actual implementation of the AddPacketFilter method.
ObjectFactory m_queueLimitsFactory
Factory to create a queue limits object.
void Uninstall(NetDeviceContainer c)
ClassIdList DoAddQueueDiscClasses(uint16_t handle, uint16_t count, ObjectFactory factory)
Actual implementation of the AddQueueDiscClasses method.
std::vector< uint16_t > ClassIdList
Container type for Class IDs.
static TrafficControlHelper Default(std::size_t nTxQueues=1)
ClassIdList AddQueueDiscClasses(uint16_t handle, uint16_t count, const std::string &type, Args &&... args)
Helper function used to add the given number of queue disc classes (of the given type and with the gi...
std::vector< QueueDiscFactory > m_queueDiscFactory
QueueDisc factory, stores the configuration of all the queue discs.
HandleList DoAddChildQueueDiscs(uint16_t handle, const ClassIdList &classes, ObjectFactory factory)
Actual implementation of the AddChildQueueDiscs method.
HandleList AddChildQueueDiscs(uint16_t handle, const ClassIdList &classes, const std::string &type, Args &&... args)
Helper function used to attach a child queue disc (of the given type and with the given attributes) t...
The Traffic Control layer aims at introducing an equivalent of the Linux Traffic Control infrastructu...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.