blob: 5baa9f503cfe0c94edd37d95a78e77273880e56c [file] [log] [blame]
Alexander Afanasyevc4f88282012-01-03 11:27:20 -08001/* -*- 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 Afanasyev49165862013-01-31 00:38:20 -080024#include "ipv4-app-tracer.h"
Alexander Afanasyevfc8425c2013-01-31 13:33:49 -080025#include <boost/shared_ptr.hpp>
26#include <boost/tuple/tuple.hpp>
Alexander Afanasyevc4f88282012-01-03 11:27:20 -080027
28namespace ns3 {
29
30class Ipv4SeqsAppTracer : public Ipv4AppTracer
31{
32public:
Alexander Afanasyevfc8425c2013-01-31 13:33:49 -080033 Ipv4SeqsAppTracer (boost::shared_ptr<std::ostream> os, Ptr<Node> node);
Alexander Afanasyevc4f88282012-01-03 11:27:20 -080034 virtual ~Ipv4SeqsAppTracer () { };
35
Alexander Afanasyevfc8425c2013-01-31 13:33:49 -080036 /**
37 * @brief Helper method to install tracers on all simulation nodes
38 *
39 * @param file File to which traces will be written
40 *
41 * @returns a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved
42 * for the lifetime of simulation, otherwise SEGFAULTs are inevitable
43 *
44 */
45 static boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<Ipv4SeqsAppTracer> > >
46 InstallAll (const std::string &file);
47
48
Alexander Afanasyevc4f88282012-01-03 11:27:20 -080049 virtual void
50 PrintHeader (std::ostream &os) const;
51
52 virtual void
53 Print (std::ostream &os) const;
54
55 virtual void
56 Rx (std::string context,
57 const Ipv4Header &, Ptr<const Packet>, uint32_t);
Alexander Afanasyev49165862013-01-31 00:38:20 -080058
Alexander Afanasyevc4f88282012-01-03 11:27:20 -080059 virtual void
60 Tx (std::string context,
61 const Ipv4Header &, Ptr<const Packet>, uint32_t);
62
63protected:
64 void
65 Reset ();
66
67protected:
Alexander Afanasyevfc8425c2013-01-31 13:33:49 -080068 boost::shared_ptr<std::ostream> m_os;
Alexander Afanasyevc4f88282012-01-03 11:27:20 -080069};
70
71} // namespace ns3
72
73#endif // IPV4_AGGREGATE_APP_TRACER_H