A Discrete-Event Network Simulator
API
ns3::NetDeviceQueueInterface Class Reference

Network device transmission queue interface. More...

#include "net-device.h"

+ Inheritance diagram for ns3::NetDeviceQueueInterface:
+ Collaboration diagram for ns3::NetDeviceQueueInterface:

Public Types

typedef Callback< uint8_t, Ptr< QueueItem > > SelectQueueCallback
 Callback invoked to determine the tx queue selected for a given packet. More...
 

Public Member Functions

 NetDeviceQueueInterface ()
 Constructor. More...
 
virtual ~NetDeviceQueueInterface ()
 
uint8_t GetSelectedQueue (Ptr< QueueItem > item) const
 Get the id of the transmission queue selected for the given packet. More...
 
Ptr< NetDeviceQueueGetTxQueue (uint8_t i) const
 Get the i-th transmission queue of the device. More...
 
uint8_t GetTxQueuesN (void) const
 Get the number of device transmission queues. More...
 
bool IsQueueDiscInstalled (void) const
 Return true if a queue disc is installed on the device. More...
 
void SetQueueDiscInstalled (bool installed)
 Set the member variable indicating whether a queue disc is installed or not. More...
 
void SetSelectQueueCallback (SelectQueueCallback cb)
 Set the select queue callback. More...
 
void SetTxQueuesN (uint8_t numTxQueues)
 Set the number of device transmission queues. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Implement the GetInstanceTypeId method defined in ObjectBase. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

virtual void DoDispose (void)
 Dispose of the object. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Private Attributes

bool m_queueDiscInstalled
 Boolean value indicating whether a queue disc is installed or not. More...
 
SelectQueueCallback m_selectQueueCallback
 Select queue callback. More...
 
std::vector< Ptr< NetDeviceQueue > > m_txQueuesVector
 Device transmission queues. More...
 

Additional Inherited Members

Detailed Description

Network device transmission queue interface.

Introspection did not find any typical Config paths.

This interface is required by the traffic control layer to access the information about the status of the transmission queues of a device. Thus, every NetDevice (but loopback) needs to create this interface. NetDevices supporting flow control can start and stop their device transmission queues and wake the upper layers through this interface. By default, a NetDeviceQueueInterface object is created with a single device transmission queue. Therefore, multi-queue devices need to call SetTxQueuesN to create additional queues (before a root queue disc is installed, i.e., typically before an IPv4/IPv6 address is assigned to the device), implement a GetSelectedQueue method and pass a callback to such a method through the SetSelectedQueueCallback method.


No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 72 bytes (on a 64-bit architecture).

Definition at line 216 of file net-device.h.

Member Typedef Documentation

Callback invoked to determine the tx queue selected for a given packet.

Definition at line 259 of file net-device.h.

Constructor & Destructor Documentation

ns3::NetDeviceQueueInterface::NetDeviceQueueInterface ( )

Constructor.

Creates one NetDeviceQueue by default

Definition at line 133 of file net-device.cc.

References m_txQueuesVector, and NS_LOG_FUNCTION.

ns3::NetDeviceQueueInterface::~NetDeviceQueueInterface ( )
virtual

Definition at line 141 of file net-device.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::NetDeviceQueueInterface::DoDispose ( void  )
protectedvirtual

Dispose of the object.

Reimplemented from ns3::Object.

Definition at line 160 of file net-device.cc.

References ns3::Object::DoDispose(), m_txQueuesVector, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

uint8_t ns3::NetDeviceQueueInterface::GetSelectedQueue ( Ptr< QueueItem item) const

Get the id of the transmission queue selected for the given packet.

Returns
the id of the transmission queue selected for the given packet

Called by the traffic control when it needs to determine which device transmission queue a given packet must be enqueued into. This function calls the select queue callback, if set by the device. Return 0 otherwise.

Definition at line 195 of file net-device.cc.

References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), and m_selectQueueCallback.

+ Here is the call graph for this function:

Ptr< NetDeviceQueue > ns3::NetDeviceQueueInterface::GetTxQueue ( uint8_t  i) const

Get the i-th transmission queue of the device.

Returns
the i-th transmission queue of the device.

The index of the first transmission queue is zero.

Definition at line 147 of file net-device.cc.

References m_txQueuesVector, and NS_ASSERT.

Referenced by SetTxQueuesN().

+ Here is the caller graph for this function:

uint8_t ns3::NetDeviceQueueInterface::GetTxQueuesN ( void  ) const

Get the number of device transmission queues.

Returns
the number of device transmission queues.

Definition at line 154 of file net-device.cc.

References m_txQueuesVector.

TypeId ns3::NetDeviceQueueInterface::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 124 of file net-device.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

bool ns3::NetDeviceQueueInterface::IsQueueDiscInstalled ( void  ) const

Return true if a queue disc is installed on the device.

Returns
true if a queue disc is installed on the device.

Definition at line 205 of file net-device.cc.

References m_queueDiscInstalled.

void ns3::NetDeviceQueueInterface::SetQueueDiscInstalled ( bool  installed)

Set the member variable indicating whether a queue disc is installed or not.

Parameters
installedthe value for the member variable indicating whether a queue disc is installed or not

Definition at line 211 of file net-device.cc.

References m_queueDiscInstalled, and NS_LOG_FUNCTION.

void ns3::NetDeviceQueueInterface::SetSelectQueueCallback ( SelectQueueCallback  cb)

Set the select queue callback.

Parameters
cbthe callback to set

Called by a device to set the select queue callback, i.e., the method used to select a device transmission queue for a given packet

Definition at line 189 of file net-device.cc.

References m_selectQueueCallback.

void ns3::NetDeviceQueueInterface::SetTxQueuesN ( uint8_t  numTxQueues)

Set the number of device transmission queues.

Parameters
numTxQueuesnumber of device transmission queues.

Called by a device to set the number of device transmission queues. This method can be called by a NetDevice at initialization time only, because it is not possible to change the number of device transmission queues after the wake callbacks have been set on the device queues.

Definition at line 168 of file net-device.cc.

References GetTxQueue(), m_txQueuesVector, NS_ABORT_MSG_IF, and NS_ASSERT.

+ Here is the call graph for this function:

Member Data Documentation

bool ns3::NetDeviceQueueInterface::m_queueDiscInstalled
private

Boolean value indicating whether a queue disc is installed or not.

Definition at line 301 of file net-device.h.

Referenced by IsQueueDiscInstalled(), and SetQueueDiscInstalled().

SelectQueueCallback ns3::NetDeviceQueueInterface::m_selectQueueCallback
private

Select queue callback.

Definition at line 300 of file net-device.h.

Referenced by GetSelectedQueue(), and SetSelectQueueCallback().

std::vector< Ptr<NetDeviceQueue> > ns3::NetDeviceQueueInterface::m_txQueuesVector
private

Device transmission queues.

Definition at line 299 of file net-device.h.

Referenced by DoDispose(), GetTxQueue(), GetTxQueuesN(), NetDeviceQueueInterface(), and SetTxQueuesN().


The documentation for this class was generated from the following files: