View | Details | Raw Unified | Return to bug 827
Collapse All | Expand All

(-)a/src/wifi/model/wifi-phy.cc (-8 / +8 lines)
 Lines 74-85    Link Here 
74
    .AddTraceSource ("PhyRxDrop",
74
    .AddTraceSource ("PhyRxDrop",
75
                     "Trace source indicating a packet has been dropped by the device during reception",
75
                     "Trace source indicating a packet has been dropped by the device during reception",
76
                     MakeTraceSourceAccessor (&WifiPhy::m_phyRxDropTrace))
76
                     MakeTraceSourceAccessor (&WifiPhy::m_phyRxDropTrace))
77
    .AddTraceSource ("PromiscSnifferRx",
77
    .AddTraceSource ("MonitorSnifferRx",
78
                     "Trace source simulating a wifi device in monitor mode sniffing all received frames",
78
                     "Trace source simulating a wifi device in monitor mode sniffing all received frames",
79
                     MakeTraceSourceAccessor (&WifiPhy::m_phyPromiscSniffRxTrace))
79
                     MakeTraceSourceAccessor (&WifiPhy::m_phyMonitorSniffRxTrace))
80
    .AddTraceSource ("PromiscSnifferTx",
80
    .AddTraceSource ("MonitorSnifferTx",
81
                     "Trace source simulating the capability of a wifi device in monitor mode to sniff all frames being transmitted",
81
                     "Trace source simulating the capability of a wifi device in monitor mode to sniff all frames being transmitted",
82
                     MakeTraceSourceAccessor (&WifiPhy::m_phyPromiscSniffTxTrace))
82
                     MakeTraceSourceAccessor (&WifiPhy::m_phyMonitorSniffTxTrace))
83
  ;
83
  ;
84
  return tid;
84
  return tid;
85
}
85
}
 Lines 338-352    Link Here 
338
}
338
}
339
339
340
void
340
void
341
WifiPhy::NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
341
WifiPhy::NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
342
{
342
{
343
  m_phyPromiscSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, signalDbm, noiseDbm);
343
  m_phyMonitorSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, signalDbm, noiseDbm);
344
}
344
}
345
345
346
void
346
void
347
WifiPhy::NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble)
347
WifiPhy::NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble)
348
{
348
{
349
  m_phyPromiscSniffTxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble);
349
  m_phyMonitorSniffTxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble);
350
}
350
}
351
351
352
352
(-)a/src/wifi/model/wifi-phy.h (-6 / +6 lines)
 Lines 415-421    Link Here 
415
415
416
  /**
416
  /**
417
   *
417
   *
418
   * Public method used to fire a PromiscSniffer trace for a wifi packet being received.  Implemented for encapsulation
418
   * Public method used to fire a MonitorSniffer trace for a wifi packet being received.  Implemented for encapsulation
419
   * purposes.
419
   * purposes.
420
   *
420
   *
421
   * @param packet the packet being received
421
   * @param packet the packet being received
 Lines 433-444    Link Here 
433
   * @param signalDbm signal power in dBm
433
   * @param signalDbm signal power in dBm
434
   * @param noiseDbm  noise power in dBm
434
   * @param noiseDbm  noise power in dBm
435
   */
435
   */
436
  void NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble,
436
  void NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble,
437
                             double signalDbm, double noiseDbm);
437
                             double signalDbm, double noiseDbm);
438
438
439
  /**
439
  /**
440
   *
440
   *
441
   * Public method used to fire a PromiscSniffer trace for a wifi packet being transmitted.  Implemented for encapsulation
441
   * Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.  Implemented for encapsulation
442
   * purposes.
442
   * purposes.
443
   *
443
   *
444
   * @param packet the packet being transmitted
444
   * @param packet the packet being transmitted
 Lines 449-455    Link Here 
449
   * units used both for the radiotap and for the prism header)
449
   * units used both for the radiotap and for the prism header)
450
   * @param isShortPreamble true if short preamble is used, false otherwise
450
   * @param isShortPreamble true if short preamble is used, false otherwise
451
   */
451
   */
452
  void NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
452
  void NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
453
453
454
454
455
private:
455
private:
 Lines 510-516    Link Here 
510
   *
510
   *
511
   * \see class CallBackTraceSource
511
   * \see class CallBackTraceSource
512
   */
512
   */
513
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool, double, double> m_phyPromiscSniffRxTrace;
513
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool, double, double> m_phyMonitorSniffRxTrace;
514
514
515
  /**
515
  /**
516
   * A trace source that emulates a wifi device in monitor mode
516
   * A trace source that emulates a wifi device in monitor mode
 Lines 522-528    Link Here 
522
   *
522
   *
523
   * \see class CallBackTraceSource
523
   * \see class CallBackTraceSource
524
   */
524
   */
525
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool> m_phyPromiscSniffTxTrace;
525
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool> m_phyMonitorSniffTxTrace;
526
526
527
};
527
};
528
528
(-)a/src/wifi/model/yans-wifi-phy.cc (-2 / +2 lines)
 Lines 516-522    Link Here 
516
  NotifyTxBegin (packet);
516
  NotifyTxBegin (packet);
517
  uint32_t dataRate500KbpsUnits = txMode.GetDataRate () / 500000;
517
  uint32_t dataRate500KbpsUnits = txMode.GetDataRate () / 500000;
518
  bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble);
518
  bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble);
519
  NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble);
519
  NotifyMonitorSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble);
520
  m_state->SwitchToTx (txDuration, packet, txMode, preamble, txPower);
520
  m_state->SwitchToTx (txDuration, packet, txMode, preamble, txPower);
521
  m_channel->Send (this, packet, GetPowerDbm (txPower) + m_txGainDb, txMode, preamble);
521
  m_channel->Send (this, packet, GetPowerDbm (txPower) + m_txGainDb, txMode, preamble);
522
}
522
}
 Lines 787-793    Link Here 
787
      bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ());
787
      bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ());
788
      double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30;
788
      double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30;
789
      double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30 ;
789
      double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30 ;
790
      NotifyPromiscSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
790
      NotifyMonitorSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
791
      m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (), event->GetPreambleType ());
791
      m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (), event->GetPreambleType ());
792
    }
792
    }
793
  else
793
  else

Return to bug 827