24 #include "ns3/pointer.h"
25 #include "ns3/object-factory.h"
26 #include "ns3/drop-tail-queue.h"
39 .SetGroupName (
"TrafficControl")
41 .AddAttribute (
"Limit",
42 "The maximum number of packets accepted by this queue disc.",
45 MakeUintegerChecker<uint32_t> ())
67 NS_LOG_LOGIC (
"Queue disc limit exceeded -- dropping packet");
78 NS_LOG_DEBUG (
"The filter was unable to classify; using default band of " << band);
80 else if (ret < 0 || ret > 2)
83 NS_LOG_DEBUG (
"The filter returned an invalid value; using default band of " << band);
111 NS_LOG_LOGIC (
"Popped from band " << i <<
": " << item);
131 NS_LOG_LOGIC (
"Peeked from band " << i <<
": " << item);
146 NS_LOG_ERROR (
"PfifoFastQueueDisc cannot have classes");
152 NS_LOG_ERROR (
"PfifoFastQueueDisc needs at least a packet filter");
160 factory.
SetTypeId (
"ns3::DropTailQueue");
170 NS_LOG_ERROR (
"PfifoFastQueueDisc needs 3 internal queues");
178 NS_LOG_ERROR (
"PfifoFastQueueDisc needs 3 internal queues operating in packet mode");
182 for (uint8_t i = 0; i < 2; i++)
186 NS_LOG_ERROR (
"The capacity of some internal queue(s) is less than the queue disc capacity");
uint32_t GetNQueueDiscClasses(void) const
Get the number of queue disc classes.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual ~PfifoFastQueueDisc()
static const int PF_NO_MATCH
Standard value used by packet filters to indicate that no match was possible.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< Queue > GetInternalQueue(uint32_t i) const
Get the i-th internal queue.
virtual void InitializeParams(void)
Initialize parameters (if any) before the first packet is enqueued.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
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...
Abstract base class for packet Queues.
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
uint32_t GetNInternalQueues(void) const
Get the number of internal queues.
void Drop(Ptr< QueueItem > item)
Drop a packet.
Hold variables of type enum.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Hold an unsigned integer type.
void AddInternalQueue(Ptr< Queue > queue)
Add an internal queue to the tail of the list of queues.
int32_t Classify(Ptr< QueueDiscItem > item)
Classify a packet by calling the packet filters, one at a time, until either a filter able to classif...
uint32_t GetNPacketFilters(void) const
Get the number of packet filters.
uint32_t m_limit
Maximum number of packets that can be stored.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
virtual Ptr< const QueueDiscItem > DoPeek(void) const
This function returns a copy of the next packet the queue disc will extract.
Ptr< QueueDiscItem > Dequeue(void)
Request the queue discipline to extract a packet.
static TypeId GetTypeId(void)
Get the type ID.
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
Use number of packets for maximum queue size.
Instantiate subclasses of ns3::Object.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Linux pfifo_fast is the default priority queue enabled on Linux systems.
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
PfifoFastQueueDisc()
PfifoFastQueueDisc constructor.
uint32_t GetNPackets(void) const
Get the number of packets stored by the queue disc.