From 4b26cca7e69f2b58497292d453259881e7e8fe26 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 16 Jul 2009 13:12:34 +0200 Subject: [PATCH 1/2] rescan python --- bindings/python/ns3_module_core.py | 10 ++ bindings/python/ns3_module_csma.py | 6 +- bindings/python/ns3_module_global_routing.py | 28 +++- bindings/python/ns3_module_wifi.py | 149 ++++++++++++++++--- 4 files changed, 168 insertions(+), 25 deletions(-) diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py index deaa6436e..1d5cd0e9a 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -442,6 +442,16 @@ def register_Ns3GlobalValue_methods(root_module, cls): '__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): diff --git a/bindings/python/ns3_module_csma.py b/bindings/python/ns3_module_csma.py index 4dcae39f4..9f464f0d7 100644 --- a/bindings/python/ns3_module_csma.py +++ b/bindings/python/ns3_module_csma.py @@ -205,13 +205,11 @@ def register_Ns3CsmaChannel_methods(root_module, cls): ## 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): diff --git a/bindings/python/ns3_module_global_routing.py b/bindings/python/ns3_module_global_routing.py index a76df6b3d..9f3bda083 100644 --- a/bindings/python/ns3_module_global_routing.py +++ b/bindings/python/ns3_module_global_routing.py @@ -83,17 +83,32 @@ def register_Ns3GlobalRouteManager_methods(root_module, cls): 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 @@ def register_Ns3GlobalRoutingLSA_methods(root_module, cls): 'ns3::Ipv4Mask', [], is_const=True) + ## global-router-interface.h: ns3::Ptr 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 @@ def register_Ns3GlobalRoutingLSA_methods(root_module, cls): cls.add_method('SetNetworkLSANetworkMask', 'void', [param('ns3::Ipv4Mask', 'mask')]) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetNode(ns3::Ptr 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', diff --git a/bindings/python/ns3_module_wifi.py b/bindings/python/ns3_module_wifi.py index 1555f2e7d..06db78743 100644 --- a/bindings/python/ns3_module_wifi.py +++ b/bindings/python/ns3_module_wifi.py @@ -8,7 +8,7 @@ def register_types(module): ## 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 @@ def register_Ns3InterferenceHelper_methods(root_module, cls): 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 @@ def register_Ns3InterferenceHelper_methods(root_module, cls): '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 rate) [member function] cls.add_method('SetErrorRateModel', 'void', @@ -457,6 +469,11 @@ def register_Ns3WifiMode_methods(root_module, cls): '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_Ns3WifiMode_methods(root_module, cls): 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 @@ def register_Ns3WifiMac_methods(root_module, cls): 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 @@ def register_Ns3WifiPhy_methods(root_module, cls): '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 packet) [member function] cls.add_method('NotifyTxBegin', 'void', @@ -3128,6 +3229,16 @@ def register_Ns3JakesPropagationLossModel_methods(root_module, cls): 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 a, ns3::Ptr b) const [member function] cls.add_method('DoCalcRxPower', 'double', From 82f915fd5abb8e2ed03357a3ba7ba0c48b3a9be0 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 16 Jul 2009 13:40:56 +0200 Subject: [PATCH 2/2] fix optimized build for true --- src/devices/wifi/interference-helper.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/devices/wifi/interference-helper.cc b/src/devices/wifi/interference-helper.cc index f1d1ae1b4..c375d095e 100644 --- a/src/devices/wifi/interference-helper.cc +++ b/src/devices/wifi/interference-helper.cc @@ -372,8 +372,11 @@ InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payl 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