A Discrete-Event Network Simulator
API
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 "ns3/basic-data-calculators.h"
23 #include "ns3/log.h"
24 #include "ns3/mac48-address.h"
25 #include "ns3/packet.h"
26 
27 using namespace ns3;
28 
29 NS_LOG_COMPONENT_DEFINE("PacketDataCalculators");
30 
31 //--------------------------------------------------------------
32 //----------------------------------------------
34 {
36 }
37 
39 {
41 }
42 
43 /* static */
44 TypeId
46 {
47  static TypeId tid = TypeId("ns3::PacketCounterCalculator")
49  .SetGroupName("Network")
50  .AddConstructor<PacketCounterCalculator>();
51  return tid;
52 }
53 
54 void
56 {
58 
60  // PacketCounterCalculator::DoDispose
61 }
62 
63 void
65 {
67 
69 
70  // PacketCounterCalculator::Update
71 }
72 
73 void
75  Ptr<const Packet> packet,
76  Mac48Address realto)
77 {
79 
81 
82  // PacketCounterCalculator::Update
83 }
84 
85 //--------------------------------------------------------------
86 //----------------------------------------------
88 {
90 }
91 
93 {
95 }
96 
97 /* static */
98 TypeId
100 {
101  static TypeId tid = TypeId("ns3::PacketSizeMinMaxAvgTotalCalculator")
103  .SetGroupName("Network")
104  .AddConstructor<PacketSizeMinMaxAvgTotalCalculator>();
105  return tid;
106 }
107 
108 void
110 {
112 
114  // end PacketSizeMinMaxAvgTotalCalculator::DoDispose
115 }
116 
117 void
119 {
121 
123 
124  // end PacketSizeMinMaxAvgTotalCalculator::Update
125 }
126 
127 void
129  Ptr<const Packet> packet,
130  Mac48Address realto)
131 {
133 
135 
136  // end PacketSizeMinMaxAvgTotalCalculator::Update
137 }
Introspection did not find any typical Config paths.
void DoDispose() override
Dispose of this Object.
void Update()
Increments count by 1.
an EUI-48 address
Definition: mac48-address.h:46
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.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:863
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.
a unique identifier for an interface.
Definition: type-id.h:60
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:935
#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.