ArpQueueDiscItem is a subclass of QueueDiscItem which stores ARP packets. More...
#include "arp-queue-disc-item.h"
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... | |
virtual | ~ArpQueueDiscItem () |
Destructor. More... | |
virtual void | AddHeader (void) |
Add the header to the packet. More... | |
const ArpHeader & | GetHeader (void) const |
virtual uint32_t | GetSize (void) const |
virtual uint32_t | Hash (uint32_t perturbation) const |
Computes the hash of the packet's 5-tuple. More... | |
virtual bool | Mark (void) |
Inherited from the base class, but we cannot mark ARP packets. More... | |
ArpQueueDiscItem & | operator= (const ArpQueueDiscItem &)=delete |
virtual void | Print (std::ostream &os) const |
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... | |
virtual | ~QueueDiscItem () |
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... | |
QueueDiscItem & | operator= (const QueueDiscItem &)=delete |
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< Packet > | GetPacket (void) const |
virtual bool | GetUint8Value (Uint8Values field, uint8_t &value) const |
Retrieve the value of a given field from the packet, if present. More... | |
QueueItem & | operator= (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 (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] 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 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... | |
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 36 of file arp-queue-disc-item.h.
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.
p | the packet included in the created item. |
addr | the destination MAC address |
protocol | the protocol number |
header | the ARP header |
Definition at line 26 of file arp-queue-disc-item.cc.
|
virtual |
|
delete |
|
delete |
|
virtual |
Add the header to the packet.
Implements ns3::QueueDiscItem.
Definition at line 58 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.
const ArpHeader & ns3::ArpQueueDiscItem::GetHeader | ( | void | ) | const |
Definition at line 53 of file arp-queue-disc-item.cc.
References m_header.
|
virtual |
Reimplemented from ns3::QueueItem.
Definition at line 39 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.
|
virtual |
Computes the hash of the packet's 5-tuple.
perturbation | hash perturbation value |
Reimplemented from ns3::QueueDiscItem.
Definition at line 91 of file arp-queue-disc-item.cc.
References ns3::ArpHeader::ARP_TYPE_REPLY, ns3::ArpHeader::ARP_TYPE_REQUEST, ns3::Address::CopyTo(), ns3::ArpHeader::GetDestinationHardwareAddress(), ns3::ArpHeader::GetDestinationIpv4Address(), ns3::Address::GetLength(), ns3::ArpHeader::GetSourceHardwareAddress(), ns3::ArpHeader::GetSourceIpv4Address(), nlohmann::detail::hash(), ns3::Hash32(), ns3::ArpHeader::IsRequest(), m_header, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Ipv4Address::Serialize().
|
virtual |
Inherited from the base class, but we cannot mark ARP packets.
Implements ns3::QueueDiscItem.
Definition at line 84 of file arp-queue-disc-item.cc.
References NS_LOG_FUNCTION.
|
delete |
|
virtual |
Print the item contents.
os | output stream in which the data should be printed. |
Reimplemented from ns3::QueueDiscItem.
Definition at line 70 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.
|
private |
The ARP header.
Definition at line 91 of file arp-queue-disc-item.h.
Referenced by AddHeader(), GetHeader(), GetSize(), Hash(), and Print().
|
private |
True if the header has already been added to the packet.
Definition at line 92 of file arp-queue-disc-item.h.
Referenced by AddHeader(), GetSize(), and Print().