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
packet-data-calculators.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 Drexel University
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
* Author: Joe Kopena (tjkopena@cs.drexel.edu)
18
*/
19
20
#ifndef PACKET_DATA_CALCULATORS_H
21
#define PACKET_DATA_CALCULATORS_H
22
23
#include "
mac48-address.h
"
24
25
#include "ns3/basic-data-calculators.h"
26
#include "ns3/data-calculator.h"
27
#include "ns3/packet.h"
28
29
namespace
ns3
30
{
31
32
/**
33
* \ingroup stats
34
*
35
* A stat for counting packets
36
*
37
*/
38
class
PacketCounterCalculator
:
public
CounterCalculator
<uint32_t>
39
{
40
public
:
41
PacketCounterCalculator
();
42
~PacketCounterCalculator
()
override
;
43
44
/**
45
* Register this type.
46
* \return The TypeId.
47
*/
48
static
TypeId
GetTypeId
();
49
50
/**
51
* Increments the packet counter by one
52
*
53
* \param path not used in this method
54
* \param packet not used in this method
55
*/
56
void
PacketUpdate
(std::string path,
Ptr<const Packet>
packet);
57
58
/**
59
* Increments the packet counter by one
60
*
61
* \param path not used in this method
62
* \param packet not used in this method
63
* \param realto not used in this method
64
*/
65
66
void
FrameUpdate
(std::string path,
Ptr<const Packet>
packet,
Mac48Address
realto);
67
68
protected
:
69
/**
70
* Dispose of this Object.
71
*/
72
void
DoDispose
()
override
;
73
74
// end class PacketCounterCalculator
75
};
76
77
/**
78
* \ingroup stats
79
*
80
* A stat for collecting packet size statistics: min, max and average
81
*
82
*/
83
class
PacketSizeMinMaxAvgTotalCalculator
:
public
MinMaxAvgTotalCalculator
<uint32_t>
84
{
85
public
:
86
PacketSizeMinMaxAvgTotalCalculator
();
87
~PacketSizeMinMaxAvgTotalCalculator
()
override
;
88
89
/**
90
* Register this type.
91
* \return The TypeId.
92
*/
93
static
TypeId
GetTypeId
();
94
95
/**
96
* Increments the packet stats by the size of the packet
97
*
98
* \param path not used in this method
99
* \param packet packet size used to update stats
100
*/
101
void
PacketUpdate
(std::string path,
Ptr<const Packet>
packet);
102
103
/**
104
* Increments the packet stats by the size of the packet
105
*
106
* \param path not used in this method
107
* \param packet packet size used to update stats
108
* \param realto not used in this method
109
*/
110
void
FrameUpdate
(std::string path,
Ptr<const Packet>
packet,
Mac48Address
realto);
111
112
protected
:
113
void
DoDispose
()
override
;
114
115
// end class PacketSizeMinMaxAvgTotalCalculator
116
};
117
118
// end namespace ns3
119
};
// namespace ns3
120
121
#endif
/* PACKET_DATA_CALCULATORS_H */
ns3::CounterCalculator
Template class CounterCalculator.
Definition:
basic-data-calculators.h:301
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:46
ns3::MinMaxAvgTotalCalculator
Template class MinMaxAvgTotalCalculator.
Definition:
basic-data-calculators.h:41
ns3::PacketCounterCalculator
A stat for counting packets.
Definition:
packet-data-calculators.h:39
ns3::PacketCounterCalculator::~PacketCounterCalculator
~PacketCounterCalculator() override
Definition:
packet-data-calculators.cc:39
ns3::PacketCounterCalculator::FrameUpdate
void FrameUpdate(std::string path, Ptr< const Packet > packet, Mac48Address realto)
Increments the packet counter by one.
Definition:
packet-data-calculators.cc:75
ns3::PacketCounterCalculator::PacketUpdate
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet counter by one.
Definition:
packet-data-calculators.cc:65
ns3::PacketCounterCalculator::PacketCounterCalculator
PacketCounterCalculator()
Definition:
packet-data-calculators.cc:34
ns3::PacketCounterCalculator::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
packet-data-calculators.cc:46
ns3::PacketCounterCalculator::DoDispose
void DoDispose() override
Dispose of this Object.
Definition:
packet-data-calculators.cc:56
ns3::PacketSizeMinMaxAvgTotalCalculator
A stat for collecting packet size statistics: min, max and average.
Definition:
packet-data-calculators.h:84
ns3::PacketSizeMinMaxAvgTotalCalculator::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
packet-data-calculators.cc:110
ns3::PacketSizeMinMaxAvgTotalCalculator::FrameUpdate
void FrameUpdate(std::string path, Ptr< const Packet > packet, Mac48Address realto)
Increments the packet stats by the size of the packet.
Definition:
packet-data-calculators.cc:129
ns3::PacketSizeMinMaxAvgTotalCalculator::~PacketSizeMinMaxAvgTotalCalculator
~PacketSizeMinMaxAvgTotalCalculator() override
Definition:
packet-data-calculators.cc:93
ns3::PacketSizeMinMaxAvgTotalCalculator::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
packet-data-calculators.cc:100
ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator
PacketSizeMinMaxAvgTotalCalculator()
Definition:
packet-data-calculators.cc:88
ns3::PacketSizeMinMaxAvgTotalCalculator::PacketUpdate
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet stats by the size of the packet.
Definition:
packet-data-calculators.cc:119
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
mac48-address.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
utils
packet-data-calculators.h
Generated on Tue May 28 2024 23:38:45 for ns-3 by
1.9.6