A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
ipv4-queue-disc-item.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*/
17
18
#ifndef IPV4_QUEUE_DISC_ITEM_H
19
#define IPV4_QUEUE_DISC_ITEM_H
20
21
#include "
ipv4-header.h
"
22
23
#include "ns3/packet.h"
24
#include "ns3/queue-item.h"
25
26
namespace
ns3
27
{
28
37
class
Ipv4QueueDiscItem
:
public
QueueDiscItem
38
{
39
public
:
47
Ipv4QueueDiscItem
(
Ptr<Packet>
p,
48
const
Address
& addr,
49
uint16_t protocol,
50
const
Ipv4Header
& header);
51
52
~Ipv4QueueDiscItem
()
override
;
53
54
// Delete default constructor, copy constructor and assignment operator to avoid misuse
55
Ipv4QueueDiscItem
() =
delete
;
56
Ipv4QueueDiscItem
(
const
Ipv4QueueDiscItem
&) =
delete
;
57
Ipv4QueueDiscItem
&
operator=
(
const
Ipv4QueueDiscItem
&) =
delete
;
58
62
uint32_t
GetSize
()
const override
;
63
67
const
Ipv4Header
&
GetHeader
()
const
;
68
72
void
AddHeader
()
override
;
73
78
void
Print
(std::ostream& os)
const override
;
79
80
/*
81
* The values for the fields of the Ipv4 header are taken from m_header and
82
* thus might differ from those present in the packet in case the header is
83
* modified after being added to the packet. However, this function is likely
84
* to be called before the header is added to the packet (i.e., before the
85
* packet is dequeued from the queue disc)
86
*/
87
bool
GetUint8Value
(
Uint8Values
field, uint8_t& value)
const override
;
88
94
bool
Mark
()
override
;
95
106
uint32_t
Hash
(uint32_t perturbation)
const override
;
107
108
private
:
109
Ipv4Header
m_header
;
110
bool
m_headerAdded
;
111
};
112
113
}
// namespace ns3
114
115
#endif
/* IPV4_QUEUE_DISC_ITEM_H */
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::Ipv4Header
Packet header for IPv4.
Definition:
ipv4-header.h:34
ns3::Ipv4QueueDiscItem
Ipv4QueueDiscItem is a subclass of QueueDiscItem which stores IPv4 packets.
Definition:
ipv4-queue-disc-item.h:38
ns3::Ipv4QueueDiscItem::m_headerAdded
bool m_headerAdded
True if the header has already been added to the packet.
Definition:
ipv4-queue-disc-item.h:110
ns3::Ipv4QueueDiscItem::GetHeader
const Ipv4Header & GetHeader() const
Definition:
ipv4-queue-disc-item.cc:60
ns3::Ipv4QueueDiscItem::m_header
Ipv4Header m_header
The IPv4 header.
Definition:
ipv4-queue-disc-item.h:109
ns3::Ipv4QueueDiscItem::Hash
uint32_t Hash(uint32_t perturbation) const override
Computes the hash of the packet's 5-tuple.
Definition:
ipv4-queue-disc-item.cc:119
ns3::Ipv4QueueDiscItem::~Ipv4QueueDiscItem
~Ipv4QueueDiscItem() override
Definition:
ipv4-queue-disc-item.cc:40
ns3::Ipv4QueueDiscItem::Ipv4QueueDiscItem
Ipv4QueueDiscItem(const Ipv4QueueDiscItem &)=delete
ns3::Ipv4QueueDiscItem::AddHeader
void AddHeader() override
Add the header to the packet.
Definition:
ipv4-queue-disc-item.cc:66
ns3::Ipv4QueueDiscItem::GetUint8Value
bool GetUint8Value(Uint8Values field, uint8_t &value) const override
Retrieve the value of a given field from the packet, if present.
Definition:
ipv4-queue-disc-item.cc:103
ns3::Ipv4QueueDiscItem::Ipv4QueueDiscItem
Ipv4QueueDiscItem()=delete
ns3::Ipv4QueueDiscItem::Mark
bool Mark() override
Marks the packet by setting ECN_CE bits if the packet has ECN_ECT0 or ECN_ECT1 set.
Definition:
ipv4-queue-disc-item.cc:91
ns3::Ipv4QueueDiscItem::Print
void Print(std::ostream &os) const override
Print the item contents.
Definition:
ipv4-queue-disc-item.cc:78
ns3::Ipv4QueueDiscItem::operator=
Ipv4QueueDiscItem & operator=(const Ipv4QueueDiscItem &)=delete
ns3::Ipv4QueueDiscItem::GetSize
uint32_t GetSize() const override
Definition:
ipv4-queue-disc-item.cc:46
ns3::Ptr< Packet >
ns3::QueueDiscItem
QueueDiscItem is the abstract base class for items that are stored in a queue disc.
Definition:
queue-item.h:133
ns3::QueueItem::Uint8Values
Uint8Values
1-byte fields of the packet whose value can be retrieved, if present
Definition:
queue-item.h:82
ipv4-header.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
model
ipv4-queue-disc-item.h
Generated on Sun Mar 3 2024 17:10:58 for ns-3 by
1.9.1