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

(-)a/src/wifi/model/mac-low.cc (+14 lines)
 Lines 366-371    Link Here 
366
  NS_LOG_FUNCTION (this);
366
  NS_LOG_FUNCTION (this);
367
  m_lastNavDuration = Seconds (0);
367
  m_lastNavDuration = Seconds (0);
368
  m_lastNavStart = Seconds (0);
368
  m_lastNavStart = Seconds (0);
369
  m_promisc = false;
369
}
370
}
370
371
371
MacLow::~MacLow ()
372
MacLow::~MacLow ()
 Lines 522-527    Link Here 
522
{
523
{
523
  m_bssid = bssid;
524
  m_bssid = bssid;
524
}
525
}
526
void
527
MacLow::SetPromisc (void)
528
{
529
  m_promisc = true;
530
}
525
Mac48Address
531
Mac48Address
526
MacLow::GetAddress (void) const
532
MacLow::GetAddress (void) const
527
{
533
{
 Lines 893-898    Link Here 
893
          // DROP
899
          // DROP
894
        }
900
        }
895
    }
901
    }
902
  else if (m_promisc)
903
    {
904
      NS_ASSERT (hdr.GetAddr1 () != m_self);
905
      if (hdr.IsData ())
906
        {
907
          goto rxPacket;
908
        }
909
    }
896
  else
910
  else
897
    {
911
    {
898
      //NS_LOG_DEBUG_VERBOSE ("rx not-for-me from %d", GetSource (packet));
912
      //NS_LOG_DEBUG_VERBOSE ("rx not-for-me from %d", GetSource (packet));
(-)a/src/wifi/model/mac-low.h (+3 lines)
 Lines 388-393    Link Here 
388
  void SetSlotTime (Time slotTime);
388
  void SetSlotTime (Time slotTime);
389
  void SetPifs (Time pifs);
389
  void SetPifs (Time pifs);
390
  void SetBssid (Mac48Address ad);
390
  void SetBssid (Mac48Address ad);
391
  void SetPromisc (void);
391
  Mac48Address GetAddress (void) const;
392
  Mac48Address GetAddress (void) const;
392
  Time GetAckTimeout (void) const;
393
  Time GetAckTimeout (void) const;
393
  Time GetBasicBlockAckTimeout () const;
394
  Time GetBasicBlockAckTimeout () const;
 Lines 632-637    Link Here 
632
  Time m_lastNavStart;
633
  Time m_lastNavStart;
633
  Time m_lastNavDuration;
634
  Time m_lastNavDuration;
634
635
636
  bool m_promisc;
637
635
  // Listerner needed to monitor when a channel switching occurs.
638
  // Listerner needed to monitor when a channel switching occurs.
636
  class PhyMacLowListener * m_phyMacLowListener;
639
  class PhyMacLowListener * m_phyMacLowListener;
637
640
(-)a/src/wifi/model/regular-wifi-mac.cc (+6 lines)
 Lines 391-396    Link Here 
391
}
391
}
392
392
393
void
393
void
394
RegularWifiMac::SetPromisc (void)
395
{
396
  m_low->SetPromisc ();
397
}
398
399
void
394
RegularWifiMac::Enqueue (Ptr<const Packet> packet,
400
RegularWifiMac::Enqueue (Ptr<const Packet> packet,
395
                         Mac48Address to, Mac48Address from)
401
                         Mac48Address to, Mac48Address from)
396
{
402
{
(-)a/src/wifi/model/regular-wifi-mac.h (+8 lines)
 Lines 130-135    Link Here 
130
   * \returns the bssid of the network this device belongs to.
130
   * \returns the bssid of the network this device belongs to.
131
   */
131
   */
132
  virtual Mac48Address GetBssid (void) const;
132
  virtual Mac48Address GetBssid (void) const;
133
  /**
134
   * \brief Sets the interface in promiscuous mode.
135
   *
136
   * Enables promiscuous mode on the interface. Note that any further
137
   * filtering on the incoming frame path may affect the overall
138
   * behavior.
139
   */
140
  virtual void SetPromisc (void);
133
141
134
  /**
142
  /**
135
   * \param packet the packet to send.
143
   * \param packet the packet to send.
(-)a/src/wifi/model/wifi-mac.h (+8 lines)
 Lines 133-138    Link Here 
133
   * \returns the bssid of the network this device belongs to.
133
   * \returns the bssid of the network this device belongs to.
134
   */
134
   */
135
  virtual Mac48Address GetBssid (void) const = 0;
135
  virtual Mac48Address GetBssid (void) const = 0;
136
  /**
137
   * \brief Sets the interface in promiscuous mode.
138
   *
139
   * Enables promiscuous mode on the interface. Note that any further
140
   * filtering on the incoming frame path may affect the overall
141
   * behavior.
142
   */
143
  virtual void SetPromisc (void) = 0;
136
144
137
  /**
145
  /**
138
   * \param packet the packet to send.
146
   * \param packet the packet to send.
(-)a/src/wifi/model/wifi-net-device.cc (+1 lines)
 Lines 356-361    Link Here 
356
WifiNetDevice::SetPromiscReceiveCallback (PromiscReceiveCallback cb)
356
WifiNetDevice::SetPromiscReceiveCallback (PromiscReceiveCallback cb)
357
{
357
{
358
  m_promiscRx = cb;
358
  m_promiscRx = cb;
359
  m_mac->SetPromisc();
359
}
360
}
360
361
361
bool
362
bool

Return to bug 827