implement promisc mode
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 02 Sep 2008 13:37:59 -0700
changeset 3604 a84d99890289
parent 3603 da21b3e410b6
child 3605 60f2abc7df58
implement promisc mode
bindings/python/callbacks_list.py
bindings/python/ns3_module_wifi.py
src/devices/wifi/adhoc-wifi-mac.cc
src/devices/wifi/adhoc-wifi-mac.h
src/devices/wifi/nqap-wifi-mac.cc
src/devices/wifi/nqap-wifi-mac.h
src/devices/wifi/nqsta-wifi-mac.cc
src/devices/wifi/nqsta-wifi-mac.h
src/devices/wifi/wifi-mac.h
src/devices/wifi/wifi-net-device.cc
src/devices/wifi/wifi-net-device.h
--- a/bindings/python/callbacks_list.py	Tue Sep 02 13:19:21 2008 -0700
+++ b/bindings/python/callbacks_list.py	Tue Sep 02 13:37:59 2008 -0700
@@ -4,7 +4,7 @@
     ['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Socket>', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::Socket>', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
-    ['void', 'ns3::Ptr<ns3::Packet>', 'ns3::Mac48Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
+    ['void', 'ns3::Ptr<ns3::Packet>', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType'],
--- a/bindings/python/ns3_module_wifi.py	Tue Sep 02 13:19:21 2008 -0700
+++ b/bindings/python/ns3_module_wifi.py	Tue Sep 02 13:37:59 2008 -0700
@@ -1099,6 +1099,16 @@
                    'void', 
                    [param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], 
                    is_pure_virtual=True, visibility='private', is_virtual=True)
+    ## wifi-mac.h: void ns3::WifiMac::Enqueue(ns3::Ptr<const ns3::Packet> packet, ns3::Mac48Address to) [member function]
+    cls.add_method('Enqueue', 
+                   'void', 
+                   [param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to')], 
+                   is_pure_virtual=True, visibility='private', is_virtual=True)
+    ## wifi-mac.h: bool ns3::WifiMac::SupportsSendFrom() const [member function]
+    cls.add_method('SupportsSendFrom', 
+                   'bool', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
     ## wifi-mac.h: void ns3::WifiMac::SetWifiPhy(ns3::Ptr<ns3::WifiPhy> phy) [member function]
     cls.add_method('SetWifiPhy', 
                    'void', 
@@ -1109,10 +1119,10 @@
                    'void', 
                    [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], 
                    is_pure_virtual=True, visibility='private', is_virtual=True)
-    ## wifi-mac.h: void ns3::WifiMac::SetForwardUpCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Mac48Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function]
+    ## wifi-mac.h: void ns3::WifiMac::SetForwardUpCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function]
     cls.add_method('SetForwardUpCallback', 
                    'void', 
-                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], 
+                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], 
                    is_pure_virtual=True, visibility='private', is_virtual=True)
     ## wifi-mac.h: void ns3::WifiMac::SetLinkUpCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> linkUp) [member function]
     cls.add_method('SetLinkUpCallback', 
@@ -1209,10 +1219,20 @@
                    'void', 
                    [param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], 
                    is_virtual=True)
-    ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetForwardUpCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Mac48Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function]
+    ## nqap-wifi-mac.h: void ns3::NqapWifiMac::Enqueue(ns3::Ptr<const ns3::Packet> packet, ns3::Mac48Address to) [member function]
+    cls.add_method('Enqueue', 
+                   'void', 
+                   [param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to')], 
+                   is_virtual=True)
+    ## nqap-wifi-mac.h: bool ns3::NqapWifiMac::SupportsSendFrom() const [member function]
+    cls.add_method('SupportsSendFrom', 
+                   'bool', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetForwardUpCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function]
     cls.add_method('SetForwardUpCallback', 
                    'void', 
-                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], 
+                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], 
                    is_virtual=True)
     ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetLinkUpCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> linkUp) [member function]
     cls.add_method('SetLinkUpCallback', 
@@ -1430,10 +1450,20 @@
                    'void', 
                    [param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], 
                    is_virtual=True)
-    ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetForwardUpCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Mac48Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function]
+    ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::Enqueue(ns3::Ptr<const ns3::Packet> packet, ns3::Mac48Address to) [member function]
+    cls.add_method('Enqueue', 
+                   'void', 
+                   [param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to')], 
+                   is_virtual=True)
+    ## adhoc-wifi-mac.h: bool ns3::AdhocWifiMac::SupportsSendFrom() const [member function]
+    cls.add_method('SupportsSendFrom', 
+                   'bool', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetForwardUpCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function]
     cls.add_method('SetForwardUpCallback', 
                    'void', 
-                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], 
+                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], 
                    is_virtual=True)
     ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetLinkUpCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> linkUp) [member function]
     cls.add_method('SetLinkUpCallback', 
@@ -2279,10 +2309,20 @@
                    'void', 
                    [param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], 
                    is_virtual=True)
-    ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetForwardUpCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Mac48Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function]
+    ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::Enqueue(ns3::Ptr<const ns3::Packet> packet, ns3::Mac48Address to) [member function]
+    cls.add_method('Enqueue', 
+                   'void', 
+                   [param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to')], 
+                   is_virtual=True)
+    ## nqsta-wifi-mac.h: bool ns3::NqstaWifiMac::SupportsSendFrom() const [member function]
+    cls.add_method('SupportsSendFrom', 
+                   'bool', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetForwardUpCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function]
     cls.add_method('SetForwardUpCallback', 
                    'void', 
-                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], 
+                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], 
                    is_virtual=True)
     ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetLinkUpCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> linkUp) [member function]
     cls.add_method('SetLinkUpCallback', 
--- a/src/devices/wifi/adhoc-wifi-mac.cc	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/adhoc-wifi-mac.cc	Tue Sep 02 13:37:59 2008 -0700
@@ -154,7 +154,7 @@
   m_low->SetWifiRemoteStationManager (stationManager);
 }
 void 
-AdhocWifiMac::SetForwardUpCallback (Callback<void,Ptr<Packet>, const Mac48Address &> upCallback)
+AdhocWifiMac::SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback)
 {
   m_upCallback = upCallback;
 }
@@ -237,10 +237,7 @@
 AdhocWifiMac::ForwardUp (Ptr<Packet> packet, WifiMacHeader const *hdr)
 {
   NS_LOG_DEBUG ("received size="<<packet->GetSize ()<<", from="<<hdr->GetAddr2 ());
-  if (hdr->GetAddr1 ().IsBroadcast () || hdr->GetAddr1 () == GetAddress ())
-    {
-      m_upCallback (packet, hdr->GetAddr2 ());
-    }
+  m_upCallback (packet, hdr->GetAddr2 (), hdr->GetAddr1 ());
 }
 
 } // namespace ns3
--- a/src/devices/wifi/adhoc-wifi-mac.h	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/adhoc-wifi-mac.h	Tue Sep 02 13:37:59 2008 -0700
@@ -70,7 +70,7 @@
   virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
   virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
   virtual bool SupportsSendFrom (void) const;
-  virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, const Mac48Address &> upCallback);
+  virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback);
   virtual void SetLinkUpCallback (Callback<void> linkUp);
   virtual void SetLinkDownCallback (Callback<void> linkDown);
   virtual Mac48Address GetAddress (void) const;
@@ -88,7 +88,7 @@
   Mac48Address GetBssid (void) const;
 
   Ptr<DcaTxop> m_dca;
-  Callback<void,Ptr<Packet>,const Mac48Address &> m_upCallback;
+  Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> m_upCallback;
   Ptr<WifiRemoteStationManager> m_stationManager;
   Ptr<WifiPhy> m_phy;
   DcfManager *m_dcfManager;
--- a/src/devices/wifi/nqap-wifi-mac.cc	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/nqap-wifi-mac.cc	Tue Sep 02 13:37:59 2008 -0700
@@ -209,7 +209,7 @@
   m_low->SetWifiRemoteStationManager (stationManager);
 }
 void 
-NqapWifiMac::SetForwardUpCallback (Callback<void,Ptr<Packet>, const Mac48Address &> upCallback)
+NqapWifiMac::SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback)
 {
   NS_LOG_FUNCTION (this);
   m_upCallback = upCallback;
@@ -266,10 +266,10 @@
   SendOneBeacon ();
 }
 void 
-NqapWifiMac::ForwardUp (Ptr<Packet> packet, Mac48Address from)
+NqapWifiMac::ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to)
 {
   NS_LOG_FUNCTION (this << packet << from);
-  m_upCallback (packet, from);
+  m_upCallback (packet, from, to);
 }
 void 
 NqapWifiMac::ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to)
@@ -430,7 +430,7 @@
           if (hdr->GetAddr3 () == GetAddress ()) 
             {
               NS_LOG_DEBUG ("frame for me from="<<hdr->GetAddr2 ());
-              ForwardUp (packet, hdr->GetAddr2 ());
+              ForwardUp (packet, hdr->GetAddr2 (), hdr->GetAddr1 ());
             } 
           else 
             {
@@ -439,7 +439,7 @@
               ForwardDown (packet,
                            hdr->GetAddr2 (), 
                            hdr->GetAddr3 ());
-              ForwardUp (copy, hdr->GetAddr2 ());
+              ForwardUp (copy, hdr->GetAddr2 (), hdr->GetAddr1 ());
             }
         } 
       else if (hdr->IsFromDs () &&
--- a/src/devices/wifi/nqap-wifi-mac.h	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/nqap-wifi-mac.h	Tue Sep 02 13:37:59 2008 -0700
@@ -76,7 +76,7 @@
   virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
   virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
   virtual bool SupportsSendFrom (void) const;
-  virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, const Mac48Address &> upCallback);
+  virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback);
   virtual void SetLinkUpCallback (Callback<void> linkUp);
   virtual void SetLinkDownCallback (Callback<void> linkDown);
   virtual Mac48Address GetAddress (void) const;
@@ -100,7 +100,7 @@
 
 private:
   void Receive (Ptr<Packet> packet, WifiMacHeader const *hdr);
-  void ForwardUp (Ptr<Packet> packet, Mac48Address from);
+  void ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to);
   void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to);
   void TxOk (WifiMacHeader const &hdr);
   void TxFailed (WifiMacHeader const &hdr);
@@ -117,7 +117,7 @@
   Ptr<DcaTxop> m_beaconDca;
   Ptr<WifiRemoteStationManager> m_stationManager;
   Ptr<WifiPhy> m_phy;
-  Callback<void, Ptr<Packet>,const Mac48Address &> m_upCallback;
+  Callback<void, Ptr<Packet>,Mac48Address, Mac48Address> m_upCallback;
   Time m_beaconInterval;
 
   DcfManager *m_dcfManager;
--- a/src/devices/wifi/nqsta-wifi-mac.cc	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/nqsta-wifi-mac.cc	Tue Sep 02 13:37:59 2008 -0700
@@ -207,7 +207,7 @@
   m_low->SetWifiRemoteStationManager (stationManager);
 }
 void 
-NqstaWifiMac::SetForwardUpCallback (Callback<void,Ptr<Packet>, const Mac48Address &> upCallback)
+NqstaWifiMac::SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback)
 {
   m_forwardUp = upCallback;
 }
@@ -301,10 +301,10 @@
     }
 }
 void 
-NqstaWifiMac::ForwardUp (Ptr<Packet> packet, const Mac48Address &address)
+NqstaWifiMac::ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to)
 {
-  NS_LOG_FUNCTION (this << packet << address);
-  m_forwardUp (packet, address);
+  NS_LOG_FUNCTION (this << packet << from << to);
+  m_forwardUp (packet, from, to);
 }
 void
 NqstaWifiMac::SendProbeRequest (void)
@@ -480,7 +480,7 @@
     } 
   else if (hdr->IsData ()) 
     {
-      ForwardUp (packet, hdr->GetAddr2 ());
+      ForwardUp (packet, hdr->GetAddr2 (), hdr->GetAddr1 ());
     } 
   else if (hdr->IsProbeReq () ||
            hdr->IsAssocReq ()) 
--- a/src/devices/wifi/nqsta-wifi-mac.h	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/nqsta-wifi-mac.h	Tue Sep 02 13:37:59 2008 -0700
@@ -76,7 +76,7 @@
   virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
   virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
   virtual bool SupportsSendFrom (void) const;
-  virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, const Mac48Address &> upCallback);
+  virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback);
   virtual void SetLinkUpCallback (Callback<void> linkUp);
   virtual void SetLinkDownCallback (Callback<void> linkDown);
   virtual Mac48Address GetAddress (void) const;
@@ -114,7 +114,7 @@
   void SetBssid (Mac48Address bssid);
   void SetActiveProbing (bool enable);
   bool GetActiveProbing (void) const;
-  void ForwardUp (Ptr<Packet> packet, const Mac48Address &address);
+  void ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to);
   void Receive (Ptr<Packet> packet, WifiMacHeader const *hdr);
   Mac48Address GetBroadcastBssid (void);
   void SendProbeRequest (void);
@@ -141,7 +141,7 @@
   Time m_assocRequestTimeout;
   EventId m_probeRequestEvent;
   EventId m_assocRequestEvent;
-  Callback<void, Ptr<Packet>,const Mac48Address &> m_forwardUp;
+  Callback<void, Ptr<Packet>, Mac48Address, Mac48Address> m_forwardUp;
   Callback<void> m_linkUp;
   Callback<void> m_linkDown;
   Ptr<DcaTxop> m_dca;
--- a/src/devices/wifi/wifi-mac.h	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/wifi-mac.h	Tue Sep 02 13:37:59 2008 -0700
@@ -154,7 +154,7 @@
   /**
    * \param upCallback the callback to invoke when a packet must be forwarded up the stack.
    */
-  virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, const Mac48Address &> upCallback) = 0;
+  virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback) = 0;
   /**
    * \param linkUp the callback to invoke when the link becomes up.
    */
--- a/src/devices/wifi/wifi-net-device.cc	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/wifi-net-device.cc	Tue Sep 02 13:37:59 2008 -0700
@@ -305,12 +305,36 @@
 }
 
 void
-WifiNetDevice::ForwardUp (Ptr<Packet> packet, const Mac48Address &from)
+WifiNetDevice::ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to)
 {
   m_rxLogger (packet, from);
   LlcSnapHeader llc;
   packet->RemoveHeader (llc);
-  m_forwardUp (this, packet, llc.GetType (), from);
+  enum NetDevice::PacketType type;
+  if (to.IsBroadcast ())
+    {
+      type = NetDevice::PACKET_BROADCAST;
+    }
+  else if (to.IsMulticast ())
+    {
+      type = NetDevice::PACKET_MULTICAST;
+    }
+  else if (to == m_mac->GetAddress ())
+    {
+      type = NetDevice::PACKET_HOST;
+    }
+  else
+    {
+      type = NetDevice::PACKET_OTHERHOST;
+    }
+  if (type != NetDevice::PACKET_OTHERHOST)
+    {
+      m_forwardUp (this, packet, llc.GetType (), from);
+    }
+  if (!m_promiscRx.IsNull ())
+    {
+      m_promiscRx (this, packet, llc.GetType (), from, to, type);
+    }
 }
 
 void
@@ -355,7 +379,7 @@
 void
 WifiNetDevice::SetPromiscReceiveCallback (PromiscReceiveCallback cb)
 {
-  NS_FATAL_ERROR ("TODO");
+  m_promiscRx = cb;
 }
 
 bool
--- a/src/devices/wifi/wifi-net-device.h	Tue Sep 02 13:19:21 2008 -0700
+++ b/src/devices/wifi/wifi-net-device.h	Tue Sep 02 13:37:59 2008 -0700
@@ -107,7 +107,7 @@
 
 private:
   virtual void DoDispose (void);
-  void ForwardUp (Ptr<Packet> packet, const Mac48Address &from);
+  void ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to);
   void LinkUp (void);
   void LinkDown (void);
   void Setup (void);
@@ -117,7 +117,8 @@
   Ptr<WifiChannel> m_channel;
   Ptr<WifiMac> m_mac;
   Ptr<WifiRemoteStationManager> m_stationManager;
-  ReceiveCallback m_forwardUp;
+  NetDevice::ReceiveCallback m_forwardUp;
+  NetDevice::PromiscReceiveCallback m_promiscRx;
   TracedCallback<Ptr<const Packet>, Mac48Address> m_rxLogger;
   TracedCallback<Ptr<const Packet>, Mac48Address> m_txLogger;
   uint32_t m_ifIndex;