Merge with code.nsnam.org
authorKirill Andreev <andreev@iitp.ru>
Wed, 22 Jul 2009 16:57:12 +0400
changeset 5133 1e44b8fa74cd
parent 5132 aee541a30256 (current diff)
parent 4692 f4cd995f1718 (diff)
child 5134 26472734b69f
Merge with code.nsnam.org
src/devices/wifi/dcf-manager.cc
src/devices/wifi/mgt-headers.cc
src/devices/wifi/mgt-headers.h
src/devices/wifi/wifi-mac-header.cc
src/devices/wifi/wifi-mac-header.h
src/devices/wifi/wifi-phy.h
src/devices/wifi/wifi-remote-station-manager.cc
src/devices/wifi/wifi-remote-station-manager.h
src/devices/wifi/wscript
src/devices/wifi/yans-wifi-channel.cc
src/devices/wifi/yans-wifi-phy.cc
src/devices/wifi/yans-wifi-phy.h
--- a/bindings/python/ns3_module_core.py	Wed Jul 22 16:43:43 2009 +0400
+++ b/bindings/python/ns3_module_core.py	Wed Jul 22 16:57:12 2009 +0400
@@ -442,6 +442,16 @@
                    '__gnu_cxx::__normal_iterator< ns3::GlobalValue * const *, std::vector< ns3::GlobalValue * > >', 
                    [], 
                    is_static=True)
+    ## global-value.h: static bool ns3::GlobalValue::GetValueByNameFailSafe(std::string name, ns3::AttributeValue & value) [member function]
+    cls.add_method('GetValueByNameFailSafe', 
+                   'bool', 
+                   [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], 
+                   is_static=True)
+    ## global-value.h: static void ns3::GlobalValue::GetValueByName(std::string name, ns3::AttributeValue & value) [member function]
+    cls.add_method('GetValueByName', 
+                   'void', 
+                   [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], 
+                   is_static=True)
     return
 
 def register_Ns3IntToType__0_methods(root_module, cls):
--- a/bindings/python/ns3_module_csma.py	Wed Jul 22 16:43:43 2009 +0400
+++ b/bindings/python/ns3_module_csma.py	Wed Jul 22 16:57:12 2009 +0400
@@ -205,13 +205,11 @@
     ## csma-channel.h: ns3::DataRate ns3::CsmaChannel::GetDataRate() [member function]
     cls.add_method('GetDataRate', 
                    'ns3::DataRate', 
-                   [], 
-                   is_virtual=True)
+                   [])
     ## csma-channel.h: ns3::Time ns3::CsmaChannel::GetDelay() [member function]
     cls.add_method('GetDelay', 
                    'ns3::Time', 
-                   [], 
-                   is_virtual=True)
+                   [])
     return
 
 def register_Ns3CsmaNetDevice_methods(root_module, cls):
--- a/bindings/python/ns3_module_global_routing.py	Wed Jul 22 16:43:43 2009 +0400
+++ b/bindings/python/ns3_module_global_routing.py	Wed Jul 22 16:57:12 2009 +0400
@@ -83,17 +83,32 @@
     cls.add_method('PopulateRoutingTables', 
                    'void', 
                    [], 
-                   is_static=True)
+                   is_static=True, deprecated=True)
     ## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function]
     cls.add_method('RecomputeRoutingTables', 
                    'void', 
                    [], 
-                   is_static=True)
+                   is_static=True, deprecated=True)
     ## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function]
     cls.add_method('AllocateRouterId', 
                    'uint32_t', 
                    [], 
                    is_static=True)
+    ## global-route-manager.h: static void ns3::GlobalRouteManager::DeleteGlobalRoutes() [member function]
+    cls.add_method('DeleteGlobalRoutes', 
+                   'void', 
+                   [], 
+                   is_static=True)
+    ## global-route-manager.h: static void ns3::GlobalRouteManager::BuildGlobalRoutingDatabase() [member function]
+    cls.add_method('BuildGlobalRoutingDatabase', 
+                   'void', 
+                   [], 
+                   is_static=True)
+    ## global-route-manager.h: static void ns3::GlobalRouteManager::InitializeRoutes() [member function]
+    cls.add_method('InitializeRoutes', 
+                   'void', 
+                   [], 
+                   is_static=True)
     return
 
 def register_Ns3GlobalRoutingLSA_methods(root_module, cls):
@@ -160,6 +175,11 @@
                    'ns3::Ipv4Mask', 
                    [], 
                    is_const=True)
+    ## global-router-interface.h: ns3::Ptr<ns3::Node> ns3::GlobalRoutingLSA::GetNode() const [member function]
+    cls.add_method('GetNode', 
+                   'ns3::Ptr< ns3::Node >', 
+                   [], 
+                   is_const=True)
     ## global-router-interface.h: ns3::GlobalRoutingLSA::SPFStatus ns3::GlobalRoutingLSA::GetStatus() const [member function]
     cls.add_method('GetStatus', 
                    'ns3::GlobalRoutingLSA::SPFStatus', 
@@ -191,6 +211,10 @@
     cls.add_method('SetNetworkLSANetworkMask', 
                    'void', 
                    [param('ns3::Ipv4Mask', 'mask')])
+    ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetNode(ns3::Ptr<ns3::Node> node) [member function]
+    cls.add_method('SetNode', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Node >', 'node')])
     ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetStatus(ns3::GlobalRoutingLSA::SPFStatus status) [member function]
     cls.add_method('SetStatus', 
                    'void', 
--- a/bindings/python/ns3_module_wifi.py	Wed Jul 22 16:43:43 2009 +0400
+++ b/bindings/python/ns3_module_wifi.py	Wed Jul 22 16:57:12 2009 +0400
@@ -8,7 +8,7 @@
     ## wifi-preamble.h: ns3::WifiPreamble [enumeration]
     module.add_enum('WifiPreamble', ['WIFI_PREAMBLE_LONG', 'WIFI_PREAMBLE_SHORT'])
     ## wifi-phy-standard.h: ns3::WifiPhyStandard [enumeration]
-    module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_holland'])
+    module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_80211_10Mhz', 'WIFI_PHY_STANDARD_80211_5Mhz', 'WIFI_PHY_STANDARD_holland'])
     ## qos-utils.h: ns3::AccessClass [enumeration]
     module.add_enum('AccessClass', ['AC_VO', 'AC_VI', 'AC_BE', 'AC_BK', 'AC_UNDEF'])
     ## edca-txop-n.h: ns3::TypeOfStation [enumeration]
@@ -264,19 +264,11 @@
     cls.add_method('CalculateSnrPer', 
                    'ns3::InterferenceHelper::SnrPer', 
                    [param('ns3::Ptr< ns3::InterferenceHelper::Event >', 'event')])
-    ## interference-helper.h: ns3::Time ns3::InterferenceHelper::CalculateTxDuration(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) const [member function]
+    ## interference-helper.h: static ns3::Time ns3::InterferenceHelper::CalculateTxDuration(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function]
     cls.add_method('CalculateTxDuration', 
                    'ns3::Time', 
                    [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], 
-                   is_const=True)
-    ## interference-helper.h: void ns3::InterferenceHelper::Configure80211aParameters() [member function]
-    cls.add_method('Configure80211aParameters', 
-                   'void', 
-                   [])
-    ## interference-helper.h: void ns3::InterferenceHelper::Configure80211bParameters() [member function]
-    cls.add_method('Configure80211bParameters', 
-                   'void', 
-                   [])
+                   is_static=True)
     ## interference-helper.h: ns3::Time ns3::InterferenceHelper::GetEnergyDuration(double energyW) [member function]
     cls.add_method('GetEnergyDuration', 
                    'ns3::Time', 
@@ -291,6 +283,26 @@
                    'double', 
                    [], 
                    is_const=True)
+    ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPayloadDurationMicroSeconds(uint32_t size, ns3::WifiMode payloadMode) [member function]
+    cls.add_method('GetPayloadDurationMicroSeconds', 
+                   'uint32_t', 
+                   [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode')], 
+                   is_static=True)
+    ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPlcpHeaderDurationMicroSeconds(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function]
+    cls.add_method('GetPlcpHeaderDurationMicroSeconds', 
+                   'uint32_t', 
+                   [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], 
+                   is_static=True)
+    ## interference-helper.h: static ns3::WifiMode ns3::InterferenceHelper::GetPlcpHeaderMode(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function]
+    cls.add_method('GetPlcpHeaderMode', 
+                   'ns3::WifiMode', 
+                   [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], 
+                   is_static=True)
+    ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPlcpPreambleDurationMicroSeconds(ns3::WifiMode mode, ns3::WifiPreamble preamble) [member function]
+    cls.add_method('GetPlcpPreambleDurationMicroSeconds', 
+                   'uint32_t', 
+                   [param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble')], 
+                   is_static=True)
     ## interference-helper.h: void ns3::InterferenceHelper::SetErrorRateModel(ns3::Ptr<ns3::ErrorRateModel> rate) [member function]
     cls.add_method('SetErrorRateModel', 
                    'void', 
@@ -457,6 +469,11 @@
                    'uint32_t', 
                    [], 
                    is_const=True)
+    ## wifi-mode.h: ns3::WifiPhyStandard ns3::WifiMode::GetStandard() const [member function]
+    cls.add_method('GetStandard', 
+                   'ns3::WifiPhyStandard', 
+                   [], 
+                   is_const=True)
     ## wifi-mode.h: uint32_t ns3::WifiMode::GetUid() const [member function]
     cls.add_method('GetUid', 
                    'uint32_t', 
@@ -487,25 +504,25 @@
 def register_Ns3WifiModeFactory_methods(root_module, cls):
     ## wifi-mode.h: ns3::WifiModeFactory::WifiModeFactory(ns3::WifiModeFactory const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::WifiModeFactory const &', 'arg0')])
-    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateBpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function]
+    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateBpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function]
     cls.add_method('CreateBpsk', 
                    'ns3::WifiMode', 
-                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], 
+                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], 
                    is_static=True)
-    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateQam(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, uint8_t constellationSize) [member function]
+    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateQam(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, uint8_t constellationSize, ns3::WifiPhyStandard standard) [member function]
     cls.add_method('CreateQam', 
                    'ns3::WifiMode', 
-                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('uint8_t', 'constellationSize')], 
+                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('uint8_t', 'constellationSize'), param('ns3::WifiPhyStandard', 'standard')], 
                    is_static=True)
-    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDbpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function]
+    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDbpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function]
     cls.add_method('CreateDbpsk', 
                    'ns3::WifiMode', 
-                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], 
+                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], 
                    is_static=True)
-    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDqpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function]
+    ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDqpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function]
     cls.add_method('CreateDqpsk', 
                    'ns3::WifiMode', 
-                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], 
+                   [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], 
                    is_static=True)
     return
 
@@ -1470,6 +1487,10 @@
     cls.add_method('NotifyRxDrop', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet const >', 'packet')])
+    ## wifi-mac.h: void ns3::WifiMac::SetStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('SetStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')])
     return
 
 def register_Ns3WifiMacHeader_methods(root_module, cls):
@@ -2053,6 +2074,86 @@
                    'ns3::WifiMode', 
                    [], 
                    is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get3mb10Mhz() [member function]
+    cls.add_method('Get3mb10Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get4_5mb10Mhz() [member function]
+    cls.add_method('Get4_5mb10Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get6mb10Mhz() [member function]
+    cls.add_method('Get6mb10Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get9mb10Mhz() [member function]
+    cls.add_method('Get9mb10Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get12mb10Mhz() [member function]
+    cls.add_method('Get12mb10Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get18mb10Mhz() [member function]
+    cls.add_method('Get18mb10Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get24mb10Mhz() [member function]
+    cls.add_method('Get24mb10Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get27mb10Mhz() [member function]
+    cls.add_method('Get27mb10Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get1_5mb5Mhz() [member function]
+    cls.add_method('Get1_5mb5Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get2_25mb5Mhz() [member function]
+    cls.add_method('Get2_25mb5Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get3mb5Mhz() [member function]
+    cls.add_method('Get3mb5Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get4_5mb5Mhz() [member function]
+    cls.add_method('Get4_5mb5Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get6mb5Mhz() [member function]
+    cls.add_method('Get6mb5Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get9mb5Mhz() [member function]
+    cls.add_method('Get9mb5Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get12mb5Mhz() [member function]
+    cls.add_method('Get12mb5Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
+    ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get13_5mb5Mhz() [member function]
+    cls.add_method('Get13_5mb5Mhz', 
+                   'ns3::WifiMode', 
+                   [], 
+                   is_static=True)
     ## wifi-phy.h: void ns3::WifiPhy::NotifyTxBegin(ns3::Ptr<ns3::Packet const> packet) [member function]
     cls.add_method('NotifyTxBegin', 
                    'void', 
@@ -3128,6 +3229,16 @@
     cls.add_method('SetNOscillators', 
                    'void', 
                    [param('uint8_t', 'nOscillators')])
+    ## jakes-propagation-loss-model.h: uint8_t ns3::JakesPropagationLossModel::GetNRays() const [member function]
+    cls.add_method('GetNRays', 
+                   'uint8_t', 
+                   [], 
+                   is_const=True)
+    ## jakes-propagation-loss-model.h: uint8_t ns3::JakesPropagationLossModel::GetNOscillators() const [member function]
+    cls.add_method('GetNOscillators', 
+                   'uint8_t', 
+                   [], 
+                   is_const=True)
     ## jakes-propagation-loss-model.h: double ns3::JakesPropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr<ns3::MobilityModel> a, ns3::Ptr<ns3::MobilityModel> b) const [member function]
     cls.add_method('DoCalcRxPower', 
                    'double', 
--- a/src/devices/wifi/dcf-manager-test.cc	Wed Jul 22 16:43:43 2009 +0400
+++ b/src/devices/wifi/dcf-manager-test.cc	Wed Jul 22 16:57:12 2009 +0400
@@ -379,6 +379,21 @@
   AddAccessRequest (30, 2, 70, 0);
   ExpectCollision (30, 0, 0); // backoff: 0 slots
   EndTest ();
+  // Test shows when two frames are received without interval between
+  // them:
+  //  20          60         100   106     110  112
+  //   |    rx     |    rx     |sifs | aifsn | tx | 
+  //        |
+  //       30 request access. backoff slots: 0
+
+  StartTest (4, 6 , 10);
+  AddDcfState (1);
+  AddRxOkEvt (20, 40);
+  AddRxOkEvt (60, 40);
+  AddAccessRequest (30, 2, 110, 0);
+  ExpectCollision (30, 0, 0); // backoff: 0 slots
+  EndTest ();
+
 
   // The test below is subject to some discussion because I am 
   // not sure I understand the intent of the spec here.
--- a/src/devices/wifi/dcf-manager.cc	Wed Jul 22 16:43:43 2009 +0400
+++ b/src/devices/wifi/dcf-manager.cc	Wed Jul 22 16:57:12 2009 +0400
@@ -433,7 +433,7 @@
 DcfManager::GetAccessGrantStart (void) const
 {
   Time rxAccessStart;
-  if (m_lastRxEnd >= m_lastRxStart) 
+  if (!m_rxing) 
     {
       rxAccessStart = m_lastRxEnd;
       if (!m_lastRxReceivedOk)
--- a/src/devices/wifi/interference-helper.cc	Wed Jul 22 16:43:43 2009 +0400
+++ b/src/devices/wifi/interference-helper.cc	Wed Jul 22 16:57:12 2009 +0400
@@ -372,8 +372,11 @@
           case WIFI_PHY_STANDARD_80211b:
             NS_FATAL_ERROR("can't happen here");
             symbolDurationUs = 0; // quiet compiler
+            break;
           default:
             NS_FATAL_ERROR("unknown standard");
+            symbolDurationUs = 0; // quiet compiler
+            break;
           }
       
         // IEEE Std 802.11-2007, section 17.3.2.2, table 17-3
@@ -381,7 +384,7 @@
         double numDataBitsPerSymbol = payloadMode.GetDataRate ()  * symbolDurationUs / 1e6;
 
         // IEEE Std 802.11-2007, section 17.3.5.3, equation (17-11)
-        uint32_t numSymbols = ceil ((16 + size * 8.0 + 6.0)/numDataBitsPerSymbol);
+        uint32_t numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0)/numDataBitsPerSymbol));
       
         return numSymbols*symbolDurationUs;
       }
@@ -390,7 +393,7 @@
       NS_LOG_LOGIC(" size=" << size
                    << " mode=" << payloadMode 
                    << " rate=" << payloadMode.GetDataRate () );
-      return ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6));
+      return lrint(ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6)));
 
     default:
       NS_FATAL_ERROR("unknown standard");
--- a/src/devices/wifi/nqap-wifi-mac.cc	Wed Jul 22 16:43:43 2009 +0400
+++ b/src/devices/wifi/nqap-wifi-mac.cc	Wed Jul 22 16:57:12 2009 +0400
@@ -97,6 +97,7 @@
   NS_LOG_FUNCTION (this);
   delete m_rxMiddle;
   delete m_dcfManager;
+  m_low->Dispose ();
   m_rxMiddle = 0;
   m_low = 0;
   m_dcfManager = 0;
--- a/src/devices/wifi/nqsta-wifi-mac.cc	Wed Jul 22 16:43:43 2009 +0400
+++ b/src/devices/wifi/nqsta-wifi-mac.cc	Wed Jul 22 16:57:12 2009 +0400
@@ -128,6 +128,7 @@
   NS_LOG_FUNCTION (this);
   delete m_rxMiddle;
   delete m_dcfManager;
+  m_low->Dispose ();
   m_rxMiddle = 0;
   m_low = 0;
   m_dcfManager = 0;
--- a/src/devices/wifi/qap-wifi-mac.cc	Wed Jul 22 16:43:43 2009 +0400
+++ b/src/devices/wifi/qap-wifi-mac.cc	Wed Jul 22 16:57:12 2009 +0400
@@ -119,10 +119,11 @@
 QapWifiMac::DoDispose ()
 {
   delete m_rxMiddle;
+  delete m_txMiddle;
+  delete m_dcfManager;
+  m_low->Dispose ();
   m_rxMiddle = 0;
-  delete m_txMiddle;
   m_txMiddle = 0;
-  delete m_dcfManager;
   m_dcfManager = 0;
   m_low = 0;
   m_phy = 0;
--- a/src/devices/wifi/qsta-wifi-mac.cc	Wed Jul 22 16:43:43 2009 +0400
+++ b/src/devices/wifi/qsta-wifi-mac.cc	Wed Jul 22 16:57:12 2009 +0400
@@ -125,6 +125,7 @@
   delete m_rxMiddle;
   delete m_txMiddle;
   delete m_dcfManager;
+  m_low->Dispose ();
   m_rxMiddle = 0;
   m_txMiddle = 0;
   m_low = 0;
--- a/src/devices/wifi/yans-wifi-phy.cc	Wed Jul 22 16:43:43 2009 +0400
+++ b/src/devices/wifi/yans-wifi-phy.cc	Wed Jul 22 16:57:12 2009 +0400
@@ -112,14 +112,14 @@
                    MakeEnumChecker (WIFI_PHY_STANDARD_80211a, "802.11a",
                                     WIFI_PHY_STANDARD_80211b, "802.11b",
                                     WIFI_PHY_STANDARD_80211_10Mhz,"802.11_10Mhz",
-                                    WIFI_PHY_STANDARD_80211_5Mhz,"802-11_5Mhz",
+                                    WIFI_PHY_STANDARD_80211_5Mhz,"802.11_5Mhz",
                                     WIFI_PHY_STANDARD_holland, "holland"))
     .AddAttribute ("State", "The state of the PHY layer",
                    PointerValue (),
                    MakePointerAccessor (&YansWifiPhy::m_state),
                    MakePointerChecker<WifiPhyStateHelper> ())
     .AddAttribute ("ChannelSwitchDelay",
-                   "Delay between two short frames transmitted on different frequencies",
+                   "Delay between two short frames transmitted on different frequencies. NOTE: Unused now.",
                    TimeValue (MicroSeconds (250)),
                    MakeTimeAccessor (&YansWifiPhy::m_channelSwitchDelay), 
                    MakeTimeChecker ())
@@ -167,7 +167,7 @@
     break;
   case WIFI_PHY_STANDARD_80211_5Mhz:
     Configure80211_5Mhz ();
-    break;
+    break; 
   case WIFI_PHY_STANDARD_holland:
     ConfigureHolland ();
     break;
@@ -318,7 +318,8 @@
 void 
 YansWifiPhy::SetChannelNumber (uint16_t nch)
 {
-  Simulator::Schedule (m_channelSwitchDelay, &YansWifiPhy::DoSetChannelNumber, this, nch);
+  // TODO implement channel switching state machine here
+  DoSetChannelNumber (nch);
 }
 
 void
@@ -476,6 +477,7 @@
 YansWifiPhy::Configure80211a (void)
 {
   NS_LOG_FUNCTION (this);
+  m_channelStartingFrequency = 5e3; // 5.000 GHz 
   m_modes.push_back (WifiPhy::Get6mba ());
   m_modes.push_back (WifiPhy::Get9mba ());
   m_modes.push_back (WifiPhy::Get12mba ());
@@ -491,6 +493,7 @@
 YansWifiPhy::Configure80211b (void)
 {
   NS_LOG_FUNCTION (this);
+  m_channelStartingFrequency = 2412; // 2.412 GHz 
   m_modes.push_back (WifiPhy::Get1mbb ());
   m_modes.push_back (WifiPhy::Get2mbb ());
   m_modes.push_back (WifiPhy::Get5_5mbb ());
@@ -501,6 +504,7 @@
 YansWifiPhy::Configure80211_10Mhz (void)
 {
   NS_LOG_FUNCTION (this);
+  m_channelStartingFrequency = 5e3; // 5.000 GHz, suppose 802.11a 
   m_modes.push_back (WifiPhy::Get3mb10Mhz ());
   m_modes.push_back (WifiPhy::Get4_5mb10Mhz ());
   m_modes.push_back (WifiPhy::Get6mb10Mhz ());
@@ -515,6 +519,7 @@
 YansWifiPhy::Configure80211_5Mhz (void)
 {
   NS_LOG_FUNCTION (this); 
+  m_channelStartingFrequency = 5e3; // 5.000 GHz, suppose 802.11a
   m_modes.push_back (WifiPhy::Get1_5mb5Mhz ());
   m_modes.push_back (WifiPhy::Get2_25mb5Mhz ());
   m_modes.push_back (WifiPhy::Get3mb5Mhz ());
@@ -529,6 +534,7 @@
 YansWifiPhy::ConfigureHolland (void)
 {
   NS_LOG_FUNCTION (this);
+  m_channelStartingFrequency = 5e3; // 5.000 GHz 
   m_modes.push_back (WifiPhy::Get6mba ());
   m_modes.push_back (WifiPhy::Get12mba ());
   m_modes.push_back (WifiPhy::Get18mba ());