blob: 54d7405b98312c538f449b492ca0856b40537274 [file] [log] [blame]
Alexander Afanasyev141d1312011-12-18 14:58:35 -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 CCNX_TRACE_HELPER_H
22#define CCNX_TRACE_HELPER_H
23
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080024#include "ns3/nstime.h"
25#include "ns3/event-id.h"
26
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080027#include <list>
Alexander Afanasyev141d1312011-12-18 14:58:35 -080028
29namespace ns3 {
30
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080031class CcnxAppTracer;
32class CcnxL3Tracer;
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080033
Alexander Afanasyev141d1312011-12-18 14:58:35 -080034class CcnxTraceHelper
35{
36public:
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080037 CcnxTraceHelper ();
38
Alexander Afanasyev141d1312011-12-18 14:58:35 -080039 /**
40 * @brief Destructor that invokes trace output procedures
41 */
42 ~CcnxTraceHelper ();
43
44 /**
45 * @brief Set filename to output app trace.
46 *
47 * By default, trace is output to NS_LOG_INFO stream
48 *
49 * @param file File where trace will be written to
50 */
51 void
52 SetAppTraceFile (const std::string &appTrace = "apps.log");
53
54 /**
55 * @brief Set filename to output app trace.
56 *
57 * By default, trace is output to NS_LOG_INFO stream
58 *
59 * @param file File where trace will be written to
60 */
61 void
62 SetL3TraceFile (const std::string &l3Trace = "l3.log");
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080063
Alexander Afanasyev141d1312011-12-18 14:58:35 -080064 /**
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080065 * @brief Enable aggregate app-level CCNx tracing on all CCNx applications
Alexander Afanasyev141d1312011-12-18 14:58:35 -080066 *
67 * @param app Class name of the application of interest
68 */
69 void
70 EnableAggregateAppAll (const std::string &app);
71
72 /**
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080073 * @brief Enable aggregate network-level CCNx tracing on all CCNx node
Alexander Afanasyev141d1312011-12-18 14:58:35 -080074 */
75 void
76 EnableAggregateL3All ();
77
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080078 /**
79 * @brief Enable network-level CCNx rate tracing on all CCNx nodes (individual file per node)
80 */
81 void
82 EnableRateL3All (const std::string &l3RateTrace = "l3-rate.log");
83
Alexander Afanasyev141d1312011-12-18 14:58:35 -080084private:
85 std::string m_appTrace;
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080086 std::list<Ptr<CcnxAppTracer> > m_apps;
Alexander Afanasyev141d1312011-12-18 14:58:35 -080087
88 std::string m_l3Trace;
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080089 std::list<Ptr<CcnxL3Tracer> > m_l3s;
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080090
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080091 std::list<Ptr<CcnxL3Tracer> > m_l3Rates;
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080092 std::ostream *m_l3RateTrace;
Alexander Afanasyev141d1312011-12-18 14:58:35 -080093};
94
95
96} // namespace ns3
97
98#endif /* CCNX_TRACE_HELPER_H */