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.cc
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
#include "
packet-data-calculators.h
"
10
11
#include "
mac48-address.h
"
12
13
#include "ns3/basic-data-calculators.h"
14
#include "ns3/log.h"
15
#include "ns3/packet.h"
16
17
using namespace
ns3
;
18
19
NS_LOG_COMPONENT_DEFINE
(
"PacketDataCalculators"
);
20
21
//--------------------------------------------------------------
22
//----------------------------------------------
23
PacketCounterCalculator::PacketCounterCalculator
()
24
{
25
NS_LOG_FUNCTION_NOARGS
();
26
}
27
28
PacketCounterCalculator::~PacketCounterCalculator
()
29
{
30
NS_LOG_FUNCTION_NOARGS
();
31
}
32
33
/* static */
34
TypeId
35
PacketCounterCalculator::GetTypeId
()
36
{
37
static
TypeId
tid =
TypeId
(
"ns3::PacketCounterCalculator"
)
38
.
SetParent
<
CounterCalculator<uint32_t>
>()
39
.SetGroupName(
"Network"
)
40
.AddConstructor<
PacketCounterCalculator
>();
41
return
tid;
42
}
43
44
void
45
PacketCounterCalculator::DoDispose
()
46
{
47
NS_LOG_FUNCTION_NOARGS
();
48
49
CounterCalculator<uint32_t>::DoDispose
();
50
// PacketCounterCalculator::DoDispose
51
}
52
53
void
54
PacketCounterCalculator::PacketUpdate
(std::string path,
Ptr<const Packet>
packet)
55
{
56
NS_LOG_FUNCTION_NOARGS
();
57
58
CounterCalculator<uint32_t>::Update
();
59
60
// PacketCounterCalculator::Update
61
}
62
63
void
64
PacketCounterCalculator::FrameUpdate
(std::string path,
65
Ptr<const Packet>
packet,
66
Mac48Address
realto)
67
{
68
NS_LOG_FUNCTION_NOARGS
();
69
70
CounterCalculator<uint32_t>::Update
();
71
72
// PacketCounterCalculator::Update
73
}
74
75
//--------------------------------------------------------------
76
//----------------------------------------------
77
PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator
()
78
{
79
NS_LOG_FUNCTION_NOARGS
();
80
}
81
82
PacketSizeMinMaxAvgTotalCalculator::~PacketSizeMinMaxAvgTotalCalculator
()
83
{
84
NS_LOG_FUNCTION_NOARGS
();
85
}
86
87
/* static */
88
TypeId
89
PacketSizeMinMaxAvgTotalCalculator::GetTypeId
()
90
{
91
static
TypeId
tid =
TypeId
(
"ns3::PacketSizeMinMaxAvgTotalCalculator"
)
92
.
SetParent
<
MinMaxAvgTotalCalculator<uint32_t>
>()
93
.SetGroupName(
"Network"
)
94
.AddConstructor<
PacketSizeMinMaxAvgTotalCalculator
>();
95
return
tid;
96
}
97
98
void
99
PacketSizeMinMaxAvgTotalCalculator::DoDispose
()
100
{
101
NS_LOG_FUNCTION_NOARGS
();
102
103
MinMaxAvgTotalCalculator<uint32_t>::DoDispose
();
104
// end PacketSizeMinMaxAvgTotalCalculator::DoDispose
105
}
106
107
void
108
PacketSizeMinMaxAvgTotalCalculator::PacketUpdate
(std::string path,
Ptr<const Packet>
packet)
109
{
110
NS_LOG_FUNCTION_NOARGS
();
111
112
MinMaxAvgTotalCalculator<uint32_t>::Update
(packet->GetSize());
113
114
// end PacketSizeMinMaxAvgTotalCalculator::Update
115
}
116
117
void
118
PacketSizeMinMaxAvgTotalCalculator::FrameUpdate
(std::string path,
119
Ptr<const Packet>
packet,
120
Mac48Address
realto)
121
{
122
NS_LOG_FUNCTION_NOARGS
();
123
124
MinMaxAvgTotalCalculator<uint32_t>::Update
(packet->GetSize());
125
126
// end PacketSizeMinMaxAvgTotalCalculator::Update
127
}
ns3::CounterCalculator
Template class CounterCalculator.
Definition
basic-data-calculators.h:290
ns3::CounterCalculator::DoDispose
void DoDispose() override
Dispose of this Object.
Definition
basic-data-calculators.h:360
ns3::CounterCalculator::Update
void Update()
Increments count by 1.
Definition
basic-data-calculators.h:368
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:35
ns3::MinMaxAvgTotalCalculator
Template class MinMaxAvgTotalCalculator.
Definition
basic-data-calculators.h:30
ns3::MinMaxAvgTotalCalculator::Update
void Update(const T i)
Updates all variables of MinMaxAvgTotalCalculator.
Definition
basic-data-calculators.h:196
ns3::MinMaxAvgTotalCalculator::DoDispose
void DoDispose() override
Dispose of this Object.
Definition
basic-data-calculators.h:176
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
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Definition
log-macros-enabled.h:195
mac48-address.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
packet-data-calculators.h
src
network
utils
packet-data-calculators.cc
Generated on Fri Nov 1 2024 09:20:45 for ns-3 by
1.11.0