diff --git a/bindings/python/ns3_module_common.py b/bindings/python/ns3_module_common.py index 64bdf7f31..bfeb1f5a0 100644 --- a/bindings/python/ns3_module_common.py +++ b/bindings/python/ns3_module_common.py @@ -548,11 +548,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_core.py b/bindings/python/ns3_module_core.py index e108eba13..f92b4d19a 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -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_helper.py b/bindings/python/ns3_module_helper.py index 2b4b7f2f5..09473b2f9 100644 --- a/bindings/python/ns3_module_helper.py +++ b/bindings/python/ns3_module_helper.py @@ -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_simulator.py b/bindings/python/ns3_module_simulator.py index 78bef44f9..b2271d232 100644 --- a/bindings/python/ns3_module_simulator.py +++ b/bindings/python/ns3_module_simulator.py @@ -277,11 +277,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/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 diff --git a/src/common/packet.cc b/src/common/packet.cc index 076f1d735..ee92b622a 100644 --- a/src/common/packet.cc +++ b/src/common/packet.cc @@ -508,13 +508,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 0a6c87279..cb698e226 100644 --- a/src/common/packet.h +++ b/src/common/packet.h @@ -368,8 +368,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/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) { 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 () 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 diff --git a/src/simulator/timer.cc b/src/simulator/timer.cc index da36e2d13..8f3ac086e 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) @@ -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); diff --git a/wscript b/wscript index 8a4cd5043..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 @@ -255,13 +256,19 @@ 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 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') conf.sub_config('bindings/python') @@ -294,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': @@ -480,11 +487,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)