A Discrete-Event Network Simulator
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 * 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
21
22#include "mac48-address.h"
23
24#include "ns3/basic-data-calculators.h"
25#include "ns3/log.h"
26#include "ns3/packet.h"
27
28using namespace ns3;
29
30NS_LOG_COMPONENT_DEFINE("PacketDataCalculators");
31
32//--------------------------------------------------------------
33//----------------------------------------------
35{
37}
38
40{
42}
43
44/* static */
47{
48 static TypeId tid = TypeId("ns3::PacketCounterCalculator")
50 .SetGroupName("Network")
51 .AddConstructor<PacketCounterCalculator>();
52 return tid;
53}
54
55void
57{
59
61 // PacketCounterCalculator::DoDispose
62}
63
64void
66{
68
70
71 // PacketCounterCalculator::Update
72}
73
74void
76 Ptr<const Packet> packet,
77 Mac48Address realto)
78{
80
82
83 // PacketCounterCalculator::Update
84}
85
86//--------------------------------------------------------------
87//----------------------------------------------
89{
91}
92
94{
96}
97
98/* static */
101{
102 static TypeId tid = TypeId("ns3::PacketSizeMinMaxAvgTotalCalculator")
104 .SetGroupName("Network")
105 .AddConstructor<PacketSizeMinMaxAvgTotalCalculator>();
106 return tid;
107}
108
109void
111{
113
115 // end PacketSizeMinMaxAvgTotalCalculator::DoDispose
116}
117
118void
120{
122
124
125 // end PacketSizeMinMaxAvgTotalCalculator::Update
126}
127
128void
130 Ptr<const Packet> packet,
131 Mac48Address realto)
132{
134
136
137 // end PacketSizeMinMaxAvgTotalCalculator::Update
138}
Template class CounterCalculator.
void DoDispose() override
Dispose of this Object.
void Update()
Increments count by 1.
an EUI-48 address
Definition: mac48-address.h:46
Template class MinMaxAvgTotalCalculator.
void Update(const T i)
Updates all variables of MinMaxAvgTotalCalculator.
void DoDispose() override
Dispose of this Object.
A stat for counting packets.
void FrameUpdate(std::string path, Ptr< const Packet > packet, Mac48Address realto)
Increments the packet counter by one.
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet counter by one.
static TypeId GetTypeId()
Register this type.
void DoDispose() override
Dispose of this Object.
A stat for collecting packet size statistics: min, max and average.
void DoDispose() override
Destructor implementation.
void FrameUpdate(std::string path, Ptr< const Packet > packet, Mac48Address realto)
Increments the packet stats by the size of the packet.
static TypeId GetTypeId()
Register this type.
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet stats by the size of the packet.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Every class exported by the ns3 library is enclosed in the ns3 namespace.