Make wifi-phy-test be an example for wifi module
authorMitch Watrous <watrous@u.washington.edu>
Tue, 05 Jul 2011 09:06:45 -0700
changeset 7340 4d4017e8994a
parent 7339 2539fd65226c
child 7341 eda4fbf4d8e3
Make wifi-phy-test be an example for wifi module
src/wifi/bindings/modulegen__gcc_ILP32.py
src/wifi/bindings/modulegen__gcc_LP64.py
src/wifi/examples/wifi-phy-test.cc
src/wifi/examples/wscript
src/wifi/test/examples-to-run.py
src/wifi/test/wifi-phy-test.cc
src/wifi/wscript
--- a/src/wifi/bindings/modulegen__gcc_ILP32.py	Tue Jul 05 13:32:33 2011 +0100
+++ b/src/wifi/bindings/modulegen__gcc_ILP32.py	Tue Jul 05 09:06:45 2011 -0700
@@ -326,6 +326,8 @@
     module.add_enum('QosAckPolicy', ['NORMAL_ACK', 'NO_ACK', 'NO_EXPLICIT_ACK', 'BLOCK_ACK'], outer_class=root_module['ns3::WifiMacHeader'])
     ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacHeader::AddressType [enumeration]
     module.add_enum('AddressType', ['ADDR1', 'ADDR2', 'ADDR3', 'ADDR4'], outer_class=root_module['ns3::WifiMacHeader'])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::WifiMacQueue [class]
+    module.add_class('WifiMacQueue', parent=root_module['ns3::Object'])
     ## wifi-phy.h (module 'wifi'): ns3::WifiPhy [class]
     module.add_class('WifiPhy', parent=root_module['ns3::Object'])
     ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::State [enumeration]
@@ -644,6 +646,7 @@
     register_Ns3WifiInformationElementVector_methods(root_module, root_module['ns3::WifiInformationElementVector'])
     register_Ns3WifiMac_methods(root_module, root_module['ns3::WifiMac'])
     register_Ns3WifiMacHeader_methods(root_module, root_module['ns3::WifiMacHeader'])
+    register_Ns3WifiMacQueue_methods(root_module, root_module['ns3::WifiMacQueue'])
     register_Ns3WifiPhy_methods(root_module, root_module['ns3::WifiPhy'])
     register_Ns3WifiRemoteStationManager_methods(root_module, root_module['ns3::WifiRemoteStationManager'])
     register_Ns3YansWifiPhy_methods(root_module, root_module['ns3::YansWifiPhy'])
@@ -4084,8 +4087,8 @@
     return
 
 def register_Ns3Int64x64_t_methods(root_module, cls):
+    cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
     cls.add_binary_comparison_operator('!=')
-    cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
     cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right'))
     cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right'))
     cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right'))
@@ -5225,8 +5228,8 @@
     return
 
 def register_Ns3Time_methods(root_module, cls):
+    cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
     cls.add_binary_comparison_operator('!=')
-    cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
     cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
     cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
     cls.add_binary_comparison_operator('<')
@@ -5765,6 +5768,11 @@
                    'void', 
                    [param('ns3::Time', 'pifs')], 
                    is_pure_virtual=True, is_virtual=True)
+    ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetPromisc() [member function]
+    cls.add_method('SetPromisc', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, is_virtual=True)
     ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetSifs(ns3::Time sifs) [member function]
     cls.add_method('SetSifs', 
                    'void', 
@@ -6231,6 +6239,88 @@
                    [])
     return
 
+def register_Ns3WifiMacQueue_methods(root_module, cls):
+    ## wifi-mac-queue.h (module 'wifi'): ns3::WifiMacQueue::WifiMacQueue(ns3::WifiMacQueue const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::WifiMacQueue const &', 'arg0')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::WifiMacQueue::WifiMacQueue() [constructor]
+    cls.add_constructor([])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::Dequeue(ns3::WifiMacHeader * hdr) [member function]
+    cls.add_method('Dequeue', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::DequeueByTidAndAddress(ns3::WifiMacHeader * hdr, uint8_t tid, ns3::WifiMacHeader::AddressType type, ns3::Mac48Address addr) [member function]
+    cls.add_method('DequeueByTidAndAddress', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr'), param('uint8_t', 'tid'), param('ns3::WifiMacHeader::AddressType', 'type'), param('ns3::Mac48Address', 'addr')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::DequeueFirstAvailable(ns3::WifiMacHeader * hdr, ns3::Time & tStamp, ns3::QosBlockedDestinations const * blockedPackets) [member function]
+    cls.add_method('DequeueFirstAvailable', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr'), param('ns3::Time &', 'tStamp'), param('ns3::QosBlockedDestinations const *', 'blockedPackets')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::Enqueue(ns3::Ptr<ns3::Packet const> packet, ns3::WifiMacHeader const & hdr) [member function]
+    cls.add_method('Enqueue', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const &', 'hdr')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::Flush() [member function]
+    cls.add_method('Flush', 
+                   'void', 
+                   [])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Time ns3::WifiMacQueue::GetMaxDelay() const [member function]
+    cls.add_method('GetMaxDelay', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## wifi-mac-queue.h (module 'wifi'): uint32_t ns3::WifiMacQueue::GetMaxSize() const [member function]
+    cls.add_method('GetMaxSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## wifi-mac-queue.h (module 'wifi'): uint32_t ns3::WifiMacQueue::GetNPacketsByTidAndAddress(uint8_t tid, ns3::WifiMacHeader::AddressType type, ns3::Mac48Address addr) [member function]
+    cls.add_method('GetNPacketsByTidAndAddress', 
+                   'uint32_t', 
+                   [param('uint8_t', 'tid'), param('ns3::WifiMacHeader::AddressType', 'type'), param('ns3::Mac48Address', 'addr')])
+    ## wifi-mac-queue.h (module 'wifi'): uint32_t ns3::WifiMacQueue::GetSize() [member function]
+    cls.add_method('GetSize', 
+                   'uint32_t', 
+                   [])
+    ## wifi-mac-queue.h (module 'wifi'): static ns3::TypeId ns3::WifiMacQueue::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## wifi-mac-queue.h (module 'wifi'): bool ns3::WifiMacQueue::IsEmpty() [member function]
+    cls.add_method('IsEmpty', 
+                   'bool', 
+                   [])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::Peek(ns3::WifiMacHeader * hdr) [member function]
+    cls.add_method('Peek', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::PeekByTidAndAddress(ns3::WifiMacHeader * hdr, uint8_t tid, ns3::WifiMacHeader::AddressType type, ns3::Mac48Address addr) [member function]
+    cls.add_method('PeekByTidAndAddress', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr'), param('uint8_t', 'tid'), param('ns3::WifiMacHeader::AddressType', 'type'), param('ns3::Mac48Address', 'addr')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::PeekFirstAvailable(ns3::WifiMacHeader * hdr, ns3::Time & tStamp, ns3::QosBlockedDestinations const * blockedPackets) [member function]
+    cls.add_method('PeekFirstAvailable', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr'), param('ns3::Time &', 'tStamp'), param('ns3::QosBlockedDestinations const *', 'blockedPackets')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::PushFront(ns3::Ptr<ns3::Packet const> packet, ns3::WifiMacHeader const & hdr) [member function]
+    cls.add_method('PushFront', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const &', 'hdr')])
+    ## wifi-mac-queue.h (module 'wifi'): bool ns3::WifiMacQueue::Remove(ns3::Ptr<ns3::Packet const> packet) [member function]
+    cls.add_method('Remove', 
+                   'bool', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::SetMaxDelay(ns3::Time delay) [member function]
+    cls.add_method('SetMaxDelay', 
+                   'void', 
+                   [param('ns3::Time', 'delay')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::SetMaxSize(uint32_t maxSize) [member function]
+    cls.add_method('SetMaxSize', 
+                   'void', 
+                   [param('uint32_t', 'maxSize')])
+    return
+
 def register_Ns3WifiPhy_methods(root_module, cls):
     ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::WifiPhy(ns3::WifiPhy const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::WifiPhy const &', 'arg0')])
@@ -6536,12 +6626,12 @@
                    'bool', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyPromiscSniffRx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) [member function]
-    cls.add_method('NotifyPromiscSniffRx', 
+    ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyMonitorSniffRx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) [member function]
+    cls.add_method('NotifyMonitorSniffRx', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('double', 'signalDbm'), param('double', 'noiseDbm')])
-    ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyPromiscSniffTx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble) [member function]
-    cls.add_method('NotifyPromiscSniffTx', 
+    ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyMonitorSniffTx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble) [member function]
+    cls.add_method('NotifyMonitorSniffTx', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble')])
     ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyRxBegin(ns3::Ptr<ns3::Packet const> packet) [member function]
@@ -8829,6 +8919,10 @@
     cls.add_method('SetPifs', 
                    'void', 
                    [param('ns3::Time', 'pifs')])
+    ## mac-low.h (module 'wifi'): void ns3::MacLow::SetPromisc() [member function]
+    cls.add_method('SetPromisc', 
+                   'void', 
+                   [])
     ## mac-low.h (module 'wifi'): void ns3::MacLow::SetRxCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::WifiMacHeader const*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('SetRxCallback', 
                    'void', 
@@ -9669,6 +9763,11 @@
                    'ns3::Mac48Address', 
                    [], 
                    is_const=True, is_virtual=True)
+    ## regular-wifi-mac.h (module 'wifi'): void ns3::RegularWifiMac::SetPromisc() [member function]
+    cls.add_method('SetPromisc', 
+                   'void', 
+                   [], 
+                   is_virtual=True)
     ## regular-wifi-mac.h (module 'wifi'): void ns3::RegularWifiMac::Enqueue(ns3::Ptr<ns3::Packet const> packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function]
     cls.add_method('Enqueue', 
                    'void', 
--- a/src/wifi/bindings/modulegen__gcc_LP64.py	Tue Jul 05 13:32:33 2011 +0100
+++ b/src/wifi/bindings/modulegen__gcc_LP64.py	Tue Jul 05 09:06:45 2011 -0700
@@ -326,6 +326,8 @@
     module.add_enum('QosAckPolicy', ['NORMAL_ACK', 'NO_ACK', 'NO_EXPLICIT_ACK', 'BLOCK_ACK'], outer_class=root_module['ns3::WifiMacHeader'])
     ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacHeader::AddressType [enumeration]
     module.add_enum('AddressType', ['ADDR1', 'ADDR2', 'ADDR3', 'ADDR4'], outer_class=root_module['ns3::WifiMacHeader'])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::WifiMacQueue [class]
+    module.add_class('WifiMacQueue', parent=root_module['ns3::Object'])
     ## wifi-phy.h (module 'wifi'): ns3::WifiPhy [class]
     module.add_class('WifiPhy', parent=root_module['ns3::Object'])
     ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::State [enumeration]
@@ -644,6 +646,7 @@
     register_Ns3WifiInformationElementVector_methods(root_module, root_module['ns3::WifiInformationElementVector'])
     register_Ns3WifiMac_methods(root_module, root_module['ns3::WifiMac'])
     register_Ns3WifiMacHeader_methods(root_module, root_module['ns3::WifiMacHeader'])
+    register_Ns3WifiMacQueue_methods(root_module, root_module['ns3::WifiMacQueue'])
     register_Ns3WifiPhy_methods(root_module, root_module['ns3::WifiPhy'])
     register_Ns3WifiRemoteStationManager_methods(root_module, root_module['ns3::WifiRemoteStationManager'])
     register_Ns3YansWifiPhy_methods(root_module, root_module['ns3::YansWifiPhy'])
@@ -4084,8 +4087,8 @@
     return
 
 def register_Ns3Int64x64_t_methods(root_module, cls):
+    cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
     cls.add_binary_comparison_operator('!=')
-    cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
     cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right'))
     cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right'))
     cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right'))
@@ -5225,8 +5228,8 @@
     return
 
 def register_Ns3Time_methods(root_module, cls):
+    cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
     cls.add_binary_comparison_operator('!=')
-    cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
     cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
     cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
     cls.add_binary_comparison_operator('<')
@@ -5765,6 +5768,11 @@
                    'void', 
                    [param('ns3::Time', 'pifs')], 
                    is_pure_virtual=True, is_virtual=True)
+    ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetPromisc() [member function]
+    cls.add_method('SetPromisc', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, is_virtual=True)
     ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetSifs(ns3::Time sifs) [member function]
     cls.add_method('SetSifs', 
                    'void', 
@@ -6231,6 +6239,88 @@
                    [])
     return
 
+def register_Ns3WifiMacQueue_methods(root_module, cls):
+    ## wifi-mac-queue.h (module 'wifi'): ns3::WifiMacQueue::WifiMacQueue(ns3::WifiMacQueue const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::WifiMacQueue const &', 'arg0')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::WifiMacQueue::WifiMacQueue() [constructor]
+    cls.add_constructor([])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::Dequeue(ns3::WifiMacHeader * hdr) [member function]
+    cls.add_method('Dequeue', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::DequeueByTidAndAddress(ns3::WifiMacHeader * hdr, uint8_t tid, ns3::WifiMacHeader::AddressType type, ns3::Mac48Address addr) [member function]
+    cls.add_method('DequeueByTidAndAddress', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr'), param('uint8_t', 'tid'), param('ns3::WifiMacHeader::AddressType', 'type'), param('ns3::Mac48Address', 'addr')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::DequeueFirstAvailable(ns3::WifiMacHeader * hdr, ns3::Time & tStamp, ns3::QosBlockedDestinations const * blockedPackets) [member function]
+    cls.add_method('DequeueFirstAvailable', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr'), param('ns3::Time &', 'tStamp'), param('ns3::QosBlockedDestinations const *', 'blockedPackets')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::Enqueue(ns3::Ptr<ns3::Packet const> packet, ns3::WifiMacHeader const & hdr) [member function]
+    cls.add_method('Enqueue', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const &', 'hdr')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::Flush() [member function]
+    cls.add_method('Flush', 
+                   'void', 
+                   [])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Time ns3::WifiMacQueue::GetMaxDelay() const [member function]
+    cls.add_method('GetMaxDelay', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## wifi-mac-queue.h (module 'wifi'): uint32_t ns3::WifiMacQueue::GetMaxSize() const [member function]
+    cls.add_method('GetMaxSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## wifi-mac-queue.h (module 'wifi'): uint32_t ns3::WifiMacQueue::GetNPacketsByTidAndAddress(uint8_t tid, ns3::WifiMacHeader::AddressType type, ns3::Mac48Address addr) [member function]
+    cls.add_method('GetNPacketsByTidAndAddress', 
+                   'uint32_t', 
+                   [param('uint8_t', 'tid'), param('ns3::WifiMacHeader::AddressType', 'type'), param('ns3::Mac48Address', 'addr')])
+    ## wifi-mac-queue.h (module 'wifi'): uint32_t ns3::WifiMacQueue::GetSize() [member function]
+    cls.add_method('GetSize', 
+                   'uint32_t', 
+                   [])
+    ## wifi-mac-queue.h (module 'wifi'): static ns3::TypeId ns3::WifiMacQueue::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## wifi-mac-queue.h (module 'wifi'): bool ns3::WifiMacQueue::IsEmpty() [member function]
+    cls.add_method('IsEmpty', 
+                   'bool', 
+                   [])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::Peek(ns3::WifiMacHeader * hdr) [member function]
+    cls.add_method('Peek', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::PeekByTidAndAddress(ns3::WifiMacHeader * hdr, uint8_t tid, ns3::WifiMacHeader::AddressType type, ns3::Mac48Address addr) [member function]
+    cls.add_method('PeekByTidAndAddress', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr'), param('uint8_t', 'tid'), param('ns3::WifiMacHeader::AddressType', 'type'), param('ns3::Mac48Address', 'addr')])
+    ## wifi-mac-queue.h (module 'wifi'): ns3::Ptr<ns3::Packet const> ns3::WifiMacQueue::PeekFirstAvailable(ns3::WifiMacHeader * hdr, ns3::Time & tStamp, ns3::QosBlockedDestinations const * blockedPackets) [member function]
+    cls.add_method('PeekFirstAvailable', 
+                   'ns3::Ptr< ns3::Packet const >', 
+                   [param('ns3::WifiMacHeader *', 'hdr'), param('ns3::Time &', 'tStamp'), param('ns3::QosBlockedDestinations const *', 'blockedPackets')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::PushFront(ns3::Ptr<ns3::Packet const> packet, ns3::WifiMacHeader const & hdr) [member function]
+    cls.add_method('PushFront', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const &', 'hdr')])
+    ## wifi-mac-queue.h (module 'wifi'): bool ns3::WifiMacQueue::Remove(ns3::Ptr<ns3::Packet const> packet) [member function]
+    cls.add_method('Remove', 
+                   'bool', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::SetMaxDelay(ns3::Time delay) [member function]
+    cls.add_method('SetMaxDelay', 
+                   'void', 
+                   [param('ns3::Time', 'delay')])
+    ## wifi-mac-queue.h (module 'wifi'): void ns3::WifiMacQueue::SetMaxSize(uint32_t maxSize) [member function]
+    cls.add_method('SetMaxSize', 
+                   'void', 
+                   [param('uint32_t', 'maxSize')])
+    return
+
 def register_Ns3WifiPhy_methods(root_module, cls):
     ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::WifiPhy(ns3::WifiPhy const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::WifiPhy const &', 'arg0')])
@@ -6536,12 +6626,12 @@
                    'bool', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyPromiscSniffRx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) [member function]
-    cls.add_method('NotifyPromiscSniffRx', 
+    ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyMonitorSniffRx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) [member function]
+    cls.add_method('NotifyMonitorSniffRx', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('double', 'signalDbm'), param('double', 'noiseDbm')])
-    ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyPromiscSniffTx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble) [member function]
-    cls.add_method('NotifyPromiscSniffTx', 
+    ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyMonitorSniffTx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble) [member function]
+    cls.add_method('NotifyMonitorSniffTx', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble')])
     ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyRxBegin(ns3::Ptr<ns3::Packet const> packet) [member function]
@@ -8829,6 +8919,10 @@
     cls.add_method('SetPifs', 
                    'void', 
                    [param('ns3::Time', 'pifs')])
+    ## mac-low.h (module 'wifi'): void ns3::MacLow::SetPromisc() [member function]
+    cls.add_method('SetPromisc', 
+                   'void', 
+                   [])
     ## mac-low.h (module 'wifi'): void ns3::MacLow::SetRxCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::WifiMacHeader const*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('SetRxCallback', 
                    'void', 
@@ -9669,6 +9763,11 @@
                    'ns3::Mac48Address', 
                    [], 
                    is_const=True, is_virtual=True)
+    ## regular-wifi-mac.h (module 'wifi'): void ns3::RegularWifiMac::SetPromisc() [member function]
+    cls.add_method('SetPromisc', 
+                   'void', 
+                   [], 
+                   is_virtual=True)
     ## regular-wifi-mac.h (module 'wifi'): void ns3::RegularWifiMac::Enqueue(ns3::Ptr<ns3::Packet const> packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function]
     cls.add_method('Enqueue', 
                    'void', 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/wifi/examples/wifi-phy-test.cc	Tue Jul 05 09:06:45 2011 -0700
@@ -0,0 +1,455 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2005,2006 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#include "ns3/wifi-net-device.h"
+#include "ns3/yans-wifi-channel.h"
+#include "ns3/yans-wifi-phy.h"
+#include "ns3/propagation-loss-model.h"
+#include "ns3/propagation-delay-model.h"
+#include "ns3/error-rate-model.h"
+#include "ns3/yans-error-rate-model.h"
+#include "ns3/ptr.h"
+#include "ns3/mobility-model.h"
+#include "ns3/constant-position-mobility-model.h"
+#include "ns3/vector.h"
+#include "ns3/packet.h"
+#include "ns3/simulator.h"
+#include "ns3/nstime.h"
+#include "ns3/command-line.h"
+#include "ns3/flow-id-tag.h"
+
+using namespace ns3;
+
+class PsrExperiment
+{
+public:
+  struct Input
+  {
+    Input ();
+    double distance;
+    std::string txMode;
+    uint8_t txPowerLevel;
+    uint32_t packetSize;
+    uint32_t nPackets;
+  };
+  struct Output
+  {
+    uint32_t received;
+  };
+  PsrExperiment ();
+
+  struct PsrExperiment::Output Run (struct PsrExperiment::Input input);
+
+private:
+  void Send (void);
+  void Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble);
+  Ptr<WifiPhy> m_tx;
+  struct Input m_input;
+  struct Output m_output;
+};
+
+void
+PsrExperiment::Send (void)
+{
+  Ptr<Packet> p = Create<Packet> (m_input.packetSize);
+  WifiMode mode = WifiMode (m_input.txMode);
+  m_tx->SendPacket (p, mode, WIFI_PREAMBLE_SHORT, m_input.txPowerLevel);
+}
+
+void
+PsrExperiment::Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble)
+{
+  m_output.received++;
+}
+
+PsrExperiment::PsrExperiment ()
+{
+}
+PsrExperiment::Input::Input ()
+  : distance (5.0),
+    txMode ("OfdmRate6Mbps"),
+    txPowerLevel (0),
+    packetSize (2304),
+    nPackets (400)
+{
+}
+
+struct PsrExperiment::Output
+PsrExperiment::Run (struct PsrExperiment::Input input)
+{
+  m_output.received = 0;
+  m_input = input;
+
+  Ptr<MobilityModel> posTx = CreateObject<ConstantPositionMobilityModel> ();
+  posTx->SetPosition (Vector (0.0, 0.0, 0.0));
+  Ptr<MobilityModel> posRx = CreateObject<ConstantPositionMobilityModel> ();
+  posRx->SetPosition (Vector (m_input.distance, 0.0, 0.0));
+
+  Ptr<YansWifiChannel> channel = CreateObject<YansWifiChannel> ();
+  channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
+  Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
+  channel->SetPropagationLossModel (log);
+
+  Ptr<YansWifiPhy> tx = CreateObject<YansWifiPhy> ();
+  Ptr<YansWifiPhy> rx = CreateObject<YansWifiPhy> ();
+  Ptr<ErrorRateModel> error = CreateObject<YansErrorRateModel> ();
+  tx->SetErrorRateModel (error);
+  rx->SetErrorRateModel (error);
+  tx->SetChannel (channel);
+  rx->SetChannel (channel);
+  tx->SetMobility (posTx);
+  rx->SetMobility (posRx);
+
+  rx->SetReceiveOkCallback (MakeCallback (&PsrExperiment::Receive, this));
+
+  for (uint32_t i = 0; i < m_input.nPackets; ++i)
+    {
+      Simulator::Schedule (Seconds (i), &PsrExperiment::Send, this);
+    }
+  m_tx = tx;
+  Simulator::Run ();
+  return m_output;
+}
+
+
+class CollisionExperiment
+{
+public:
+  struct Input
+  {
+    Input ();
+    Time interval;
+    double xA;
+    double xB;
+    std::string txModeA;
+    std::string txModeB;
+    uint8_t txPowerLevelA;
+    uint8_t txPowerLevelB;
+    uint32_t packetSizeA;
+    uint32_t packetSizeB;
+    uint32_t nPackets;
+  };
+  struct Output
+  {
+    uint32_t receivedA;
+    uint32_t receivedB;
+  };
+  CollisionExperiment ();
+
+  struct CollisionExperiment::Output Run (struct CollisionExperiment::Input input);
+private:
+  void SendA (void) const;
+  void SendB (void) const;
+  void Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble);
+  Ptr<WifiPhy> m_txA;
+  Ptr<WifiPhy> m_txB;
+  uint32_t m_flowIdA;
+  uint32_t m_flowIdB;
+  struct Input m_input;
+  struct Output m_output;
+};
+
+void
+CollisionExperiment::SendA (void) const
+{
+  Ptr<Packet> p = Create<Packet> (m_input.packetSizeA);
+  p->AddByteTag (FlowIdTag (m_flowIdA));
+  m_txA->SendPacket (p, WifiMode (m_input.txModeA),
+                     WIFI_PREAMBLE_SHORT, m_input.txPowerLevelA);
+}
+
+void
+CollisionExperiment::SendB (void) const
+{
+  Ptr<Packet> p = Create<Packet> (m_input.packetSizeB);
+  p->AddByteTag (FlowIdTag (m_flowIdB));
+  m_txB->SendPacket (p, WifiMode (m_input.txModeB),
+                     WIFI_PREAMBLE_SHORT, m_input.txPowerLevelB);
+}
+
+void
+CollisionExperiment::Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble)
+{
+  FlowIdTag tag;
+  p->FindFirstMatchingByteTag (tag);
+  if (tag.GetFlowId () == m_flowIdA)
+    {
+      m_output.receivedA++;
+    }
+  else if (tag.GetFlowId () == m_flowIdB)
+    {
+      m_output.receivedB++;
+    }
+}
+
+CollisionExperiment::CollisionExperiment ()
+{
+}
+CollisionExperiment::Input::Input ()
+  : interval (MicroSeconds (0)),
+    xA (-5),
+    xB (5),
+    txModeA ("OfdmRate6Mbps"),
+    txModeB ("OfdmRate6Mbps"),
+    txPowerLevelA (0),
+    txPowerLevelB (0),
+    packetSizeA (2304),
+    packetSizeB (2304),
+    nPackets (400)
+{
+}
+
+struct CollisionExperiment::Output
+CollisionExperiment::Run (struct CollisionExperiment::Input input)
+{
+  m_output.receivedA = 0;
+  m_output.receivedB = 0;
+  m_input = input;
+
+  m_flowIdA = FlowIdTag::AllocateFlowId ();
+  m_flowIdB = FlowIdTag::AllocateFlowId ();
+
+  Ptr<YansWifiChannel> channel = CreateObject<YansWifiChannel> ();
+  channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
+  Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
+  channel->SetPropagationLossModel (log);
+
+  Ptr<MobilityModel> posTxA = CreateObject<ConstantPositionMobilityModel> ();
+  posTxA->SetPosition (Vector (input.xA, 0.0, 0.0));
+  Ptr<MobilityModel> posTxB = CreateObject<ConstantPositionMobilityModel> ();
+  posTxB->SetPosition (Vector (input.xB, 0.0, 0.0));
+  Ptr<MobilityModel> posRx = CreateObject<ConstantPositionMobilityModel> ();
+  posRx->SetPosition (Vector (0, 0.0, 0.0));
+
+  Ptr<YansWifiPhy> txA = CreateObject<YansWifiPhy> ();
+  Ptr<YansWifiPhy> txB = CreateObject<YansWifiPhy> ();
+  Ptr<YansWifiPhy> rx = CreateObject<YansWifiPhy> ();
+
+  Ptr<ErrorRateModel> error = CreateObject<YansErrorRateModel> ();
+  txA->SetErrorRateModel (error);
+  txB->SetErrorRateModel (error);
+  rx->SetErrorRateModel (error);
+  txA->SetChannel (channel);
+  txB->SetChannel (channel);
+  rx->SetChannel (channel);
+  txA->SetMobility (posTxA);
+  txB->SetMobility (posTxB);
+  rx->SetMobility (posRx);
+
+
+  rx->SetReceiveOkCallback (MakeCallback (&CollisionExperiment::Receive, this));
+
+  for (uint32_t i = 0; i < m_input.nPackets; ++i)
+    {
+      Simulator::Schedule (Seconds (i), &CollisionExperiment::SendA, this);
+    }
+  for (uint32_t i = 0; i < m_input.nPackets; ++i)
+    {
+      Simulator::Schedule (Seconds (i) + m_input.interval, &CollisionExperiment::SendB, this);
+    }
+  m_txA = txA;
+  m_txB = txB;
+  Simulator::Run ();
+  return m_output;
+}
+
+
+static void PrintPsr (int argc, char *argv[])
+{
+  PsrExperiment experiment;
+  struct PsrExperiment::Input input;
+
+  CommandLine cmd;
+  cmd.AddValue ("Distance", "The distance between two phys", input.distance);
+  cmd.AddValue ("PacketSize", "The size of each packet sent", input.packetSize);
+  cmd.AddValue ("TxMode", "The mode to use to send each packet", input.txMode);
+  cmd.AddValue ("NPackets", "The number of packets to send", input.nPackets);
+  cmd.AddValue ("TxPowerLevel", "The power level index to use to send each packet", input.txPowerLevel);
+  cmd.Parse (argc, argv);
+
+  struct PsrExperiment::Output output;
+  output = experiment.Run (input);
+
+  double psr = output.received;
+  psr /= input.nPackets;
+
+  std::cout << psr << std::endl;
+}
+
+double CalcPsr (struct PsrExperiment::Output output, struct PsrExperiment::Input input)
+{
+  double psr = output.received;
+  psr /= input.nPackets;
+  return psr;
+}
+
+static void PrintPsrVsDistance (int argc, char *argv[])
+{
+  struct PsrExperiment::Input input;
+  CommandLine cmd;
+  cmd.AddValue ("TxPowerLevel", "The power level index to use to send each packet", input.txPowerLevel);
+  cmd.AddValue ("TxMode", "The mode to use to send each packet", input.txMode);
+  cmd.AddValue ("NPackets", "The number of packets to send", input.nPackets);
+  cmd.AddValue ("PacketSize", "The size of each packet sent", input.packetSize);
+  cmd.Parse (argc, argv);
+  for (input.distance = 1.0; input.distance < 165; input.distance += 2.0)
+    {
+      std::cout << input.distance;
+      PsrExperiment experiment;
+      struct PsrExperiment::Output output;
+
+      input.txMode = "OfdmRate6Mbps";
+      output = experiment.Run (input);
+      std::cout << " " << CalcPsr (output, input);
+
+      input.txMode = "OfdmRate9Mbps";
+      output = experiment.Run (input);
+      std::cout << " " << CalcPsr (output, input);
+
+      input.txMode = "OfdmRate12Mbps";
+      output = experiment.Run (input);
+      std::cout << " " << CalcPsr (output, input);
+
+      input.txMode = "OfdmRate18Mbps";
+      output = experiment.Run (input);
+      std::cout << " " << CalcPsr (output, input);
+
+      input.txMode = "OfdmRate24Mbps";
+      output = experiment.Run (input);
+      std::cout << " " << CalcPsr (output, input);
+
+      input.txMode = "OfdmRate36Mbps";
+      output = experiment.Run (input);
+      std::cout << " " << CalcPsr (output, input);
+
+      input.txMode = "OfdmRate48Mbps";
+      output = experiment.Run (input);
+      std::cout << " " << CalcPsr (output, input);
+
+      input.txMode = "OfdmRate54Mbps";
+      output = experiment.Run (input);
+      std::cout << " " << CalcPsr (output, input);
+
+      std::cout << std::endl;
+    }
+}
+
+static void PrintSizeVsRange (int argc, char *argv[])
+{
+  double targetPsr = 0.05;
+  struct PsrExperiment::Input input;
+  CommandLine cmd;
+  cmd.AddValue ("TxPowerLevel", "The power level index to use to send each packet", input.txPowerLevel);
+  cmd.AddValue ("TxMode", "The mode to use to send each packet", input.txMode);
+  cmd.AddValue ("NPackets", "The number of packets to send", input.nPackets);
+  cmd.AddValue ("TargetPsr", "The psr needed to assume that we are within range", targetPsr);
+  cmd.Parse (argc, argv);
+  for (input.packetSize = 10; input.packetSize < 3000; input.packetSize += 40)
+    {
+      double precision = 0.1;
+      double low = 1.0;
+      double high = 200.0;
+      while (high - low > precision)
+        {
+          double middle = low + (high - low) / 2;
+          struct PsrExperiment::Output output;
+          PsrExperiment experiment;
+          input.distance = middle;
+          output = experiment.Run (input);
+          double psr = CalcPsr (output, input);
+          if (psr >= targetPsr)
+            {
+              low = middle;
+            }
+          else
+            {
+              high = middle;
+            }
+        }
+      std::cout << input.packetSize << " " << input.distance << std::endl;
+    }
+}
+
+static void PrintPsrVsCollisionInterval (int argc, char *argv[])
+{
+  CollisionExperiment::Input input;
+  input.nPackets = 100;
+  CommandLine cmd;
+  cmd.AddValue ("NPackets", "The number of packets to send for each transmitter", input.nPackets);
+  cmd.AddValue ("xA", "the position of transmitter A", input.xA);
+  cmd.AddValue ("xB", "the position of transmitter B", input.xB);
+  for (uint32_t i = 0; i < 100; i += 1)
+    {
+      CollisionExperiment experiment;
+      CollisionExperiment::Output output;
+      input.interval = MicroSeconds (i);
+      output = experiment.Run (input);
+      double perA = (output.receivedA + 0.0) / (input.nPackets + 0.0);
+      double perB = (output.receivedB + 0.0) / (input.nPackets + 0.0);
+      std::cout << i << " " << perA << " " << perB << std::endl;
+    }
+  for (uint32_t i = 100; i < 4000; i += 50)
+    {
+      CollisionExperiment experiment;
+      CollisionExperiment::Output output;
+      input.interval = MicroSeconds (i);
+      output = experiment.Run (input);
+      double perA = (output.receivedA + 0.0) / (input.nPackets + 0.0);
+      double perB = (output.receivedB + 0.0) / (input.nPackets + 0.0);
+      std::cout << i << " " << perA << " " << perB << std::endl;
+    }
+}
+
+
+
+int main (int argc, char *argv[])
+{
+  if (argc <= 1)
+    {
+      std::cout << "Available experiments: "
+                << "Psr "
+                << "SizeVsRange "
+                << "PsrVsDistance "
+                << "PsrVsCollisionInterval "
+                << std::endl;
+      return -1;
+    }
+  std::string type = argv[1];
+  argc--;
+  argv[1] = argv[0];
+  argv++;
+  if (type == "Psr")
+    {
+      PrintPsr (argc, argv);
+    }
+  else if (type == "SizeVsRange")
+    {
+      PrintSizeVsRange (argc, argv);
+    }
+  else if (type == "PsrVsDistance")
+    {
+      PrintPsrVsDistance (argc, argv);
+    }
+  else if (type == "PsrVsCollisionInterval")
+    {
+      PrintPsrVsCollisionInterval (argc, argv);
+    }
+
+  return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/wifi/examples/wscript	Tue Jul 05 09:06:45 2011 -0700
@@ -0,0 +1,9 @@
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+def build(bld):
+    if not bld.env['ENABLE_EXAMPLES']:
+        return;
+
+    obj = bld.create_ns3_program('wifi-phy-test',
+        ['core', 'mobility', 'network', 'wifi'])
+    obj.source = 'wifi-phy-test.cc'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/wifi/test/examples-to-run.py	Tue Jul 05 09:06:45 2011 -0700
@@ -0,0 +1,18 @@
+#! /usr/bin/env python
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# A list of C++ examples to run in order to ensure that they remain
+# buildable and runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run, do_valgrind_run).
+#
+# See test.py for more information.
+cpp_examples = []
+
+# A list of Python examples to run in order to ensure that they remain
+# runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run).
+#
+# See test.py for more information.
+python_examples = []
--- a/src/wifi/test/wifi-phy-test.cc	Tue Jul 05 13:32:33 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,455 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2005,2006 INRIA
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
- */
-#include "ns3/wifi-net-device.h"
-#include "ns3/yans-wifi-channel.h"
-#include "ns3/yans-wifi-phy.h"
-#include "ns3/propagation-loss-model.h"
-#include "ns3/propagation-delay-model.h"
-#include "ns3/error-rate-model.h"
-#include "ns3/yans-error-rate-model.h"
-#include "ns3/ptr.h"
-#include "ns3/mobility-model.h"
-#include "ns3/constant-position-mobility-model.h"
-#include "ns3/vector.h"
-#include "ns3/packet.h"
-#include "ns3/simulator.h"
-#include "ns3/nstime.h"
-#include "ns3/command-line.h"
-#include "ns3/flow-id-tag.h"
-
-using namespace ns3;
-
-class PsrExperiment
-{
-public:
-  struct Input
-  {
-    Input ();
-    double distance;
-    std::string txMode;
-    uint8_t txPowerLevel;
-    uint32_t packetSize;
-    uint32_t nPackets;
-  };
-  struct Output
-  {
-    uint32_t received;
-  };
-  PsrExperiment ();
-
-  struct PsrExperiment::Output Run (struct PsrExperiment::Input input);
-
-private:
-  void Send (void);
-  void Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble);
-  Ptr<WifiPhy> m_tx;
-  struct Input m_input;
-  struct Output m_output;
-};
-
-void
-PsrExperiment::Send (void)
-{
-  Ptr<Packet> p = Create<Packet> (m_input.packetSize);
-  WifiMode mode = WifiMode (m_input.txMode);
-  m_tx->SendPacket (p, mode, WIFI_PREAMBLE_SHORT, m_input.txPowerLevel);
-}
-
-void
-PsrExperiment::Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble)
-{
-  m_output.received++;
-}
-
-PsrExperiment::PsrExperiment ()
-{
-}
-PsrExperiment::Input::Input ()
-  : distance (5.0),
-    txMode ("OfdmRate6Mbps"),
-    txPowerLevel (0),
-    packetSize (2304),
-    nPackets (400)
-{
-}
-
-struct PsrExperiment::Output
-PsrExperiment::Run (struct PsrExperiment::Input input)
-{
-  m_output.received = 0;
-  m_input = input;
-
-  Ptr<MobilityModel> posTx = CreateObject<ConstantPositionMobilityModel> ();
-  posTx->SetPosition (Vector (0.0, 0.0, 0.0));
-  Ptr<MobilityModel> posRx = CreateObject<ConstantPositionMobilityModel> ();
-  posRx->SetPosition (Vector (m_input.distance, 0.0, 0.0));
-
-  Ptr<YansWifiChannel> channel = CreateObject<YansWifiChannel> ();
-  channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
-  Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
-  channel->SetPropagationLossModel (log);
-
-  Ptr<YansWifiPhy> tx = CreateObject<YansWifiPhy> ();
-  Ptr<YansWifiPhy> rx = CreateObject<YansWifiPhy> ();
-  Ptr<ErrorRateModel> error = CreateObject<YansErrorRateModel> ();
-  tx->SetErrorRateModel (error);
-  rx->SetErrorRateModel (error);
-  tx->SetChannel (channel);
-  rx->SetChannel (channel);
-  tx->SetMobility (posTx);
-  rx->SetMobility (posRx);
-
-  rx->SetReceiveOkCallback (MakeCallback (&PsrExperiment::Receive, this));
-
-  for (uint32_t i = 0; i < m_input.nPackets; ++i)
-    {
-      Simulator::Schedule (Seconds (i), &PsrExperiment::Send, this);
-    }
-  m_tx = tx;
-  Simulator::Run ();
-  return m_output;
-}
-
-
-class CollisionExperiment
-{
-public:
-  struct Input
-  {
-    Input ();
-    Time interval;
-    double xA;
-    double xB;
-    std::string txModeA;
-    std::string txModeB;
-    uint8_t txPowerLevelA;
-    uint8_t txPowerLevelB;
-    uint32_t packetSizeA;
-    uint32_t packetSizeB;
-    uint32_t nPackets;
-  };
-  struct Output
-  {
-    uint32_t receivedA;
-    uint32_t receivedB;
-  };
-  CollisionExperiment ();
-
-  struct CollisionExperiment::Output Run (struct CollisionExperiment::Input input);
-private:
-  void SendA (void) const;
-  void SendB (void) const;
-  void Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble);
-  Ptr<WifiPhy> m_txA;
-  Ptr<WifiPhy> m_txB;
-  uint32_t m_flowIdA;
-  uint32_t m_flowIdB;
-  struct Input m_input;
-  struct Output m_output;
-};
-
-void
-CollisionExperiment::SendA (void) const
-{
-  Ptr<Packet> p = Create<Packet> (m_input.packetSizeA);
-  p->AddByteTag (FlowIdTag (m_flowIdA));
-  m_txA->SendPacket (p, WifiMode (m_input.txModeA),
-                     WIFI_PREAMBLE_SHORT, m_input.txPowerLevelA);
-}
-
-void
-CollisionExperiment::SendB (void) const
-{
-  Ptr<Packet> p = Create<Packet> (m_input.packetSizeB);
-  p->AddByteTag (FlowIdTag (m_flowIdB));
-  m_txB->SendPacket (p, WifiMode (m_input.txModeB),
-                     WIFI_PREAMBLE_SHORT, m_input.txPowerLevelB);
-}
-
-void
-CollisionExperiment::Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble)
-{
-  FlowIdTag tag;
-  p->FindFirstMatchingByteTag (tag);
-  if (tag.GetFlowId () == m_flowIdA)
-    {
-      m_output.receivedA++;
-    }
-  else if (tag.GetFlowId () == m_flowIdB)
-    {
-      m_output.receivedB++;
-    }
-}
-
-CollisionExperiment::CollisionExperiment ()
-{
-}
-CollisionExperiment::Input::Input ()
-  : interval (MicroSeconds (0)),
-    xA (-5),
-    xB (5),
-    txModeA ("OfdmRate6Mbps"),
-    txModeB ("OfdmRate6Mbps"),
-    txPowerLevelA (0),
-    txPowerLevelB (0),
-    packetSizeA (2304),
-    packetSizeB (2304),
-    nPackets (400)
-{
-}
-
-struct CollisionExperiment::Output
-CollisionExperiment::Run (struct CollisionExperiment::Input input)
-{
-  m_output.receivedA = 0;
-  m_output.receivedB = 0;
-  m_input = input;
-
-  m_flowIdA = FlowIdTag::AllocateFlowId ();
-  m_flowIdB = FlowIdTag::AllocateFlowId ();
-
-  Ptr<YansWifiChannel> channel = CreateObject<YansWifiChannel> ();
-  channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
-  Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
-  channel->SetPropagationLossModel (log);
-
-  Ptr<MobilityModel> posTxA = CreateObject<ConstantPositionMobilityModel> ();
-  posTxA->SetPosition (Vector (input.xA, 0.0, 0.0));
-  Ptr<MobilityModel> posTxB = CreateObject<ConstantPositionMobilityModel> ();
-  posTxB->SetPosition (Vector (input.xB, 0.0, 0.0));
-  Ptr<MobilityModel> posRx = CreateObject<ConstantPositionMobilityModel> ();
-  posRx->SetPosition (Vector (0, 0.0, 0.0));
-
-  Ptr<YansWifiPhy> txA = CreateObject<YansWifiPhy> ();
-  Ptr<YansWifiPhy> txB = CreateObject<YansWifiPhy> ();
-  Ptr<YansWifiPhy> rx = CreateObject<YansWifiPhy> ();
-
-  Ptr<ErrorRateModel> error = CreateObject<YansErrorRateModel> ();
-  txA->SetErrorRateModel (error);
-  txB->SetErrorRateModel (error);
-  rx->SetErrorRateModel (error);
-  txA->SetChannel (channel);
-  txB->SetChannel (channel);
-  rx->SetChannel (channel);
-  txA->SetMobility (posTxA);
-  txB->SetMobility (posTxB);
-  rx->SetMobility (posRx);
-
-
-  rx->SetReceiveOkCallback (MakeCallback (&CollisionExperiment::Receive, this));
-
-  for (uint32_t i = 0; i < m_input.nPackets; ++i)
-    {
-      Simulator::Schedule (Seconds (i), &CollisionExperiment::SendA, this);
-    }
-  for (uint32_t i = 0; i < m_input.nPackets; ++i)
-    {
-      Simulator::Schedule (Seconds (i) + m_input.interval, &CollisionExperiment::SendB, this);
-    }
-  m_txA = txA;
-  m_txB = txB;
-  Simulator::Run ();
-  return m_output;
-}
-
-
-static void PrintPsr (int argc, char *argv[])
-{
-  PsrExperiment experiment;
-  struct PsrExperiment::Input input;
-
-  CommandLine cmd;
-  cmd.AddValue ("Distance", "The distance between two phys", input.distance);
-  cmd.AddValue ("PacketSize", "The size of each packet sent", input.packetSize);
-  cmd.AddValue ("TxMode", "The mode to use to send each packet", input.txMode);
-  cmd.AddValue ("NPackets", "The number of packets to send", input.nPackets);
-  cmd.AddValue ("TxPowerLevel", "The power level index to use to send each packet", input.txPowerLevel);
-  cmd.Parse (argc, argv);
-
-  struct PsrExperiment::Output output;
-  output = experiment.Run (input);
-
-  double psr = output.received;
-  psr /= input.nPackets;
-
-  std::cout << psr << std::endl;
-}
-
-double CalcPsr (struct PsrExperiment::Output output, struct PsrExperiment::Input input)
-{
-  double psr = output.received;
-  psr /= input.nPackets;
-  return psr;
-}
-
-static void PrintPsrVsDistance (int argc, char *argv[])
-{
-  struct PsrExperiment::Input input;
-  CommandLine cmd;
-  cmd.AddValue ("TxPowerLevel", "The power level index to use to send each packet", input.txPowerLevel);
-  cmd.AddValue ("TxMode", "The mode to use to send each packet", input.txMode);
-  cmd.AddValue ("NPackets", "The number of packets to send", input.nPackets);
-  cmd.AddValue ("PacketSize", "The size of each packet sent", input.packetSize);
-  cmd.Parse (argc, argv);
-  for (input.distance = 1.0; input.distance < 165; input.distance += 2.0)
-    {
-      std::cout << input.distance;
-      PsrExperiment experiment;
-      struct PsrExperiment::Output output;
-
-      input.txMode = "OfdmRate6Mbps";
-      output = experiment.Run (input);
-      std::cout << " " << CalcPsr (output, input);
-
-      input.txMode = "OfdmRate9Mbps";
-      output = experiment.Run (input);
-      std::cout << " " << CalcPsr (output, input);
-
-      input.txMode = "OfdmRate12Mbps";
-      output = experiment.Run (input);
-      std::cout << " " << CalcPsr (output, input);
-
-      input.txMode = "OfdmRate18Mbps";
-      output = experiment.Run (input);
-      std::cout << " " << CalcPsr (output, input);
-
-      input.txMode = "OfdmRate24Mbps";
-      output = experiment.Run (input);
-      std::cout << " " << CalcPsr (output, input);
-
-      input.txMode = "OfdmRate36Mbps";
-      output = experiment.Run (input);
-      std::cout << " " << CalcPsr (output, input);
-
-      input.txMode = "OfdmRate48Mbps";
-      output = experiment.Run (input);
-      std::cout << " " << CalcPsr (output, input);
-
-      input.txMode = "OfdmRate54Mbps";
-      output = experiment.Run (input);
-      std::cout << " " << CalcPsr (output, input);
-
-      std::cout << std::endl;
-    }
-}
-
-static void PrintSizeVsRange (int argc, char *argv[])
-{
-  double targetPsr = 0.05;
-  struct PsrExperiment::Input input;
-  CommandLine cmd;
-  cmd.AddValue ("TxPowerLevel", "The power level index to use to send each packet", input.txPowerLevel);
-  cmd.AddValue ("TxMode", "The mode to use to send each packet", input.txMode);
-  cmd.AddValue ("NPackets", "The number of packets to send", input.nPackets);
-  cmd.AddValue ("TargetPsr", "The psr needed to assume that we are within range", targetPsr);
-  cmd.Parse (argc, argv);
-  for (input.packetSize = 10; input.packetSize < 3000; input.packetSize += 40)
-    {
-      double precision = 0.1;
-      double low = 1.0;
-      double high = 200.0;
-      while (high - low > precision)
-        {
-          double middle = low + (high - low) / 2;
-          struct PsrExperiment::Output output;
-          PsrExperiment experiment;
-          input.distance = middle;
-          output = experiment.Run (input);
-          double psr = CalcPsr (output, input);
-          if (psr >= targetPsr)
-            {
-              low = middle;
-            }
-          else
-            {
-              high = middle;
-            }
-        }
-      std::cout << input.packetSize << " " << input.distance << std::endl;
-    }
-}
-
-static void PrintPsrVsCollisionInterval (int argc, char *argv[])
-{
-  CollisionExperiment::Input input;
-  input.nPackets = 100;
-  CommandLine cmd;
-  cmd.AddValue ("NPackets", "The number of packets to send for each transmitter", input.nPackets);
-  cmd.AddValue ("xA", "the position of transmitter A", input.xA);
-  cmd.AddValue ("xB", "the position of transmitter B", input.xB);
-  for (uint32_t i = 0; i < 100; i += 1)
-    {
-      CollisionExperiment experiment;
-      CollisionExperiment::Output output;
-      input.interval = MicroSeconds (i);
-      output = experiment.Run (input);
-      double perA = (output.receivedA + 0.0) / (input.nPackets + 0.0);
-      double perB = (output.receivedB + 0.0) / (input.nPackets + 0.0);
-      std::cout << i << " " << perA << " " << perB << std::endl;
-    }
-  for (uint32_t i = 100; i < 4000; i += 50)
-    {
-      CollisionExperiment experiment;
-      CollisionExperiment::Output output;
-      input.interval = MicroSeconds (i);
-      output = experiment.Run (input);
-      double perA = (output.receivedA + 0.0) / (input.nPackets + 0.0);
-      double perB = (output.receivedB + 0.0) / (input.nPackets + 0.0);
-      std::cout << i << " " << perA << " " << perB << std::endl;
-    }
-}
-
-
-
-int main (int argc, char *argv[])
-{
-  if (argc <= 1)
-    {
-      std::cout << "Available experiments: "
-                << "Psr "
-                << "SizeVsRange "
-                << "PsrVsDistance "
-                << "PsrVsCollisionInterval "
-                << std::endl;
-      return -1;
-    }
-  std::string type = argv[1];
-  argc--;
-  argv[1] = argv[0];
-  argv++;
-  if (type == "Psr")
-    {
-      PrintPsr (argc, argv);
-    }
-  else if (type == "SizeVsRange")
-    {
-      PrintSizeVsRange (argc, argv);
-    }
-  else if (type == "PsrVsDistance")
-    {
-      PrintPsrVsDistance (argc, argv);
-    }
-  else if (type == "PsrVsCollisionInterval")
-    {
-      PrintPsrVsCollisionInterval (argc, argv);
-    }
-
-  return 0;
-}
--- a/src/wifi/wscript	Tue Jul 05 13:32:33 2011 +0100
+++ b/src/wifi/wscript	Tue Jul 05 09:06:45 2011 -0700
@@ -143,9 +143,8 @@
         obj.uselib      = 'GSL GSLCBLAS M'
         obj_test.uselib = 'GSL GSLCBLAS M'
 
-    obj = bld.create_ns3_program('wifi-phy-test',
-        ['core', 'mobility', 'network', 'wifi'])
-    obj.source = 'test/wifi-phy-test.cc'
+    if (bld.env['ENABLE_EXAMPLES']):
+        bld.add_subdirs('examples')
 
     bld.ns3_python_bindings()