Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -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 IPV4_SEQS_APP_TRACER_H |
| 22 | #define IPV4_SEQS_APP_TRACER_H |
| 23 | |
Alexander Afanasyev | 4916586 | 2013-01-31 00:38:20 -0800 | [diff] [blame] | 24 | #include "ipv4-app-tracer.h" |
Alexander Afanasyev | fc8425c | 2013-01-31 13:33:49 -0800 | [diff] [blame] | 25 | #include <boost/shared_ptr.hpp> |
| 26 | #include <boost/tuple/tuple.hpp> |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 27 | |
| 28 | namespace ns3 { |
| 29 | |
Alexander Afanasyev | 7920651 | 2013-07-27 16:49:12 -0700 | [diff] [blame] | 30 | /** |
| 31 | * @ingroup ndn-tracers |
| 32 | * @brief Helper to track application-level sequence numbers (approximated from TCP ACKs) |
| 33 | */ |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 34 | class Ipv4SeqsAppTracer : public Ipv4AppTracer |
| 35 | { |
| 36 | public: |
Alexander Afanasyev | fc8425c | 2013-01-31 13:33:49 -0800 | [diff] [blame] | 37 | Ipv4SeqsAppTracer (boost::shared_ptr<std::ostream> os, Ptr<Node> node); |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 38 | virtual ~Ipv4SeqsAppTracer () { }; |
| 39 | |
Alexander Afanasyev | fc8425c | 2013-01-31 13:33:49 -0800 | [diff] [blame] | 40 | /** |
| 41 | * @brief Helper method to install tracers on all simulation nodes |
| 42 | * |
| 43 | * @param file File to which traces will be written |
| 44 | * |
| 45 | * @returns a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved |
| 46 | * for the lifetime of simulation, otherwise SEGFAULTs are inevitable |
| 47 | * |
| 48 | */ |
| 49 | static boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<Ipv4SeqsAppTracer> > > |
| 50 | InstallAll (const std::string &file); |
| 51 | |
| 52 | |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 53 | virtual void |
| 54 | PrintHeader (std::ostream &os) const; |
| 55 | |
| 56 | virtual void |
| 57 | Print (std::ostream &os) const; |
| 58 | |
| 59 | virtual void |
| 60 | Rx (std::string context, |
| 61 | const Ipv4Header &, Ptr<const Packet>, uint32_t); |
Alexander Afanasyev | 4916586 | 2013-01-31 00:38:20 -0800 | [diff] [blame] | 62 | |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 63 | virtual void |
| 64 | Tx (std::string context, |
| 65 | const Ipv4Header &, Ptr<const Packet>, uint32_t); |
| 66 | |
| 67 | protected: |
| 68 | void |
| 69 | Reset (); |
| 70 | |
| 71 | protected: |
Alexander Afanasyev | fc8425c | 2013-01-31 13:33:49 -0800 | [diff] [blame] | 72 | boost::shared_ptr<std::ostream> m_os; |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 73 | }; |
| 74 | |
| 75 | } // namespace ns3 |
| 76 | |
| 77 | #endif // IPV4_AGGREGATE_APP_TRACER_H |