QueueDiscItem is the abstract base class for items that are stored in a queue disc. More...
#include "queue-disc.h"
Public Member Functions | |
QueueDiscItem (Ptr< Packet > p, const Address &addr, uint16_t protocol) | |
Create a queue disc item. More... | |
virtual | ~QueueDiscItem () |
virtual void | AddHeader (void)=0 |
Add the header to the packet. More... | |
Address | GetAddress (void) const |
Get the MAC address included in this item. More... | |
uint16_t | GetProtocol (void) const |
Get the L3 protocol included in this item. More... | |
uint8_t | GetTxQueueIndex (void) const |
Get the transmission queue index included in this item. More... | |
virtual void | Print (std::ostream &os) const |
Print the item contents. More... | |
void | SetTxQueueIndex (uint8_t txq) |
Set the transmission queue index to store in this item. More... | |
![]() | |
QueueItem (Ptr< Packet > p) | |
Create a queue item containing a packet. More... | |
virtual | ~QueueItem () |
Ptr< Packet > | GetPacket (void) const |
virtual uint32_t | GetPacketSize (void) const |
Use this method (instead of GetPacket ()->GetSize ()) to get the packet size. 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... | |
Private Member Functions | |
QueueDiscItem () | |
Default constructor. More... | |
QueueDiscItem (const QueueDiscItem &) | |
Copy constructor. More... | |
QueueDiscItem & | operator= (const QueueDiscItem &) |
Assignment operator. More... | |
Private Attributes | |
Address | m_address |
MAC destination address. More... | |
uint16_t | m_protocol |
L3 Protocol number. More... | |
uint8_t | m_txq |
Transmission queue index. More... | |
Additional Inherited Members | |
![]() | |
typedef void(* | TracedCallback) (Ptr< const QueueItem > item) |
TracedCallback signature for Ptr<QueueItem> More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
QueueDiscItem is the abstract base class for items that are stored in a queue disc.
It is derived from QueueItem (which only consists of a Ptr<Packet>) to additionally store the destination MAC address, the L3 protocol number and the transmission queue index,
Definition at line 43 of file queue-disc.h.
Create a queue disc item.
p | the packet included in the created item. |
addr | the destination MAC address |
protocol | the L3 protocol number |
Definition at line 33 of file queue-disc.cc.
|
virtual |
Definition at line 41 of file queue-disc.cc.
References NS_LOG_FUNCTION.
|
private |
Default constructor.
Defined and unimplemented to avoid misuse
|
private |
Copy constructor.
Defined and unimplemented to avoid misuse
|
pure virtual |
Add the header to the packet.
Subclasses may keep header and payload separate to allow manipulating the header, so this method allows to add the header to the packet before sending the packet to the device.
Implemented in ns3::Ipv4QueueDiscItem, ns3::Ipv6QueueDiscItem, CodelQueueDiscTestItem, and RedQueueDiscTestItem.
Address ns3::QueueDiscItem::GetAddress | ( | void | ) | const |
Get the MAC address included in this item.
Definition at line 47 of file queue-disc.cc.
References m_address.
Referenced by ns3::Ipv4QueueDiscItem::Print(), and ns3::Ipv6QueueDiscItem::Print().
uint16_t ns3::QueueDiscItem::GetProtocol | ( | void | ) | const |
Get the L3 protocol included in this item.
Definition at line 53 of file queue-disc.cc.
References m_protocol.
Referenced by ns3::Ipv4QueueDiscItem::Print(), and ns3::Ipv6QueueDiscItem::Print().
uint8_t ns3::QueueDiscItem::GetTxQueueIndex | ( | void | ) | const |
Get the transmission queue index included in this item.
Definition at line 59 of file queue-disc.cc.
References m_txq.
Referenced by ns3::Ipv4QueueDiscItem::Print(), and ns3::Ipv6QueueDiscItem::Print().
|
private |
Assignment operator.
Defined and unimplemented to avoid misuse
|
virtual |
Print the item contents.
os | output stream in which the data should be printed. |
Reimplemented from ns3::QueueItem.
Reimplemented in ns3::Ipv4QueueDiscItem, and ns3::Ipv6QueueDiscItem.
Definition at line 71 of file queue-disc.cc.
References ns3::QueueItem::GetPacket(), m_address, m_protocol, and m_txq.
void ns3::QueueDiscItem::SetTxQueueIndex | ( | uint8_t | txq | ) |
Set the transmission queue index to store in this item.
txq | the transmission queue index to store in this item. |
Definition at line 65 of file queue-disc.cc.
References m_txq.
|
private |
MAC destination address.
Definition at line 115 of file queue-disc.h.
Referenced by GetAddress(), and Print().
|
private |
L3 Protocol number.
Definition at line 116 of file queue-disc.h.
Referenced by GetProtocol(), and Print().
|
private |
Transmission queue index.
Definition at line 117 of file queue-disc.h.
Referenced by GetTxQueueIndex(), Print(), and SetTxQueueIndex().