Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(435)

Unified Diff: examples/wireless/mixed-wireless.cc

Issue 196058: Redo ASCII and pcap Traces
Patch Set: Created 14 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: examples/wireless/mixed-wireless.cc
===================================================================
--- a/examples/wireless/mixed-wireless.cc
+++ b/examples/wireless/mixed-wireless.cc
@@ -381,20 +381,26 @@
///////////////////////////////////////////////////////////////////////////
NS_LOG_INFO ("Configure Tracing.");
- std::ofstream ascii;
if (enableTracing == true)
{
- //
- // Let's set up some ns-2-like ascii traces, using another helper class
- //
- ascii.open ("mixed-wireless.tr");
- YansWifiPhyHelper::EnableAsciiAll (ascii);
- CsmaHelper::EnableAsciiAll (ascii);
- InternetStackHelper::EnableAsciiAll (ascii);
+ CsmaHelper csma;
+
+ //
+ // Let's set up some ns-2-like ascii traces, using another helper class
+ //
+ AsciiTraceHelper ascii;
+ Ptr<OutputStreamObject> stream = ascii.CreateFileStream ("mixed-wireless.tr");
+ wifiPhy.EnableAsciiAll (stream);
+ csma.EnableAsciiAll (stream);
+ internet.EnableAsciiIpv4All (stream);
// Let's do a pcap trace on the application source and sink, ifIndex 0
// Csma captures in non-promiscuous mode
- CsmaHelper::EnablePcap ("mixed-wireless", appSource->GetId (), 0, false);
+#if 0
+ csma.EnablePcap ("mixed-wireless", appSource->GetId (), 0, false);
+#else
+ csma.EnablePcapAll ("mixed-wireless", false);
+#endif
wifiPhy.EnablePcap ("mixed-wireless", appSink->GetId (), 0);
wifiPhy.EnablePcap ("mixed-wireless", 9, 2);
wifiPhy.EnablePcap ("mixed-wireless", 9, 0);

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b