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

ArpQueueDiscItem is a subclass of QueueDiscItem which stores ARP packets. More...

#include "arp-queue-disc-item.h"

+ Inheritance diagram for ns3::ArpQueueDiscItem:
+ Collaboration diagram for ns3::ArpQueueDiscItem:

Public Member Functions

 ArpQueueDiscItem ()=delete
 
 ArpQueueDiscItem (const ArpQueueDiscItem &)=delete
 
 ArpQueueDiscItem (Ptr< Packet > p, const Address &addr, uint16_t protocol, const ArpHeader &header)
 Create an ARP queue disc item containing an ARP packet. More...
 
 ~ArpQueueDiscItem () override
 Destructor. More...
 
void AddHeader () override
 Add the header to the packet. More...
 
const ArpHeaderGetHeader () const
 
uint32_t GetSize () const override
 
uint32_t Hash (uint32_t perturbation) const override
 Computes the hash of the packet's 5-tuple. More...
 
bool Mark () override
 Inherited from the base class, but we cannot mark ARP packets. More...
 
ArpQueueDiscItemoperator= (const ArpQueueDiscItem &)=delete
 
void Print (std::ostream &os) const override
 Print the item contents. More...
 
- Public Member Functions inherited from ns3::QueueDiscItem
 QueueDiscItem ()=delete
 
 QueueDiscItem (const QueueDiscItem &)=delete
 
 QueueDiscItem (Ptr< Packet > p, const Address &addr, uint16_t protocol)
 Create a queue disc item. More...
 
 ~QueueDiscItem () override
 
Address GetAddress () const
 Get the MAC address included in this item. More...
 
uint16_t GetProtocol () const
 Get the L3 protocol included in this item. More...
 
Time GetTimeStamp () const
 Get the timestamp included in this item. More...
 
uint8_t GetTxQueueIndex () const
 Get the transmission queue index included in this item. More...
 
QueueDiscItemoperator= (const QueueDiscItem &)=delete
 
void Print (std::ostream &os) const override
 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 ()=delete
 
 QueueItem (const QueueItem &)=delete
 
 QueueItem (Ptr< Packet > p)
 Create a queue item containing a packet. More...
 
virtual ~QueueItem ()
 
Ptr< PacketGetPacket () const
 
virtual bool GetUint8Value (Uint8Values field, uint8_t &value) const
 Retrieve the value of a given field from the packet, if present. More...
 
QueueItemoperator= (const QueueItem &)=delete
 
- Public Member Functions inherited from ns3::SimpleRefCount< QueueItem >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 

Private Attributes

ArpHeader m_header
 The ARP header. More...
 
bool m_headerAdded
 True if the header has already been added to the packet. 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...
 

Detailed Description

ArpQueueDiscItem is a subclass of QueueDiscItem which stores ARP packets.

Header and payload are kept separate to allow the queue disc to hash the fields of the header, which is added to the packet when the packet is dequeued.

Definition at line 37 of file arp-queue-disc-item.h.

Constructor & Destructor Documentation

◆ ArpQueueDiscItem() [1/3]

ns3::ArpQueueDiscItem::ArpQueueDiscItem ( Ptr< Packet p,
const Address addr,
uint16_t  protocol,
const ArpHeader header 
)

Create an ARP queue disc item containing an ARP packet.

Parameters
pthe packet included in the created item.
addrthe destination MAC address
protocolthe protocol number
headerthe ARP header

Definition at line 27 of file arp-queue-disc-item.cc.

◆ ~ArpQueueDiscItem()

ns3::ArpQueueDiscItem::~ArpQueueDiscItem ( )
override

Destructor.

Definition at line 37 of file arp-queue-disc-item.cc.

References NS_LOG_FUNCTION.

◆ ArpQueueDiscItem() [2/3]

ns3::ArpQueueDiscItem::ArpQueueDiscItem ( )
delete

◆ ArpQueueDiscItem() [3/3]

ns3::ArpQueueDiscItem::ArpQueueDiscItem ( const ArpQueueDiscItem )
delete

Member Function Documentation

◆ AddHeader()

void ns3::ArpQueueDiscItem::AddHeader ( )
overridevirtual

Add the header to the packet.

Implements ns3::QueueDiscItem.

Definition at line 63 of file arp-queue-disc-item.cc.

References ns3::Packet::AddHeader(), ns3::QueueItem::GetPacket(), m_header, m_headerAdded, NS_ASSERT, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetHeader()

const ArpHeader & ns3::ArpQueueDiscItem::GetHeader ( ) const
Returns
the header stored in this item..

Definition at line 57 of file arp-queue-disc-item.cc.

References m_header.

◆ GetSize()

uint32_t ns3::ArpQueueDiscItem::GetSize ( void  ) const
overridevirtual
Returns
the correct packet size (header plus payload).

Reimplemented from ns3::QueueItem.

Definition at line 43 of file arp-queue-disc-item.cc.

References ns3::QueueItem::GetPacket(), ns3::ArpHeader::GetSerializedSize(), ns3::Packet::GetSize(), m_header, m_headerAdded, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Hash()

uint32_t ns3::ArpQueueDiscItem::Hash ( uint32_t  perturbation) const
overridevirtual

◆ Mark()

bool ns3::ArpQueueDiscItem::Mark ( )
overridevirtual

Inherited from the base class, but we cannot mark ARP packets.

Returns
false

Implements ns3::QueueDiscItem.

Definition at line 88 of file arp-queue-disc-item.cc.

References NS_LOG_FUNCTION.

◆ operator=()

ArpQueueDiscItem& ns3::ArpQueueDiscItem::operator= ( const ArpQueueDiscItem )
delete

◆ Print()

void ns3::ArpQueueDiscItem::Print ( std::ostream &  os) const
overridevirtual

Print the item contents.

Parameters
osoutput stream in which the data should be printed.

Reimplemented from ns3::QueueItem.

Definition at line 75 of file arp-queue-disc-item.cc.

References ns3::QueueDiscItem::GetAddress(), ns3::QueueItem::GetPacket(), ns3::QueueDiscItem::GetProtocol(), ns3::QueueDiscItem::GetTxQueueIndex(), m_header, and m_headerAdded.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_header

ArpHeader ns3::ArpQueueDiscItem::m_header
private

The ARP header.

Definition at line 96 of file arp-queue-disc-item.h.

Referenced by AddHeader(), GetHeader(), GetSize(), Hash(), and Print().

◆ m_headerAdded

bool ns3::ArpQueueDiscItem::m_headerAdded
private

True if the header has already been added to the packet.

Definition at line 97 of file arp-queue-disc-item.h.

Referenced by AddHeader(), GetSize(), and Print().


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