/* * Copyright (c) 2008 Drexel University * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Joe Kopena (tjkopena@cs.drexel.edu) */ #include "packet-data-calculators.h" #include "ns3/basic-data-calculators.h" #include "ns3/log.h" #include "ns3/mac48-address.h" #include "ns3/packet.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE("PacketDataCalculators"); //-------------------------------------------------------------- //---------------------------------------------- PacketCounterCalculator::PacketCounterCalculator() { NS_LOG_FUNCTION_NOARGS(); } PacketCounterCalculator::~PacketCounterCalculator() { NS_LOG_FUNCTION_NOARGS(); } /* static */ TypeId PacketCounterCalculator::GetTypeId() { static TypeId tid = TypeId("ns3::PacketCounterCalculator") .SetParent>() .SetGroupName("Network") .AddConstructor(); return tid; } void PacketCounterCalculator::DoDispose() { NS_LOG_FUNCTION_NOARGS(); CounterCalculator::DoDispose(); // PacketCounterCalculator::DoDispose } void PacketCounterCalculator::PacketUpdate(std::string path, Ptr packet) { NS_LOG_FUNCTION_NOARGS(); CounterCalculator::Update(); // PacketCounterCalculator::Update } void PacketCounterCalculator::FrameUpdate(std::string path, Ptr packet, Mac48Address realto) { NS_LOG_FUNCTION_NOARGS(); CounterCalculator::Update(); // PacketCounterCalculator::Update } //-------------------------------------------------------------- //---------------------------------------------- PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator() { NS_LOG_FUNCTION_NOARGS(); } PacketSizeMinMaxAvgTotalCalculator::~PacketSizeMinMaxAvgTotalCalculator() { NS_LOG_FUNCTION_NOARGS(); } /* static */ TypeId PacketSizeMinMaxAvgTotalCalculator::GetTypeId() { static TypeId tid = TypeId("ns3::PacketSizeMinMaxAvgTotalCalculator") .SetParent>() .SetGroupName("Network") .AddConstructor(); return tid; } void PacketSizeMinMaxAvgTotalCalculator::DoDispose() { NS_LOG_FUNCTION_NOARGS(); MinMaxAvgTotalCalculator::DoDispose(); // end PacketSizeMinMaxAvgTotalCalculator::DoDispose } void PacketSizeMinMaxAvgTotalCalculator::PacketUpdate(std::string path, Ptr packet) { NS_LOG_FUNCTION_NOARGS(); MinMaxAvgTotalCalculator::Update(packet->GetSize()); // end PacketSizeMinMaxAvgTotalCalculator::Update } void PacketSizeMinMaxAvgTotalCalculator::FrameUpdate(std::string path, Ptr packet, Mac48Address realto) { NS_LOG_FUNCTION_NOARGS(); MinMaxAvgTotalCalculator::Update(packet->GetSize()); // end PacketSizeMinMaxAvgTotalCalculator::Update }