blob: 544c8878f875bec946164ea75e8bbd9a52d04c1b [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 Afanasyevc4f88282012-01-03 11:27:20 -080033class Ipv4AppTracer;
Alexander Afanasyeve4c2ece2012-01-11 10:44:40 -080034class CcnxConsumerWindowTracer;
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080035
Alexander Afanasyev141d1312011-12-18 14:58:35 -080036class CcnxTraceHelper
37{
38public:
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080039 CcnxTraceHelper ();
40
Alexander Afanasyev141d1312011-12-18 14:58:35 -080041 /**
42 * @brief Destructor that invokes trace output procedures
43 */
44 ~CcnxTraceHelper ();
45
46 /**
47 * @brief Set filename to output app trace.
48 *
49 * By default, trace is output to NS_LOG_INFO stream
50 *
51 * @param file File where trace will be written to
52 */
53 void
54 SetAppTraceFile (const std::string &appTrace = "apps.log");
55
56 /**
57 * @brief Set filename to output app trace.
58 *
59 * By default, trace is output to NS_LOG_INFO stream
60 *
61 * @param file File where trace will be written to
62 */
63 void
64 SetL3TraceFile (const std::string &l3Trace = "l3.log");
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080065
Alexander Afanasyev141d1312011-12-18 14:58:35 -080066 /**
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080067 * @brief Enable aggregate app-level CCNx tracing on all CCNx applications
Alexander Afanasyev141d1312011-12-18 14:58:35 -080068 *
69 * @param app Class name of the application of interest
70 */
71 void
72 EnableAggregateAppAll (const std::string &app);
73
74 /**
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080075 * @brief Enable aggregate network-level CCNx tracing on all CCNx node
Alexander Afanasyev141d1312011-12-18 14:58:35 -080076 */
77 void
78 EnableAggregateL3All ();
79
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080080 /**
Alexander Afanasyev3183b5a2011-12-23 20:48:20 -080081 * @brief Enable network-level CCNx rate tracing on all CCNx nodes
Alexander Afanasyevc86c2832011-12-23 02:56:22 -080082 */
83 void
84 EnableRateL3All (const std::string &l3RateTrace = "l3-rate.log");
85
Alexander Afanasyev3183b5a2011-12-23 20:48:20 -080086 /**
87 * @brief Enable app-level CCNx sequence tracing on all CCNx applications
88 */
89 void
90 EnableSeqsAppAll (const std::string &app, const std::string &appSeqsTrace = "app-seqs.log");
91
Alexander Afanasyevc4f88282012-01-03 11:27:20 -080092 /**
93 * @brief Enable app-level IPv4 sequence tracing on all nodes (BulkSender + PacketSink)
94 */
95 void
96 EnableIpv4SeqsAppAll (const std::string &appSeqsTrace = "app-seqs.log");
Alexander Afanasyeve4c2ece2012-01-11 10:44:40 -080097
98 /**
99 * @brief Enable tracing of window changes in CcnxConsumerWindow
100 */
101 void
102 EnableWindowsAll (const std::string &windowTrace = "windows.log");
Alexander Afanasyevc4f88282012-01-03 11:27:20 -0800103
Alexander Afanasyev141d1312011-12-18 14:58:35 -0800104private:
105 std::string m_appTrace;
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -0800106 std::list<Ptr<CcnxAppTracer> > m_apps;
Alexander Afanasyev141d1312011-12-18 14:58:35 -0800107
108 std::string m_l3Trace;
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -0800109 std::list<Ptr<CcnxL3Tracer> > m_l3s;
Alexander Afanasyevc86c2832011-12-23 02:56:22 -0800110
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -0800111 std::list<Ptr<CcnxL3Tracer> > m_l3Rates;
Alexander Afanasyevc86c2832011-12-23 02:56:22 -0800112 std::ostream *m_l3RateTrace;
Alexander Afanasyev3183b5a2011-12-23 20:48:20 -0800113
114 std::list<Ptr<CcnxAppTracer> > m_appSeqs;
115 std::ostream *m_appSeqsTrace;
Alexander Afanasyevc4f88282012-01-03 11:27:20 -0800116
117 std::list<Ptr<Ipv4AppTracer> > m_ipv4AppSeqs;
118 std::ostream *m_ipv4AppSeqsTrace;
Alexander Afanasyeve4c2ece2012-01-11 10:44:40 -0800119
120 std::list<Ptr<CcnxConsumerWindowTracer> > m_windows;
121 std::ostream *m_windowsTrace;
Alexander Afanasyev141d1312011-12-18 14:58:35 -0800122};
123
124
125} // namespace ns3
126
127#endif /* CCNX_TRACE_HELPER_H */