00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright (c) 2008 Drexel University 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation; 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Author: Joe Kopena (tjkopena@cs.drexel.edu) 00019 */ 00020 00021 #include "ns3/log.h" 00022 #include "ns3/packet.h" 00023 #include "ns3/mac48-address.h" 00024 00025 #include "basic-data-calculators.h" 00026 #include "packet-data-calculators.h" 00027 00028 using namespace ns3; 00029 00030 NS_LOG_COMPONENT_DEFINE("PacketDataCalculators"); 00031 00032 00033 //-------------------------------------------------------------- 00034 //---------------------------------------------- 00035 PacketCounterCalculator::PacketCounterCalculator() 00036 { 00037 NS_LOG_FUNCTION_NOARGS(); 00038 } 00039 00040 PacketCounterCalculator::~PacketCounterCalculator() 00041 { 00042 NS_LOG_FUNCTION_NOARGS(); 00043 } 00044 void 00045 PacketCounterCalculator::DoDispose(void) 00046 { 00047 NS_LOG_FUNCTION_NOARGS(); 00048 00049 CounterCalculator<uint32_t>::DoDispose(); 00050 // PacketCounterCalculator::DoDispose 00051 } 00052 00053 void 00054 PacketCounterCalculator::PacketUpdate(std::string path, 00055 Ptr<const Packet> packet) 00056 { 00057 NS_LOG_FUNCTION_NOARGS(); 00058 00059 CounterCalculator<uint32_t>::Update(); 00060 00061 // PacketCounterCalculator::Update 00062 } 00063 void 00064 PacketCounterCalculator::FrameUpdate(std::string path, 00065 Ptr<const Packet> packet, 00066 Mac48Address realto) 00067 { 00068 NS_LOG_FUNCTION_NOARGS(); 00069 00070 CounterCalculator<uint32_t>::Update(); 00071 00072 // PacketCounterCalculator::Update 00073 } 00074 00075 00076 00077 00078 //-------------------------------------------------------------- 00079 //---------------------------------------------- 00080 PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator() 00081 { 00082 NS_LOG_FUNCTION_NOARGS(); 00083 } 00084 00085 PacketSizeMinMaxAvgTotalCalculator::~PacketSizeMinMaxAvgTotalCalculator() 00086 { 00087 NS_LOG_FUNCTION_NOARGS(); 00088 } 00089 void 00090 PacketSizeMinMaxAvgTotalCalculator::DoDispose(void) 00091 { 00092 NS_LOG_FUNCTION_NOARGS(); 00093 00094 MinMaxAvgTotalCalculator<uint32_t>::DoDispose(); 00095 // end PacketSizeMinMaxAvgTotalCalculator::DoDispose 00096 } 00097 00098 void 00099 PacketSizeMinMaxAvgTotalCalculator::PacketUpdate(std::string path, 00100 Ptr<const Packet> packet) 00101 { 00102 NS_LOG_FUNCTION_NOARGS(); 00103 00104 MinMaxAvgTotalCalculator<uint32_t>::Update(packet->GetSize()); 00105 00106 // end PacketSizeMinMaxAvgTotalCalculator::Update 00107 } 00108 void 00109 PacketSizeMinMaxAvgTotalCalculator::FrameUpdate(std::string path, 00110 Ptr<const Packet> packet, 00111 Mac48Address realto) 00112 { 00113 NS_LOG_FUNCTION_NOARGS(); 00114 00115 MinMaxAvgTotalCalculator<uint32_t>::Update(packet->GetSize()); 00116 00117 // end PacketSizeMinMaxAvgTotalCalculator::Update 00118 }