|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/abort.h"
23 #include "ns3/queue-limits.h"
24 #include "ns3/net-device-queue-interface.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/pointer.h"
27 #include "ns3/traffic-control-layer.h"
35 : m_queueDiscFactory (factory)
62 "Cannot attach a queue disc to a non existing class");
91 "Cannot create a queue disc class with no attached queue disc");
94 NS_ABORT_MSG_IF (handle >= queueDiscs.size () || queueDiscs[handle] == 0,
95 "A queue disc with handle " << handle <<
" has not been created yet");
113 NS_ABORT_MSG_IF (nTxQueues == 0,
"The device must have at least one queue");
142 << handle <<
" does not exist");
144 for (
int i = 0; i < count; i++)
154 << handle <<
" does not exist");
163 << handle <<
" does not exist");
168 for (
int i = 0; i < count; i++)
171 list.push_back (classId);
180 << handle <<
" does not exist");
194 for (ClassIdList::const_iterator c = classes.begin (); c != classes.end (); c++)
197 list.push_back (childHandle);
235 NS_ABORT_MSG_IF (!ndqi,
"A NetDeviceQueueInterface object has not been"
236 "aggregated to the NetDevice");
237 for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
240 ndqi->GetTxQueue (i)->SetQueueLimits (ql);
266 tc->DeleteRootQueueDiscOnDevice (d);
272 for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
274 ndqi->GetTxQueue (i)->SetQueueLimits (0);
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
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.
std::vector< ObjectFactory > m_queueDiscClassesFactory
Vector of factories to create queue disc classes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< uint16_t, uint16_t > m_classIdChildHandleMap
Map storing the associations between class IDs and child queue disc handles.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Hold objects of type Ptr<T>.
void AddQueueDiscClass(Ptr< QueueDiscClass > qdClass)
Add a queue disc class to the tail of the list of classes.
PacketFilter is the abstract base class for filters used by queue discs to classify packets.
void AddPacketFilter(ObjectFactory factory)
Add a factory to create a packet filter.
ClassIdList DoAddQueueDiscClasses(uint16_t handle, uint16_t count, ObjectFactory factory)
Actual implementation of the AddQueueDiscClasses method.
std::vector< Ptr< QueueDisc > > m_queueDiscs
Vector of all the created queue discs.
uint16_t GetUid(void) const
Get the internal id of this TypeId.
void Add(QueueDiscContainer other)
Append the contents of another QueueDiscContainer to the end of this container.
uint16_t AddQueueDiscClass(ObjectFactory factory)
Add a factory to create a queue disc class.
TrafficControlHelper()
Create a TrafficControlHelper to make life easier when creating QueueDisc objects.
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...
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.
ObjectFactory m_queueDiscFactory
Factory to create this queue disc.
QueueDiscContainer Install(NetDeviceContainer c)
virtual Ptr< Node > GetNode(void) const =0
Holds a vector of ns3::QueueDisc pointers.
uint16_t DoSetRootQueueDisc(ObjectFactory factory)
Actual implementation of the SetRootQueueDisc method.
Instantiate subclasses of ns3::Object.
Introspection did not find any typical Config paths.
void DoAddPacketFilter(uint16_t handle, ObjectFactory factory)
Actual implementation of the AddPacketFilter method.
void AddInternalQueue(Ptr< InternalQueue > queue)
Add an internal queue to the tail of the list of queues.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
void DoAddInternalQueues(uint16_t handle, uint16_t count, ObjectFactory factory)
Actual implementation of the AddInternalQueues method.
HandleList DoAddChildQueueDiscs(uint16_t handle, const ClassIdList &classes, ObjectFactory factory)
Actual implementation of the AddChildQueueDiscs method.
QueueDiscFactory()
Default constructor.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
Network device transmission queue interface.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
void SetChildQueueDisc(uint16_t classId, uint16_t handle)
Set the (child) queue disc to attach to a class.
Ptr< QueueDisc > CreateQueueDisc(const std::vector< Ptr< QueueDisc > > &queueDiscs)
Create a queue disc with the currently stored configuration.
void AddPacketFilter(Ptr< PacketFilter > filter)
Add a packet filter to the tail of the list of filters used to classify packets.
Introspection did not find any typical Config paths.
void Uninstall(NetDeviceContainer c)
void AddInternalQueue(ObjectFactory factory)
Add a factory to create an internal queue.
Build a set of QueueDisc objects.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
std::vector< ObjectFactory > m_packetFiltersFactory
Vector of factories to create packet filters.
This class stores object factories required to create a queue disc and all of its components (packet ...
std::vector< ObjectFactory > m_internalQueuesFactory
Vector of factories to create internal queues.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
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...
static TrafficControlHelper Default(std::size_t nTxQueues=1)
std::vector< uint16_t > HandleList
Container type for Handlers.
std::vector< QueueDiscFactory > m_queueDiscFactory
QueueDisc factory, stores the configuration of all the queue discs.
std::vector< uint16_t > ClassIdList
Container type for Class IDs.
ObjectFactory m_queueLimitsFactory
Factory to create a queue limits object.
Abstract base class for NetDevice queue length controller.
uint16_t DoAddChildQueueDisc(uint16_t handle, uint16_t classId, ObjectFactory factory)
Actual implementation of the AddChildQueueDisc method.