[Bug 827] Rename promisc trace to monitor in WifiPhy
authorRuben Merz <ruben@net.t-labs.tu-berlin.de>
Tue, 17 May 2011 11:48:50 +0200
changeset 7376 21b6b53ba0d5
parent 7375 17b50c5b062c
child 7377 5e233023a060
[Bug 827] Rename promisc trace to monitor in WifiPhy
src/wifi/helper/yans-wifi-helper.cc
src/wifi/model/wifi-phy.cc
src/wifi/model/wifi-phy.h
src/wifi/model/yans-wifi-phy.cc
--- a/src/wifi/helper/yans-wifi-helper.cc	Mon May 16 22:12:39 2011 +0200
+++ b/src/wifi/helper/yans-wifi-helper.cc	Tue May 17 11:48:50 2011 +0200
@@ -444,8 +444,8 @@
 
   Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, std::ios::out, m_pcapDlt);
 
-  phy->TraceConnectWithoutContext ("PromiscSnifferTx", MakeBoundCallback (&PcapSniffTxEvent, file));
-  phy->TraceConnectWithoutContext ("PromiscSnifferRx", MakeBoundCallback (&PcapSniffRxEvent, file));
+  phy->TraceConnectWithoutContext ("MonitorSnifferTx", MakeBoundCallback (&PcapSniffTxEvent, file));
+  phy->TraceConnectWithoutContext ("MonitorSnifferRx", MakeBoundCallback (&PcapSniffRxEvent, file));
 }
 
 void
--- a/src/wifi/model/wifi-phy.cc	Mon May 16 22:12:39 2011 +0200
+++ b/src/wifi/model/wifi-phy.cc	Tue May 17 11:48:50 2011 +0200
@@ -74,12 +74,12 @@
     .AddTraceSource ("PhyRxDrop",
                      "Trace source indicating a packet has been dropped by the device during reception",
                      MakeTraceSourceAccessor (&WifiPhy::m_phyRxDropTrace))
-    .AddTraceSource ("PromiscSnifferRx",
+    .AddTraceSource ("MonitorSnifferRx",
                      "Trace source simulating a wifi device in monitor mode sniffing all received frames",
-                     MakeTraceSourceAccessor (&WifiPhy::m_phyPromiscSniffRxTrace))
-    .AddTraceSource ("PromiscSnifferTx",
+                     MakeTraceSourceAccessor (&WifiPhy::m_phyMonitorSniffRxTrace))
+    .AddTraceSource ("MonitorSnifferTx",
                      "Trace source simulating the capability of a wifi device in monitor mode to sniff all frames being transmitted",
-                     MakeTraceSourceAccessor (&WifiPhy::m_phyPromiscSniffTxTrace))
+                     MakeTraceSourceAccessor (&WifiPhy::m_phyMonitorSniffTxTrace))
   ;
   return tid;
 }
@@ -338,15 +338,15 @@
 }
 
 void
-WifiPhy::NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
+WifiPhy::NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
 {
-  m_phyPromiscSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, signalDbm, noiseDbm);
+  m_phyMonitorSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, signalDbm, noiseDbm);
 }
 
 void
-WifiPhy::NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble)
+WifiPhy::NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble)
 {
-  m_phyPromiscSniffTxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble);
+  m_phyMonitorSniffTxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble);
 }
 
 
--- a/src/wifi/model/wifi-phy.h	Mon May 16 22:12:39 2011 +0200
+++ b/src/wifi/model/wifi-phy.h	Tue May 17 11:48:50 2011 +0200
@@ -415,7 +415,7 @@
 
   /**
    *
-   * Public method used to fire a PromiscSniffer trace for a wifi packet being received.  Implemented for encapsulation
+   * Public method used to fire a MonitorSniffer trace for a wifi packet being received.  Implemented for encapsulation
    * purposes.
    *
    * @param packet the packet being received
@@ -433,12 +433,12 @@
    * @param signalDbm signal power in dBm
    * @param noiseDbm  noise power in dBm
    */
-  void NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble,
+  void NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble,
                              double signalDbm, double noiseDbm);
 
   /**
    *
-   * Public method used to fire a PromiscSniffer trace for a wifi packet being transmitted.  Implemented for encapsulation
+   * Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.  Implemented for encapsulation
    * purposes.
    *
    * @param packet the packet being transmitted
@@ -449,7 +449,7 @@
    * units used both for the radiotap and for the prism header)
    * @param isShortPreamble true if short preamble is used, false otherwise
    */
-  void NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
+  void NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
 
 
 private:
@@ -510,7 +510,7 @@
    *
    * \see class CallBackTraceSource
    */
-  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool, double, double> m_phyPromiscSniffRxTrace;
+  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool, double, double> m_phyMonitorSniffRxTrace;
 
   /**
    * A trace source that emulates a wifi device in monitor mode
@@ -522,7 +522,7 @@
    *
    * \see class CallBackTraceSource
    */
-  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool> m_phyPromiscSniffTxTrace;
+  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool> m_phyMonitorSniffTxTrace;
 
 };
 
--- a/src/wifi/model/yans-wifi-phy.cc	Mon May 16 22:12:39 2011 +0200
+++ b/src/wifi/model/yans-wifi-phy.cc	Tue May 17 11:48:50 2011 +0200
@@ -516,7 +516,7 @@
   NotifyTxBegin (packet);
   uint32_t dataRate500KbpsUnits = txMode.GetDataRate () / 500000;
   bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble);
-  NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble);
+  NotifyMonitorSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble);
   m_state->SwitchToTx (txDuration, packet, txMode, preamble, txPower);
   m_channel->Send (this, packet, GetPowerDbm (txPower) + m_txGainDb, txMode, preamble);
 }
@@ -787,7 +787,7 @@
       bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ());
       double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30;
       double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;
-      NotifyPromiscSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
+      NotifyMonitorSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
       m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (), event->GetPreambleType ());
     }
   else