src/helper/yans-wifi-helper.cc
changeset 6096 96deefc231fa
parent 6091 ab0d5e641fd7
child 6206 9787dc9fdd84
--- a/src/helper/yans-wifi-helper.cc	Mon Mar 01 15:14:42 2010 -0800
+++ b/src/helper/yans-wifi-helper.cc	Mon Mar 01 18:15:36 2010 -0800
@@ -398,6 +398,7 @@
   NS_ABORT_MSG_IF (phy == 0, "YansWifiPhyHelper::EnablePcapInternal(): Phy layer in WifiNetDevice must be set");
 
   PcapHelper pcapHelper;
+
   std::string filename;
   if (explicitFilename)
     {
@@ -415,7 +416,11 @@
 }
 
 void 
-YansWifiPhyHelper::EnableAsciiInternal (Ptr<OutputStreamWrapper> stream, std::string prefix, Ptr<NetDevice> nd)
+YansWifiPhyHelper::EnableAsciiInternal (
+  Ptr<OutputStreamWrapper> stream, 
+  std::string prefix, 
+  Ptr<NetDevice> nd,
+  bool explicitFilename)
 {
   //
   // All of the ascii enable functions vector through here including the ones
@@ -453,8 +458,16 @@
       // name of the file given the prefix.
       //
       AsciiTraceHelper asciiTraceHelper;
-      std::string filename = asciiTraceHelper.GetFilenameFromDevice (prefix, device);
-      Ptr<OutputStreamWrapper> theStream = asciiTraceHelper.CreateFileStream (filename, "w");
+
+      std::string filename;
+      if (explicitFilename)
+        {
+          filename = prefix;
+        }
+      else
+        {
+          filename = asciiTraceHelper.GetFilenameFromDevice (prefix, device);
+        }
 
       //
       // We could go poking through the phy and the state looking for the