A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
arp-queue-disc-item.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Universita' degli Studi di Napoli Federico II
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*/
6
7
#ifndef ARP_QUEUE_DISC_ITEM_H
8
#define ARP_QUEUE_DISC_ITEM_H
9
10
#include "
arp-header.h
"
11
12
#include "ns3/packet.h"
13
#include "ns3/queue-item.h"
14
15
namespace
ns3
16
{
17
18
/**
19
* \ingroup arp
20
* \ingroup traffic-control
21
*
22
* ArpQueueDiscItem is a subclass of QueueDiscItem which stores ARP packets.
23
* Header and payload are kept separate to allow the queue disc to hash the
24
* fields of the header, which is added to the packet when the packet is dequeued.
25
*/
26
class
ArpQueueDiscItem
:
public
QueueDiscItem
27
{
28
public
:
29
/**
30
* \brief Create an ARP queue disc item containing an ARP packet.
31
* \param p the packet included in the created item.
32
* \param addr the destination MAC address
33
* \param protocol the protocol number
34
* \param header the ARP header
35
*/
36
ArpQueueDiscItem
(
Ptr<Packet>
p,
37
const
Address
& addr,
38
uint16_t protocol,
39
const
ArpHeader
& header);
40
41
/** Destructor. */
42
~ArpQueueDiscItem
()
override
;
43
44
// Delete default constructor, copy constructor and assignment operator to avoid misuse
45
ArpQueueDiscItem
() =
delete
;
46
ArpQueueDiscItem
(
const
ArpQueueDiscItem
&) =
delete
;
47
ArpQueueDiscItem
&
operator=
(
const
ArpQueueDiscItem
&) =
delete
;
48
49
/**
50
* \return the correct packet size (header plus payload).
51
*/
52
uint32_t
GetSize
()
const override
;
53
54
/**
55
* \return the header stored in this item..
56
*/
57
const
ArpHeader
&
GetHeader
()
const
;
58
59
/**
60
* \brief Add the header to the packet
61
*/
62
void
AddHeader
()
override
;
63
64
/**
65
* \brief Print the item contents.
66
* \param os output stream in which the data should be printed.
67
*/
68
void
Print
(std::ostream& os)
const override
;
69
70
/**
71
* \brief Inherited from the base class, but we cannot mark ARP packets
72
* \return false
73
*/
74
bool
Mark
()
override
;
75
76
/**
77
* \brief Computes the hash of the packet's 5-tuple
78
*
79
* \param perturbation hash perturbation value
80
* \return the hash of the packet's 5-tuple
81
*/
82
uint32_t
Hash
(
uint32_t
perturbation)
const override
;
83
84
private
:
85
ArpHeader
m_header
;
//!< The ARP header.
86
bool
m_headerAdded
;
//!< True if the header has already been added to the packet.
87
};
88
89
}
// namespace ns3
90
91
#endif
/* ARP_QUEUE_DISC_ITEM_H */
arp-header.h
ns3::Address
a polymophic address class
Definition
address.h:90
ns3::ArpHeader
The packet header for an ARP packet.
Definition
arp-header.h:25
ns3::ArpQueueDiscItem
ArpQueueDiscItem is a subclass of QueueDiscItem which stores ARP packets.
Definition
arp-queue-disc-item.h:27
ns3::ArpQueueDiscItem::AddHeader
void AddHeader() override
Add the header to the packet.
Definition
arp-queue-disc-item.cc:54
ns3::ArpQueueDiscItem::m_header
ArpHeader m_header
The ARP header.
Definition
arp-queue-disc-item.h:85
ns3::ArpQueueDiscItem::ArpQueueDiscItem
ArpQueueDiscItem()=delete
ns3::ArpQueueDiscItem::GetHeader
const ArpHeader & GetHeader() const
Definition
arp-queue-disc-item.cc:48
ns3::ArpQueueDiscItem::m_headerAdded
bool m_headerAdded
True if the header has already been added to the packet.
Definition
arp-queue-disc-item.h:86
ns3::ArpQueueDiscItem::Hash
uint32_t Hash(uint32_t perturbation) const override
Computes the hash of the packet's 5-tuple.
Definition
arp-queue-disc-item.cc:86
ns3::ArpQueueDiscItem::operator=
ArpQueueDiscItem & operator=(const ArpQueueDiscItem &)=delete
ns3::ArpQueueDiscItem::Print
void Print(std::ostream &os) const override
Print the item contents.
Definition
arp-queue-disc-item.cc:66
ns3::ArpQueueDiscItem::ArpQueueDiscItem
ArpQueueDiscItem(const ArpQueueDiscItem &)=delete
ns3::ArpQueueDiscItem::Mark
bool Mark() override
Inherited from the base class, but we cannot mark ARP packets.
Definition
arp-queue-disc-item.cc:79
ns3::ArpQueueDiscItem::GetSize
uint32_t GetSize() const override
Definition
arp-queue-disc-item.cc:34
ns3::ArpQueueDiscItem::~ArpQueueDiscItem
~ArpQueueDiscItem() override
Destructor.
Definition
arp-queue-disc-item.cc:28
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::QueueDiscItem
QueueDiscItem is the abstract base class for items that are stored in a queue disc.
Definition
queue-item.h:122
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
model
arp-queue-disc-item.h
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0