QueueDiscItem is the abstract base class for items that are stored in a queue disc. More...
#include "queue-item.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... | |
Time | GetTimeStamp (void) const |
Get the timestamp included in this item. More... | |
uint8_t | GetTxQueueIndex (void) const |
Get the transmission queue index included in this item. More... | |
virtual uint32_t | Hash (uint32_t perturbation=0) const |
Computes the hash of various fields of the packet header. More... | |
virtual bool | Mark (void)=0 |
Marks the packet as a substitute for dropping it, such as for Explicit Congestion Notification. More... | |
virtual void | Print (std::ostream &os) const |
Print the item contents. More... | |
void | SetTimeStamp (Time t) |
Set the timestamp included in this item. More... | |
void | SetTxQueueIndex (uint8_t txq) |
Set the transmission queue index to store in this item. More... | |
Public Member Functions inherited from ns3::QueueItem | |
QueueItem (Ptr< Packet > p) | |
Create a queue item containing a packet. More... | |
virtual | ~QueueItem () |
Ptr< Packet > | GetPacket (void) const |
virtual uint32_t | GetSize (void) const |
Use this method (instead of GetPacket ()->GetSize ()) to get the packet size. More... | |
virtual bool | GetUint8Value (Uint8Values field, uint8_t &value) const |
Retrieve the value of a given field from the packet, if present. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< QueueItem > | |
SimpleRefCount () | |
Default 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 operator. 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... | |
Time | m_tstamp |
timestamp when the packet was enqueued More... | |
uint8_t | m_txq |
Transmission queue index. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::QueueItem | |
typedef void(* | TracedCallback) (Ptr< const QueueItem > item) |
TracedCallback signature for Ptr<QueueItem> More... | |
enum | Uint8Values { IP_DSFIELD } |
1-byte fields of the packet whose value can be retrieved, if present 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 148 of file queue-item.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 76 of file queue-item.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 85 of file queue-item.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 CodelQueueDiscTestItem, ns3::ArpQueueDiscItem, ns3::Ipv4QueueDiscItem, ns3::Ipv6QueueDiscItem, AredQueueDiscTestItem, TbfQueueDiscTestItem, QueueDiscTestItem, PrioQueueDiscTestItem, FifoQueueDiscTestItem, PieQueueDiscTestItem, RedQueueDiscTestItem, and qdTestItem.
Address ns3::QueueDiscItem::GetAddress | ( | void | ) | const |
Get the MAC address included in this item.
Definition at line 91 of file queue-item.cc.
References m_address, and NS_LOG_FUNCTION.
Referenced by ns3::ArpQueueDiscItem::Print(), ns3::Ipv6QueueDiscItem::Print(), and ns3::Ipv4QueueDiscItem::Print().
uint16_t ns3::QueueDiscItem::GetProtocol | ( | void | ) | const |
Get the L3 protocol included in this item.
Definition at line 98 of file queue-item.cc.
References m_protocol, and NS_LOG_FUNCTION.
Referenced by ns3::ArpQueueDiscItem::Print(), ns3::Ipv6QueueDiscItem::Print(), and ns3::Ipv4QueueDiscItem::Print().
Time ns3::QueueDiscItem::GetTimeStamp | ( | void | ) | const |
Get the timestamp included in this item.
Definition at line 119 of file queue-item.cc.
References m_tstamp, and NS_LOG_FUNCTION.
uint8_t ns3::QueueDiscItem::GetTxQueueIndex | ( | void | ) | const |
Get the transmission queue index included in this item.
Definition at line 105 of file queue-item.cc.
References m_txq, and NS_LOG_FUNCTION.
Referenced by ns3::ArpQueueDiscItem::Print(), ns3::Ipv6QueueDiscItem::Print(), and ns3::Ipv4QueueDiscItem::Print().
|
virtual |
Computes the hash of various fields of the packet header.
This method just returns 0. Subclasses should implement a reasonable hash for their protocol type, such as hashing on the TCP/IP 5-tuple.
perturbation | hash perturbation value |
Reimplemented in ns3::Ipv4QueueDiscItem, ns3::Ipv6QueueDiscItem, and ns3::ArpQueueDiscItem.
Definition at line 143 of file queue-item.cc.
References NS_LOG_WARN.
|
pure virtual |
Marks the packet as a substitute for dropping it, such as for Explicit Congestion Notification.
Implemented in ns3::Ipv4QueueDiscItem, ns3::Ipv6QueueDiscItem, ns3::ArpQueueDiscItem, CodelQueueDiscTestItem, AredQueueDiscTestItem, TbfQueueDiscTestItem, QueueDiscTestItem, PrioQueueDiscTestItem, FifoQueueDiscTestItem, PieQueueDiscTestItem, RedQueueDiscTestItem, and qdTestItem.
|
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::ArpQueueDiscItem, ns3::Ipv4QueueDiscItem, and ns3::Ipv6QueueDiscItem.
Definition at line 133 of file queue-item.cc.
References ns3::QueueItem::GetPacket(), m_address, m_protocol, and m_txq.
void ns3::QueueDiscItem::SetTimeStamp | ( | Time | t | ) |
Set the timestamp included in this item.
t | the timestamp to include in this item. |
Definition at line 126 of file queue-item.cc.
References m_tstamp, and NS_LOG_FUNCTION.
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 112 of file queue-item.cc.
References m_txq, and NS_LOG_FUNCTION.
|
private |
MAC destination address.
Definition at line 250 of file queue-item.h.
Referenced by GetAddress(), and Print().
|
private |
L3 Protocol number.
Definition at line 251 of file queue-item.h.
Referenced by GetProtocol(), and Print().
|
private |
timestamp when the packet was enqueued
Definition at line 253 of file queue-item.h.
Referenced by GetTimeStamp(), and SetTimeStamp().
|
private |
Transmission queue index.
Definition at line 252 of file queue-item.h.
Referenced by GetTxQueueIndex(), Print(), and SetTxQueueIndex().