A Discrete-Event Network Simulator
API
packet-data-calculators.cc
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#include "ns3/log.h"
22#include "ns3/packet.h"
23#include "ns3/mac48-address.h"
24
25#include "ns3/basic-data-calculators.h"
27
28using namespace ns3;
29
30NS_LOG_COMPONENT_DEFINE ("PacketDataCalculators");
31
32//--------------------------------------------------------------
33//----------------------------------------------
34PacketCounterCalculator::PacketCounterCalculator()
35{
37}
38
40{
42}
43/* static */
46{
47 static TypeId tid = TypeId ("ns3::PacketCounterCalculator")
49 .SetGroupName ("Network")
50 .AddConstructor<PacketCounterCalculator> ()
51 ;
52 return tid;
53}
54void
56{
58
60 // PacketCounterCalculator::DoDispose
61}
62
63void
65 Ptr<const Packet> packet)
66{
68
70
71 // PacketCounterCalculator::Update
72}
73void
75 Ptr<const Packet> packet,
76 Mac48Address realto)
77{
79
81
82 // PacketCounterCalculator::Update
83}
84
85
86
87
88//--------------------------------------------------------------
89//----------------------------------------------
91{
93}
94
96{
98}
99/* static */
100TypeId
102{
103 static TypeId tid = TypeId ("ns3::PacketSizeMinMaxAvgTotalCalculator")
105 .SetGroupName ("Network")
106 .AddConstructor<PacketSizeMinMaxAvgTotalCalculator> ()
107 ;
108 return tid;
109}
110void
112{
114
116 // end PacketSizeMinMaxAvgTotalCalculator::DoDispose
117}
118
119void
121 Ptr<const Packet> packet)
122{
124
126
127 // end PacketSizeMinMaxAvgTotalCalculator::Update
128}
129void
131 Ptr<const Packet> packet,
132 Mac48Address realto)
133{
135
137
138 // end PacketSizeMinMaxAvgTotalCalculator::Update
139}
virtual void DoDispose(void)
Destructor implementation.
void Update()
Increments count by 1.
an EUI-48 address
Definition: mac48-address.h:44
virtual void DoDispose(void)
Destructor implementation.
void Update(const T i)
Updates all variables of MinMaxAvgTotalCalculator.
A stat for counting packets.
static TypeId GetTypeId(void)
Register this type.
virtual void DoDispose(void)
Destructor implementation.
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.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
A stat for collecting packet size statistics: min, max and average.
void FrameUpdate(std::string path, Ptr< const Packet > packet, Mac48Address realto)
Increments the packet stats by the size of the packet.
static TypeId GetTypeId(void)
Register this type.
virtual void DoDispose(void)
Destructor implementation.
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
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Every class exported by the ns3 library is enclosed in the ns3 namespace.