A Discrete-Event Network Simulator
API
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 
39 {
40  public:
42  ~PacketCounterCalculator() override;
43 
48  static TypeId GetTypeId();
49 
56  void PacketUpdate(std::string path, Ptr<const Packet> packet);
57 
66  void FrameUpdate(std::string path, Ptr<const Packet> packet, Mac48Address realto);
67 
68  protected:
72  void DoDispose() override;
73 
74  // end class PacketCounterCalculator
75 };
76 
84 {
85  public:
88 
93  static TypeId GetTypeId();
94 
101  void PacketUpdate(std::string path, Ptr<const Packet> packet);
102 
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 */
Template class CounterCalculator.
an EUI-48 address
Definition: mac48-address.h:46
Template class MinMaxAvgTotalCalculator.
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.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.