From 990960bbca7f319f80fe10089048ed246c89f9dd Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Mon, 18 May 2009 11:06:26 +0100 Subject: [PATCH 01/11] Add -Wl,--soname=libns3.so to link flags to allow dlopen hacks Mathieu's explanation: """ In python, I want to load the ns3 python bindings without having to install libns3.so in /usr and without having to configure LD_LIBRARY_PATH. So, I need to dlopen (RTLD_GLOBAL) libns3.so before doing imp.find_module ('ns3') to ensure that python finds the libns3.so library. To do the dlopen, I need to give a full path to libns3.so but, if you do this without a soname, the dynamic loader does not know about libns3.so: it knows only about /foo/bar/libns3.so. """ --- wscript | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index 8a4cd5043..508baa784 100644 --- a/wscript +++ b/wscript @@ -255,13 +255,18 @@ def configure(conf): env.append_value("LINKFLAGS", "-Wl,--enable-runtime-pseudo-reloc") elif sys.platform == 'cygwin': env.append_value("LINKFLAGS", "-Wl,--enable-auto-import") + cxx, = env['CXX'] + p = subprocess.Popen([cxx, '-print-file-name=libstdc++.so'], stdout=subprocess.PIPE) libstdcxx_location = os.path.dirname(p.stdout.read().strip()) p.wait() if libstdcxx_location: conf.env.append_value('NS3_MODULE_PATH', libstdcxx_location) + if conf.check_compilation_flag('-Wl,--soname=foo'): + env['WL_SONAME_SUPPORTED'] = True + conf.sub_config('src') conf.sub_config('utils') conf.sub_config('bindings/python') @@ -480,11 +485,15 @@ def build(bld): ## Create a single ns3 library containing all enabled modules if env['ENABLE_STATIC_NS3']: lib = bld.new_task_gen('cxx', 'staticlib') + lib.name = 'ns3' + lib.target = 'ns3' else: lib = bld.new_task_gen('cxx', 'shlib') + lib.name = 'ns3' + lib.target = 'ns3' + if lib.env['CXX_NAME'] == 'gcc' and env['WL_SONAME_SUPPORTED']: + lib.env.append_value('LINKFLAGS', '-Wl,--soname=%s' % ccroot.get_target_name(lib)) - lib.name = 'ns3' - lib.target = 'ns3' if env['NS3_ENABLED_MODULES']: lib.add_objects = list(modules) env['NS3_ENABLED_MODULES'] = list(modules) From e37a5eed7a19f1dcac6160819a63c46d8f2fa866 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Mon, 18 May 2009 14:10:49 +0100 Subject: [PATCH 02/11] Don't event try to enable -Wl,--soname option if we're not on linux. --- wscript | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index 508baa784..32257703b 100644 --- a/wscript +++ b/wscript @@ -264,8 +264,9 @@ def configure(conf): if libstdcxx_location: conf.env.append_value('NS3_MODULE_PATH', libstdcxx_location) - if conf.check_compilation_flag('-Wl,--soname=foo'): - env['WL_SONAME_SUPPORTED'] = True + if Options.platform in ['linux']: + if conf.check_compilation_flag('-Wl,--soname=foo'): + env['WL_SONAME_SUPPORTED'] = True conf.sub_config('src') conf.sub_config('utils') From 2f0944386f4116c52a0b2db89b040a2ae5c7514e Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 19 May 2009 15:34:20 +0200 Subject: [PATCH 03/11] bug 560: remove deprecated methods. --- src/common/packet.cc | 7 ------- src/common/packet.h | 2 -- src/helper/csma-helper.cc | 12 ------------ src/helper/csma-helper.h | 3 --- src/helper/point-to-point-helper.cc | 11 ----------- src/helper/point-to-point-helper.h | 3 --- src/simulator/simulator.cc | 4 ---- src/simulator/simulator.h | 2 -- 8 files changed, 44 deletions(-) diff --git a/src/common/packet.cc b/src/common/packet.cc index a5f5e3993..b5fa52d0a 100644 --- a/src/common/packet.cc +++ b/src/common/packet.cc @@ -468,13 +468,6 @@ Packet::BeginItem (void) const return m_metadata.BeginItem (m_buffer); } -void -Packet::EnableMetadata (void) -{ - NS_LOG_FUNCTION_NOARGS (); - EnableChecking (); -} - void Packet::EnablePrinting (void) { diff --git a/src/common/packet.h b/src/common/packet.h index 9b0aba9e9..405b18ec1 100644 --- a/src/common/packet.h +++ b/src/common/packet.h @@ -321,8 +321,6 @@ public: PacketMetadata::ItemIterator BeginItem (void) const; - static void EnableMetadata (void) NS_DEPRECATED; - /** * By default, packets do not keep around enough metadata to * perform the operations requested by the Print methods. If you diff --git a/src/helper/csma-helper.cc b/src/helper/csma-helper.cc index fb799104b..be3337d8f 100644 --- a/src/helper/csma-helper.cc +++ b/src/helper/csma-helper.cc @@ -64,18 +64,6 @@ CsmaHelper::SetChannelAttribute (std::string n1, const AttributeValue &v1) m_channelFactory.Set (n1, v1); } -void -CsmaHelper::SetDeviceParameter (std::string n1, const AttributeValue &v1) -{ - SetDeviceAttribute (n1, v1); -} - -void -CsmaHelper::SetChannelParameter (std::string n1, const AttributeValue &v1) -{ - SetChannelAttribute (n1, v1); -} - void CsmaHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) { diff --git a/src/helper/csma-helper.h b/src/helper/csma-helper.h index 22b53a331..4f6aa6025 100644 --- a/src/helper/csma-helper.h +++ b/src/helper/csma-helper.h @@ -80,9 +80,6 @@ public: */ void SetChannelAttribute (std::string n1, const AttributeValue &v1); - void SetDeviceParameter (std::string n1, const AttributeValue &v1) NS_DEPRECATED; - void SetChannelParameter (std::string n1, const AttributeValue &v1) NS_DEPRECATED; - /** * \param filename filename prefix to use for pcap files. * \param nodeid the id of the node to generate pcap output for. diff --git a/src/helper/point-to-point-helper.cc b/src/helper/point-to-point-helper.cc index f9288c79b..e53bd6ed8 100644 --- a/src/helper/point-to-point-helper.cc +++ b/src/helper/point-to-point-helper.cc @@ -63,17 +63,6 @@ PointToPointHelper::SetChannelAttribute (std::string n1, const AttributeValue &v m_channelFactory.Set (n1, v1); } -void -PointToPointHelper::SetDeviceParameter (std::string name, const AttributeValue &value) -{ - SetDeviceAttribute (name, value); -} -void -PointToPointHelper::SetChannelParameter (std::string name, const AttributeValue &value) -{ - SetChannelAttribute (name, value); -} - void PointToPointHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid) { diff --git a/src/helper/point-to-point-helper.h b/src/helper/point-to-point-helper.h index d67a9f526..483a32a0a 100644 --- a/src/helper/point-to-point-helper.h +++ b/src/helper/point-to-point-helper.h @@ -79,9 +79,6 @@ public: */ void SetChannelAttribute (std::string name, const AttributeValue &value); - void SetDeviceParameter (std::string name, const AttributeValue &value) NS_DEPRECATED; - void SetChannelParameter (std::string name, const AttributeValue &value) NS_DEPRECATED; - /** * \param filename filename prefix to use for pcap files. * \param nodeid the id of the node to generate pcap output for. diff --git a/src/simulator/simulator.cc b/src/simulator/simulator.cc index 0eae117b1..e90c99d19 100644 --- a/src/simulator/simulator.cc +++ b/src/simulator/simulator.cc @@ -139,10 +139,6 @@ Simulator::SetScheduler (Ptr scheduler) GetImpl ()->SetScheduler (scheduler); } -void -Simulator::EnableLogTo (char const *filename) -{} - bool Simulator::IsFinished (void) { diff --git a/src/simulator/simulator.h b/src/simulator/simulator.h index a0732fb53..477a55be8 100644 --- a/src/simulator/simulator.h +++ b/src/simulator/simulator.h @@ -82,8 +82,6 @@ public: */ static void SetScheduler (Ptr scheduler); - static void EnableLogTo (char const *filename) NS_DEPRECATED; - /** * Every event scheduled by the Simulator::insertAtDestroy method is * invoked. Then, we ensure that any memory allocated by the From bf673cf808833c10704d6b66ad6c0cbfdecfad10 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 19 May 2009 15:35:05 +0200 Subject: [PATCH 04/11] rescan python --- bindings/python/ns3_module_bridge.py | 2 +- bindings/python/ns3_module_common.py | 7 +------ bindings/python/ns3_module_contrib.py | 2 +- bindings/python/ns3_module_core.py | 2 +- bindings/python/ns3_module_csma.py | 2 +- bindings/python/ns3_module_emu.py | 2 +- bindings/python/ns3_module_global_routing.py | 2 +- bindings/python/ns3_module_helper.py | 22 +------------------- bindings/python/ns3_module_internet_stack.py | 2 +- bindings/python/ns3_module_mobility.py | 2 +- bindings/python/ns3_module_node.py | 2 +- bindings/python/ns3_module_olsr.py | 11 +++++++++- bindings/python/ns3_module_onoff.py | 2 +- bindings/python/ns3_module_packet_sink.py | 2 +- bindings/python/ns3_module_point_to_point.py | 2 +- bindings/python/ns3_module_simulator.py | 11 +++++----- bindings/python/ns3_module_stats.py | 4 +++- bindings/python/ns3_module_tap_bridge.py | 2 +- bindings/python/ns3_module_udp_echo.py | 2 +- bindings/python/ns3_module_v4ping.py | 2 +- bindings/python/ns3_module_wifi.py | 3 ++- bindings/python/ns3modulegen_generated.py | 2 +- 22 files changed, 38 insertions(+), 52 deletions(-) diff --git a/bindings/python/ns3_module_bridge.py b/bindings/python/ns3_module_bridge.py index e63db6b91..20f9620a8 100644 --- a/bindings/python/ns3_module_bridge.py +++ b/bindings/python/ns3_module_bridge.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_common.py b/bindings/python/ns3_module_common.py index b12fb8e79..4d6ede6db 100644 --- a/bindings/python/ns3_module_common.py +++ b/bindings/python/ns3_module_common.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() @@ -424,11 +424,6 @@ def register_Ns3Packet_methods(root_module, cls): 'void', [], is_static=True) - ## packet.h: static void ns3::Packet::EnableMetadata() [member function] - cls.add_method('EnableMetadata', - 'void', - [], - is_static=True, deprecated=True) ## packet.h: static void ns3::Packet::EnablePrinting() [member function] cls.add_method('EnablePrinting', 'void', diff --git a/bindings/python/ns3_module_contrib.py b/bindings/python/ns3_module_contrib.py index f334a7a30..bc01326b9 100644 --- a/bindings/python/ns3_module_contrib.py +++ b/bindings/python/ns3_module_contrib.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py index e108eba13..a55a03694 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_csma.py b/bindings/python/ns3_module_csma.py index d7e8e9b4f..08fc60f01 100644 --- a/bindings/python/ns3_module_csma.py +++ b/bindings/python/ns3_module_csma.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_emu.py b/bindings/python/ns3_module_emu.py index 4fa5d12a1..67f067f94 100644 --- a/bindings/python/ns3_module_emu.py +++ b/bindings/python/ns3_module_emu.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_global_routing.py b/bindings/python/ns3_module_global_routing.py index c3e0386d5..9b96b618f 100644 --- a/bindings/python/ns3_module_global_routing.py +++ b/bindings/python/ns3_module_global_routing.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_helper.py b/bindings/python/ns3_module_helper.py index 2b4b7f2f5..d75433a4e 100644 --- a/bindings/python/ns3_module_helper.py +++ b/bindings/python/ns3_module_helper.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() @@ -218,16 +218,6 @@ def register_Ns3CsmaHelper_methods(root_module, cls): cls.add_method('SetChannelAttribute', 'void', [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) - ## csma-helper.h: void ns3::CsmaHelper::SetDeviceParameter(std::string n1, ns3::AttributeValue const & v1) [member function] - cls.add_method('SetDeviceParameter', - 'void', - [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')], - deprecated=True) - ## csma-helper.h: void ns3::CsmaHelper::SetChannelParameter(std::string n1, ns3::AttributeValue const & v1) [member function] - cls.add_method('SetChannelParameter', - 'void', - [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')], - deprecated=True) ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) [member function] cls.add_method('EnablePcap', 'void', @@ -815,16 +805,6 @@ def register_Ns3PointToPointHelper_methods(root_module, cls): cls.add_method('SetChannelAttribute', 'void', [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) - ## point-to-point-helper.h: void ns3::PointToPointHelper::SetDeviceParameter(std::string name, ns3::AttributeValue const & value) [member function] - cls.add_method('SetDeviceParameter', - 'void', - [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')], - deprecated=True) - ## point-to-point-helper.h: void ns3::PointToPointHelper::SetChannelParameter(std::string name, ns3::AttributeValue const & value) [member function] - cls.add_method('SetChannelParameter', - 'void', - [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')], - deprecated=True) ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function] cls.add_method('EnablePcap', 'void', diff --git a/bindings/python/ns3_module_internet_stack.py b/bindings/python/ns3_module_internet_stack.py index c29a3992a..b063c6a38 100644 --- a/bindings/python/ns3_module_internet_stack.py +++ b/bindings/python/ns3_module_internet_stack.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_mobility.py b/bindings/python/ns3_module_mobility.py index ef884b178..c179a685b 100644 --- a/bindings/python/ns3_module_mobility.py +++ b/bindings/python/ns3_module_mobility.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_node.py b/bindings/python/ns3_module_node.py index 8fa22046a..11781e8ca 100644 --- a/bindings/python/ns3_module_node.py +++ b/bindings/python/ns3_module_node.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_olsr.py b/bindings/python/ns3_module_olsr.py index a4f946822..6d299606a 100644 --- a/bindings/python/ns3_module_olsr.py +++ b/bindings/python/ns3_module_olsr.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() @@ -91,6 +91,15 @@ def register_types_ns3_olsr(module): module.add_class('TwoHopNeighborTuple') module.add_container('std::vector< ns3::olsr::MessageHeader::Hello::LinkMessage >', 'ns3::olsr::MessageHeader::Hello::LinkMessage', container_type='vector') module.add_container('std::vector< ns3::olsr::MessageHeader::Hna::Association >', 'ns3::olsr::MessageHeader::Hna::Association', container_type='vector') + typehandlers.add_type_alias('std::vector< ns3::olsr::DuplicateTuple, std::allocator< ns3::olsr::DuplicateTuple > >', 'ns3::olsr::DuplicateSet') + typehandlers.add_type_alias('std::set< ns3::Ipv4Address, std::less< ns3::Ipv4Address >, std::allocator< ns3::Ipv4Address > >', 'ns3::olsr::MprSet') + typehandlers.add_type_alias('std::vector< ns3::olsr::MprSelectorTuple, std::allocator< ns3::olsr::MprSelectorTuple > >', 'ns3::olsr::MprSelectorSet') + typehandlers.add_type_alias('std::vector< ns3::olsr::MessageHeader, std::allocator< ns3::olsr::MessageHeader > >', 'ns3::olsr::MessageList') + typehandlers.add_type_alias('std::vector< ns3::olsr::IfaceAssocTuple, std::allocator< ns3::olsr::IfaceAssocTuple > >', 'ns3::olsr::IfaceAssocSet') + typehandlers.add_type_alias('std::vector< ns3::olsr::NeighborTuple, std::allocator< ns3::olsr::NeighborTuple > >', 'ns3::olsr::NeighborSet') + typehandlers.add_type_alias('std::vector< ns3::olsr::TwoHopNeighborTuple, std::allocator< ns3::olsr::TwoHopNeighborTuple > >', 'ns3::olsr::TwoHopNeighborSet') + typehandlers.add_type_alias('std::vector< ns3::olsr::TopologyTuple, std::allocator< ns3::olsr::TopologyTuple > >', 'ns3::olsr::TopologySet') + typehandlers.add_type_alias('std::vector< ns3::olsr::LinkTuple, std::allocator< ns3::olsr::LinkTuple > >', 'ns3::olsr::LinkSet') def register_methods(root_module): register_Ns3OlsrState_methods(root_module, root_module['ns3::OlsrState']) diff --git a/bindings/python/ns3_module_onoff.py b/bindings/python/ns3_module_onoff.py index 2d253ec6d..1de43a429 100644 --- a/bindings/python/ns3_module_onoff.py +++ b/bindings/python/ns3_module_onoff.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_packet_sink.py b/bindings/python/ns3_module_packet_sink.py index 8478d79c4..ce901e7a9 100644 --- a/bindings/python/ns3_module_packet_sink.py +++ b/bindings/python/ns3_module_packet_sink.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_point_to_point.py b/bindings/python/ns3_module_point_to_point.py index 2360f1f62..14abbe961 100644 --- a/bindings/python/ns3_module_point_to_point.py +++ b/bindings/python/ns3_module_point_to_point.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_simulator.py b/bindings/python/ns3_module_simulator.py index 78bef44f9..1147dfa79 100644 --- a/bindings/python/ns3_module_simulator.py +++ b/bindings/python/ns3_module_simulator.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() @@ -61,6 +61,10 @@ def register_types(module): module.add_class('RealtimeSimulatorImpl', parent=root_module['ns3::SimulatorImpl']) ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl::SynchronizationMode [enumeration] module.add_enum('SynchronizationMode', ['SYNC_BEST_EFFORT', 'SYNC_HARD_LIMIT'], outer_class=root_module['ns3::RealtimeSimulatorImpl']) + typehandlers.add_type_alias('ns3::TimeUnit< 2 >', 'ns3::TimeSquare') + typehandlers.add_type_alias('ns3::TimeUnit< - 1 >', 'ns3::TimeInvert') + typehandlers.add_type_alias('ns3::TimeUnit< 0 >', 'ns3::Scalar') + typehandlers.add_type_alias('ns3::TimeUnit< 1 >', 'ns3::Time') ## Register a nested module for the namespace Config @@ -277,11 +281,6 @@ def register_Ns3Simulator_methods(root_module, cls): 'void', [param('ns3::Ptr< ns3::Scheduler >', 'scheduler')], is_static=True) - ## simulator.h: static void ns3::Simulator::EnableLogTo(char const * filename) [member function] - cls.add_method('EnableLogTo', - 'void', - [param('char const *', 'filename')], - is_static=True, deprecated=True) ## simulator.h: static void ns3::Simulator::Destroy() [member function] cls.add_method('Destroy', 'void', diff --git a/bindings/python/ns3_module_stats.py b/bindings/python/ns3_module_stats.py index 59532ca76..d37a6b328 100644 --- a/bindings/python/ns3_module_stats.py +++ b/bindings/python/ns3_module_stats.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() @@ -25,6 +25,8 @@ def register_types(module): module.add_class('CounterCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator']) ## packet-data-calculators.h: ns3::PacketCounterCalculator [class] module.add_class('PacketCounterCalculator', parent=root_module['ns3::CounterCalculator< unsigned int >']) + typehandlers.add_type_alias('std::list< ns3::Ptr< ns3::DataCalculator >, std::allocator< ns3::Ptr< ns3::DataCalculator > > >', 'ns3::DataCalculatorList') + typehandlers.add_type_alias('std::list< std::pair< std::string, std::string >, std::allocator< std::pair< std::string, std::string > > >', 'ns3::MetadataList') ## Register a nested module for the namespace Config diff --git a/bindings/python/ns3_module_tap_bridge.py b/bindings/python/ns3_module_tap_bridge.py index ba5310e25..85cb35479 100644 --- a/bindings/python/ns3_module_tap_bridge.py +++ b/bindings/python/ns3_module_tap_bridge.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_udp_echo.py b/bindings/python/ns3_module_udp_echo.py index dae92a56e..054694d98 100644 --- a/bindings/python/ns3_module_udp_echo.py +++ b/bindings/python/ns3_module_udp_echo.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_v4ping.py b/bindings/python/ns3_module_v4ping.py index ec2bc2357..3959bc0ee 100644 --- a/bindings/python/ns3_module_v4ping.py +++ b/bindings/python/ns3_module_v4ping.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_wifi.py b/bindings/python/ns3_module_wifi.py index e13cc31ea..432c47665 100644 --- a/bindings/python/ns3_module_wifi.py +++ b/bindings/python/ns3_module_wifi.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() @@ -135,6 +135,7 @@ def register_types(module): module.add_class('YansWifiChannel', parent=root_module['ns3::WifiChannel']) ## aarf-wifi-manager.h: ns3::AarfWifiManager [class] module.add_class('AarfWifiManager', parent=root_module['ns3::ArfWifiManager']) + typehandlers.add_type_alias('std::vector< ns3::ThresholdsItem, std::allocator< ns3::ThresholdsItem > >', 'ns3::Thresholds') ## Register a nested module for the namespace Config diff --git a/bindings/python/ns3modulegen_generated.py b/bindings/python/ns3modulegen_generated.py index 694befa0b..4a898b5d9 100644 --- a/bindings/python/ns3modulegen_generated.py +++ b/bindings/python/ns3modulegen_generated.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings From 0abda7e9381591278df1ca64c7e026f0c4bc01b1 Mon Sep 17 00:00:00 2001 From: Andrey Hippo Date: Tue, 19 May 2009 15:39:15 +0200 Subject: [PATCH 05/11] bug 567: --enable-static does not work on i686 --- wscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index 32257703b..43452ed41 100644 --- a/wscript +++ b/wscript @@ -6,6 +6,7 @@ import shutil import types import optparse import os.path +import re # WAF modules import pproc as subprocess @@ -300,7 +301,7 @@ def configure(conf): if Options.options.enable_static: if env['PLATFORM'].startswith('linux') and \ env['CXX_NAME'] == 'gcc': - if os.uname()[4] == 'i386': + if re.match('i[3-6]86', os.uname()[4]): conf.report_optional_feature("static", "Static build", True, '') env['ENABLE_STATIC_NS3'] = True elif os.uname()[4] == 'x86_64': From 9c634932809c007aabf9e94cd1f57887d0c9a9c0 Mon Sep 17 00:00:00 2001 From: Fabian Mauchle Date: Tue, 19 May 2009 15:41:01 +0200 Subject: [PATCH 06/11] bug 568: Timer's default destroy policy not set. --- src/simulator/timer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulator/timer.cc b/src/simulator/timer.cc index da36e2d13..a79f94670 100644 --- a/src/simulator/timer.cc +++ b/src/simulator/timer.cc @@ -24,7 +24,7 @@ namespace ns3 { Timer::Timer () - : m_flags (0), + : m_flags (CHECK_ON_DESTROY), m_delay (FemtoSeconds (0)), m_event (), m_impl (0) From fa5e05290dd9832943fc5a8582db71e2254a08ee Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 20 May 2009 15:54:56 +0200 Subject: [PATCH 07/11] fix uninitialized variable --- src/routing/olsr/olsr-routing-protocol.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routing/olsr/olsr-routing-protocol.cc b/src/routing/olsr/olsr-routing-protocol.cc index f7625072c..36cff48e9 100644 --- a/src/routing/olsr/olsr-routing-protocol.cc +++ b/src/routing/olsr/olsr-routing-protocol.cc @@ -186,7 +186,8 @@ RoutingProtocol::RoutingProtocol () : m_helloTimer (Timer::CANCEL_ON_DESTROY), m_tcTimer (Timer::CANCEL_ON_DESTROY), - m_midTimer (Timer::CANCEL_ON_DESTROY) + m_midTimer (Timer::CANCEL_ON_DESTROY), + m_queuedMessagesTimer (Timer::CANCEL_ON_DESTROY) {} RoutingProtocol::~RoutingProtocol () From 4159520b4bce9632d0a1f79705198d0a66169d17 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 21 May 2009 06:03:42 -0700 Subject: [PATCH 08/11] fix packet tag manual documentation --- doc/manual/packets.texi | 85 +++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/doc/manual/packets.texi b/doc/manual/packets.texi index b4cc4e3b8..a0a962050 100644 --- a/doc/manual/packets.texi +++ b/doc/manual/packets.texi @@ -152,9 +152,7 @@ Unlike Headers, Tags are not serialized into a contiguous buffer but are stored in an array. By default, Tags are limited to 16 bytes in size. Tags can be flexibly defined to be any type, but there can only be one instance of any particular object type in -the Tags buffer at any time. The implementation makes use -of templates to generate the proper set of Add(), Remove(), -and Peek() functions for each Tag type. +the Tags buffer at any time. @section Packet interface @@ -219,49 +217,46 @@ exist for Trailers. @end verbatim @subsection Adding and removing Tags + +@strong{Note: This part of ns-3 will change for ns-3.5; see this mail message: +http://mailman.isi.edu/pipermail/ns-developers/2009-March/005557.html} + @verbatim - /** - * Attach a tag to this packet. The tag is fully copied - * in a packet-specific internal buffer. This operation - * is expected to be really fast. - * - * \param tag a pointer to the tag to attach to this packet. - */ - template - void AddTag (T const &tag); - /** - * Remove a tag from this packet. The data stored internally - * for this tag is copied in the input tag if an instance - * of this tag type is present in the internal buffer. If this - * tag type is not present, the input tag is not modified. - * - * This operation can be potentially slow and might trigger - * unexpectedly large memory allocations. It is thus - * usually a better idea to create a copy of this packet, - * and invoke removeAllTags on the copy to remove all - * tags rather than remove the tags one by one from a packet. - * - * \param tag a pointer to the tag to remove from this packet - * \returns true if an instance of this tag type is stored - * in this packet, false otherwise. - */ - template - bool RemoveTag (T &tag); - /** - * Copy a tag stored internally to the input tag. If no instance - * of this tag is present internally, the input tag is not modified. - * - * \param tag a pointer to the tag to read from this packet - * \returns true if an instance of this tag type is stored - * in this packet, false otherwise. - */ - template - bool PeekTag (T &tag) const; - /** - * Remove all the tags stored in this packet. This operation is - * much much faster than invoking removeTag n times. - */ - void RemoveAllTags (void); + /** + * \param tag the new tag to add to this packet + * + * Tag each byte included in this packet with the + * new tag. + * + * Note that adding a tag is a const operation which is pretty + * un-intuitive. The rationale is that the content and behavior of + * a packet is _not_ changed when a tag is added to a packet: any + * code which was not aware of the new tag is going to work just + * the same if the new tag is added. The real reason why adding a + * tag was made a const operation is to allow a trace sink which gets + * a packet to tag the packet, even if the packet is const (and most + * trace sources should use const packets because it would be + * totally evil to allow a trace sink to modify the content of a + * packet). + */ + void AddTag (const Tag &tag) const; + /** + * \returns an iterator over the set of tags included in this packet. + */ + TagIterator GetTagIterator (void) const; + /** + * \param tag the tag to search in this packet + * \returns true if the requested tag type was found, false otherwise. + * + * If the requested tag type is found, it is copied in the user's + * provided tag instance. + */ + bool FindFirstMatchingTag (Tag &tag) const; + + /** + * Remove all the tags stored in this packet. + */ + void RemoveAllTags (void); @end verbatim @subsection Fragmentation From 9cdc0cfd71f515ea5e53cebe8e8d2763b3fde27e Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 21 May 2009 06:04:40 -0700 Subject: [PATCH 09/11] rescan python bindings --- bindings/python/ns3_module_bridge.py | 2 +- bindings/python/ns3_module_common.py | 2 +- bindings/python/ns3_module_contrib.py | 2 +- bindings/python/ns3_module_core.py | 10 +++++----- bindings/python/ns3_module_csma.py | 2 +- bindings/python/ns3_module_emu.py | 2 +- bindings/python/ns3_module_global_routing.py | 2 +- bindings/python/ns3_module_helper.py | 2 +- bindings/python/ns3_module_internet_stack.py | 2 +- bindings/python/ns3_module_mobility.py | 2 +- bindings/python/ns3_module_node.py | 2 +- bindings/python/ns3_module_olsr.py | 11 +---------- bindings/python/ns3_module_onoff.py | 2 +- bindings/python/ns3_module_packet_sink.py | 2 +- bindings/python/ns3_module_point_to_point.py | 2 +- bindings/python/ns3_module_simulator.py | 6 +----- bindings/python/ns3_module_stats.py | 4 +--- bindings/python/ns3_module_tap_bridge.py | 2 +- bindings/python/ns3_module_udp_echo.py | 2 +- bindings/python/ns3_module_v4ping.py | 2 +- bindings/python/ns3_module_wifi.py | 3 +-- bindings/python/ns3modulegen_generated.py | 2 +- 22 files changed, 26 insertions(+), 42 deletions(-) diff --git a/bindings/python/ns3_module_bridge.py b/bindings/python/ns3_module_bridge.py index 20f9620a8..e63db6b91 100644 --- a/bindings/python/ns3_module_bridge.py +++ b/bindings/python/ns3_module_bridge.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_common.py b/bindings/python/ns3_module_common.py index 4d6ede6db..46badd328 100644 --- a/bindings/python/ns3_module_common.py +++ b/bindings/python/ns3_module_common.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_contrib.py b/bindings/python/ns3_module_contrib.py index bc01326b9..f334a7a30 100644 --- a/bindings/python/ns3_module_contrib.py +++ b/bindings/python/ns3_module_contrib.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py index a55a03694..f92b4d19a 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() @@ -2028,7 +2028,7 @@ def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls): cls.add_method('ConnectWithoutContext', 'void', [param('ns3::CallbackBase const &', 'cb')]) - ## traced-value.h: void ns3::TracedValue::Connect(ns3::CallbackBase const & cb, std::string path) [member function] + ## traced-value.h: void ns3::TracedValue::Connect(ns3::CallbackBase const & cb, std::basic_string,std::allocator > path) [member function] cls.add_method('Connect', 'void', [param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')]) @@ -2036,7 +2036,7 @@ def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls): cls.add_method('DisconnectWithoutContext', 'void', [param('ns3::CallbackBase const &', 'cb')]) - ## traced-value.h: void ns3::TracedValue::Disconnect(ns3::CallbackBase const & cb, std::string path) [member function] + ## traced-value.h: void ns3::TracedValue::Disconnect(ns3::CallbackBase const & cb, std::basic_string,std::allocator > path) [member function] cls.add_method('Disconnect', 'void', [param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')]) @@ -2184,7 +2184,7 @@ def register_functions(root_module): module.add_function('TypeNameGet', 'std::string', [], - template_parameters=['long long']) + template_parameters=['long']) ## type-name.h: extern std::string ns3::TypeNameGet() [free function] module.add_function('TypeNameGet', 'std::string', @@ -2204,7 +2204,7 @@ def register_functions(root_module): module.add_function('TypeNameGet', 'std::string', [], - template_parameters=['unsigned long long']) + template_parameters=['unsigned long']) ## type-name.h: extern std::string ns3::TypeNameGet() [free function] module.add_function('TypeNameGet', 'std::string', diff --git a/bindings/python/ns3_module_csma.py b/bindings/python/ns3_module_csma.py index 08fc60f01..d7e8e9b4f 100644 --- a/bindings/python/ns3_module_csma.py +++ b/bindings/python/ns3_module_csma.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_emu.py b/bindings/python/ns3_module_emu.py index 67f067f94..4fa5d12a1 100644 --- a/bindings/python/ns3_module_emu.py +++ b/bindings/python/ns3_module_emu.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_global_routing.py b/bindings/python/ns3_module_global_routing.py index 9b96b618f..c3e0386d5 100644 --- a/bindings/python/ns3_module_global_routing.py +++ b/bindings/python/ns3_module_global_routing.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_helper.py b/bindings/python/ns3_module_helper.py index d75433a4e..09473b2f9 100644 --- a/bindings/python/ns3_module_helper.py +++ b/bindings/python/ns3_module_helper.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_internet_stack.py b/bindings/python/ns3_module_internet_stack.py index b063c6a38..c29a3992a 100644 --- a/bindings/python/ns3_module_internet_stack.py +++ b/bindings/python/ns3_module_internet_stack.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_mobility.py b/bindings/python/ns3_module_mobility.py index c179a685b..ef884b178 100644 --- a/bindings/python/ns3_module_mobility.py +++ b/bindings/python/ns3_module_mobility.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_node.py b/bindings/python/ns3_module_node.py index 11781e8ca..8fa22046a 100644 --- a/bindings/python/ns3_module_node.py +++ b/bindings/python/ns3_module_node.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_olsr.py b/bindings/python/ns3_module_olsr.py index 6d299606a..a4f946822 100644 --- a/bindings/python/ns3_module_olsr.py +++ b/bindings/python/ns3_module_olsr.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() @@ -91,15 +91,6 @@ def register_types_ns3_olsr(module): module.add_class('TwoHopNeighborTuple') module.add_container('std::vector< ns3::olsr::MessageHeader::Hello::LinkMessage >', 'ns3::olsr::MessageHeader::Hello::LinkMessage', container_type='vector') module.add_container('std::vector< ns3::olsr::MessageHeader::Hna::Association >', 'ns3::olsr::MessageHeader::Hna::Association', container_type='vector') - typehandlers.add_type_alias('std::vector< ns3::olsr::DuplicateTuple, std::allocator< ns3::olsr::DuplicateTuple > >', 'ns3::olsr::DuplicateSet') - typehandlers.add_type_alias('std::set< ns3::Ipv4Address, std::less< ns3::Ipv4Address >, std::allocator< ns3::Ipv4Address > >', 'ns3::olsr::MprSet') - typehandlers.add_type_alias('std::vector< ns3::olsr::MprSelectorTuple, std::allocator< ns3::olsr::MprSelectorTuple > >', 'ns3::olsr::MprSelectorSet') - typehandlers.add_type_alias('std::vector< ns3::olsr::MessageHeader, std::allocator< ns3::olsr::MessageHeader > >', 'ns3::olsr::MessageList') - typehandlers.add_type_alias('std::vector< ns3::olsr::IfaceAssocTuple, std::allocator< ns3::olsr::IfaceAssocTuple > >', 'ns3::olsr::IfaceAssocSet') - typehandlers.add_type_alias('std::vector< ns3::olsr::NeighborTuple, std::allocator< ns3::olsr::NeighborTuple > >', 'ns3::olsr::NeighborSet') - typehandlers.add_type_alias('std::vector< ns3::olsr::TwoHopNeighborTuple, std::allocator< ns3::olsr::TwoHopNeighborTuple > >', 'ns3::olsr::TwoHopNeighborSet') - typehandlers.add_type_alias('std::vector< ns3::olsr::TopologyTuple, std::allocator< ns3::olsr::TopologyTuple > >', 'ns3::olsr::TopologySet') - typehandlers.add_type_alias('std::vector< ns3::olsr::LinkTuple, std::allocator< ns3::olsr::LinkTuple > >', 'ns3::olsr::LinkSet') def register_methods(root_module): register_Ns3OlsrState_methods(root_module, root_module['ns3::OlsrState']) diff --git a/bindings/python/ns3_module_onoff.py b/bindings/python/ns3_module_onoff.py index 1de43a429..2d253ec6d 100644 --- a/bindings/python/ns3_module_onoff.py +++ b/bindings/python/ns3_module_onoff.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_packet_sink.py b/bindings/python/ns3_module_packet_sink.py index ce901e7a9..8478d79c4 100644 --- a/bindings/python/ns3_module_packet_sink.py +++ b/bindings/python/ns3_module_packet_sink.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_point_to_point.py b/bindings/python/ns3_module_point_to_point.py index 14abbe961..2360f1f62 100644 --- a/bindings/python/ns3_module_point_to_point.py +++ b/bindings/python/ns3_module_point_to_point.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_simulator.py b/bindings/python/ns3_module_simulator.py index 1147dfa79..b2271d232 100644 --- a/bindings/python/ns3_module_simulator.py +++ b/bindings/python/ns3_module_simulator.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() @@ -61,10 +61,6 @@ def register_types(module): module.add_class('RealtimeSimulatorImpl', parent=root_module['ns3::SimulatorImpl']) ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl::SynchronizationMode [enumeration] module.add_enum('SynchronizationMode', ['SYNC_BEST_EFFORT', 'SYNC_HARD_LIMIT'], outer_class=root_module['ns3::RealtimeSimulatorImpl']) - typehandlers.add_type_alias('ns3::TimeUnit< 2 >', 'ns3::TimeSquare') - typehandlers.add_type_alias('ns3::TimeUnit< - 1 >', 'ns3::TimeInvert') - typehandlers.add_type_alias('ns3::TimeUnit< 0 >', 'ns3::Scalar') - typehandlers.add_type_alias('ns3::TimeUnit< 1 >', 'ns3::Time') ## Register a nested module for the namespace Config diff --git a/bindings/python/ns3_module_stats.py b/bindings/python/ns3_module_stats.py index d37a6b328..59532ca76 100644 --- a/bindings/python/ns3_module_stats.py +++ b/bindings/python/ns3_module_stats.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() @@ -25,8 +25,6 @@ def register_types(module): module.add_class('CounterCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator']) ## packet-data-calculators.h: ns3::PacketCounterCalculator [class] module.add_class('PacketCounterCalculator', parent=root_module['ns3::CounterCalculator< unsigned int >']) - typehandlers.add_type_alias('std::list< ns3::Ptr< ns3::DataCalculator >, std::allocator< ns3::Ptr< ns3::DataCalculator > > >', 'ns3::DataCalculatorList') - typehandlers.add_type_alias('std::list< std::pair< std::string, std::string >, std::allocator< std::pair< std::string, std::string > > >', 'ns3::MetadataList') ## Register a nested module for the namespace Config diff --git a/bindings/python/ns3_module_tap_bridge.py b/bindings/python/ns3_module_tap_bridge.py index 85cb35479..ba5310e25 100644 --- a/bindings/python/ns3_module_tap_bridge.py +++ b/bindings/python/ns3_module_tap_bridge.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_udp_echo.py b/bindings/python/ns3_module_udp_echo.py index 054694d98..dae92a56e 100644 --- a/bindings/python/ns3_module_udp_echo.py +++ b/bindings/python/ns3_module_udp_echo.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_v4ping.py b/bindings/python/ns3_module_v4ping.py index 3959bc0ee..ec2bc2357 100644 --- a/bindings/python/ns3_module_v4ping.py +++ b/bindings/python/ns3_module_v4ping.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() diff --git a/bindings/python/ns3_module_wifi.py b/bindings/python/ns3_module_wifi.py index 432c47665..e13cc31ea 100644 --- a/bindings/python/ns3_module_wifi.py +++ b/bindings/python/ns3_module_wifi.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass def register_types(module): root_module = module.get_root() @@ -135,7 +135,6 @@ def register_types(module): module.add_class('YansWifiChannel', parent=root_module['ns3::WifiChannel']) ## aarf-wifi-manager.h: ns3::AarfWifiManager [class] module.add_class('AarfWifiManager', parent=root_module['ns3::ArfWifiManager']) - typehandlers.add_type_alias('std::vector< ns3::ThresholdsItem, std::allocator< ns3::ThresholdsItem > >', 'ns3::Thresholds') ## Register a nested module for the namespace Config diff --git a/bindings/python/ns3modulegen_generated.py b/bindings/python/ns3modulegen_generated.py index 4a898b5d9..694befa0b 100644 --- a/bindings/python/ns3modulegen_generated.py +++ b/bindings/python/ns3modulegen_generated.py @@ -1,4 +1,4 @@ -from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers +from pybindgen import Module, FileCodeSink, param, retval, cppclass import pybindgen.settings From 0e9b2360a2bf0c37742385bdfe1990b415a236ee Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 21 May 2009 06:07:03 -0700 Subject: [PATCH 10/11] Fix bug 570 (ArpCache not registered) --- src/internet-stack/arp-cache.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/internet-stack/arp-cache.cc b/src/internet-stack/arp-cache.cc index b56f05fb8..a3a272bf3 100644 --- a/src/internet-stack/arp-cache.cc +++ b/src/internet-stack/arp-cache.cc @@ -33,6 +33,8 @@ NS_LOG_COMPONENT_DEFINE ("ArpCache"); namespace ns3 { +NS_OBJECT_ENSURE_REGISTERED (ArpCache); + TypeId ArpCache::GetTypeId (void) { From 71272db683ca86b8a198328f068b32790321e993 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 21 May 2009 06:46:38 -0700 Subject: [PATCH 11/11] initialize timer in Timer unit tests --- src/simulator/timer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulator/timer.cc b/src/simulator/timer.cc index a79f94670..8f3ac086e 100644 --- a/src/simulator/timer.cc +++ b/src/simulator/timer.cc @@ -222,7 +222,7 @@ TimerTests::RunTests (void) { bool result = true; - Timer timer; + Timer timer = Timer (Timer::CANCEL_ON_DESTROY); timer.SetFunction (&bari); timer.SetArguments (1);