src/helper/yans-wifi-helper.cc
changeset 4264 9d2e96c4e6e4
parent 4263 fec2f830d015
child 4492 3ebeb7bf3c15
--- a/src/helper/yans-wifi-helper.cc	Sat Feb 28 16:25:24 2009 -0800
+++ b/src/helper/yans-wifi-helper.cc	Tue Mar 10 23:47:55 2009 -0700
@@ -220,9 +220,11 @@
   pcap->Open (oss.str ());
   pcap->WriteWifiHeader ();
   oss.str ("");
-  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/PromiscSniffer";
+  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid;
+  oss << "/$ns3::WifiNetDevice/Phy/PromiscSniffer";
   Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&PcapSnifferEvent, pcap));
 }
+
 void 
 YansWifiPhyHelper::EnablePcap (std::string filename, NetDeviceContainer d)
 {
@@ -232,6 +234,20 @@
       EnablePcap (filename, dev->GetNode ()->GetId (), dev->GetIfIndex ());
     }
 }
+
+void 
+YansWifiPhyHelper::EnablePcap (std::string filename, Ptr<NetDevice> nd)
+{
+  EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex ());
+}
+
+void 
+YansWifiPhyHelper::EnablePcap (std::string filename, std::string ndName)
+{
+  Ptr<NetDevice> nd = Names::Find<NetDevice> (ndName);
+  EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex ());
+}
+
 void
 YansWifiPhyHelper::EnablePcap (std::string filename, NodeContainer n)
 {
@@ -294,6 +310,4 @@
   EnableAscii (os, NodeContainer::GetGlobal ());
 }
 
-
-
 } // namespace ns3