Alexander Afanasyev | c9d5c1a | 2012-11-21 18:00:26 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 UCLA |
| 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 19 | */ |
| 20 | |
| 21 | #ifndef NDN_L3_AGGREGATE_TRACER_H |
| 22 | #define NDN_L3_AGGREGATE_TRACER_H |
| 23 | |
| 24 | #include "ndn-l3-tracer.h" |
| 25 | |
| 26 | #include <ns3/nstime.h> |
| 27 | #include <ns3/event-id.h> |
| 28 | |
| 29 | namespace ns3 { |
| 30 | namespace ndn { |
| 31 | |
| 32 | class L3AggregateTracer : public L3Tracer |
| 33 | { |
| 34 | public: |
| 35 | L3AggregateTracer (Ptr<Node> node); |
| 36 | L3AggregateTracer (const std::string &node); |
| 37 | virtual ~L3AggregateTracer (); |
| 38 | |
| 39 | virtual void |
| 40 | PrintHeader (std::ostream &os) const; |
| 41 | |
| 42 | virtual void |
| 43 | Print (std::ostream &os) const; |
| 44 | |
| 45 | virtual void |
| 46 | OutInterests (std::string context, |
| 47 | Ptr<const InterestHeader>, Ptr<const Face>); |
| 48 | |
| 49 | virtual void |
| 50 | InInterests (std::string context, |
| 51 | Ptr<const InterestHeader>, Ptr<const Face>); |
| 52 | |
| 53 | virtual void |
| 54 | DropInterests (std::string context, |
| 55 | Ptr<const InterestHeader>, Ptr<const Face>); |
| 56 | |
| 57 | virtual void |
| 58 | OutNacks (std::string context, |
| 59 | Ptr<const InterestHeader>, Ptr<const Face>); |
| 60 | |
| 61 | virtual void |
| 62 | InNacks (std::string context, |
| 63 | Ptr<const InterestHeader>, Ptr<const Face>); |
| 64 | |
| 65 | virtual void |
| 66 | DropNacks (std::string context, |
| 67 | Ptr<const InterestHeader>, Ptr<const Face>); |
| 68 | |
| 69 | virtual void |
| 70 | OutData (std::string context, |
| 71 | Ptr<const ContentObjectHeader>, Ptr<const Packet>, bool fromCache, Ptr<const Face>); |
| 72 | |
| 73 | virtual void |
| 74 | InData (std::string context, |
| 75 | Ptr<const ContentObjectHeader>, Ptr<const Packet>, Ptr<const Face>); |
| 76 | |
| 77 | virtual void |
| 78 | DropData (std::string context, |
| 79 | Ptr<const ContentObjectHeader>, Ptr<const Packet>, Ptr<const Face>); |
| 80 | |
| 81 | protected: |
| 82 | void |
| 83 | Reset (); |
| 84 | |
| 85 | void |
| 86 | PeriodicPrinter (); |
| 87 | |
| 88 | protected: |
| 89 | Stats m_packets; |
| 90 | Stats m_bytes; |
| 91 | |
| 92 | Time m_period; |
| 93 | EventId m_printEvent; |
| 94 | }; |
| 95 | |
| 96 | } // namespace ndn |
| 97 | } // namespace ns3 |
| 98 | |
| 99 | #endif // NDN_L3_AGGREGATE_TRACER_H |