A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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"
26
#include "
packet-data-calculators.h
"
27
28
using namespace
ns3;
29
30
NS_LOG_COMPONENT_DEFINE
(
"PacketDataCalculators"
);
31
32
33
//--------------------------------------------------------------
34
//----------------------------------------------
35
PacketCounterCalculator::PacketCounterCalculator
()
36
{
37
NS_LOG_FUNCTION_NOARGS
();
38
}
39
40
PacketCounterCalculator::~PacketCounterCalculator
()
41
{
42
NS_LOG_FUNCTION_NOARGS
();
43
}
44
void
45
PacketCounterCalculator::DoDispose
(
void
)
46
{
47
NS_LOG_FUNCTION_NOARGS
();
48
49
CounterCalculator<uint32_t>::DoDispose
();
50
// PacketCounterCalculator::DoDispose
51
}
52
53
void
54
PacketCounterCalculator::PacketUpdate
(std::string path,
55
Ptr<const Packet>
packet)
56
{
57
NS_LOG_FUNCTION_NOARGS
();
58
59
CounterCalculator<uint32_t>::Update
();
60
61
// PacketCounterCalculator::Update
62
}
63
void
64
PacketCounterCalculator::FrameUpdate
(std::string path,
65
Ptr<const Packet>
packet,
66
Mac48Address
realto)
67
{
68
NS_LOG_FUNCTION_NOARGS
();
69
70
CounterCalculator<uint32_t>::Update
();
71
72
// PacketCounterCalculator::Update
73
}
74
75
76
77
78
//--------------------------------------------------------------
79
//----------------------------------------------
80
PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator
()
81
{
82
NS_LOG_FUNCTION_NOARGS
();
83
}
84
85
PacketSizeMinMaxAvgTotalCalculator::~PacketSizeMinMaxAvgTotalCalculator
()
86
{
87
NS_LOG_FUNCTION_NOARGS
();
88
}
89
void
90
PacketSizeMinMaxAvgTotalCalculator::DoDispose
(
void
)
91
{
92
NS_LOG_FUNCTION_NOARGS
();
93
94
MinMaxAvgTotalCalculator<uint32_t>::DoDispose
();
95
// end PacketSizeMinMaxAvgTotalCalculator::DoDispose
96
}
97
98
void
99
PacketSizeMinMaxAvgTotalCalculator::PacketUpdate
(std::string path,
100
Ptr<const Packet>
packet)
101
{
102
NS_LOG_FUNCTION_NOARGS
();
103
104
MinMaxAvgTotalCalculator<uint32_t>::Update
(packet->
GetSize
());
105
106
// end PacketSizeMinMaxAvgTotalCalculator::Update
107
}
108
void
109
PacketSizeMinMaxAvgTotalCalculator::FrameUpdate
(std::string path,
110
Ptr<const Packet>
packet,
111
Mac48Address
realto)
112
{
113
NS_LOG_FUNCTION_NOARGS
();
114
115
MinMaxAvgTotalCalculator<uint32_t>::Update
(packet->
GetSize
());
116
117
// end PacketSizeMinMaxAvgTotalCalculator::Update
118
}
ns3::Ptr< const Packet >
ns3::NS_LOG_COMPONENT_DEFINE
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
packet-data-calculators.h
ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator
PacketSizeMinMaxAvgTotalCalculator()
Definition:
packet-data-calculators.cc:80
ns3::Packet::GetSize
uint32_t GetSize(void) const
Definition:
packet.h:650
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Definition:
log.h:309
ns3::PacketCounterCalculator::~PacketCounterCalculator
virtual ~PacketCounterCalculator()
Definition:
packet-data-calculators.cc:40
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:99
ns3::PacketCounterCalculator::DoDispose
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition:
packet-data-calculators.cc:45
ns3::PacketCounterCalculator::PacketCounterCalculator
PacketCounterCalculator()
Definition:
packet-data-calculators.cc:35
ns3::MinMaxAvgTotalCalculator::DoDispose
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition:
basic-data-calculators.h:140
ns3::PacketCounterCalculator::PacketUpdate
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet counter by one.
Definition:
packet-data-calculators.cc:54
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:41
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:109
ns3::MinMaxAvgTotalCalculator::Update
void Update(const T i)
Updates all variables of MinMaxAvgTotalCalculator.
Definition:
basic-data-calculators.h:148
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:64
ns3::PacketSizeMinMaxAvgTotalCalculator::~PacketSizeMinMaxAvgTotalCalculator
virtual ~PacketSizeMinMaxAvgTotalCalculator()
Definition:
packet-data-calculators.cc:85
ns3::CounterCalculator::Update
void Update()
Increments count by 1.
Definition:
basic-data-calculators.h:304
ns3::PacketSizeMinMaxAvgTotalCalculator::DoDispose
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition:
packet-data-calculators.cc:90
ns3::CounterCalculator::DoDispose
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition:
basic-data-calculators.h:296
src
network
utils
packet-data-calculators.cc
Generated on Sat Apr 19 2014 14:07:06 for ns-3 by
1.8.6