23 #include "ns3/string.h"
25 #undef NS_LOG_APPEND_CONTEXT
26 #define NS_LOG_APPEND_CONTEXT \
27 std::clog << "[dp " << m_dpId << " port " << m_portNo << "] ";
40 queueFactory.
SetTypeId(
"ns3::DropTailQueue<Packet>");
49 TypeId(
"ns3::OFSwitch13PriorityQueue")
51 .SetGroupName(
"OFSwitch13")
55 "The number of internal priority queues.",
59 MakeUintegerChecker<int>(1, PORT_MAX_QUEUES))
60 .AddAttribute(
"QueueFactory",
61 "The object factory for internal priority queues.",
90 NS_LOG_DEBUG(
"Packet to be dequeued from queue " << queueId);
108 NS_LOG_DEBUG(
"Packet to be removed from queue " << queueId);
126 NS_LOG_DEBUG(
"Packet to be peeked from queue " << queueId);
140 for (
int queueId = 0; queueId <
m_numQueues; queueId++)
154 for (
int queueId = 0; queueId <
GetNQueues(); queueId++)
156 if (
GetQueue(queueId)->IsEmpty() ==
false)
This class implements the priority queuing discipline for OpenFlow queue.
Ptr< Packet > Dequeue() override
Ptr< const Packet > Peek() const override
ObjectFactory m_facQueues
Factory for internal queues.
~OFSwitch13PriorityQueue() override
Dummy destructor, see DoDispose.
static TypeId GetTypeId()
Register this type.
void DoInitialize() override
int m_numQueues
Number of internal queues.
Ptr< Packet > Remove() override
OFSwitch13PriorityQueue()
Default constructor.
int GetNonEmptyQueue() const
Identify the highest-priority non-empty queue.
The OpenFlow 1.3 queue interface.
void NotifyRemove(Ptr< Packet > packet)
Notify the parent class of a packet removed from any internal queue.
uint32_t AddQueue(Ptr< Queue< Packet >> queue)
Add a new internal queue to this OpenFlow queue interface.
void NotifyDequeue(Ptr< Packet > packet)
Notify the parent class of a packet dequeued from any internal queue.
Ptr< Queue< Packet > > GetQueue(int queueId) const
Get a pointer to internal queue with specific id.
int GetNQueues() const
Get the number of internal queues.
void DoInitialize() override
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
AttributeValue implementation for ObjectFactory.
Hold variables of type string.
a unique identifier for an interface.
@ ATTR_GET
The attribute can be read.
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
Ptr< const AttributeChecker > MakeObjectFactoryChecker()
Ptr< const AttributeAccessor > MakeObjectFactoryAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_TEMPLATE_DEFINE(name)
Initialize a reference to a Log component.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static ObjectFactory GetDefaultQueueFactory()