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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Joe Kopena (tjkopena@cs.drexel.edu)
7
*/
8
9
#ifndef PACKET_DATA_CALCULATORS_H
10
#define PACKET_DATA_CALCULATORS_H
11
12
#include "
mac48-address.h
"
13
14
#include "ns3/basic-data-calculators.h"
15
#include "ns3/data-calculator.h"
16
#include "ns3/packet.h"
17
18
namespace
ns3
19
{
20
21
/**
22
* \ingroup stats
23
*
24
* A stat for counting packets
25
*
26
*/
27
class
PacketCounterCalculator
:
public
CounterCalculator
<uint32_t>
28
{
29
public
:
30
PacketCounterCalculator
();
31
~PacketCounterCalculator
()
override
;
32
33
/**
34
* Register this type.
35
* \return The TypeId.
36
*/
37
static
TypeId
GetTypeId
();
38
39
/**
40
* Increments the packet counter by one
41
*
42
* \param path not used in this method
43
* \param packet not used in this method
44
*/
45
void
PacketUpdate
(std::string path,
Ptr<const Packet>
packet);
46
47
/**
48
* Increments the packet counter by one
49
*
50
* \param path not used in this method
51
* \param packet not used in this method
52
* \param realto not used in this method
53
*/
54
55
void
FrameUpdate
(std::string path,
Ptr<const Packet>
packet,
Mac48Address
realto);
56
57
protected
:
58
/**
59
* Dispose of this Object.
60
*/
61
void
DoDispose
()
override
;
62
63
// end class PacketCounterCalculator
64
};
65
66
/**
67
* \ingroup stats
68
*
69
* A stat for collecting packet size statistics: min, max and average
70
*
71
*/
72
class
PacketSizeMinMaxAvgTotalCalculator
:
public
MinMaxAvgTotalCalculator
<uint32_t>
73
{
74
public
:
75
PacketSizeMinMaxAvgTotalCalculator
();
76
~PacketSizeMinMaxAvgTotalCalculator
()
override
;
77
78
/**
79
* Register this type.
80
* \return The TypeId.
81
*/
82
static
TypeId
GetTypeId
();
83
84
/**
85
* Increments the packet stats by the size of the packet
86
*
87
* \param path not used in this method
88
* \param packet packet size used to update stats
89
*/
90
void
PacketUpdate
(std::string path,
Ptr<const Packet>
packet);
91
92
/**
93
* Increments the packet stats by the size of the packet
94
*
95
* \param path not used in this method
96
* \param packet packet size used to update stats
97
* \param realto not used in this method
98
*/
99
void
FrameUpdate
(std::string path,
Ptr<const Packet>
packet,
Mac48Address
realto);
100
101
protected
:
102
void
DoDispose
()
override
;
103
104
// end class PacketSizeMinMaxAvgTotalCalculator
105
};
106
107
// end namespace ns3
108
};
// namespace ns3
109
110
#endif
/* PACKET_DATA_CALCULATORS_H */
ns3::CounterCalculator
Template class CounterCalculator.
Definition
basic-data-calculators.h:290
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:35
ns3::MinMaxAvgTotalCalculator
Template class MinMaxAvgTotalCalculator.
Definition
basic-data-calculators.h:30
ns3::PacketCounterCalculator
A stat for counting packets.
Definition
packet-data-calculators.h:28
ns3::PacketCounterCalculator::~PacketCounterCalculator
~PacketCounterCalculator() override
Definition
packet-data-calculators.cc:28
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:64
ns3::PacketCounterCalculator::PacketUpdate
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet counter by one.
Definition
packet-data-calculators.cc:54
ns3::PacketCounterCalculator::PacketCounterCalculator
PacketCounterCalculator()
Definition
packet-data-calculators.cc:23
ns3::PacketCounterCalculator::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
packet-data-calculators.cc:35
ns3::PacketCounterCalculator::DoDispose
void DoDispose() override
Dispose of this Object.
Definition
packet-data-calculators.cc:45
ns3::PacketSizeMinMaxAvgTotalCalculator
A stat for collecting packet size statistics: min, max and average.
Definition
packet-data-calculators.h:73
ns3::PacketSizeMinMaxAvgTotalCalculator::DoDispose
void DoDispose() override
Dispose of this Object.
Definition
packet-data-calculators.cc:99
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:118
ns3::PacketSizeMinMaxAvgTotalCalculator::~PacketSizeMinMaxAvgTotalCalculator
~PacketSizeMinMaxAvgTotalCalculator() override
Definition
packet-data-calculators.cc:82
ns3::PacketSizeMinMaxAvgTotalCalculator::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
packet-data-calculators.cc:89
ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator
PacketSizeMinMaxAvgTotalCalculator()
Definition
packet-data-calculators.cc:77
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:108
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
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 Fri Nov 8 2024 13:59:05 for ns-3 by
1.11.0