A Discrete-Event Network Simulator
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
18namespace ns3
19{
20
21/**
22 * \ingroup stats
23 *
24 * A stat for counting packets
25 *
26 */
28{
29 public:
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 */
73{
74 public:
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 */
Template class CounterCalculator.
an EUI-48 address
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
Dispose of this Object.
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.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.