Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -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 | #include "ccnx-trace-helper.h" |
| 22 | |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 23 | #include "ns3/config.h" |
| 24 | #include "ns3/callback.h" |
| 25 | #include "ns3/ccnx-app.h" |
| 26 | #include "ns3/ccnx-face.h" |
| 27 | #include "ns3/packet.h" |
| 28 | #include "ns3/log.h" |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 29 | #include "ns3/assert.h" |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 30 | #include "ns3/node-list.h" |
| 31 | #include "ns3/object-vector.h" |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 32 | #include "ns3/simulator.h" |
| 33 | #include "ns3/names.h" |
Alexander Afanasyev | 06b42ec | 2012-01-11 19:05:36 -0800 | [diff] [blame] | 34 | #include "ns3/tcp-l4-protocol.h" |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 35 | #include "ns3/node.h" |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 36 | |
| 37 | #include <boost/ref.hpp> |
| 38 | #include <boost/lexical_cast.hpp> |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 39 | |
| 40 | #include "tracers/ccnx-aggregate-app-tracer.h" |
| 41 | #include "tracers/ccnx-aggregate-l3-tracer.h" |
| 42 | #include "tracers/ccnx-rate-l3-tracer.h" |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 43 | #include "tracers/ccnx-seqs-app-tracer.h" |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 44 | #include "tracers/ipv4-rate-l3-tracer.h" |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 45 | #include "tracers/ipv4-seqs-app-tracer.h" |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 46 | #include "tracers/ccnx-consumer-window-tracer.h" |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 47 | #include "tracers/ccnx-path-weight-tracer.h" |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 48 | |
| 49 | #include "ns3/ccnx-interest-header.h" |
| 50 | #include "ns3/ccnx-content-object-header.h" |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 51 | |
| 52 | #include <fstream> |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 53 | |
| 54 | using namespace std; |
| 55 | using namespace boost; |
| 56 | |
| 57 | NS_LOG_COMPONENT_DEFINE ("CcnxTraceHelper"); |
| 58 | |
| 59 | namespace ns3 { |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 60 | |
| 61 | CcnxTraceHelper::CcnxTraceHelper () |
| 62 | : m_l3RateTrace (0) |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 63 | , m_appSeqsTrace (0) |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 64 | , m_ipv4AppSeqsTrace (0) |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 65 | , m_windowsTrace (0) |
Alexander Afanasyev | 06b42ec | 2012-01-11 19:05:36 -0800 | [diff] [blame] | 66 | , m_windowsTcpTrace (0) |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 67 | , m_pathWeightsTrace (0) |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 68 | { |
| 69 | } |
| 70 | |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 71 | CcnxTraceHelper::~CcnxTraceHelper () |
| 72 | { |
| 73 | NS_LOG_FUNCTION (this); |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 74 | if (m_l3RateTrace != 0) delete m_l3RateTrace; |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 75 | if (m_appSeqsTrace != 0) delete m_appSeqsTrace; |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 76 | if (m_ipv4AppSeqsTrace != 0) delete m_ipv4AppSeqsTrace; |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 77 | if (m_windowsTrace != 0) delete m_windowsTrace; |
Alexander Afanasyev | 06b42ec | 2012-01-11 19:05:36 -0800 | [diff] [blame] | 78 | if (m_windowsTcpTrace != 0) delete m_windowsTcpTrace; |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 79 | if (m_pathWeightsTrace != 0) delete m_pathWeightsTrace; |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 80 | if (m_ipv4RateTrace != 0) delete m_ipv4RateTrace; |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 81 | |
| 82 | if (m_apps.size () > 0) |
| 83 | { |
| 84 | ofstream of; |
| 85 | if (!m_appTrace.empty ()) |
| 86 | { |
| 87 | of.open (m_appTrace.c_str (), ios_base::trunc | ios_base::out); |
| 88 | of << "# "; |
| 89 | m_apps.front ()->PrintHeader (of); |
| 90 | of << "\n"; |
| 91 | } |
| 92 | |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 93 | for (std::list<Ptr<CcnxAppTracer> >::iterator app = m_apps.begin (); |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 94 | app != m_apps.end (); |
| 95 | app++) |
| 96 | { |
| 97 | if (!m_appTrace.empty ()) |
| 98 | { |
| 99 | (*app)->Print (of); |
| 100 | of << "\n"; |
| 101 | } |
| 102 | else |
| 103 | { |
| 104 | NS_LOG_INFO (*(*app)); |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | if (m_l3s.size () > 0) |
| 110 | { |
| 111 | ofstream of; |
| 112 | if (!m_l3Trace.empty ()) |
| 113 | { |
| 114 | of.open (m_l3Trace.c_str (), ios_base::trunc | ios_base::out); |
| 115 | of << "# "; |
| 116 | m_l3s.front ()->PrintHeader (of); |
| 117 | of << "\n"; |
| 118 | } |
| 119 | |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 120 | for (std::list<Ptr<CcnxL3Tracer> >::iterator l3 = m_l3s.begin (); |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 121 | l3 != m_l3s.end (); |
| 122 | l3++) |
| 123 | { |
| 124 | if (!m_l3Trace.empty ()) |
| 125 | { |
| 126 | (*l3)->Print (of); |
| 127 | of << "\n"; |
| 128 | } |
| 129 | else |
| 130 | { |
| 131 | NS_LOG_INFO (*(*l3)); |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | void |
| 138 | CcnxTraceHelper::SetAppTraceFile (const std::string &appTrace) |
| 139 | { |
| 140 | NS_LOG_FUNCTION (this << appTrace); |
| 141 | m_appTrace = appTrace; |
| 142 | } |
| 143 | |
| 144 | void |
| 145 | CcnxTraceHelper::SetL3TraceFile (const std::string &l3Trace) |
| 146 | { |
| 147 | NS_LOG_FUNCTION (this << l3Trace); |
| 148 | m_l3Trace = l3Trace; |
| 149 | } |
| 150 | |
| 151 | void |
| 152 | CcnxTraceHelper::EnableAggregateAppAll (const std::string &appName) |
| 153 | { |
| 154 | NS_LOG_FUNCTION (this << appName); |
| 155 | for (NodeList::Iterator node = NodeList::Begin (); |
| 156 | node != NodeList::End (); |
| 157 | node++) |
| 158 | { |
| 159 | ObjectVectorValue apps; |
| 160 | (*node)->GetAttribute ("ApplicationList", apps); |
| 161 | |
| 162 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 163 | |
| 164 | uint32_t appId = 0; |
| 165 | for (ObjectVectorValue::Iterator app = apps.Begin (); |
| 166 | app != apps.End (); |
| 167 | app++, appId++) |
| 168 | { |
| 169 | NS_LOG_DEBUG ("App: " << lexical_cast<string> (appId) << ", typeId: " << (*app)->GetInstanceTypeId ().GetName ()); |
| 170 | if ((*app)->GetInstanceTypeId ().GetName () == appName) |
| 171 | { |
| 172 | m_apps.push_back (Create<CcnxAggregateAppTracer> (appName, |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 173 | *node, |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 174 | lexical_cast<string> (appId))); |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | void |
| 181 | CcnxTraceHelper::EnableAggregateL3All () |
| 182 | { |
| 183 | NS_LOG_FUNCTION (this); |
| 184 | |
| 185 | for (NodeList::Iterator node = NodeList::Begin (); |
| 186 | node != NodeList::End (); |
| 187 | node++) |
| 188 | { |
| 189 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 190 | |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 191 | m_l3s.push_back (Create<CcnxAggregateL3Tracer> (*node)); |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 192 | } |
| 193 | } |
| 194 | |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 195 | void |
| 196 | CcnxTraceHelper::EnableRateL3All (const std::string &l3RateTrace) |
| 197 | { |
| 198 | NS_LOG_FUNCTION (this); |
| 199 | m_l3RateTrace = new ofstream (l3RateTrace.c_str (), ios::trunc); |
| 200 | |
| 201 | for (NodeList::Iterator node = NodeList::Begin (); |
| 202 | node != NodeList::End (); |
| 203 | node++) |
| 204 | { |
| 205 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 206 | |
| 207 | Ptr<CcnxRateL3Tracer> trace = Create<CcnxRateL3Tracer> (boost::ref(*m_l3RateTrace), *node); |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 208 | trace->SetAveragingPeriod (Seconds (0.2)); |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 209 | m_l3Rates.push_back (trace); |
| 210 | } |
| 211 | |
| 212 | if (m_l3Rates.size () > 0) |
| 213 | { |
| 214 | // *m_l3RateTrace << "# "; // not necessary for R's read.table |
| 215 | m_l3Rates.front ()->PrintHeader (*m_l3RateTrace); |
| 216 | *m_l3RateTrace << "\n"; |
| 217 | } |
| 218 | } |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 219 | |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 220 | void |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 221 | CcnxTraceHelper::EnableIpv4RateL3All (const std::string &file) |
| 222 | { |
| 223 | NS_LOG_FUNCTION (this); |
| 224 | m_ipv4RateTrace = new ofstream (file.c_str (), ios::trunc); |
| 225 | |
| 226 | for (NodeList::Iterator node = NodeList::Begin (); |
| 227 | node != NodeList::End (); |
| 228 | node++) |
| 229 | { |
| 230 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 231 | |
| 232 | Ptr<Ipv4RateL3Tracer> trace = Create<Ipv4RateL3Tracer> (boost::ref(*m_ipv4RateTrace), *node); |
| 233 | trace->SetAveragingPeriod (Seconds (0.2)); |
| 234 | m_ipv4Rates.push_back (trace); |
| 235 | } |
| 236 | |
| 237 | if (m_ipv4Rates.size () > 0) |
| 238 | { |
| 239 | // *m_ipv4RateTrace << "# "; // not necessary for R's read.table |
| 240 | m_ipv4Rates.front ()->PrintHeader (*m_ipv4RateTrace); |
| 241 | *m_ipv4RateTrace << "\n"; |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | |
| 246 | void |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 247 | CcnxTraceHelper::EnableSeqsAppAll (const std::string &appName, const std::string &trace) |
| 248 | { |
| 249 | NS_LOG_FUNCTION (this); |
| 250 | m_appSeqsTrace = new ofstream (trace.c_str (), ios::trunc); |
| 251 | |
| 252 | for (NodeList::Iterator node = NodeList::Begin (); |
| 253 | node != NodeList::End (); |
| 254 | node++) |
| 255 | { |
| 256 | ObjectVectorValue apps; |
| 257 | (*node)->GetAttribute ("ApplicationList", apps); |
| 258 | |
| 259 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 260 | |
| 261 | uint32_t appId = 0; |
| 262 | for (ObjectVectorValue::Iterator app = apps.Begin (); |
| 263 | app != apps.End (); |
| 264 | app++, appId++) |
| 265 | { |
| 266 | NS_LOG_DEBUG ("App: " << lexical_cast<string> (appId) << ", typeId: " << (*app)->GetInstanceTypeId ().GetName ()); |
| 267 | if ((*app)->GetInstanceTypeId ().GetName () == appName) |
| 268 | { |
| 269 | Ptr<CcnxSeqsAppTracer> trace = Create<CcnxSeqsAppTracer> (boost::ref(*m_appSeqsTrace), |
| 270 | appName, |
| 271 | *node, |
| 272 | lexical_cast<string> (appId)); |
| 273 | m_appSeqs.push_back (trace); |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | } |
| 278 | |
| 279 | if (m_appSeqs.size () > 0) |
| 280 | { |
| 281 | // *m_l3RateTrace << "# "; // not necessary for R's read.table |
| 282 | m_appSeqs.front ()->PrintHeader (*m_appSeqsTrace); |
| 283 | *m_appSeqsTrace << "\n"; |
| 284 | } |
| 285 | } |
| 286 | |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 287 | void |
| 288 | CcnxTraceHelper::EnableIpv4SeqsAppAll (const std::string &trace) |
| 289 | { |
| 290 | NS_LOG_FUNCTION (this); |
| 291 | m_ipv4AppSeqsTrace = new ofstream (trace.c_str (), ios::trunc); |
| 292 | |
| 293 | for (NodeList::Iterator node = NodeList::Begin (); |
| 294 | node != NodeList::End (); |
| 295 | node++) |
| 296 | { |
| 297 | ObjectVectorValue apps; |
| 298 | (*node)->GetAttribute ("ApplicationList", apps); |
| 299 | |
| 300 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 301 | |
| 302 | uint32_t appId = 0; |
| 303 | for (ObjectVectorValue::Iterator app = apps.Begin (); |
| 304 | app != apps.End (); |
| 305 | app++, appId++) |
| 306 | { |
| 307 | NS_LOG_DEBUG ("App: " << lexical_cast<string> (appId) << ", typeId: " << (*app)->GetInstanceTypeId ().GetName ()); |
| 308 | if ((*app)->GetInstanceTypeId ().GetName () == "ns3::PacketSink" || |
| 309 | (*app)->GetInstanceTypeId ().GetName () == "ns3::BulkSendApplication") |
| 310 | { |
| 311 | Ptr<Ipv4SeqsAppTracer> trace = Create<Ipv4SeqsAppTracer> (boost::ref(*m_ipv4AppSeqsTrace), |
| 312 | *node, |
| 313 | lexical_cast<string> (appId)); |
| 314 | m_ipv4AppSeqs.push_back (trace); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | } |
| 319 | |
| 320 | if (m_ipv4AppSeqs.size () > 0) |
| 321 | { |
| 322 | m_ipv4AppSeqs.front ()->PrintHeader (*m_ipv4AppSeqsTrace); |
| 323 | *m_ipv4AppSeqsTrace << "\n"; |
| 324 | } |
| 325 | } |
| 326 | |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 327 | void |
| 328 | CcnxTraceHelper::EnableWindowsAll (const std::string &windowTrace) |
| 329 | { |
| 330 | NS_LOG_FUNCTION (this); |
| 331 | m_windowsTrace = new ofstream (windowTrace.c_str (), ios::trunc); |
| 332 | |
| 333 | for (NodeList::Iterator node = NodeList::Begin (); |
| 334 | node != NodeList::End (); |
| 335 | node++) |
| 336 | { |
| 337 | ObjectVectorValue apps; |
| 338 | (*node)->GetAttribute ("ApplicationList", apps); |
| 339 | |
| 340 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 341 | |
| 342 | uint32_t appId = 0; |
| 343 | for (ObjectVectorValue::Iterator app = apps.Begin (); |
| 344 | app != apps.End (); |
| 345 | app++, appId++) |
| 346 | { |
| 347 | if ((*app)->GetInstanceTypeId ().GetName () == "ns3::CcnxConsumerWindow") |
| 348 | { |
| 349 | Ptr<CcnxConsumerWindowTracer> trace = Create<CcnxConsumerWindowTracer> (boost::ref(*m_windowsTrace), |
| 350 | *node, |
| 351 | lexical_cast<string> (appId)); |
| 352 | m_windows.push_back (trace); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | } |
| 357 | |
| 358 | if (m_windows.size () > 0) |
| 359 | { |
| 360 | m_windows.front ()->PrintHeader (*m_windowsTrace); |
| 361 | *m_windowsTrace << "\n"; |
| 362 | } |
| 363 | } |
| 364 | |
Alexander Afanasyev | 06b42ec | 2012-01-11 19:05:36 -0800 | [diff] [blame] | 365 | void |
| 366 | CcnxTraceHelper::TcpConnect (Ptr<Node> node) |
| 367 | { |
| 368 | ObjectVectorValue sockets; |
| 369 | node->GetObject<TcpL4Protocol> ()->GetAttribute ("SocketList", sockets); |
| 370 | |
| 371 | uint32_t sockId = 0; |
| 372 | for (ObjectVectorValue::Iterator socket = sockets.Begin (); |
| 373 | socket != sockets.End (); |
| 374 | socket++, sockId++) |
| 375 | { |
| 376 | // std::cout << "Node: " << node->GetId () << ", Socket " << sockId << "\n"; |
| 377 | |
| 378 | Ptr<TcpCongestionWindowTracer> trace = Create<TcpCongestionWindowTracer> (boost::ref(*m_windowsTcpTrace), |
| 379 | node, |
| 380 | lexical_cast<string> (sockId)); |
| 381 | m_windowsTcp.push_back (trace); |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | void |
| 386 | CcnxTraceHelper::EnableWindowsTcpAll (const std::string &windowTrace) |
| 387 | { |
| 388 | NS_LOG_FUNCTION (this); |
| 389 | m_windowsTcpTrace = new ofstream (windowTrace.c_str (), ios::trunc); |
| 390 | |
| 391 | WindowTracer::PrintHeader (*m_windowsTcpTrace); |
| 392 | *m_windowsTcpTrace << "\n"; |
| 393 | } |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 394 | |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 395 | void |
| 396 | CcnxTraceHelper::EnablePathWeights (const std::string &pathWeights) |
| 397 | { |
| 398 | NS_LOG_FUNCTION (this); |
| 399 | m_pathWeightsTrace = new ofstream (pathWeights.c_str (), ios::trunc); |
| 400 | |
Alexander Afanasyev | 6bff0df | 2012-01-19 17:51:52 -0800 | [diff] [blame] | 401 | CcnxPathWeightTracer::PrintHeader (*m_pathWeightsTrace); |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 402 | *m_pathWeightsTrace << "\n"; |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 403 | |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 404 | for (NodeList::Iterator node = NodeList::Begin (); |
| 405 | node != NodeList::End (); |
| 406 | node++) |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 407 | { |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 408 | Ptr<CcnxPathWeightTracer> trace = Create<CcnxPathWeightTracer> (boost::ref(*m_pathWeightsTrace), |
| 409 | *node); |
| 410 | m_pathWeights.push_back (trace); |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 411 | } |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 412 | } |
| 413 | |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 414 | } // namespace ns3 |