Ipv6QueueDiscItem is a subclass of QueueDiscItem which stores IPv6 packets. More...
#include "ipv6-queue-disc-item.h"
Public Member Functions | |
Ipv6QueueDiscItem (Ptr< Packet > p, const Address &addr, uint16_t protocol, const Ipv6Header &header) | |
Create an IPv6 queue disc item containing an IPv6 packet. More... | |
virtual | ~Ipv6QueueDiscItem () |
virtual void | AddHeader (void) |
Add the header to the packet. More... | |
const Ipv6Header & | GetHeader (void) const |
virtual uint32_t | GetSize (void) const |
virtual bool | GetUint8Value (Uint8Values field, uint8_t &value) const |
Retrieve the value of a given field from the packet, if present. More... | |
virtual uint32_t | Hash (uint32_t perturbation) const |
Computes the hash of the packet's 5-tuple. More... | |
virtual bool | Mark (void) |
Marks the packet by setting ECN_CE bits if the packet has ECN_ECT0 or ECN_ECT1 set. More... | |
virtual void | Print (std::ostream &os) const |
Print the item contents. More... | |
![]() | |
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... | |
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... | |
![]() | |
QueueItem (Ptr< Packet > p) | |
Create a queue item containing a packet. More... | |
virtual | ~QueueItem () |
Ptr< Packet > | GetPacket (void) const |
![]() | |
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 | |
Ipv6QueueDiscItem () | |
Default constructor. More... | |
Ipv6QueueDiscItem (const Ipv6QueueDiscItem &) | |
Copy constructor. More... | |
Ipv6QueueDiscItem & | operator= (const Ipv6QueueDiscItem &) |
Assignment operator. More... | |
Private Attributes | |
Ipv6Header | m_header |
The IPv6 header. More... | |
bool | m_headerAdded |
True if the header has already been added to the packet. More... | |
Additional Inherited Members | |
![]() | |
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... | |
Ipv6QueueDiscItem is a subclass of QueueDiscItem which stores IPv6 packets.
Header and payload are kept separate to allow the queue disc to manipulate the header, which is added to the packet when the packet is dequeued.
Definition at line 36 of file ipv6-queue-disc-item.h.
ns3::Ipv6QueueDiscItem::Ipv6QueueDiscItem | ( | Ptr< Packet > | p, |
const Address & | addr, | ||
uint16_t | protocol, | ||
const Ipv6Header & | header | ||
) |
Create an IPv6 queue disc item containing an IPv6 packet.
p | the packet included in the created item. |
addr | the destination MAC address |
protocol | the protocol number |
header | the IPv6 header |
Definition at line 28 of file ipv6-queue-disc-item.cc.
|
virtual |
Definition at line 36 of file ipv6-queue-disc-item.cc.
References NS_LOG_FUNCTION.
|
private |
Default constructor.
Defined and unimplemented to avoid misuse
|
private |
Copy constructor.
Defined and unimplemented to avoid misuse
|
virtual |
Add the header to the packet.
Implements ns3::QueueDiscItem.
Definition at line 60 of file ipv6-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 Ipv6Header & ns3::Ipv6QueueDiscItem::GetHeader | ( | void | ) | const |
Definition at line 55 of file ipv6-queue-disc-item.cc.
References m_header.
|
virtual |
Reimplemented from ns3::QueueItem.
Definition at line 41 of file ipv6-queue-disc-item.cc.
References ns3::QueueItem::GetPacket(), ns3::Ipv6Header::GetSerializedSize(), ns3::Packet::GetSize(), m_header, m_headerAdded, NS_ASSERT, and NS_LOG_FUNCTION.
|
virtual |
Retrieve the value of a given field from the packet, if present.
field | the field whose value has to be retrieved |
value | the output parameter to store the retrieved value |
Reimplemented from ns3::QueueItem.
Definition at line 98 of file ipv6-queue-disc-item.cc.
References ns3::Ipv6Header::GetTrafficClass(), ns3::QueueItem::IP_DSFIELD, and m_header.
|
virtual |
Computes the hash of the packet's 5-tuple.
Computes the hash of the source and destination IP addresses, protocol number and, if the transport protocol is either UDP or TCP, the source and destination port
perturbation | hash perturbation value |
Reimplemented from ns3::QueueDiscItem.
Definition at line 114 of file ipv6-queue-disc-item.cc.
References ns3::Ipv6Header::GetDestinationAddress(), ns3::TcpHeader::GetDestinationPort(), ns3::UdpHeader::GetDestinationPort(), ns3::Ipv6Header::GetNextHeader(), ns3::QueueItem::GetPacket(), ns3::Ipv6Header::GetSourceAddress(), ns3::TcpHeader::GetSourcePort(), ns3::UdpHeader::GetSourcePort(), hash, ns3::Hash32(), m_header, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, ns3::Packet::PeekHeader(), and ns3::Ipv6Address::Serialize().
|
virtual |
Marks the packet by setting ECN_CE bits if the packet has ECN_ECT0 or ECN_ECT1 set.
If ECN_CE is already set, returns true.
Implements ns3::QueueDiscItem.
Definition at line 86 of file ipv6-queue-disc-item.cc.
References ns3::Ipv6Header::ECN_CE, ns3::Ipv6Header::ECN_NotECT, ns3::Ipv6Header::GetEcn(), m_header, m_headerAdded, NS_LOG_FUNCTION, and ns3::Ipv6Header::SetEcn().
|
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::QueueDiscItem.
Definition at line 72 of file ipv6-queue-disc-item.cc.
References ns3::QueueDiscItem::GetAddress(), ns3::QueueItem::GetPacket(), ns3::QueueDiscItem::GetProtocol(), ns3::QueueDiscItem::GetTxQueueIndex(), m_header, and m_headerAdded.
|
private |
The IPv6 header.
Definition at line 119 of file ipv6-queue-disc-item.h.
Referenced by AddHeader(), GetHeader(), GetSize(), GetUint8Value(), Hash(), Mark(), and Print().
|
private |
True if the header has already been added to the packet.
Definition at line 120 of file ipv6-queue-disc-item.h.
Referenced by AddHeader(), GetSize(), Mark(), and Print().