A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
network
utils
packet-data-calculators.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 Drexel University
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Joe Kopena (tjkopena@cs.drexel.edu)
19
*/
20
21
#ifndef PACKET_DATA_CALCULATORS_H
22
#define PACKET_DATA_CALCULATORS_H
23
24
#include "ns3/packet.h"
25
#include "ns3/mac48-address.h"
26
#include "ns3/data-calculator.h"
27
#include "ns3/basic-data-calculators.h"
28
29
namespace
ns3
{
30
37
class
PacketCounterCalculator
:
public
CounterCalculator
<uint32_t> {
38
public
:
39
PacketCounterCalculator
();
40
virtual
~PacketCounterCalculator
();
41
46
static
TypeId
GetTypeId
(
void
);
47
54
void
PacketUpdate
(std::string path,
Ptr<const Packet>
packet);
55
64
void
FrameUpdate
(std::string path,
Ptr<const Packet>
packet,
65
Mac48Address
realto);
66
67
protected
:
68
virtual
void
DoDispose
(
void
);
69
70
// end class PacketCounterCalculator
71
};
72
73
80
class
PacketSizeMinMaxAvgTotalCalculator
:
81
public
MinMaxAvgTotalCalculator
<uint32_t>
82
{
83
public
:
84
PacketSizeMinMaxAvgTotalCalculator
();
85
virtual
~PacketSizeMinMaxAvgTotalCalculator
();
86
91
static
TypeId
GetTypeId
(
void
);
92
99
void
PacketUpdate
(std::string path,
Ptr<const Packet>
packet);
100
108
void
FrameUpdate
(std::string path,
Ptr<const Packet>
packet,
109
Mac48Address
realto);
110
111
protected
:
112
virtual
void
DoDispose
(
void
);
113
114
// end class PacketSizeMinMaxAvgTotalCalculator
115
};
116
117
118
// end namespace ns3
119
};
120
121
122
#endif
/* PACKET_DATA_CALCULATORS_H */
ns3::Ptr< const Packet >
ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator
PacketSizeMinMaxAvgTotalCalculator()
Definition:
packet-data-calculators.cc:90
ns3::PacketCounterCalculator::~PacketCounterCalculator
virtual ~PacketCounterCalculator()
Definition:
packet-data-calculators.cc:39
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:120
ns3::PacketCounterCalculator::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
packet-data-calculators.cc:55
ns3::PacketSizeMinMaxAvgTotalCalculator::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition:
packet-data-calculators.cc:101
ns3::PacketSizeMinMaxAvgTotalCalculator
A stat for collecting packet size statistics: min, max and average.
Definition:
packet-data-calculators.h:80
ns3::PacketCounterCalculator::PacketCounterCalculator
PacketCounterCalculator()
Definition:
packet-data-calculators.cc:34
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MinMaxAvgTotalCalculator
Template class MinMaxAvgTotalCalculator.
Definition:
basic-data-calculators.h:39
ns3::PacketCounterCalculator::PacketUpdate
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet counter by one.
Definition:
packet-data-calculators.cc:64
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:43
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:130
ns3::PacketCounterCalculator
A stat for counting packets.
Definition:
packet-data-calculators.h:37
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:74
ns3::PacketSizeMinMaxAvgTotalCalculator::~PacketSizeMinMaxAvgTotalCalculator
virtual ~PacketSizeMinMaxAvgTotalCalculator()
Definition:
packet-data-calculators.cc:95
ns3::CounterCalculator
Template class CounterCalculator.
Definition:
basic-data-calculators.h:268
ns3::PacketCounterCalculator::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition:
packet-data-calculators.cc:45
ns3::PacketSizeMinMaxAvgTotalCalculator::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
packet-data-calculators.cc:111
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
Generated on Wed Nov 7 2018 10:02:07 for ns-3 by
1.8.14