Network device transmission queue interface. More...
#include "net-device.h"
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 () |
void | CreateTxQueues (void) |
Create the device transmission queues. More... | |
uint8_t | GetNTxQueues (void) const |
Get the number of device transmission queues. More... | |
SelectQueueCallback | GetSelectQueueCallback (void) const |
Get the select queue callback. More... | |
Ptr< NetDeviceQueue > | GetTxQueue (uint8_t i) const |
Get the i-th transmission queue of the device. More... | |
void | SetSelectQueueCallback (SelectQueueCallback cb) |
Set the select queue callback. More... | |
void | SetTxQueuesN (uint8_t numTxQueues) |
Set the number of device transmission queues to create. More... | |
![]() | |
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... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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 TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | DoDispose (void) |
Dispose of the object. More... | |
![]() | |
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... | |
![]() | |
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 | |
uint8_t | m_numTxQueues |
Number of transmission queues to create. More... | |
SelectQueueCallback | m_selectQueueCallback |
Select queue callback. More... | |
std::vector< Ptr< NetDeviceQueue > > | m_txQueuesVector |
Device transmission queues. More... | |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Network device transmission queue interface.
Introspection did not find any typical Config paths.
This interface is used by the traffic control layer and by the aggregated device to access the transmission queues of the device. Additionally, through this interface, traffic control aware netdevices can:
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 262 of file net-device.h.
typedef Callback< uint8_t, Ptr<QueueItem> > ns3::NetDeviceQueueInterface::SelectQueueCallback |
Callback invoked to determine the tx queue selected for a given packet.
Definition at line 314 of file net-device.h.
ns3::NetDeviceQueueInterface::NetDeviceQueueInterface | ( | ) |
Constructor.
Creates one NetDeviceQueue by default
Definition at line 197 of file net-device.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 203 of file net-device.cc.
References NS_LOG_FUNCTION.
void ns3::NetDeviceQueueInterface::CreateTxQueues | ( | void | ) |
Create the device transmission queues.
Called by the traffic control layer just after aggregating this netdevice queue interface to the netdevice.
Definition at line 242 of file net-device.cc.
References m_numTxQueues, m_txQueuesVector, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.
Referenced by PointToPointTest::DoRun().
|
protectedvirtual |
Dispose of the object.
Reimplemented from ns3::Object.
Definition at line 222 of file net-device.cc.
References ns3::Object::DoDispose(), m_txQueuesVector, and NS_LOG_FUNCTION.
uint8_t ns3::NetDeviceQueueInterface::GetNTxQueues | ( | void | ) | const |
Get the number of device transmission queues.
Definition at line 216 of file net-device.cc.
References m_txQueuesVector.
NetDeviceQueueInterface::SelectQueueCallback ns3::NetDeviceQueueInterface::GetSelectQueueCallback | ( | void | ) | const |
Get the select queue callback.
Called by the traffic control layer to get the select queue callback set by a multi-queue device.
Definition at line 263 of file net-device.cc.
References m_selectQueueCallback.
Ptr< NetDeviceQueue > ns3::NetDeviceQueueInterface::GetTxQueue | ( | uint8_t | i | ) | const |
Get the i-th transmission queue of the device.
i | the index of the requested queue. |
The index of the first transmission queue is zero.
Definition at line 209 of file net-device.cc.
References m_txQueuesVector, and NS_ASSERT.
|
static |
Get the type ID.
Definition at line 188 of file net-device.cc.
References ns3::TypeId::SetParent().
void ns3::NetDeviceQueueInterface::SetSelectQueueCallback | ( | SelectQueueCallback | cb | ) |
Set the select queue callback.
cb | the callback to set. |
A multi-queue netdevice must call this method from within its NotifyNewAggregate method to set the select queue callback, i.e., the method used to select a device transmission queue for a given packet.
Definition at line 257 of file net-device.cc.
References m_selectQueueCallback.
void ns3::NetDeviceQueueInterface::SetTxQueuesN | ( | uint8_t | numTxQueues | ) |
Set the number of device transmission queues to create.
numTxQueues | number of device transmission queues to create. |
A multi-queue netdevice must call this method from within its NotifyNewAggregate method to set the number of device transmission queues to create.
Definition at line 230 of file net-device.cc.
References m_numTxQueues, m_txQueuesVector, NS_ABORT_MSG_IF, NS_ASSERT, and NS_LOG_FUNCTION.
|
private |
Number of transmission queues to create.
Definition at line 344 of file net-device.h.
Referenced by CreateTxQueues(), and SetTxQueuesN().
|
private |
Select queue callback.
Definition at line 343 of file net-device.h.
Referenced by GetSelectQueueCallback(), and SetSelectQueueCallback().
|
private |
Device transmission queues.
Definition at line 342 of file net-device.h.
Referenced by CreateTxQueues(), DoDispose(), GetNTxQueues(), GetTxQueue(), and SetTxQueuesN().