diff --git a/bindings/python/ns3_module_csma.py b/bindings/python/ns3_module_csma.py index 9488dc9b8..e592db248 100644 --- a/bindings/python/ns3_module_csma.py +++ b/bindings/python/ns3_module_csma.py @@ -13,8 +13,8 @@ def register_types(module): module.add_class('CsmaChannel', parent=root_module['ns3::Channel']) ## csma-net-device.h: ns3::CsmaNetDevice [class] module.add_class('CsmaNetDevice', parent=root_module['ns3::NetDevice']) - ## csma-net-device.h: ns3::CsmaNetDevice::CsmaEncapsulationMode [enumeration] - module.add_enum('CsmaEncapsulationMode', ['ETHERNET_V1', 'IP_ARP', 'RAW', 'LLC'], outer_class=root_module['ns3::CsmaNetDevice']) + ## csma-net-device.h: ns3::CsmaNetDevice::EncapsulationMode [enumeration] + module.add_enum('EncapsulationMode', ['ETHERNET_V1', 'IP_ARP', 'RAW', 'LLC'], outer_class=root_module['ns3::CsmaNetDevice']) ## Register a nested module for the namespace internal @@ -250,6 +250,32 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls): cls.add_method('SetAddress', 'void', [param('ns3::Mac48Address', 'addr')]) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetMaxPayloadLength(uint16_t maxPayloadLength) [member function] + cls.add_method('SetMaxPayloadLength', + 'void', + [param('uint16_t', 'maxPayloadLength')]) + ## csma-net-device.h: uint16_t ns3::CsmaNetDevice::GetMaxPayloadLength() const [member function] + cls.add_method('GetMaxPayloadLength', + 'uint16_t', + [], + is_const=True) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetMacMtu(uint16_t mtu) [member function] + cls.add_method('SetMacMtu', + 'void', + [param('uint16_t', 'mtu')]) + ## csma-net-device.h: uint16_t ns3::CsmaNetDevice::GetMacMtu() const [member function] + cls.add_method('GetMacMtu', + 'uint16_t', + [], + is_const=True) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetEncapsulationMode(ns3::CsmaNetDevice::EncapsulationMode mode) [member function] + cls.add_method('SetEncapsulationMode', + 'void', + [param('ns3::CsmaNetDevice::EncapsulationMode', 'mode')]) + ## csma-net-device.h: ns3::CsmaNetDevice::EncapsulationMode ns3::CsmaNetDevice::GetEncapsulationMode() [member function] + cls.add_method('GetEncapsulationMode', + 'ns3::CsmaNetDevice::EncapsulationMode', + []) ## csma-net-device.h: void ns3::CsmaNetDevice::SetName(std::string const name) [member function] cls.add_method('SetName', 'void', @@ -275,11 +301,6 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls): 'ns3::Ptr< ns3::Channel >', [], is_const=True, is_virtual=True) - ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetAddress() const [member function] - cls.add_method('GetAddress', - 'ns3::Address', - [], - is_const=True, is_virtual=True) ## csma-net-device.h: bool ns3::CsmaNetDevice::SetMtu(uint16_t const mtu) [member function] cls.add_method('SetMtu', 'bool', @@ -290,6 +311,11 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls): 'uint16_t', [], is_const=True, is_virtual=True) + ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) ## csma-net-device.h: bool ns3::CsmaNetDevice::IsLinkUp() const [member function] cls.add_method('IsLinkUp', 'bool', diff --git a/bindings/python/ns3_module_helper.py b/bindings/python/ns3_module_helper.py index 38945199d..26dad4e00 100644 --- a/bindings/python/ns3_module_helper.py +++ b/bindings/python/ns3_module_helper.py @@ -137,6 +137,21 @@ def register_Ns3MobilityHelper_methods(root_module, cls): cls.add_method('InstallAll', 'void', []) + ## mobility-helper.h: static void ns3::MobilityHelper::EnableAscii(std::ostream & os, uint32_t nodeid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream&', 'os'), param('uint32_t', 'nodeid')], + is_static=True) + ## mobility-helper.h: static void ns3::MobilityHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream&', 'os'), param('ns3::NodeContainer', 'n')], + is_static=True) + ## mobility-helper.h: static void ns3::MobilityHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream&', 'os')], + is_static=True) return def register_Ns3InternetStackHelper_methods(root_module, cls): diff --git a/bindings/python/ns3_module_simulator.py b/bindings/python/ns3_module_simulator.py index 1c68ef1cd..aee2ed2f6 100644 --- a/bindings/python/ns3_module_simulator.py +++ b/bindings/python/ns3_module_simulator.py @@ -346,7 +346,7 @@ def register_Ns3Simulator_methods(root_module, cls): cls.add_method('EnableLogTo', 'void', [param('char *', 'filename', transfer_ownership=False, is_const=True)], - is_static=True) + is_static=True, deprecated=True) ## simulator.h: static void ns3::Simulator::Destroy() [member function] cls.add_method('Destroy', 'void', @@ -366,7 +366,7 @@ def register_Ns3Simulator_methods(root_module, cls): cls.add_method('Run', 'void', [], - is_static=True) + is_static=True, unblock_threads=True) ## simulator.h: static void ns3::Simulator::Stop() [member function] cls.add_method('Stop', 'void', diff --git a/bindings/python/ns3modulescan.py b/bindings/python/ns3modulescan.py index 05be63d55..1bd148959 100644 --- a/bindings/python/ns3modulescan.py +++ b/bindings/python/ns3modulescan.py @@ -148,6 +148,13 @@ def pre_scan_hook(dummy_module_parser, and pygccxml_definition.name.startswith('Schedule'): global_annotations['ignore'] = None + # unblock python threads for Simulator::Run + if isinstance(pygccxml_definition, member_function_t) \ + and pygccxml_definition.parent.name == 'Simulator' \ + and pygccxml_definition.name == 'Run': + global_annotations['unblock_threads'] = True + + ## classes if isinstance(pygccxml_definition, class_t): # no need for helper classes to allow subclassing in Python, I think... diff --git a/bindings/python/wscript b/bindings/python/wscript index 799fa5e82..674982114 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -21,7 +21,7 @@ else: os.environ['PYTHONPATH'] = LOCAL_PYBINDGEN_PATH ## https://launchpad.net/pybindgen/ -REQUIRED_PYBINDGEN_VERSION = (0, 9, 0, 526) +REQUIRED_PYBINDGEN_VERSION = (0, 9, 0, 530) REQUIRED_PYGCCXML_VERSION = (0, 9, 5)