23 #include "ns3/object.h"
24 #include "ns3/traced-value.h"
25 #include <ns3/queue.h>
26 #include "ns3/net-device.h"
92 virtual void Print (std::ostream &os)
const;
293 virtual void SetQuota (
const uint32_t quota);
299 virtual uint32_t
GetQuota (
void)
const;
uint8_t GetTxQueueIndex(void) const
Get the transmission queue index included in this item.
TracedCallback< Ptr< const QueueItem > > m_traceRequeue
Traced callback: fired when a packet is requeued.
uint32_t GetNQueueDiscClasses(void) const
Get the number of queue disc classes.
Base class to represent items of packet Queues.
Ptr< QueueDiscItem > m_requeued
The last packet that failed to be transmitted.
uint32_t GetTotalReceivedPackets(void) const
Get the total number of received packets.
void AddQueueDiscClass(Ptr< QueueDiscClass > qdClass)
Add a queue disc class to the tail of the list of classes.
bool Enqueue(Ptr< QueueDiscItem > item)
Pass a packet to store to the queue discipline.
Ptr< Queue > GetInternalQueue(uint32_t i) const
Get the i-th internal queue.
uint32_t GetNBytes(void) const
Get the amount of bytes stored by the queue disc.
uint32_t GetTotalRequeuedPackets(void) const
Get the total number of requeued packets.
uint8_t m_txq
Transmission queue index.
Ptr< QueueDisc > m_queueDisc
Queue disc attached to this class.
Forward calls to a chain of Callback.
virtual void DoDispose(void)
Dispose of the object.
void SetQueueDisc(Ptr< QueueDisc > qd)
Set the queue disc attached to this class.
void SetTxQueueIndex(uint8_t txq)
Set the transmission queue index to store in this item.
TracedCallback< Ptr< const QueueItem > > m_traceEnqueue
Traced callback: fired when a packet is enqueued.
uint32_t m_nTotalReceivedPackets
Total received packets.
virtual Ptr< QueueDiscItem > DoDequeue(void)=0
This function actually extracts a packet from the queue disc.
QueueDiscItem is the abstract base class for items that are stored in a queue disc.
QueueDiscItem & operator=(const QueueDiscItem &)
Assignment operator.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Address GetAddress(void) const
Get the MAC address included in this item.
WakeMode
Used to determine whether the queue disc itself or its children must be activated when a netdevice wa...
void NotifyParentDrop(Ptr< QueueItem > item)
Notify the parent queue disc of a packet drop.
a polymophic address class
ParentDropCallback m_parentDropCallback
Parent drop callback.
uint32_t GetTotalReceivedBytes(void) const
Get the total amount of received bytes.
std::vector< Ptr< Queue > > m_queues
Internal queues.
uint32_t GetNInternalQueues(void) const
Get the number of internal queues.
void Drop(Ptr< QueueItem > item)
Drop a packet.
virtual void DoInitialize(void)
Check whether the configuration is correct and initialize parameters.
Ptr< NetDeviceQueueInterface > m_devQueueIface
NetDevice queue interface.
uint16_t m_protocol
L3 Protocol number.
QueueDiscItem()
Default constructor.
void AddInternalQueue(Ptr< Queue > queue)
Add an internal queue to the tail of the list of queues.
uint32_t m_nTotalReceivedBytes
Total received bytes.
void Run(void)
Modelled after the Linux function __qdisc_run (net/sched/sch_generic.c) Dequeues multiple packets...
Ptr< PacketFilter > GetPacketFilter(uint32_t i) const
Get the i-th packet filter.
uint32_t m_nTotalDroppedBytes
Total dropped bytes.
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)=0
This function actually enqueues a packet into the queue disc.
bool Transmit(Ptr< QueueDiscItem > item)
Modelled after the Linux function sch_direct_xmit (net/sched/sch_generic.c) Sends a packet to the dev...
TracedCallback< Ptr< const QueueItem > > m_traceDequeue
Traced callback: fired when a packet is dequeued.
Ptr< QueueDisc > GetQueueDisc(void) const
Get the queue disc attached to this class.
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...
virtual void DoDispose(void)
Dispose of the object.
uint32_t GetNPacketFilters(void) const
Get the number of packet filters.
TracedCallback< Ptr< const QueueItem > > m_traceDrop
Traced callback: fired when a packet is dropped.
QueueDiscClass is the base class for classes that are included in a queue disc.
static const uint32_t DEFAULT_QUOTA
Default quota (as in /proc/sys/net/core/dev_weight)
Ptr< QueueDiscItem > Dequeue(void)
Request the queue discipline to extract a packet.
uint32_t m_nTotalRequeuedBytes
Total requeued bytes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t GetTotalDroppedPackets(void) const
Get the total number of dropped packets.
WakeMode GetWakeMode(void)
When setting up the wake callbacks on the netdevice queues, it is necessary to determine which queue ...
uint32_t m_quota
Maximum number of packets dequeued in a qdisc run.
uint32_t GetTotalDroppedBytes(void) const
Get the total amount of dropped bytes.
bool RunBegin(void)
Modelled after the Linux function qdisc_run_begin (include/net/sch_generic.h).
bool m_running
The queue disc is performing multiple dequeue operations.
virtual void Print(std::ostream &os) const
Print the item contents.
virtual uint32_t GetQuota(void) const
Get the maximum number of dequeue operations following a packet enqueue.
virtual bool CheckConfig(void)=0
Check whether the current configuration is correct.
TracedValue< uint32_t > m_nBytes
Number of bytes in the queue.
void Requeue(Ptr< QueueDiscItem > item)
Modelled after the Linux function dev_requeue_skb (net/sched/sch_generic.c) Requeues a packet whose t...
TracedValue< uint32_t > m_nPackets
Number of packets in the queue.
std::vector< Ptr< PacketFilter > > m_filters
Packet filters.
Ptr< NetDevice > m_device
The NetDevice on which this queue discipline is installed.
virtual void SetQuota(const uint32_t quota)
Set the maximum number of dequeue operations following a packet enqueue.
uint32_t GetTotalRequeuedBytes(void) const
Get the total amount of requeued bytes.
void AddPacketFilter(Ptr< PacketFilter > filter)
Add a packet filter to the tail of the list of filters used to classify packets.
virtual void InitializeParams(void)=0
Initialize parameters (if any) before the first packet is enqueued.
virtual void SetParentDropCallback(ParentDropCallback cb)
Set the parent drop callback.
static TypeId GetTypeId(void)
Get the type ID.
uint16_t GetProtocol(void) const
Get the L3 protocol included in this item.
A base class which provides memory management and object aggregation.
virtual Ptr< const QueueDiscItem > DoPeek(void) const =0
This function returns a copy of the next packet the queue disc will extract.
Callback< void, Ptr< QueueItem > > ParentDropCallback
Callback invoked by a child queue disc to notify the parent of a packet drop.
bool Restart(void)
Modelled after the Linux function qdisc_restart (net/sched/sch_generic.c) Dequeue a packet (by callin...
Address m_address
MAC destination address.
virtual ~QueueDiscClass()
a unique identifier for an interface.
Ptr< QueueDiscItem > DequeuePacket(void)
Modelled after the Linux function dequeue_skb (net/sched/sch_generic.c)
Ptr< NetDevice > GetNetDevice(void) const
Get the NetDevice on which this queue discipline is installed.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t m_nTotalRequeuedPackets
Total requeued packets.
Ptr< const QueueDiscItem > Peek(void) const
Get a copy of the next packet the queue discipline will extract, without actually extracting the pack...
virtual void AddHeader(void)=0
Add the header to the packet.
uint32_t m_nTotalDroppedPackets
Total dropped packets.
void SetNetDevice(Ptr< NetDevice > device)
Set the NetDevice on which this queue discipline is installed.
Ptr< QueueDiscClass > GetQueueDiscClass(uint32_t i) const
Get the i-th queue disc class.
void RunEnd(void)
Modelled after the Linux function qdisc_run_end (include/net/sch_generic.h).
std::vector< Ptr< QueueDiscClass > > m_classes
Classes.
uint32_t GetNPackets(void) const
Get the number of packets stored by the queue disc.