diff --git a/AUTHORS b/AUTHORS index 6cb66345f..93e5c0225 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,16 +1,18 @@ -Kirill V. Andreev (kirillano@yandex.ru) +Kirill Andreev (andreev@iitp.ru) Nicola Baldo (nbaldo@cttc.es) Mirko Banchi (mk.banchi@gmail.com) +Ramon Bauza (monbauza@gmail.com) Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu) Raj Bhattacharjea (raj.b@gatech.edu) Timo Bingmann (timo.bingmann@student.kit.edu) +Pavel Boyko (boyko@iitp.ru) Gustavo Carneiro (gjc@inescporto.pt, gjcarneiro@gmail.com) Angelos Chatzipapas (chatzipa@ceid.upatras.gr) Luis Cortes (cortes@gatech.edu) Craig Dowell (craigdo@ee.washington.edu) David Gross (gdavid.devel@gmail.com) Tom Henderson (tomhend@u.washington.edu) -Andrey Hippo (ahippo@yandex.ru) +Andrey Mazo (mazo@iitp.ru) Sam Jansen (sam.jansen@gmail.com) Liu Jian (liujatp@gmail.com) Joe Kopena (tjkopena@cs.drexel.edu) @@ -29,3 +31,4 @@ Mauro Tortonesi (mauro.tortonesi@unife.it) Sebastien Vincent (vincent@clarinet.u-strasbg.fr) Guillaume Vu-Brugier (gvubrugier@gmail.com) Florian Westphal (fw@strlen.de) +Josh Pelkey (jpelkey@gatech.edu) diff --git a/CHANGES.html b/CHANGES.html index d2269f231..c8ae3b493 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -67,6 +67,7 @@ allows a user to insert a route and have it redistributed like an OSPF external LSA to the rest of the topology.

+
  • Athstats

    New classes AthstatsWifiTraceSink and AthstatsHelper.

    @@ -75,6 +76,7 @@ external LSA to the rest of the topology.

    New trace sources exported by WifiRemoteStationManager: MacTxRtsFailed, MacTxDataFailed, MacTxFinalRtsFailed and MacTxFinalDataFailed.

  • +
  • IPv6 additions

    Add an IPv6 protocol and ICMPv6 capability.

    +

    +
  • + +
  • Wireless Mesh Networking models + +

    +
  • + +
  • 802.11 enhancements +

    +

    + +

    +
  • + +
  • Nix-vector Routing +

    Add nix-vector routing protocol +

    + +

    +
  • +

    Changes to existing API:

    diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 4175cd258..bf7d4bb52 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -30,8 +30,16 @@ http://www.nsnam.org/wiki/index.php/Installation New user-visible features ------------------------- - a) Add an implementation of the minstrel rate control algorithm - (Duy Nguyen for gsoc) + a) 802.11 models: + - Add an implementation of the minstrel rate control algorithm + (Duy Nguyen for gsoc) + - AthstatsHelper: enables the wifi device to produce periodic + reports similar to the ones generated by madwifi's + athstats tool (Nicola Baldo) + - 10MHz and 5MHz channel width supported by 802.11a model + (Ramon Bauza and Kirill Andreev) + - Channel switching support. YansWifiPhy can now switch among + different channels (Ramon Bauza and Pavel Boyko) b) IPv6 models: - IPv6 interface; @@ -46,11 +54,15 @@ New user-visible features - Examples (ping6, simple-routing-ping6, radvd, radvd-two-prefix, icmpv6-redirect). - c) added AthstatsHelper, which enables the wifi device to produce - periodic reports similar to the ones generated by madwifi's - athstats tool (Nicola Baldo) - - + c) Wireless Mesh Networking models: + - General multi-interface mesh stack infrastructure (devices/mesh module). + - IEEE 802.11s (Draft 3.0) model including Peering Management Protocol and HWMP. + - Forwarding Layer for Meshing (FLAME) protocol. + + d) Nix-vector routing: + - Ipv4NixVectorHelper + - Examples (nix-simple, nms-p2p-nix) + API changes from ns-3.5 ----------------------- API changes for this release are documented in the file CHANGES.html. diff --git a/bindings/python/callbacks_list.py b/bindings/python/apidefs/gcc-ILP32/callbacks_list.py similarity index 72% rename from bindings/python/callbacks_list.py rename to bindings/python/apidefs/gcc-ILP32/callbacks_list.py index bfe090aa6..da45e917c 100644 --- a/bindings/python/callbacks_list.py +++ b/bindings/python/apidefs/gcc-ILP32/callbacks_list.py @@ -2,12 +2,17 @@ callback_classes = [ ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['bool', 'ns3::Ptr', 'ns3::Address const&', 'ns3::Address const&', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Mac48Address', 'ns3::Mac48Address', 'unsigned int', 'bool', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'unsigned int', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::dot11s::PeerLink::PeerState', 'ns3::dot11s::PeerLink::PeerState', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::WifiMacHeader const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['unsigned int', 'ns3::Mac48Address', 'ns3::Ptr', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr', 'ns3::WifiMacHeader const*', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['bool', 'ns3::Ptr', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], - ['void', 'ns3::WifiMacHeader const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['std::vector >', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'bool', 'ns3::Ptr', 'ns3::Mac48Address', 'ns3::Mac48Address', 'unsigned short', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['bool', 'std::string', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['bool', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['bool', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], diff --git a/bindings/python/ns3_module_bridge.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_bridge.py similarity index 95% rename from bindings/python/ns3_module_bridge.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_bridge.py index 011a75fc2..76c1401b9 100644 --- a/bindings/python/ns3_module_bridge.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_bridge.py @@ -26,6 +26,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -50,6 +62,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -270,6 +290,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -283,6 +305,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_common.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py similarity index 89% rename from bindings/python/ns3_module_common.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_common.py index 4175cfe55..a7a0c4975 100644 --- a/bindings/python/ns3_module_common.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py @@ -39,6 +39,8 @@ def register_types(module): module.add_class('PacketTagList') ## packet-tag-list.h: ns3::PacketTagList::TagData [struct] module.add_class('TagData', outer_class=root_module['ns3::PacketTagList']) + ## pcap-file.h: ns3::PcapFile [class] + module.add_class('PcapFile') ## tag.h: ns3::Tag [class] module.add_class('Tag', parent=root_module['ns3::ObjectBase']) ## tag-buffer.h: ns3::TagBuffer [class] @@ -63,6 +65,8 @@ def register_types(module): module.add_class('ErrorModel', parent=root_module['ns3::Object']) ## error-model.h: ns3::ListErrorModel [class] module.add_class('ListErrorModel', parent=root_module['ns3::ErrorModel']) + ## nix-vector.h: ns3::NixVector [class] + module.add_class('NixVector', parent=root_module['ns3::Object']) ## error-model.h: ns3::RateErrorModel [class] module.add_class('RateErrorModel', parent=root_module['ns3::ErrorModel']) @@ -84,6 +88,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -108,6 +124,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -133,6 +157,7 @@ def register_methods(root_module): register_Ns3PacketTagIteratorItem_methods(root_module, root_module['ns3::PacketTagIterator::Item']) register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList']) register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData']) + register_Ns3PcapFile_methods(root_module, root_module['ns3::PcapFile']) register_Ns3Tag_methods(root_module, root_module['ns3::Tag']) register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer']) register_Ns3AsciiWriter_methods(root_module, root_module['ns3::AsciiWriter']) @@ -144,6 +169,7 @@ def register_methods(root_module): register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) register_Ns3ErrorModel_methods(root_module, root_module['ns3::ErrorModel']) register_Ns3ListErrorModel_methods(root_module, root_module['ns3::ListErrorModel']) + register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector']) register_Ns3RateErrorModel_methods(root_module, root_module['ns3::RateErrorModel']) return @@ -588,6 +614,11 @@ def register_Ns3Packet_methods(root_module, cls): 'ns3::ByteTagIterator', [], is_const=True) + ## packet.h: ns3::Ptr ns3::Packet::GetNixVector() const [member function] + cls.add_method('GetNixVector', + 'ns3::Ptr< ns3::NixVector >', + [], + is_const=True) ## packet.h: ns3::PacketTagIterator ns3::Packet::GetPacketTagIterator() const [member function] cls.add_method('GetPacketTagIterator', 'ns3::PacketTagIterator', @@ -670,6 +701,10 @@ def register_Ns3Packet_methods(root_module, cls): 'ns3::Buffer', [], is_const=True) + ## packet.h: void ns3::Packet::SetNixVector(ns3::Ptr arg0) [member function] + cls.add_method('SetNixVector', + 'void', + [param('ns3::Ptr< ns3::NixVector >', 'arg0')]) return def register_Ns3PacketMetadata_methods(root_module, cls): @@ -859,6 +894,69 @@ def register_Ns3PacketTagListTagData_methods(root_module, cls): cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) return +def register_Ns3PcapFile_methods(root_module, cls): + ## pcap-file.h: ns3::PcapFile::PcapFile(ns3::PcapFile const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapFile const &', 'arg0')]) + ## pcap-file.h: ns3::PcapFile::PcapFile() [constructor] + cls.add_constructor([]) + ## pcap-file.h: void ns3::PcapFile::Close() [member function] + cls.add_method('Close', + 'void', + []) + ## pcap-file.h: uint32_t ns3::PcapFile::GetDataLinkType() [member function] + cls.add_method('GetDataLinkType', + 'uint32_t', + []) + ## pcap-file.h: uint32_t ns3::PcapFile::GetMagic() [member function] + cls.add_method('GetMagic', + 'uint32_t', + []) + ## pcap-file.h: uint32_t ns3::PcapFile::GetSigFigs() [member function] + cls.add_method('GetSigFigs', + 'uint32_t', + []) + ## pcap-file.h: uint32_t ns3::PcapFile::GetSnapLen() [member function] + cls.add_method('GetSnapLen', + 'uint32_t', + []) + ## pcap-file.h: bool ns3::PcapFile::GetSwapMode() [member function] + cls.add_method('GetSwapMode', + 'bool', + []) + ## pcap-file.h: int32_t ns3::PcapFile::GetTimeZoneOffset() [member function] + cls.add_method('GetTimeZoneOffset', + 'int32_t', + []) + ## pcap-file.h: uint16_t ns3::PcapFile::GetVersionMajor() [member function] + cls.add_method('GetVersionMajor', + 'uint16_t', + []) + ## pcap-file.h: uint16_t ns3::PcapFile::GetVersionMinor() [member function] + cls.add_method('GetVersionMinor', + 'uint16_t', + []) + ## pcap-file.h: bool ns3::PcapFile::Init(uint32_t dataLinkType, uint32_t snapLen=ns3::PcapFile::SNAPLEN_DEFAULT, int32_t timeZoneCorrection=ns3::PcapFile::ZONE_DEFAULT, bool swapMode=false) [member function] + cls.add_method('Init', + 'bool', + [param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT'), param('int32_t', 'timeZoneCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT'), param('bool', 'swapMode', default_value='false')]) + ## pcap-file.h: bool ns3::PcapFile::Open(std::string const & filename, std::string const & mode) [member function] + cls.add_method('Open', + 'bool', + [param('std::string const &', 'filename'), param('std::string const &', 'mode')]) + ## pcap-file.h: bool ns3::PcapFile::Read(uint8_t * const data, uint32_t maxBytes, uint32_t & tsSec, uint32_t & tsUsec, uint32_t & inclLen, uint32_t & origLen, uint32_t & readLen) [member function] + cls.add_method('Read', + 'bool', + [param('uint8_t * const', 'data'), param('uint32_t', 'maxBytes'), param('uint32_t &', 'tsSec'), param('uint32_t &', 'tsUsec'), param('uint32_t &', 'inclLen'), param('uint32_t &', 'origLen'), param('uint32_t &', 'readLen')]) + ## pcap-file.h: bool ns3::PcapFile::Write(uint32_t tsSec, uint32_t tsUsec, uint8_t const * const data, uint32_t totalLen) [member function] + cls.add_method('Write', + 'bool', + [param('uint32_t', 'tsSec'), param('uint32_t', 'tsUsec'), param('uint8_t const * const', 'data'), param('uint32_t', 'totalLen')]) + ## pcap-file.h: ns3::PcapFile::SNAPLEN_DEFAULT [variable] + cls.add_static_attribute('SNAPLEN_DEFAULT', 'uint32_t const', is_const=True) + ## pcap-file.h: ns3::PcapFile::ZONE_DEFAULT [variable] + cls.add_static_attribute('ZONE_DEFAULT', 'int32_t const', is_const=True) + return + def register_Ns3Tag_methods(root_module, cls): ## tag.h: ns3::Tag::Tag() [constructor] cls.add_constructor([]) @@ -1222,6 +1320,60 @@ def register_Ns3ListErrorModel_methods(root_module, cls): visibility='private', is_virtual=True) return +def register_Ns3NixVector_methods(root_module, cls): + cls.add_output_stream_operator() + ## nix-vector.h: ns3::NixVector::NixVector() [constructor] + cls.add_constructor([]) + ## nix-vector.h: ns3::NixVector::NixVector(ns3::NixVector const & o) [copy constructor] + cls.add_constructor([param('ns3::NixVector const &', 'o')]) + ## nix-vector.h: void ns3::NixVector::AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits) [member function] + cls.add_method('AddNeighborIndex', + 'void', + [param('uint32_t', 'newBits'), param('uint32_t', 'numberOfBits')]) + ## nix-vector.h: uint32_t ns3::NixVector::BitCount(uint32_t numberOfNeighbors) const [member function] + cls.add_method('BitCount', + 'uint32_t', + [param('uint32_t', 'numberOfNeighbors')], + is_const=True) + ## nix-vector.h: ns3::Ptr ns3::NixVector::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::NixVector >', + [], + is_const=True) + ## nix-vector.h: uint32_t ns3::NixVector::Deserialize(ns3::Buffer::Iterator i) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'i')]) + ## nix-vector.h: void ns3::NixVector::DumpNixVector(std::ostream & os) const [member function] + cls.add_method('DumpNixVector', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## nix-vector.h: uint32_t ns3::NixVector::ExtractNeighborIndex(uint32_t numberOfBits) [member function] + cls.add_method('ExtractNeighborIndex', + 'uint32_t', + [param('uint32_t', 'numberOfBits')]) + ## nix-vector.h: uint32_t ns3::NixVector::GetRemainingBits() [member function] + cls.add_method('GetRemainingBits', + 'uint32_t', + []) + ## nix-vector.h: uint32_t ns3::NixVector::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## nix-vector.h: static ns3::TypeId ns3::NixVector::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## nix-vector.h: void ns3::NixVector::Serialize(ns3::Buffer::Iterator i, uint32_t size) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'i'), param('uint32_t', 'size')], + is_const=True) + return + def register_Ns3RateErrorModel_methods(root_module, cls): ## error-model.h: ns3::RateErrorModel::RateErrorModel(ns3::RateErrorModel const & arg0) [copy constructor] cls.add_constructor([param('ns3::RateErrorModel const &', 'arg0')]) @@ -1290,6 +1442,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -1303,6 +1457,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_contrib.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_contrib.py similarity index 97% rename from bindings/python/ns3_module_contrib.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_contrib.py index ef8989f31..e953c1869 100644 --- a/bindings/python/ns3_module_contrib.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_contrib.py @@ -58,6 +58,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -82,6 +94,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -481,6 +501,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -494,6 +516,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_core.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py similarity index 91% rename from bindings/python/ns3_module_core.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_core.py index 06d6e8014..ec79d6a9f 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py @@ -69,6 +69,14 @@ def register_types(module): module.add_class('SystemThread') ## system-wall-clock-ms.h: ns3::SystemWallClockMs [class] module.add_class('SystemWallClockMs') + ## test.h: ns3::TestCase [class] + module.add_class('TestCase', allow_subclassing=True) + ## test.h: ns3::TestRunner [class] + module.add_class('TestRunner') + ## test.h: ns3::TestSuite [class] + module.add_class('TestSuite', allow_subclassing=True) + ## test.h: ns3::TestSuite::TestType [enumeration] + module.add_enum('TestType', ['BVT', 'UNIT', 'SYSTEM', 'EXAMPLE', 'PERFORMANCE'], outer_class=root_module['ns3::TestSuite']) ## trace-source-accessor.h: ns3::TraceSourceAccessor [class] module.add_class('TraceSourceAccessor', allow_subclassing=True) ## random-variable.h: ns3::TriangularVariable [class] @@ -189,6 +197,8 @@ def register_types(module): root_module['ns3::TracedValue< unsigned int >'].implicitly_converts_to(root_module['ns3::EnumValue']) module.add_container('std::list< ns3::Ptr< ns3::RadvdPrefix > >', 'ns3::Ptr< ns3::RadvdPrefix >', container_type='list') module.add_container('std::list< ns3::Ptr< ns3::Packet > >', 'ns3::Ptr< ns3::Packet >', container_type='list') + module.add_container('std::vector< ns3::Ptr< ns3::FlowProbe > >', 'ns3::Ptr< ns3::FlowProbe >', container_type='vector') + module.add_container('std::vector< ns3::Ptr< ns3::NetDevice > >', 'ns3::Ptr< ns3::NetDevice >', container_type='vector') typehandlers.add_type_alias('ns3::Vector3D', 'ns3::Vector') typehandlers.add_type_alias('ns3::Vector3D*', 'ns3::Vector*') typehandlers.add_type_alias('ns3::Vector3D&', 'ns3::Vector&') @@ -220,6 +230,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -247,6 +269,15 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + module.add_container('std::vector< ns3::Ptr< ns3::dot11s::IeBeaconTimingUnit > >', 'ns3::Ptr< ns3::dot11s::IeBeaconTimingUnit >', container_type='vector') + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -281,6 +312,9 @@ def register_methods(root_module): register_Ns3SystemMutex_methods(root_module, root_module['ns3::SystemMutex']) register_Ns3SystemThread_methods(root_module, root_module['ns3::SystemThread']) register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs']) + register_Ns3TestCase_methods(root_module, root_module['ns3::TestCase']) + register_Ns3TestRunner_methods(root_module, root_module['ns3::TestRunner']) + register_Ns3TestSuite_methods(root_module, root_module['ns3::TestSuite']) register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor']) register_Ns3TriangularVariable_methods(root_module, root_module['ns3::TriangularVariable']) register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId']) @@ -937,6 +971,228 @@ def register_Ns3SystemWallClockMs_methods(root_module, cls): []) return +def register_Ns3TestCase_methods(root_module, cls): + ## test.h: ns3::TestCase::TestCase(std::string name) [constructor] + cls.add_constructor([param('std::string', 'name')]) + ## test.h: bool ns3::TestCase::Run() [member function] + cls.add_method('Run', + 'bool', + []) + ## test.h: void ns3::TestCase::SetVerbose(bool verbose) [member function] + cls.add_method('SetVerbose', + 'void', + [param('bool', 'verbose')]) + ## test.h: void ns3::TestCase::SetName(std::string name) [member function] + cls.add_method('SetName', + 'void', + [param('std::string', 'name')]) + ## test.h: std::string ns3::TestCase::GetName() [member function] + cls.add_method('GetName', + 'std::string', + []) + ## test.h: void ns3::TestCase::SetBaseDir(std::string dir) [member function] + cls.add_method('SetBaseDir', + 'void', + [param('std::string', 'dir')]) + ## test.h: std::string ns3::TestCase::GetBaseDir() [member function] + cls.add_method('GetBaseDir', + 'std::string', + []) + ## test.h: std::string ns3::TestCase::GetSourceDir(std::string file) [member function] + cls.add_method('GetSourceDir', + 'std::string', + [param('std::string', 'file')]) + ## test.h: void ns3::TestCase::SetStream(std::ofstream * ofs) [member function] + cls.add_method('SetStream', + 'void', + [param('std::ofstream *', 'ofs')]) + ## test.h: std::ofstream * ns3::TestCase::GetStream() [member function] + cls.add_method('GetStream', + 'std::ofstream *', + []) + ## test.h: void ns3::TestCase::SetErrorStatus(bool error) [member function] + cls.add_method('SetErrorStatus', + 'void', + [param('bool', 'error')]) + ## test.h: bool ns3::TestCase::GetErrorStatus() [member function] + cls.add_method('GetErrorStatus', + 'bool', + []) + ## test.h: void ns3::TestCase::ReportStart() [member function] + cls.add_method('ReportStart', + 'void', + []) + ## test.h: void ns3::TestCase::ReportSuccess() [member function] + cls.add_method('ReportSuccess', + 'void', + []) + ## test.h: void ns3::TestCase::ReportFailure(std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) [member function] + cls.add_method('ReportFailure', + 'void', + [param('std::string', 'cond'), param('std::string', 'actual'), param('std::string', 'limit'), param('std::string', 'message'), param('std::string', 'file'), param('int32_t', 'line')]) + ## test.h: void ns3::TestCase::ReportEnd() [member function] + cls.add_method('ReportEnd', + 'void', + []) + ## test.h: void ns3::TestCase::DoReportStart() [member function] + cls.add_method('DoReportStart', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoReportSuccess() [member function] + cls.add_method('DoReportSuccess', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoReportFailure(std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) [member function] + cls.add_method('DoReportFailure', + 'void', + [param('std::string', 'cond'), param('std::string', 'actual'), param('std::string', 'limit'), param('std::string', 'message'), param('std::string', 'file'), param('int32_t', 'line')], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoReportEnd() [member function] + cls.add_method('DoReportEnd', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoSetup() [member function] + cls.add_method('DoSetup', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: bool ns3::TestCase::DoRun() [member function] + cls.add_method('DoRun', + 'bool', + [], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoTeardown() [member function] + cls.add_method('DoTeardown', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3TestRunner_methods(root_module, cls): + ## test.h: ns3::TestRunner::TestRunner() [constructor] + cls.add_constructor([]) + ## test.h: ns3::TestRunner::TestRunner(ns3::TestRunner const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TestRunner const &', 'arg0')]) + ## test.h: static uint32_t ns3::TestRunner::AddTestSuite(ns3::TestSuite * testSuite) [member function] + cls.add_method('AddTestSuite', + 'uint32_t', + [param('ns3::TestSuite *', 'testSuite')], + is_static=True) + ## test.h: static uint32_t ns3::TestRunner::GetNTestSuites() [member function] + cls.add_method('GetNTestSuites', + 'uint32_t', + [], + is_static=True) + ## test.h: static ns3::TestSuite * ns3::TestRunner::GetTestSuite(uint32_t n) [member function] + cls.add_method('GetTestSuite', + 'ns3::TestSuite *', + [param('uint32_t', 'n')], + is_static=True) + return + +def register_Ns3TestSuite_methods(root_module, cls): + ## test.h: ns3::TestSuite::TestSuite(std::string name, ns3::TestSuite::TestType type=::ns3::TestSuite::UNIT) [constructor] + cls.add_constructor([param('std::string', 'name'), param('ns3::TestSuite::TestType', 'type', default_value='::ns3::TestSuite::UNIT')]) + ## test.h: bool ns3::TestSuite::Run() [member function] + cls.add_method('Run', + 'bool', + []) + ## test.h: uint32_t ns3::TestSuite::AddTestCase(ns3::TestCase * testCase) [member function] + cls.add_method('AddTestCase', + 'uint32_t', + [param('ns3::TestCase *', 'testCase')]) + ## test.h: uint32_t ns3::TestSuite::GetNTestCases() [member function] + cls.add_method('GetNTestCases', + 'uint32_t', + []) + ## test.h: ns3::TestCase * ns3::TestSuite::GetTestCase(uint32_t i) [member function] + cls.add_method('GetTestCase', + 'ns3::TestCase *', + [param('uint32_t', 'i')]) + ## test.h: ns3::TestSuite::TestType ns3::TestSuite::GetTestType() [member function] + cls.add_method('GetTestType', + 'ns3::TestSuite::TestType', + []) + ## test.h: void ns3::TestSuite::SetVerbose(bool verbose) [member function] + cls.add_method('SetVerbose', + 'void', + [param('bool', 'verbose')]) + ## test.h: void ns3::TestSuite::SetName(std::string name) [member function] + cls.add_method('SetName', + 'void', + [param('std::string', 'name')]) + ## test.h: std::string ns3::TestSuite::GetName() [member function] + cls.add_method('GetName', + 'std::string', + []) + ## test.h: void ns3::TestSuite::SetBaseDir(std::string basedir) [member function] + cls.add_method('SetBaseDir', + 'void', + [param('std::string', 'basedir')]) + ## test.h: std::string ns3::TestSuite::GetBaseDir() [member function] + cls.add_method('GetBaseDir', + 'std::string', + []) + ## test.h: void ns3::TestSuite::SetStream(std::ofstream * ofs) [member function] + cls.add_method('SetStream', + 'void', + [param('std::ofstream *', 'ofs')]) + ## test.h: void ns3::TestSuite::ReportStart() [member function] + cls.add_method('ReportStart', + 'void', + []) + ## test.h: void ns3::TestSuite::ReportSuccess() [member function] + cls.add_method('ReportSuccess', + 'void', + []) + ## test.h: void ns3::TestSuite::ReportFailure() [member function] + cls.add_method('ReportFailure', + 'void', + []) + ## test.h: void ns3::TestSuite::ReportEnd() [member function] + cls.add_method('ReportEnd', + 'void', + []) + ## test.h: void ns3::TestSuite::DoReportStart() [member function] + cls.add_method('DoReportStart', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoReportSuccess() [member function] + cls.add_method('DoReportSuccess', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoReportFailure() [member function] + cls.add_method('DoReportFailure', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoReportEnd() [member function] + cls.add_method('DoReportEnd', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoSetup() [member function] + cls.add_method('DoSetup', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: bool ns3::TestSuite::DoRun() [member function] + cls.add_method('DoRun', + 'bool', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoTeardown() [member function] + cls.add_method('DoTeardown', + 'void', + [], + visibility='protected', is_virtual=True) + return + def register_Ns3TraceSourceAccessor_methods(root_module, cls): ## trace-source-accessor.h: ns3::TraceSourceAccessor::TraceSourceAccessor(ns3::TraceSourceAccessor const & arg0) [copy constructor] cls.add_constructor([param('ns3::TraceSourceAccessor const &', 'arg0')]) @@ -2203,7 +2459,7 @@ def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls): cls.add_constructor([param('ns3::BooleanValue const &', 'value')]) ## traced-value.h: ns3::TracedValue::TracedValue(ns3::EnumValue const & value) [constructor] cls.add_constructor([param('ns3::EnumValue const &', 'value')]) - ## 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')]) @@ -2211,7 +2467,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::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')]) @@ -2369,6 +2625,10 @@ def register_functions(root_module): module.add_function('MakeVectorChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) + ## test.h: extern bool ns3::TestDoubleIsEqual(double const a, double const b, double const epsilon=std::numeric_limits::epsilon()) [free function] + module.add_function('TestDoubleIsEqual', + 'bool', + [param('double const', 'a'), param('double const', 'b'), param('double const', 'epsilon', default_value='std::numeric_limits::epsilon()')]) ## type-name.h: extern std::string ns3::TypeNameGet() [free function] module.add_function('TypeNameGet', 'std::string', @@ -2422,6 +2682,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -2491,6 +2753,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): ## double.h: extern ns3::Ptr ns3::internal::MakeDoubleChecker(double min, double max, std::string name) [free function] module.add_function('MakeDoubleChecker', diff --git a/bindings/python/ns3_module_csma.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_csma.py similarity index 96% rename from bindings/python/ns3_module_csma.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_csma.py index 7ce291dd1..f70b6d99b 100644 --- a/bindings/python/ns3_module_csma.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_csma.py @@ -34,6 +34,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -58,6 +70,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -424,6 +444,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -437,6 +459,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_dot11s.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_dot11s.py new file mode 100644 index 000000000..71e2d9cb1 --- /dev/null +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_dot11s.py @@ -0,0 +1,782 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sPathSelectionProtocol [enumeration] + module.add_enum('dot11sPathSelectionProtocol', ['PROTOCOL_HWMP']) + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sSynchronizationProtocolIdentifier [enumeration] + module.add_enum('dot11sSynchronizationProtocolIdentifier', ['SYNC_NEIGHBOUR_OFFSET', 'SYNC_NULL']) + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sCongestionControlMode [enumeration] + module.add_enum('dot11sCongestionControlMode', ['CONGESTION_SIGNALING', 'CONGESTION_NULL']) + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sAuthenticationProtocol [enumeration] + module.add_enum('dot11sAuthenticationProtocol', ['AUTH_NULL', 'AUTH_SAE']) + ## ie-dot11s-peer-management.h: ns3::dot11s::PmpReasonCode [enumeration] + module.add_enum('PmpReasonCode', ['REASON11S_PEERING_CANCELLED', 'REASON11S_MESH_MAX_PEERS', 'REASON11S_MESH_CAPABILITY_POLICY_VIOLATION', 'REASON11S_MESH_CLOSE_RCVD', 'REASON11S_MESH_MAX_RETRIES', 'REASON11S_MESH_CONFIRM_TIMEOUT', 'REASON11S_MESH_INVALID_GTK', 'REASON11S_MESH_INCONSISTENT_PARAMETERS', 'REASON11S_MESH_INVALID_SECURITY_CAPABILITY', 'REASON11S_RESERVED']) + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sPathSelectionMetric [enumeration] + module.add_enum('dot11sPathSelectionMetric', ['METRIC_AIRTIME']) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability [class] + module.add_class('Dot11sMeshCapability') + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol [class] + module.add_class('HwmpProtocol', parent=root_module['ns3::MeshL2RoutingProtocol']) + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination [struct] + module.add_class('FailedDestination', outer_class=root_module['ns3::dot11s::HwmpProtocol']) + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTiming [class] + module.add_class('IeBeaconTiming', parent=root_module['ns3::WifiInformationElement']) + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTimingUnit [class] + module.add_class('IeBeaconTimingUnit', parent=root_module['ns3::RefCountBase']) + ## ie-dot11s-configuration.h: ns3::dot11s::IeConfiguration [class] + module.add_class('IeConfiguration', parent=root_module['ns3::WifiInformationElement']) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId [class] + module.add_class('IeMeshId', parent=root_module['ns3::WifiInformationElement']) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdChecker [class] + module.add_class('IeMeshIdChecker', parent=root_module['ns3::AttributeChecker']) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdValue [class] + module.add_class('IeMeshIdValue', parent=root_module['ns3::AttributeValue']) + ## ie-dot11s-peer-management.h: ns3::dot11s::IePeerManagement [class] + module.add_class('IePeerManagement', parent=root_module['ns3::WifiInformationElement']) + ## ie-dot11s-peer-management.h: ns3::dot11s::IePeerManagement::Subtype [enumeration] + module.add_enum('Subtype', ['PEER_OPEN', 'PEER_CONFIRM', 'PEER_CLOSE'], outer_class=root_module['ns3::dot11s::IePeerManagement']) + ## peer-link.h: ns3::dot11s::PeerLink [class] + module.add_class('PeerLink', parent=root_module['ns3::Object']) + ## peer-link.h: ns3::dot11s::PeerLink::PeerState [enumeration] + module.add_enum('PeerState', ['IDLE', 'OPN_SNT', 'CNF_RCVD', 'OPN_RCVD', 'ESTAB', 'HOLDING'], outer_class=root_module['ns3::dot11s::PeerLink']) + ## peer-management-protocol.h: ns3::dot11s::PeerManagementProtocol [class] + module.add_class('PeerManagementProtocol', parent=root_module['ns3::Object']) + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Dot11sDot11sMeshCapability_methods(root_module, root_module['ns3::dot11s::Dot11sMeshCapability']) + register_Ns3Dot11sHwmpProtocol_methods(root_module, root_module['ns3::dot11s::HwmpProtocol']) + register_Ns3Dot11sHwmpProtocolFailedDestination_methods(root_module, root_module['ns3::dot11s::HwmpProtocol::FailedDestination']) + register_Ns3Dot11sIeBeaconTiming_methods(root_module, root_module['ns3::dot11s::IeBeaconTiming']) + register_Ns3Dot11sIeBeaconTimingUnit_methods(root_module, root_module['ns3::dot11s::IeBeaconTimingUnit']) + register_Ns3Dot11sIeConfiguration_methods(root_module, root_module['ns3::dot11s::IeConfiguration']) + register_Ns3Dot11sIeMeshId_methods(root_module, root_module['ns3::dot11s::IeMeshId']) + register_Ns3Dot11sIeMeshIdChecker_methods(root_module, root_module['ns3::dot11s::IeMeshIdChecker']) + register_Ns3Dot11sIeMeshIdValue_methods(root_module, root_module['ns3::dot11s::IeMeshIdValue']) + register_Ns3Dot11sIePeerManagement_methods(root_module, root_module['ns3::dot11s::IePeerManagement']) + register_Ns3Dot11sPeerLink_methods(root_module, root_module['ns3::dot11s::PeerLink']) + register_Ns3Dot11sPeerManagementProtocol_methods(root_module, root_module['ns3::dot11s::PeerManagementProtocol']) + return + +def register_Ns3Dot11sDot11sMeshCapability_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::Dot11sMeshCapability(ns3::dot11s::Dot11sMeshCapability const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::Dot11sMeshCapability const &', 'arg0')]) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::Dot11sMeshCapability() [constructor] + cls.add_constructor([]) + ## ie-dot11s-configuration.h: ns3::Buffer::Iterator ns3::dot11s::Dot11sMeshCapability::Deserialize(ns3::Buffer::Iterator i) [member function] + cls.add_method('Deserialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'i')]) + ## ie-dot11s-configuration.h: uint8_t ns3::dot11s::Dot11sMeshCapability::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint8_t', + [], + is_const=True) + ## ie-dot11s-configuration.h: uint16_t ns3::dot11s::Dot11sMeshCapability::GetUint16() const [member function] + cls.add_method('GetUint16', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-configuration.h: bool ns3::dot11s::Dot11sMeshCapability::Is(uint16_t cap, uint8_t n) const [member function] + cls.add_method('Is', + 'bool', + [param('uint16_t', 'cap'), param('uint8_t', 'n')], + is_const=True) + ## ie-dot11s-configuration.h: ns3::Buffer::Iterator ns3::dot11s::Dot11sMeshCapability::Serialize(ns3::Buffer::Iterator i) const [member function] + cls.add_method('Serialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::MCCAEnabled [variable] + cls.add_instance_attribute('MCCAEnabled', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::MCCASupported [variable] + cls.add_instance_attribute('MCCASupported', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::TBTTAdjustment [variable] + cls.add_instance_attribute('TBTTAdjustment', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::acceptPeerLinks [variable] + cls.add_instance_attribute('acceptPeerLinks', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::beaconTimingReport [variable] + cls.add_instance_attribute('beaconTimingReport', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::forwarding [variable] + cls.add_instance_attribute('forwarding', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::powerSaveLevel [variable] + cls.add_instance_attribute('powerSaveLevel', 'bool', is_const=False) + return + +def register_Ns3Dot11sHwmpProtocol_methods(root_module, cls): + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::HwmpProtocol() [constructor] + cls.add_constructor([]) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## hwmp-protocol.h: static ns3::TypeId ns3::dot11s::HwmpProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## hwmp-protocol.h: bool ns3::dot11s::HwmpProtocol::Install(ns3::Ptr arg0) [member function] + cls.add_method('Install', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'arg0')]) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::PeerLinkStatus(ns3::Mac48Address meshPontAddress, ns3::Mac48Address peerAddress, uint32_t interface, bool status) [member function] + cls.add_method('PeerLinkStatus', + 'void', + [param('ns3::Mac48Address', 'meshPontAddress'), param('ns3::Mac48Address', 'peerAddress'), param('uint32_t', 'interface'), param('bool', 'status')]) + ## hwmp-protocol.h: bool ns3::dot11s::HwmpProtocol::RemoveRoutingStuff(uint32_t fromIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t & protocolType) [member function] + cls.add_method('RemoveRoutingStuff', + 'bool', + [param('uint32_t', 'fromIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t &', 'protocolType')], + is_virtual=True) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::Report(std::ostream & arg0) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'arg0')], + is_const=True) + ## hwmp-protocol.h: bool ns3::dot11s::HwmpProtocol::RequestRoute(uint32_t sourceIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t protocolType, ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty> routeReply) [member function] + cls.add_method('RequestRoute', + 'bool', + [param('uint32_t', 'sourceIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocolType'), param('ns3::Callback< void, bool, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty >', 'routeReply')], + is_virtual=True) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::SetNeighboursCallback(ns3::Callback >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetNeighboursCallback', + 'void', + [param('ns3::Callback< std::vector< ns3::Mac48Address >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::SetRoot() [member function] + cls.add_method('SetRoot', + 'void', + []) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::UnsetRoot() [member function] + cls.add_method('UnsetRoot', + 'void', + []) + return + +def register_Ns3Dot11sHwmpProtocolFailedDestination_methods(root_module, cls): + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination::FailedDestination() [constructor] + cls.add_constructor([]) + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination::FailedDestination(ns3::dot11s::HwmpProtocol::FailedDestination const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::HwmpProtocol::FailedDestination const &', 'arg0')]) + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination::destination [variable] + cls.add_instance_attribute('destination', 'ns3::Mac48Address', is_const=False) + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination::seqnum [variable] + cls.add_instance_attribute('seqnum', 'uint32_t', is_const=False) + return + +def register_Ns3Dot11sIeBeaconTiming_methods(root_module, cls): + cls.add_output_stream_operator() + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTiming::IeBeaconTiming(ns3::dot11s::IeBeaconTiming const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeBeaconTiming const &', 'arg0')]) + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTiming::IeBeaconTiming() [constructor] + cls.add_constructor([]) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::AddNeighboursTimingElementUnit(uint16_t aid, ns3::Time last_beacon, ns3::Time beacon_interval) [member function] + cls.add_method('AddNeighboursTimingElementUnit', + 'void', + [param('uint16_t', 'aid'), param('ns3::Time', 'last_beacon'), param('ns3::Time', 'beacon_interval')]) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::ClearTimingElement() [member function] + cls.add_method('ClearTimingElement', + 'void', + []) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::DelNeighboursTimingElementUnit(uint16_t aid, ns3::Time last_beacon, ns3::Time beacon_interval) [member function] + cls.add_method('DelNeighboursTimingElementUnit', + 'void', + [param('uint16_t', 'aid'), param('ns3::Time', 'last_beacon'), param('ns3::Time', 'beacon_interval')]) + ## ie-dot11s-beacon-timing.h: uint8_t ns3::dot11s::IeBeaconTiming::DeserializeInformation(ns3::Buffer::Iterator i, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'i'), param('uint8_t', 'length')], + is_virtual=True) + ## ie-dot11s-beacon-timing.h: ns3::WifiElementId ns3::dot11s::IeBeaconTiming::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-beacon-timing.h: uint8_t ns3::dot11s::IeBeaconTiming::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-beacon-timing.h: std::vector, std::allocator > > ns3::dot11s::IeBeaconTiming::GetNeighboursTimingElementsList() [member function] + cls.add_method('GetNeighboursTimingElementsList', + 'std::vector< ns3::Ptr< ns3::dot11s::IeBeaconTimingUnit > >', + []) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::SerializeInformation(ns3::Buffer::Iterator i) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True, is_virtual=True) + return + +def register_Ns3Dot11sIeBeaconTimingUnit_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTimingUnit::IeBeaconTimingUnit(ns3::dot11s::IeBeaconTimingUnit const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeBeaconTimingUnit const &', 'arg0')]) + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTimingUnit::IeBeaconTimingUnit() [constructor] + cls.add_constructor([]) + ## ie-dot11s-beacon-timing.h: uint8_t ns3::dot11s::IeBeaconTimingUnit::GetAid() const [member function] + cls.add_method('GetAid', + 'uint8_t', + [], + is_const=True) + ## ie-dot11s-beacon-timing.h: uint16_t ns3::dot11s::IeBeaconTimingUnit::GetBeaconInterval() const [member function] + cls.add_method('GetBeaconInterval', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-beacon-timing.h: uint16_t ns3::dot11s::IeBeaconTimingUnit::GetLastBeacon() const [member function] + cls.add_method('GetLastBeacon', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTimingUnit::SetAid(uint8_t aid) [member function] + cls.add_method('SetAid', + 'void', + [param('uint8_t', 'aid')]) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTimingUnit::SetBeaconInterval(uint16_t beaconInterval) [member function] + cls.add_method('SetBeaconInterval', + 'void', + [param('uint16_t', 'beaconInterval')]) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTimingUnit::SetLastBeacon(uint16_t lastBeacon) [member function] + cls.add_method('SetLastBeacon', + 'void', + [param('uint16_t', 'lastBeacon')]) + return + +def register_Ns3Dot11sIeConfiguration_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ie-dot11s-configuration.h: ns3::dot11s::IeConfiguration::IeConfiguration(ns3::dot11s::IeConfiguration const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeConfiguration const &', 'arg0')]) + ## ie-dot11s-configuration.h: ns3::dot11s::IeConfiguration::IeConfiguration() [constructor] + cls.add_constructor([]) + ## ie-dot11s-configuration.h: uint8_t ns3::dot11s::IeConfiguration::DeserializeInformation(ns3::Buffer::Iterator i, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'i'), param('uint8_t', 'length')], + is_virtual=True) + ## ie-dot11s-configuration.h: ns3::WifiElementId ns3::dot11s::IeConfiguration::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-configuration.h: uint8_t ns3::dot11s::IeConfiguration::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-configuration.h: uint8_t ns3::dot11s::IeConfiguration::GetNeighborCount() [member function] + cls.add_method('GetNeighborCount', + 'uint8_t', + []) + ## ie-dot11s-configuration.h: bool ns3::dot11s::IeConfiguration::IsAirtime() [member function] + cls.add_method('IsAirtime', + 'bool', + []) + ## ie-dot11s-configuration.h: bool ns3::dot11s::IeConfiguration::IsHWMP() [member function] + cls.add_method('IsHWMP', + 'bool', + []) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability const & ns3::dot11s::IeConfiguration::MeshCapability() [member function] + cls.add_method('MeshCapability', + 'ns3::dot11s::Dot11sMeshCapability const &', + []) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::SerializeInformation(ns3::Buffer::Iterator i) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True, is_virtual=True) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::SetMetric(ns3::dot11s::dot11sPathSelectionMetric metricId) [member function] + cls.add_method('SetMetric', + 'void', + [param('ns3::dot11s::dot11sPathSelectionMetric', 'metricId')]) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::SetNeighborCount(uint8_t neighbors) [member function] + cls.add_method('SetNeighborCount', + 'void', + [param('uint8_t', 'neighbors')]) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::SetRouting(ns3::dot11s::dot11sPathSelectionProtocol routingId) [member function] + cls.add_method('SetRouting', + 'void', + [param('ns3::dot11s::dot11sPathSelectionProtocol', 'routingId')]) + return + +def register_Ns3Dot11sIeMeshId_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId::IeMeshId(ns3::dot11s::IeMeshId const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeMeshId const &', 'arg0')]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId::IeMeshId() [constructor] + cls.add_constructor([]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId::IeMeshId(std::string s) [constructor] + cls.add_constructor([param('std::string', 's')]) + ## ie-dot11s-id.h: uint8_t ns3::dot11s::IeMeshId::DeserializeInformation(ns3::Buffer::Iterator start, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')], + is_virtual=True) + ## ie-dot11s-id.h: ns3::WifiElementId ns3::dot11s::IeMeshId::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: uint8_t ns3::dot11s::IeMeshId::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: bool ns3::dot11s::IeMeshId::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True) + ## ie-dot11s-id.h: bool ns3::dot11s::IeMeshId::IsEqual(ns3::dot11s::IeMeshId const & o) const [member function] + cls.add_method('IsEqual', + 'bool', + [param('ns3::dot11s::IeMeshId const &', 'o')], + is_const=True) + ## ie-dot11s-id.h: char * ns3::dot11s::IeMeshId::PeekString() const [member function] + cls.add_method('PeekString', + 'char *', + [], + is_const=True) + ## ie-dot11s-id.h: void ns3::dot11s::IeMeshId::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: void ns3::dot11s::IeMeshId::SerializeInformation(ns3::Buffer::Iterator i) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True, is_virtual=True) + return + +def register_Ns3Dot11sIeMeshIdChecker_methods(root_module, cls): + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdChecker::IeMeshIdChecker() [constructor] + cls.add_constructor([]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdChecker::IeMeshIdChecker(ns3::dot11s::IeMeshIdChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeMeshIdChecker const &', 'arg0')]) + return + +def register_Ns3Dot11sIeMeshIdValue_methods(root_module, cls): + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdValue::IeMeshIdValue() [constructor] + cls.add_constructor([]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdValue::IeMeshIdValue(ns3::dot11s::IeMeshIdValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeMeshIdValue const &', 'arg0')]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdValue::IeMeshIdValue(ns3::dot11s::IeMeshId const & value) [constructor] + cls.add_constructor([param('ns3::dot11s::IeMeshId const &', 'value')]) + ## ie-dot11s-id.h: ns3::Ptr ns3::dot11s::IeMeshIdValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: bool ns3::dot11s::IeMeshIdValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId ns3::dot11s::IeMeshIdValue::Get() const [member function] + cls.add_method('Get', + 'ns3::dot11s::IeMeshId', + [], + is_const=True) + ## ie-dot11s-id.h: std::string ns3::dot11s::IeMeshIdValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: void ns3::dot11s::IeMeshIdValue::Set(ns3::dot11s::IeMeshId const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::dot11s::IeMeshId const &', 'value')]) + return + +def register_Ns3Dot11sIePeerManagement_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ie-dot11s-peer-management.h: ns3::dot11s::IePeerManagement::IePeerManagement(ns3::dot11s::IePeerManagement const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IePeerManagement const &', 'arg0')]) + ## ie-dot11s-peer-management.h: ns3::dot11s::IePeerManagement::IePeerManagement() [constructor] + cls.add_constructor([]) + ## ie-dot11s-peer-management.h: uint8_t ns3::dot11s::IePeerManagement::DeserializeInformation(ns3::Buffer::Iterator i, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'i'), param('uint8_t', 'length')], + is_virtual=True) + ## ie-dot11s-peer-management.h: ns3::WifiElementId ns3::dot11s::IePeerManagement::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-peer-management.h: uint8_t ns3::dot11s::IePeerManagement::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-peer-management.h: uint16_t ns3::dot11s::IePeerManagement::GetLocalLinkId() const [member function] + cls.add_method('GetLocalLinkId', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-peer-management.h: uint16_t ns3::dot11s::IePeerManagement::GetPeerLinkId() const [member function] + cls.add_method('GetPeerLinkId', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-peer-management.h: ns3::dot11s::PmpReasonCode ns3::dot11s::IePeerManagement::GetReasonCode() const [member function] + cls.add_method('GetReasonCode', + 'ns3::dot11s::PmpReasonCode', + [], + is_const=True) + ## ie-dot11s-peer-management.h: uint8_t ns3::dot11s::IePeerManagement::GetSubtype() const [member function] + cls.add_method('GetSubtype', + 'uint8_t', + [], + is_const=True) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::SerializeInformation(ns3::Buffer::Iterator i) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True, is_virtual=True) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, ns3::dot11s::PmpReasonCode reasonCode) [member function] + cls.add_method('SetPeerClose', + 'void', + [param('uint16_t', 'localLinkID'), param('uint16_t', 'peerLinkId'), param('ns3::dot11s::PmpReasonCode', 'reasonCode')]) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId) [member function] + cls.add_method('SetPeerConfirm', + 'void', + [param('uint16_t', 'localLinkID'), param('uint16_t', 'peerLinkId')]) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::SetPeerOpen(uint16_t localLinkId) [member function] + cls.add_method('SetPeerOpen', + 'void', + [param('uint16_t', 'localLinkId')]) + ## ie-dot11s-peer-management.h: bool ns3::dot11s::IePeerManagement::SubtypeIsClose() const [member function] + cls.add_method('SubtypeIsClose', + 'bool', + [], + is_const=True) + ## ie-dot11s-peer-management.h: bool ns3::dot11s::IePeerManagement::SubtypeIsConfirm() const [member function] + cls.add_method('SubtypeIsConfirm', + 'bool', + [], + is_const=True) + ## ie-dot11s-peer-management.h: bool ns3::dot11s::IePeerManagement::SubtypeIsOpen() const [member function] + cls.add_method('SubtypeIsOpen', + 'bool', + [], + is_const=True) + return + +def register_Ns3Dot11sPeerLink_methods(root_module, cls): + ## peer-link.h: static ns3::TypeId ns3::dot11s::PeerLink::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## peer-link.h: ns3::dot11s::PeerLink::PeerLink() [constructor] + cls.add_constructor([]) + ## peer-link.h: void ns3::dot11s::PeerLink::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## peer-link.h: void ns3::dot11s::PeerLink::SetBeaconInformation(ns3::Time lastBeacon, ns3::Time BeaconInterval) [member function] + cls.add_method('SetBeaconInformation', + 'void', + [param('ns3::Time', 'lastBeacon'), param('ns3::Time', 'BeaconInterval')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetLinkStatusCallback(ns3::Callback cb) [member function] + cls.add_method('SetLinkStatusCallback', + 'void', + [param('ns3::Callback< void, unsigned int, ns3::Mac48Address, bool, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetPeerAddress(ns3::Mac48Address macaddr) [member function] + cls.add_method('SetPeerAddress', + 'void', + [param('ns3::Mac48Address', 'macaddr')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetPeerMeshPointAddress(ns3::Mac48Address macaddr) [member function] + cls.add_method('SetPeerMeshPointAddress', + 'void', + [param('ns3::Mac48Address', 'macaddr')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetInterface(uint32_t interface) [member function] + cls.add_method('SetInterface', + 'void', + [param('uint32_t', 'interface')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetLocalLinkId(uint16_t id) [member function] + cls.add_method('SetLocalLinkId', + 'void', + [param('uint16_t', 'id')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetLocalAid(uint16_t aid) [member function] + cls.add_method('SetLocalAid', + 'void', + [param('uint16_t', 'aid')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetBeaconTimingElement(ns3::dot11s::IeBeaconTiming beaconTiming) [member function] + cls.add_method('SetBeaconTimingElement', + 'void', + [param('ns3::dot11s::IeBeaconTiming', 'beaconTiming')]) + ## peer-link.h: ns3::Mac48Address ns3::dot11s::PeerLink::GetPeerAddress() const [member function] + cls.add_method('GetPeerAddress', + 'ns3::Mac48Address', + [], + is_const=True) + ## peer-link.h: uint16_t ns3::dot11s::PeerLink::GetLocalAid() const [member function] + cls.add_method('GetLocalAid', + 'uint16_t', + [], + is_const=True) + ## peer-link.h: ns3::Time ns3::dot11s::PeerLink::GetLastBeacon() const [member function] + cls.add_method('GetLastBeacon', + 'ns3::Time', + [], + is_const=True) + ## peer-link.h: ns3::Time ns3::dot11s::PeerLink::GetBeaconInterval() const [member function] + cls.add_method('GetBeaconInterval', + 'ns3::Time', + [], + is_const=True) + ## peer-link.h: ns3::dot11s::IeBeaconTiming ns3::dot11s::PeerLink::GetBeaconTimingElement() const [member function] + cls.add_method('GetBeaconTimingElement', + 'ns3::dot11s::IeBeaconTiming', + [], + is_const=True) + ## peer-link.h: void ns3::dot11s::PeerLink::MLMECancelPeerLink(ns3::dot11s::PmpReasonCode reason) [member function] + cls.add_method('MLMECancelPeerLink', + 'void', + [param('ns3::dot11s::PmpReasonCode', 'reason')]) + ## peer-link.h: void ns3::dot11s::PeerLink::MLMEActivePeerLinkOpen() [member function] + cls.add_method('MLMEActivePeerLinkOpen', + 'void', + []) + ## peer-link.h: void ns3::dot11s::PeerLink::MLMEPeeringRequestReject() [member function] + cls.add_method('MLMEPeeringRequestReject', + 'void', + []) + ## peer-link.h: void ns3::dot11s::PeerLink::MLMESetSignalStatusCallback(ns3::Callback arg0) [member function] + cls.add_method('MLMESetSignalStatusCallback', + 'void', + [param('ns3::Callback< void, unsigned int, ns3::Mac48Address, ns3::Mac48Address, ns3::dot11s::PeerLink::PeerState, ns3::dot11s::PeerLink::PeerState, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arg0')]) + ## peer-link.h: void ns3::dot11s::PeerLink::TransmissionSuccess() [member function] + cls.add_method('TransmissionSuccess', + 'void', + []) + ## peer-link.h: void ns3::dot11s::PeerLink::TransmissionFailure() [member function] + cls.add_method('TransmissionFailure', + 'void', + []) + ## peer-link.h: void ns3::dot11s::PeerLink::Report(std::ostream & os) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + return + +def register_Ns3Dot11sPeerManagementProtocol_methods(root_module, cls): + ## peer-management-protocol.h: ns3::dot11s::PeerManagementProtocol::PeerManagementProtocol() [constructor] + cls.add_constructor([]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::ConfigurationMismatch(uint32_t interface, ns3::Mac48Address peerAddress) [member function] + cls.add_method('ConfigurationMismatch', + 'void', + [param('uint32_t', 'interface'), param('ns3::Mac48Address', 'peerAddress')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## peer-management-protocol.h: ns3::Ptr ns3::dot11s::PeerManagementProtocol::FindPeerLink(uint32_t interface, ns3::Mac48Address peerAddress) [member function] + cls.add_method('FindPeerLink', + 'ns3::Ptr< ns3::dot11s::PeerLink >', + [param('uint32_t', 'interface'), param('ns3::Mac48Address', 'peerAddress')]) + ## peer-management-protocol.h: std::vector > ns3::dot11s::PeerManagementProtocol::GetActiveLinks(uint32_t interface) [member function] + cls.add_method('GetActiveLinks', + 'std::vector< ns3::Mac48Address >', + [param('uint32_t', 'interface')]) + ## peer-management-protocol.h: ns3::Mac48Address ns3::dot11s::PeerManagementProtocol::GetAddress() [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + []) + ## peer-management-protocol.h: ns3::Ptr ns3::dot11s::PeerManagementProtocol::GetBeaconTimingElement(uint32_t interface) [member function] + cls.add_method('GetBeaconTimingElement', + 'ns3::Ptr< ns3::dot11s::IeBeaconTiming >', + [param('uint32_t', 'interface')]) + ## peer-management-protocol.h: ns3::Ptr ns3::dot11s::PeerManagementProtocol::GetMeshId() const [member function] + cls.add_method('GetMeshId', + 'ns3::Ptr< ns3::dot11s::IeMeshId >', + [], + is_const=True) + ## peer-management-protocol.h: uint8_t ns3::dot11s::PeerManagementProtocol::GetNumberOfLinks() [member function] + cls.add_method('GetNumberOfLinks', + 'uint8_t', + []) + ## peer-management-protocol.h: static ns3::TypeId ns3::dot11s::PeerManagementProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## peer-management-protocol.h: bool ns3::dot11s::PeerManagementProtocol::Install(ns3::Ptr arg0) [member function] + cls.add_method('Install', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'arg0')]) + ## peer-management-protocol.h: bool ns3::dot11s::PeerManagementProtocol::IsActiveLink(uint32_t interface, ns3::Mac48Address peerAddress) [member function] + cls.add_method('IsActiveLink', + 'bool', + [param('uint32_t', 'interface'), param('ns3::Mac48Address', 'peerAddress')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::ReceivePeerLinkFrame(uint32_t interface, ns3::Mac48Address peerAddress, ns3::Mac48Address peerMeshPointAddress, uint16_t aid, ns3::dot11s::IePeerManagement peerManagementElement, ns3::dot11s::IeConfiguration meshConfig) [member function] + cls.add_method('ReceivePeerLinkFrame', + 'void', + [param('uint32_t', 'interface'), param('ns3::Mac48Address', 'peerAddress'), param('ns3::Mac48Address', 'peerMeshPointAddress'), param('uint16_t', 'aid'), param('ns3::dot11s::IePeerManagement', 'peerManagementElement'), param('ns3::dot11s::IeConfiguration', 'meshConfig')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::Report(std::ostream & arg0) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'arg0')], + is_const=True) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::SetMeshId(std::string s) [member function] + cls.add_method('SetMeshId', + 'void', + [param('std::string', 's')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::SetPeerLinkStatusCallback(ns3::Callback cb) [member function] + cls.add_method('SetPeerLinkStatusCallback', + 'void', + [param('ns3::Callback< void, ns3::Mac48Address, ns3::Mac48Address, unsigned int, bool, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::TransmissionFailure(uint32_t interface, ns3::Mac48Address const peerAddress) [member function] + cls.add_method('TransmissionFailure', + 'void', + [param('uint32_t', 'interface'), param('ns3::Mac48Address const', 'peerAddress')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::TransmissionSuccess(uint32_t interface, ns3::Mac48Address const peerAddress) [member function] + cls.add_method('TransmissionSuccess', + 'void', + [param('uint32_t', 'interface'), param('ns3::Mac48Address const', 'peerAddress')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::UpdatePeerBeaconTiming(uint32_t interface, bool meshBeacon, ns3::dot11s::IeBeaconTiming timingElement, ns3::Mac48Address peerAddress, ns3::Time receivingTime, ns3::Time beaconInterval) [member function] + cls.add_method('UpdatePeerBeaconTiming', + 'void', + [param('uint32_t', 'interface'), param('bool', 'meshBeacon'), param('ns3::dot11s::IeBeaconTiming', 'timingElement'), param('ns3::Mac48Address', 'peerAddress'), param('ns3::Time', 'receivingTime'), param('ns3::Time', 'beaconInterval')]) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + ## ie-dot11s-id.h: extern ns3::Ptr ns3::dot11s::MakeIeMeshIdChecker() [free function] + module.add_function('MakeIeMeshIdChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/ns3_module_emu.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_emu.py similarity index 93% rename from bindings/python/ns3_module_emu.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_emu.py index e38257ffd..b69d9fbaf 100644 --- a/bindings/python/ns3_module_emu.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_emu.py @@ -24,6 +24,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -48,6 +60,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -218,6 +238,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -231,6 +253,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_flame.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_flame.py new file mode 100644 index 000000000..453d1c01d --- /dev/null +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_flame.py @@ -0,0 +1,200 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + ## flame-protocol.h: ns3::flame::FlameProtocol [class] + module.add_class('FlameProtocol', parent=root_module['ns3::MeshL2RoutingProtocol']) + ## flame-protocol.h: ns3::flame::FlameTag [class] + module.add_class('FlameTag', parent=root_module['ns3::Tag']) + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3FlameFlameProtocol_methods(root_module, root_module['ns3::flame::FlameProtocol']) + register_Ns3FlameFlameTag_methods(root_module, root_module['ns3::flame::FlameTag']) + return + +def register_Ns3FlameFlameProtocol_methods(root_module, cls): + ## flame-protocol.h: ns3::flame::FlameProtocol::FlameProtocol() [constructor] + cls.add_constructor([]) + ## flame-protocol.h: void ns3::flame::FlameProtocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## flame-protocol.h: ns3::Mac48Address ns3::flame::FlameProtocol::GetAddress() [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + []) + ## flame-protocol.h: static ns3::TypeId ns3::flame::FlameProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flame-protocol.h: bool ns3::flame::FlameProtocol::Install(ns3::Ptr arg0) [member function] + cls.add_method('Install', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'arg0')]) + ## flame-protocol.h: bool ns3::flame::FlameProtocol::RemoveRoutingStuff(uint32_t fromIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t & protocolType) [member function] + cls.add_method('RemoveRoutingStuff', + 'bool', + [param('uint32_t', 'fromIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t &', 'protocolType')], + is_virtual=True) + ## flame-protocol.h: void ns3::flame::FlameProtocol::Report(std::ostream & arg0) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'arg0')], + is_const=True) + ## flame-protocol.h: bool ns3::flame::FlameProtocol::RequestRoute(uint32_t sourceIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t protocolType, ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty> routeReply) [member function] + cls.add_method('RequestRoute', + 'bool', + [param('uint32_t', 'sourceIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocolType'), param('ns3::Callback< void, bool, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty >', 'routeReply')], + is_virtual=True) + ## flame-protocol.h: void ns3::flame::FlameProtocol::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + return + +def register_Ns3FlameFlameTag_methods(root_module, cls): + ## flame-protocol.h: ns3::flame::FlameTag::FlameTag(ns3::flame::FlameTag const & arg0) [copy constructor] + cls.add_constructor([param('ns3::flame::FlameTag const &', 'arg0')]) + ## flame-protocol.h: ns3::flame::FlameTag::FlameTag(ns3::Mac48Address a=ns3::Mac48Address()) [constructor] + cls.add_constructor([param('ns3::Mac48Address', 'a', default_value='ns3::Mac48Address()')]) + ## flame-protocol.h: void ns3::flame::FlameTag::Deserialize(ns3::TagBuffer i) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_virtual=True) + ## flame-protocol.h: ns3::TypeId ns3::flame::FlameTag::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## flame-protocol.h: uint32_t ns3::flame::FlameTag::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## flame-protocol.h: static ns3::TypeId ns3::flame::FlameTag::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flame-protocol.h: void ns3::flame::FlameTag::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## flame-protocol.h: void ns3::flame::FlameTag::Serialize(ns3::TagBuffer i) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_const=True, is_virtual=True) + ## flame-protocol.h: ns3::flame::FlameTag::receiver [variable] + cls.add_instance_attribute('receiver', 'ns3::Mac48Address', is_const=False) + ## flame-protocol.h: ns3::flame::FlameTag::transmitter [variable] + cls.add_instance_attribute('transmitter', 'ns3::Mac48Address', is_const=False) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_flow_monitor.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_flow_monitor.py new file mode 100644 index 000000000..6aefcf9a5 --- /dev/null +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_flow_monitor.py @@ -0,0 +1,434 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## histogram.h: ns3::Histogram [class] + module.add_class('Histogram') + ## flow-classifier.h: ns3::FlowClassifier [class] + module.add_class('FlowClassifier', parent=root_module['ns3::RefCountBase']) + ## flow-probe.h: ns3::FlowProbe [class] + module.add_class('FlowProbe', parent=root_module['ns3::RefCountBase']) + ## flow-probe.h: ns3::FlowProbe::FlowStats [struct] + module.add_class('FlowStats', outer_class=root_module['ns3::FlowProbe']) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier [class] + module.add_class('Ipv4FlowClassifier', parent=root_module['ns3::FlowClassifier']) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple [struct] + module.add_class('FiveTuple', outer_class=root_module['ns3::Ipv4FlowClassifier']) + ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe [class] + module.add_class('Ipv4FlowProbe', parent=root_module['ns3::FlowProbe']) + ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::DropReason [enumeration] + module.add_enum('DropReason', ['DROP_NO_ROUTE', 'DROP_TTL_EXPIRE', 'DROP_BAD_CHECKSUM', 'DROP_INVALID_REASON'], outer_class=root_module['ns3::Ipv4FlowProbe']) + ## flow-monitor.h: ns3::FlowMonitor [class] + module.add_class('FlowMonitor', parent=root_module['ns3::Object']) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats [struct] + module.add_class('FlowStats', outer_class=root_module['ns3::FlowMonitor']) + module.add_container('std::map< unsigned int, ns3::FlowProbe::FlowStats >', ('unsigned int', 'ns3::FlowProbe::FlowStats'), container_type='map') + module.add_container('std::map< unsigned int, ns3::FlowMonitor::FlowStats >', ('unsigned int', 'ns3::FlowMonitor::FlowStats'), container_type='map') + typehandlers.add_type_alias('uint32_t', 'ns3::FlowPacketId') + typehandlers.add_type_alias('uint32_t*', 'ns3::FlowPacketId*') + typehandlers.add_type_alias('uint32_t&', 'ns3::FlowPacketId&') + typehandlers.add_type_alias('uint32_t', 'ns3::FlowId') + typehandlers.add_type_alias('uint32_t*', 'ns3::FlowId*') + typehandlers.add_type_alias('uint32_t&', 'ns3::FlowId&') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Histogram_methods(root_module, root_module['ns3::Histogram']) + register_Ns3FlowClassifier_methods(root_module, root_module['ns3::FlowClassifier']) + register_Ns3FlowProbe_methods(root_module, root_module['ns3::FlowProbe']) + register_Ns3FlowProbeFlowStats_methods(root_module, root_module['ns3::FlowProbe::FlowStats']) + register_Ns3Ipv4FlowClassifier_methods(root_module, root_module['ns3::Ipv4FlowClassifier']) + register_Ns3Ipv4FlowClassifierFiveTuple_methods(root_module, root_module['ns3::Ipv4FlowClassifier::FiveTuple']) + register_Ns3Ipv4FlowProbe_methods(root_module, root_module['ns3::Ipv4FlowProbe']) + register_Ns3FlowMonitor_methods(root_module, root_module['ns3::FlowMonitor']) + register_Ns3FlowMonitorFlowStats_methods(root_module, root_module['ns3::FlowMonitor::FlowStats']) + return + +def register_Ns3Histogram_methods(root_module, cls): + ## histogram.h: ns3::Histogram::Histogram(ns3::Histogram const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Histogram const &', 'arg0')]) + ## histogram.h: ns3::Histogram::Histogram(double binWidth) [constructor] + cls.add_constructor([param('double', 'binWidth')]) + ## histogram.h: ns3::Histogram::Histogram() [constructor] + cls.add_constructor([]) + ## histogram.h: void ns3::Histogram::AddValue(double value) [member function] + cls.add_method('AddValue', + 'void', + [param('double', 'value')]) + ## histogram.h: uint32_t ns3::Histogram::GetBinCount(uint32_t index) [member function] + cls.add_method('GetBinCount', + 'uint32_t', + [param('uint32_t', 'index')]) + ## histogram.h: double ns3::Histogram::GetBinEnd(uint32_t index) [member function] + cls.add_method('GetBinEnd', + 'double', + [param('uint32_t', 'index')]) + ## histogram.h: double ns3::Histogram::GetBinStart(uint32_t index) [member function] + cls.add_method('GetBinStart', + 'double', + [param('uint32_t', 'index')]) + ## histogram.h: double ns3::Histogram::GetBinWidth(uint32_t index) const [member function] + cls.add_method('GetBinWidth', + 'double', + [param('uint32_t', 'index')], + is_const=True) + ## histogram.h: uint32_t ns3::Histogram::GetNBins() const [member function] + cls.add_method('GetNBins', + 'uint32_t', + [], + is_const=True) + ## histogram.h: void ns3::Histogram::SerializeToXmlStream(std::ostream & os, int indent, std::string elementName) const [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent'), param('std::string', 'elementName')], + is_const=True) + ## histogram.h: void ns3::Histogram::SetDefaultBinWidth(double binWidth) [member function] + cls.add_method('SetDefaultBinWidth', + 'void', + [param('double', 'binWidth')]) + return + +def register_Ns3FlowClassifier_methods(root_module, cls): + ## flow-classifier.h: ns3::FlowClassifier::FlowClassifier(ns3::FlowClassifier const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowClassifier const &', 'arg0')]) + ## flow-classifier.h: ns3::FlowClassifier::FlowClassifier() [constructor] + cls.add_constructor([]) + ## flow-classifier.h: void ns3::FlowClassifier::SerializeToXmlStream(std::ostream & os, int indent) const [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## flow-classifier.h: ns3::FlowId ns3::FlowClassifier::GetNewFlowId() [member function] + cls.add_method('GetNewFlowId', + 'ns3::FlowId', + [], + visibility='protected') + return + +def register_Ns3FlowProbe_methods(root_module, cls): + ## flow-probe.h: ns3::FlowProbe::FlowProbe(ns3::FlowProbe const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowProbe const &', 'arg0')]) + ## flow-probe.h: void ns3::FlowProbe::AddPacketDropStats(ns3::FlowId flowId, uint32_t packetSize, uint32_t reasonCode) [member function] + cls.add_method('AddPacketDropStats', + 'void', + [param('ns3::FlowId', 'flowId'), param('uint32_t', 'packetSize'), param('uint32_t', 'reasonCode')]) + ## flow-probe.h: void ns3::FlowProbe::AddPacketStats(ns3::FlowId flowId, uint32_t packetSize, ns3::Time delayFromFirstProbe) [member function] + cls.add_method('AddPacketStats', + 'void', + [param('ns3::FlowId', 'flowId'), param('uint32_t', 'packetSize'), param('ns3::Time', 'delayFromFirstProbe')]) + ## flow-probe.h: std::map, std::allocator > > ns3::FlowProbe::GetStats() const [member function] + cls.add_method('GetStats', + 'std::map< unsigned int, ns3::FlowProbe::FlowStats >', + [], + is_const=True) + ## flow-probe.h: void ns3::FlowProbe::SerializeToXmlStream(std::ostream & os, int indent, uint32_t index) const [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent'), param('uint32_t', 'index')], + is_const=True) + ## flow-probe.h: ns3::FlowProbe::FlowProbe(ns3::Ptr flowMonitor) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::FlowMonitor >', 'flowMonitor')], + visibility='protected') + return + +def register_Ns3FlowProbeFlowStats_methods(root_module, cls): + ## flow-probe.h: ns3::FlowProbe::FlowStats::FlowStats(ns3::FlowProbe::FlowStats const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowProbe::FlowStats const &', 'arg0')]) + ## flow-probe.h: ns3::FlowProbe::FlowStats::FlowStats() [constructor] + cls.add_constructor([]) + ## flow-probe.h: ns3::FlowProbe::FlowStats::bytes [variable] + cls.add_instance_attribute('bytes', 'uint64_t', is_const=False) + ## flow-probe.h: ns3::FlowProbe::FlowStats::bytesDropped [variable] + cls.add_instance_attribute('bytesDropped', 'std::vector< unsigned long long >', is_const=False) + ## flow-probe.h: ns3::FlowProbe::FlowStats::delayFromFirstProbeSum [variable] + cls.add_instance_attribute('delayFromFirstProbeSum', 'ns3::Time', is_const=False) + ## flow-probe.h: ns3::FlowProbe::FlowStats::packets [variable] + cls.add_instance_attribute('packets', 'uint32_t', is_const=False) + ## flow-probe.h: ns3::FlowProbe::FlowStats::packetsDropped [variable] + cls.add_instance_attribute('packetsDropped', 'std::vector< unsigned int >', is_const=False) + return + +def register_Ns3Ipv4FlowClassifier_methods(root_module, cls): + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::Ipv4FlowClassifier(ns3::Ipv4FlowClassifier const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4FlowClassifier const &', 'arg0')]) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::Ipv4FlowClassifier() [constructor] + cls.add_constructor([]) + ## ipv4-flow-classifier.h: bool ns3::Ipv4FlowClassifier::Classify(ns3::Ipv4Header const & ipHeader, ns3::Ptr ipPayload, uint32_t * out_flowId, uint32_t * out_packetId) [member function] + cls.add_method('Classify', + 'bool', + [param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet const >', 'ipPayload'), param('uint32_t *', 'out_flowId'), param('uint32_t *', 'out_packetId')]) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple ns3::Ipv4FlowClassifier::FindFlow(ns3::FlowId flowId) const [member function] + cls.add_method('FindFlow', + 'ns3::Ipv4FlowClassifier::FiveTuple', + [param('ns3::FlowId', 'flowId')], + is_const=True) + ## ipv4-flow-classifier.h: void ns3::Ipv4FlowClassifier::SerializeToXmlStream(std::ostream & os, int indent) const [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent')], + is_const=True, is_virtual=True) + return + +def register_Ns3Ipv4FlowClassifierFiveTuple_methods(root_module, cls): + cls.add_binary_comparison_operator('<') + cls.add_binary_comparison_operator('==') + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::FiveTuple() [constructor] + cls.add_constructor([]) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::FiveTuple(ns3::Ipv4FlowClassifier::FiveTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4FlowClassifier::FiveTuple const &', 'arg0')]) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::destinationAddress [variable] + cls.add_instance_attribute('destinationAddress', 'ns3::Ipv4Address', is_const=False) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::destinationPort [variable] + cls.add_instance_attribute('destinationPort', 'uint16_t', is_const=False) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::protocol [variable] + cls.add_instance_attribute('protocol', 'uint8_t', is_const=False) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::sourceAddress [variable] + cls.add_instance_attribute('sourceAddress', 'ns3::Ipv4Address', is_const=False) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::sourcePort [variable] + cls.add_instance_attribute('sourcePort', 'uint16_t', is_const=False) + return + +def register_Ns3Ipv4FlowProbe_methods(root_module, cls): + ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::Ipv4FlowProbe(ns3::Ipv4FlowProbe const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4FlowProbe const &', 'arg0')]) + ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::Ipv4FlowProbe(ns3::Ptr monitor, ns3::Ptr classifier, ns3::Ptr node) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::FlowMonitor >', 'monitor'), param('ns3::Ptr< ns3::Ipv4FlowClassifier >', 'classifier'), param('ns3::Ptr< ns3::Node >', 'node')]) + return + +def register_Ns3FlowMonitor_methods(root_module, cls): + ## flow-monitor.h: ns3::FlowMonitor::FlowMonitor(ns3::FlowMonitor const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowMonitor const &', 'arg0')]) + ## flow-monitor.h: ns3::FlowMonitor::FlowMonitor() [constructor] + cls.add_constructor([]) + ## flow-monitor.h: void ns3::FlowMonitor::AddProbe(ns3::Ptr probe) [member function] + cls.add_method('AddProbe', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe')]) + ## flow-monitor.h: void ns3::FlowMonitor::CheckForLostPackets() [member function] + cls.add_method('CheckForLostPackets', + 'void', + []) + ## flow-monitor.h: void ns3::FlowMonitor::CheckForLostPackets(ns3::Time maxDelay) [member function] + cls.add_method('CheckForLostPackets', + 'void', + [param('ns3::Time', 'maxDelay')]) + ## flow-monitor.h: std::vector, std::allocator > > ns3::FlowMonitor::GetAllProbes() const [member function] + cls.add_method('GetAllProbes', + 'std::vector< ns3::Ptr< ns3::FlowProbe > >', + [], + is_const=True) + ## flow-monitor.h: std::map, std::allocator > > ns3::FlowMonitor::GetFlowStats() const [member function] + cls.add_method('GetFlowStats', + 'std::map< unsigned int, ns3::FlowMonitor::FlowStats >', + [], + is_const=True) + ## flow-monitor.h: ns3::TypeId ns3::FlowMonitor::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## flow-monitor.h: static ns3::TypeId ns3::FlowMonitor::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flow-monitor.h: void ns3::FlowMonitor::ReportDrop(ns3::Ptr probe, ns3::FlowId flowId, ns3::FlowPacketId packetId, uint32_t packetSize, uint32_t reasonCode) [member function] + cls.add_method('ReportDrop', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe'), param('ns3::FlowId', 'flowId'), param('ns3::FlowPacketId', 'packetId'), param('uint32_t', 'packetSize'), param('uint32_t', 'reasonCode')]) + ## flow-monitor.h: void ns3::FlowMonitor::ReportFirstTx(ns3::Ptr probe, ns3::FlowId flowId, ns3::FlowPacketId packetId, uint32_t packetSize) [member function] + cls.add_method('ReportFirstTx', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe'), param('ns3::FlowId', 'flowId'), param('ns3::FlowPacketId', 'packetId'), param('uint32_t', 'packetSize')]) + ## flow-monitor.h: void ns3::FlowMonitor::ReportForwarding(ns3::Ptr probe, ns3::FlowId flowId, ns3::FlowPacketId packetId, uint32_t packetSize) [member function] + cls.add_method('ReportForwarding', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe'), param('ns3::FlowId', 'flowId'), param('ns3::FlowPacketId', 'packetId'), param('uint32_t', 'packetSize')]) + ## flow-monitor.h: void ns3::FlowMonitor::ReportLastRx(ns3::Ptr probe, ns3::FlowId flowId, ns3::FlowPacketId packetId, uint32_t packetSize) [member function] + cls.add_method('ReportLastRx', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe'), param('ns3::FlowId', 'flowId'), param('ns3::FlowPacketId', 'packetId'), param('uint32_t', 'packetSize')]) + ## flow-monitor.h: void ns3::FlowMonitor::SerializeToXmlFile(std::string fileName, bool enableHistograms, bool enableProbes) [member function] + cls.add_method('SerializeToXmlFile', + 'void', + [param('std::string', 'fileName'), param('bool', 'enableHistograms'), param('bool', 'enableProbes')]) + ## flow-monitor.h: void ns3::FlowMonitor::SerializeToXmlStream(std::ostream & os, int indent, bool enableHistograms, bool enableProbes) [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent'), param('bool', 'enableHistograms'), param('bool', 'enableProbes')]) + ## flow-monitor.h: std::string ns3::FlowMonitor::SerializeToXmlString(int indent, bool enableHistograms, bool enableProbes) [member function] + cls.add_method('SerializeToXmlString', + 'std::string', + [param('int', 'indent'), param('bool', 'enableHistograms'), param('bool', 'enableProbes')]) + ## flow-monitor.h: void ns3::FlowMonitor::SetFlowClassifier(ns3::Ptr classifier) [member function] + cls.add_method('SetFlowClassifier', + 'void', + [param('ns3::Ptr< ns3::FlowClassifier >', 'classifier')]) + ## flow-monitor.h: void ns3::FlowMonitor::Start(ns3::Time const & time) [member function] + cls.add_method('Start', + 'void', + [param('ns3::Time const &', 'time')]) + ## flow-monitor.h: void ns3::FlowMonitor::StartRightNow() [member function] + cls.add_method('StartRightNow', + 'void', + []) + ## flow-monitor.h: void ns3::FlowMonitor::Stop(ns3::Time const & time) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::Time const &', 'time')]) + ## flow-monitor.h: void ns3::FlowMonitor::StopRightNow() [member function] + cls.add_method('StopRightNow', + 'void', + []) + ## flow-monitor.h: void ns3::FlowMonitor::NotifyConstructionCompleted() [member function] + cls.add_method('NotifyConstructionCompleted', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3FlowMonitorFlowStats_methods(root_module, cls): + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::FlowStats() [constructor] + cls.add_constructor([]) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::FlowStats(ns3::FlowMonitor::FlowStats const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowMonitor::FlowStats const &', 'arg0')]) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::bytesDropped [variable] + cls.add_instance_attribute('bytesDropped', 'std::vector< unsigned long long >', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::delayHistogram [variable] + cls.add_instance_attribute('delayHistogram', 'ns3::Histogram', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::delaySum [variable] + cls.add_instance_attribute('delaySum', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::jitterHistogram [variable] + cls.add_instance_attribute('jitterHistogram', 'ns3::Histogram', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::jitterSum [variable] + cls.add_instance_attribute('jitterSum', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::lastDelay [variable] + cls.add_instance_attribute('lastDelay', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::lostPackets [variable] + cls.add_instance_attribute('lostPackets', 'uint32_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::packetSizeHistogram [variable] + cls.add_instance_attribute('packetSizeHistogram', 'ns3::Histogram', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::packetsDropped [variable] + cls.add_instance_attribute('packetsDropped', 'std::vector< unsigned int >', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::rxBytes [variable] + cls.add_instance_attribute('rxBytes', 'uint64_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::rxPackets [variable] + cls.add_instance_attribute('rxPackets', 'uint32_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timeFirstRxPacket [variable] + cls.add_instance_attribute('timeFirstRxPacket', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timeFirstTxPacket [variable] + cls.add_instance_attribute('timeFirstTxPacket', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timeLastRxPacket [variable] + cls.add_instance_attribute('timeLastRxPacket', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timeLastTxPacket [variable] + cls.add_instance_attribute('timeLastTxPacket', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timesForwarded [variable] + cls.add_instance_attribute('timesForwarded', 'uint32_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::txBytes [variable] + cls.add_instance_attribute('txBytes', 'uint64_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::txPackets [variable] + cls.add_instance_attribute('txPackets', 'uint32_t', is_const=False) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/ns3_module_global_routing.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_global_routing.py similarity index 97% rename from bindings/python/ns3_module_global_routing.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_global_routing.py index 8a795bdf5..4f44b1996 100644 --- a/bindings/python/ns3_module_global_routing.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_global_routing.py @@ -38,6 +38,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -62,6 +74,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -417,6 +437,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -430,6 +452,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_helper.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py similarity index 87% rename from bindings/python/ns3_module_helper.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py index b997f67e8..b859378f3 100644 --- a/bindings/python/ns3_module_helper.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py @@ -13,6 +13,8 @@ def register_types(module): module.add_class('CsmaHelper', allow_subclassing=False) ## emu-helper.h: ns3::EmuHelper [class] module.add_class('EmuHelper', allow_subclassing=False) + ## flow-monitor-helper.h: ns3::FlowMonitorHelper [class] + module.add_class('FlowMonitorHelper', allow_subclassing=False) ## internet-stack-helper.h: ns3::InternetStackHelper [class] module.add_class('InternetStackHelper', allow_subclassing=False) ## ipv4-address-helper.h: ns3::Ipv4AddressHelper [class] @@ -31,6 +33,10 @@ def register_types(module): module.add_class('Ipv6RoutingHelper', allow_subclassing=False) ## ipv6-static-routing-helper.h: ns3::Ipv6StaticRoutingHelper [class] module.add_class('Ipv6StaticRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv6RoutingHelper']) + ## mesh-helper.h: ns3::MeshHelper [class] + module.add_class('MeshHelper', allow_subclassing=False) + ## mesh-helper.h: ns3::MeshHelper::ChannelPolicy [enumeration] + module.add_enum('ChannelPolicy', ['SPREAD_CHANNELS', 'ZERO_CHANNEL'], outer_class=root_module['ns3::MeshHelper']) ## mobility-helper.h: ns3::MobilityHelper [class] module.add_class('MobilityHelper', allow_subclassing=False) ## net-device-container.h: ns3::NetDeviceContainer [class] @@ -75,6 +81,8 @@ def register_types(module): module.add_class('Ipv4GlobalRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper [class] module.add_class('Ipv4ListRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) + ## ipv4-nix-vector-helper.h: ns3::Ipv4NixVectorHelper [class] + module.add_class('Ipv4NixVectorHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) ## ipv6-list-routing-helper.h: ns3::Ipv6ListRoutingHelper [class] module.add_class('Ipv6ListRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv6RoutingHelper']) ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper [class] @@ -83,6 +91,12 @@ def register_types(module): module.add_class('QosWifiMacHelper', allow_subclassing=False, parent=root_module['ns3::WifiMacHelper']) ## athstats-helper.h: ns3::AthstatsWifiTraceSink [class] module.add_class('AthstatsWifiTraceSink', parent=root_module['ns3::Object']) + ## mesh-stack-installer.h: ns3::MeshStack [class] + module.add_class('MeshStack', parent=root_module['ns3::Object']) + ## dot11s-installer.h: ns3::Dot11sStack [class] + module.add_class('Dot11sStack', parent=root_module['ns3::MeshStack']) + ## flame-installer.h: ns3::FlameStack [class] + module.add_class('FlameStack', parent=root_module['ns3::MeshStack']) ## Register a nested module for the namespace Config @@ -102,6 +116,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -126,6 +152,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -140,6 +174,7 @@ def register_methods(root_module): register_Ns3BridgeHelper_methods(root_module, root_module['ns3::BridgeHelper']) register_Ns3CsmaHelper_methods(root_module, root_module['ns3::CsmaHelper']) register_Ns3EmuHelper_methods(root_module, root_module['ns3::EmuHelper']) + register_Ns3FlowMonitorHelper_methods(root_module, root_module['ns3::FlowMonitorHelper']) register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper']) register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper']) register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer']) @@ -149,6 +184,7 @@ def register_methods(root_module): register_Ns3Ipv6InterfaceContainer_methods(root_module, root_module['ns3::Ipv6InterfaceContainer']) register_Ns3Ipv6RoutingHelper_methods(root_module, root_module['ns3::Ipv6RoutingHelper']) register_Ns3Ipv6StaticRoutingHelper_methods(root_module, root_module['ns3::Ipv6StaticRoutingHelper']) + register_Ns3MeshHelper_methods(root_module, root_module['ns3::MeshHelper']) register_Ns3MobilityHelper_methods(root_module, root_module['ns3::MobilityHelper']) register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer']) register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer']) @@ -170,10 +206,14 @@ def register_methods(root_module): register_Ns3YansWifiPhyHelper_methods(root_module, root_module['ns3::YansWifiPhyHelper']) register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, root_module['ns3::Ipv4GlobalRoutingHelper']) register_Ns3Ipv4ListRoutingHelper_methods(root_module, root_module['ns3::Ipv4ListRoutingHelper']) + register_Ns3Ipv4NixVectorHelper_methods(root_module, root_module['ns3::Ipv4NixVectorHelper']) register_Ns3Ipv6ListRoutingHelper_methods(root_module, root_module['ns3::Ipv6ListRoutingHelper']) register_Ns3NqosWifiMacHelper_methods(root_module, root_module['ns3::NqosWifiMacHelper']) register_Ns3QosWifiMacHelper_methods(root_module, root_module['ns3::QosWifiMacHelper']) register_Ns3AthstatsWifiTraceSink_methods(root_module, root_module['ns3::AthstatsWifiTraceSink']) + register_Ns3MeshStack_methods(root_module, root_module['ns3::MeshStack']) + register_Ns3Dot11sStack_methods(root_module, root_module['ns3::Dot11sStack']) + register_Ns3FlameStack_methods(root_module, root_module['ns3::FlameStack']) return def register_Ns3ApplicationContainer_methods(root_module, cls): @@ -471,6 +511,37 @@ def register_Ns3EmuHelper_methods(root_module, cls): [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')]) return +def register_Ns3FlowMonitorHelper_methods(root_module, cls): + ## flow-monitor-helper.h: ns3::FlowMonitorHelper::FlowMonitorHelper(ns3::FlowMonitorHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowMonitorHelper const &', 'arg0')]) + ## flow-monitor-helper.h: ns3::FlowMonitorHelper::FlowMonitorHelper() [constructor] + cls.add_constructor([]) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::GetClassifier() [member function] + cls.add_method('GetClassifier', + 'ns3::Ptr< ns3::FlowClassifier >', + []) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::GetMonitor() [member function] + cls.add_method('GetMonitor', + 'ns3::Ptr< ns3::FlowMonitor >', + []) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::Install(ns3::NodeContainer nodes) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::FlowMonitor >', + [param('ns3::NodeContainer', 'nodes')]) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::Install(ns3::Ptr node) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::FlowMonitor >', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::InstallAll() [member function] + cls.add_method('InstallAll', + 'ns3::Ptr< ns3::FlowMonitor >', + []) + ## flow-monitor-helper.h: void ns3::FlowMonitorHelper::SetMonitorAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetMonitorAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + return + def register_Ns3InternetStackHelper_methods(root_module, cls): ## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper(ns3::InternetStackHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::InternetStackHelper const &', 'arg0')]) @@ -542,6 +613,8 @@ def register_Ns3Ipv4AddressHelper_methods(root_module, cls): cls.add_constructor([param('ns3::Ipv4AddressHelper const &', 'arg0')]) ## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper() [constructor] cls.add_constructor([]) + ## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper(ns3::Ipv4Address network, ns3::Ipv4Mask mask, ns3::Ipv4Address base="0.0.0.1") [constructor] + cls.add_constructor([param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'mask'), param('ns3::Ipv4Address', 'base', default_value='"0.0.0.1"')]) ## ipv4-address-helper.h: ns3::Ipv4InterfaceContainer ns3::Ipv4AddressHelper::Assign(ns3::NetDeviceContainer const & c) [member function] cls.add_method('Assign', 'ns3::Ipv4InterfaceContainer', @@ -573,10 +646,19 @@ def register_Ns3Ipv4InterfaceContainer_methods(root_module, cls): cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4'), param('uint32_t', 'interface')]) + ## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::Add(std::pair,unsigned int> arg0) [member function] + cls.add_method('Add', + 'void', + [param('std::pair< ns3::Ptr< ns3::Ipv4 >, unsigned int >', 'arg0')]) ## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::Add(std::string ipv4Name, uint32_t interface) [member function] cls.add_method('Add', 'void', [param('std::string', 'ipv4Name'), param('uint32_t', 'interface')]) + ## ipv4-interface-container.h: std::pair,unsigned int> ns3::Ipv4InterfaceContainer::Get(uint32_t arg0) const [member function] + cls.add_method('Get', + 'std::pair< ns3::Ptr< ns3::Ipv4 >, unsigned int >', + [param('uint32_t', 'arg0')], + is_const=True) ## ipv4-interface-container.h: ns3::Ipv4Address ns3::Ipv4InterfaceContainer::GetAddress(uint32_t i, uint32_t j=0) const [member function] cls.add_method('GetAddress', 'ns3::Ipv4Address', @@ -768,6 +850,55 @@ def register_Ns3Ipv6StaticRoutingHelper_methods(root_module, cls): is_const=True) return +def register_Ns3MeshHelper_methods(root_module, cls): + ## mesh-helper.h: ns3::MeshHelper::MeshHelper(ns3::MeshHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshHelper const &', 'arg0')]) + ## mesh-helper.h: ns3::MeshHelper::MeshHelper() [constructor] + cls.add_constructor([]) + ## mesh-helper.h: static ns3::MeshHelper ns3::MeshHelper::Default() [member function] + cls.add_method('Default', + 'ns3::MeshHelper', + [], + is_static=True) + ## mesh-helper.h: ns3::NetDeviceContainer ns3::MeshHelper::Install(ns3::WifiPhyHelper const & phyHelper, ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::WifiPhyHelper const &', 'phyHelper'), param('ns3::NodeContainer', 'c')], + is_const=True) + ## mesh-helper.h: void ns3::MeshHelper::Report(ns3::Ptr const & arg0, std::ostream & arg1) [member function] + cls.add_method('Report', + 'void', + [param('ns3::Ptr< ns3::NetDevice > const &', 'arg0'), param('std::ostream &', 'arg1')]) + ## mesh-helper.h: void ns3::MeshHelper::ResetStats(ns3::Ptr const & arg0) [member function] + cls.add_method('ResetStats', + 'void', + [param('ns3::Ptr< ns3::NetDevice > const &', 'arg0')]) + ## mesh-helper.h: void ns3::MeshHelper::SetMacType(std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetMacType', + 'void', + [param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## mesh-helper.h: void ns3::MeshHelper::SetNumberOfInterfaces(uint32_t nInterfaces) [member function] + cls.add_method('SetNumberOfInterfaces', + 'void', + [param('uint32_t', 'nInterfaces')]) + ## mesh-helper.h: void ns3::MeshHelper::SetRemoteStationManager(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetRemoteStationManager', + 'void', + [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## mesh-helper.h: void ns3::MeshHelper::SetSpreadInterfaceChannels(ns3::MeshHelper::ChannelPolicy arg0) [member function] + cls.add_method('SetSpreadInterfaceChannels', + 'void', + [param('ns3::MeshHelper::ChannelPolicy', 'arg0')]) + ## mesh-helper.h: void ns3::MeshHelper::SetStackInstaller(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetStackInstaller', + 'void', + [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## mesh-helper.h: void ns3::MeshHelper::SetStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('SetStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')]) + return + def register_Ns3MobilityHelper_methods(root_module, cls): ## mobility-helper.h: ns3::MobilityHelper::MobilityHelper(ns3::MobilityHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::MobilityHelper const &', 'arg0')]) @@ -1500,6 +1631,18 @@ def register_Ns3Ipv4ListRoutingHelper_methods(root_module, cls): is_const=True, is_virtual=True) return +def register_Ns3Ipv4NixVectorHelper_methods(root_module, cls): + ## ipv4-nix-vector-helper.h: ns3::Ipv4NixVectorHelper::Ipv4NixVectorHelper(ns3::Ipv4NixVectorHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4NixVectorHelper const &', 'arg0')]) + ## ipv4-nix-vector-helper.h: ns3::Ipv4NixVectorHelper::Ipv4NixVectorHelper() [constructor] + cls.add_constructor([]) + ## ipv4-nix-vector-helper.h: ns3::Ptr ns3::Ipv4NixVectorHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True, is_virtual=True) + return + def register_Ns3Ipv6ListRoutingHelper_methods(root_module, cls): ## ipv6-list-routing-helper.h: ns3::Ipv6ListRoutingHelper::Ipv6ListRoutingHelper(ns3::Ipv6ListRoutingHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6ListRoutingHelper const &', 'arg0')]) @@ -1618,11 +1761,99 @@ def register_Ns3AthstatsWifiTraceSink_methods(root_module, cls): [param('std::string', 'context'), param('ns3::Mac48Address', 'address')]) return +def register_Ns3MeshStack_methods(root_module, cls): + ## mesh-stack-installer.h: ns3::MeshStack::MeshStack() [constructor] + cls.add_constructor([]) + ## mesh-stack-installer.h: ns3::MeshStack::MeshStack(ns3::MeshStack const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshStack const &', 'arg0')]) + ## mesh-stack-installer.h: bool ns3::MeshStack::InstallStack(ns3::Ptr mp) [member function] + cls.add_method('InstallStack', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'mp')], + is_pure_virtual=True, is_virtual=True) + ## mesh-stack-installer.h: void ns3::MeshStack::Report(ns3::Ptr const mp, std::ostream & arg1) [member function] + cls.add_method('Report', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp'), param('std::ostream &', 'arg1')], + is_pure_virtual=True, is_virtual=True) + ## mesh-stack-installer.h: void ns3::MeshStack::ResetStats(ns3::Ptr const mp) [member function] + cls.add_method('ResetStats', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3Dot11sStack_methods(root_module, cls): + ## dot11s-installer.h: ns3::Dot11sStack::Dot11sStack(ns3::Dot11sStack const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Dot11sStack const &', 'arg0')]) + ## dot11s-installer.h: ns3::Dot11sStack::Dot11sStack() [constructor] + cls.add_constructor([]) + ## dot11s-installer.h: void ns3::Dot11sStack::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## dot11s-installer.h: static ns3::TypeId ns3::Dot11sStack::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## dot11s-installer.h: bool ns3::Dot11sStack::InstallStack(ns3::Ptr mp) [member function] + cls.add_method('InstallStack', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'mp')], + is_virtual=True) + ## dot11s-installer.h: void ns3::Dot11sStack::Report(ns3::Ptr const mp, std::ostream & arg1) [member function] + cls.add_method('Report', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp'), param('std::ostream &', 'arg1')], + is_virtual=True) + ## dot11s-installer.h: void ns3::Dot11sStack::ResetStats(ns3::Ptr const mp) [member function] + cls.add_method('ResetStats', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp')], + is_virtual=True) + return + +def register_Ns3FlameStack_methods(root_module, cls): + ## flame-installer.h: ns3::FlameStack::FlameStack(ns3::FlameStack const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlameStack const &', 'arg0')]) + ## flame-installer.h: ns3::FlameStack::FlameStack() [constructor] + cls.add_constructor([]) + ## flame-installer.h: void ns3::FlameStack::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## flame-installer.h: static ns3::TypeId ns3::FlameStack::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flame-installer.h: bool ns3::FlameStack::InstallStack(ns3::Ptr mp) [member function] + cls.add_method('InstallStack', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'mp')], + is_virtual=True) + ## flame-installer.h: void ns3::FlameStack::Report(ns3::Ptr const mp, std::ostream & arg1) [member function] + cls.add_method('Report', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp'), param('std::ostream &', 'arg1')], + is_virtual=True) + ## flame-installer.h: void ns3::FlameStack::ResetStats(ns3::Ptr const mp) [member function] + cls.add_method('ResetStats', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp')], + is_virtual=True) + return + def register_functions(root_module): module = root_module register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -1636,6 +1867,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_internet_stack.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_internet_stack.py similarity index 74% rename from bindings/python/ns3_module_internet_stack.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_internet_stack.py index a1fad209b..c8eef2d76 100644 --- a/bindings/python/ns3_module_internet_stack.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_internet_stack.py @@ -73,16 +73,32 @@ def register_types(module): module.add_class('Icmpv6Echo', parent=root_module['ns3::Icmpv6Header']) ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol [class] module.add_class('Ipv4L3Protocol', parent=root_module['ns3::Ipv4']) + ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::DropReason [enumeration] + module.add_enum('DropReason', ['DROP_TTL_EXPIRED', 'DROP_NO_ROUTE', 'DROP_BAD_CHECKSUM', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR'], outer_class=root_module['ns3::Ipv4L3Protocol']) ## ipv4-l4-protocol.h: ns3::Ipv4L4Protocol [class] module.add_class('Ipv4L4Protocol', parent=root_module['ns3::Object']) ## ipv4-l4-protocol.h: ns3::Ipv4L4Protocol::RxStatus [enumeration] module.add_enum('RxStatus', ['RX_OK', 'RX_CSUM_FAILED', 'RX_ENDPOINT_UNREACH'], outer_class=root_module['ns3::Ipv4L4Protocol']) + ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol [class] + module.add_class('Ipv6L3Protocol', parent=root_module['ns3::Ipv6']) + ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol::DropReason [enumeration] + module.add_enum('DropReason', ['DROP_TTL_EXPIRED', 'DROP_NO_ROUTE', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR'], outer_class=root_module['ns3::Ipv6L3Protocol']) + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol [class] + module.add_class('Ipv6L4Protocol', parent=root_module['ns3::Object']) + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::RxStatus_e [enumeration] + module.add_enum('RxStatus_e', ['RX_OK', 'RX_CSUM_FAILED', 'RX_ENDPOINT_UNREACH'], outer_class=root_module['ns3::Ipv6L4Protocol']) + ## ndisc-cache.h: ns3::NdiscCache [class] + module.add_class('NdiscCache', parent=root_module['ns3::Object']) + ## ndisc-cache.h: ns3::NdiscCache::Entry [class] + module.add_class('Entry', outer_class=root_module['ns3::NdiscCache']) ## tcp-l4-protocol.h: ns3::TcpL4Protocol [class] module.add_class('TcpL4Protocol', parent=root_module['ns3::Ipv4L4Protocol']) ## udp-l4-protocol.h: ns3::UdpL4Protocol [class] module.add_class('UdpL4Protocol', parent=root_module['ns3::Ipv4L4Protocol']) ## icmpv4-l4-protocol.h: ns3::Icmpv4L4Protocol [class] module.add_class('Icmpv4L4Protocol', parent=root_module['ns3::Ipv4L4Protocol']) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol [class] + module.add_class('Icmpv6L4Protocol', parent=root_module['ns3::Ipv6L4Protocol']) ## Register a nested module for the namespace Config @@ -102,6 +118,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -126,6 +154,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -162,9 +198,14 @@ def register_methods(root_module): register_Ns3Icmpv6Echo_methods(root_module, root_module['ns3::Icmpv6Echo']) register_Ns3Ipv4L3Protocol_methods(root_module, root_module['ns3::Ipv4L3Protocol']) register_Ns3Ipv4L4Protocol_methods(root_module, root_module['ns3::Ipv4L4Protocol']) + register_Ns3Ipv6L3Protocol_methods(root_module, root_module['ns3::Ipv6L3Protocol']) + register_Ns3Ipv6L4Protocol_methods(root_module, root_module['ns3::Ipv6L4Protocol']) + register_Ns3NdiscCache_methods(root_module, root_module['ns3::NdiscCache']) + register_Ns3NdiscCacheEntry_methods(root_module, root_module['ns3::NdiscCache::Entry']) register_Ns3TcpL4Protocol_methods(root_module, root_module['ns3::TcpL4Protocol']) register_Ns3UdpL4Protocol_methods(root_module, root_module['ns3::UdpL4Protocol']) register_Ns3Icmpv4L4Protocol_methods(root_module, root_module['ns3::Icmpv4L4Protocol']) + register_Ns3Icmpv6L4Protocol_methods(root_module, root_module['ns3::Icmpv6L4Protocol']) return def register_Ns3Icmpv4DestinationUnreachable_methods(root_module, cls): @@ -957,11 +998,11 @@ def register_Ns3Icmpv6ParameterError_methods(root_module, cls): 'ns3::TypeId', [], is_static=True) - ## icmpv6-header.h: void ns3::Icmpv6ParameterError::Print(std::ostream & os) [member function] + ## icmpv6-header.h: void ns3::Icmpv6ParameterError::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], - is_virtual=True) + is_const=True, is_virtual=True) ## icmpv6-header.h: void ns3::Icmpv6ParameterError::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', @@ -1116,11 +1157,11 @@ def register_Ns3Icmpv6RS_methods(root_module, cls): 'ns3::TypeId', [], is_static=True) - ## icmpv6-header.h: void ns3::Icmpv6RS::Print(std::ostream & os) [member function] + ## icmpv6-header.h: void ns3::Icmpv6RS::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], - is_virtual=True) + is_const=True, is_virtual=True) ## icmpv6-header.h: void ns3::Icmpv6RS::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', @@ -1172,11 +1213,11 @@ def register_Ns3Icmpv6Redirection_methods(root_module, cls): 'ns3::TypeId', [], is_static=True) - ## icmpv6-header.h: void ns3::Icmpv6Redirection::Print(std::ostream & os) [member function] + ## icmpv6-header.h: void ns3::Icmpv6Redirection::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], - is_virtual=True) + is_const=True, is_virtual=True) ## icmpv6-header.h: void ns3::Icmpv6Redirection::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', @@ -1226,11 +1267,11 @@ def register_Ns3Icmpv6TimeExceeded_methods(root_module, cls): 'ns3::TypeId', [], is_static=True) - ## icmpv6-header.h: void ns3::Icmpv6TimeExceeded::Print(std::ostream & os) [member function] + ## icmpv6-header.h: void ns3::Icmpv6TimeExceeded::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], - is_virtual=True) + is_const=True, is_virtual=True) ## icmpv6-header.h: void ns3::Icmpv6TimeExceeded::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', @@ -1277,11 +1318,11 @@ def register_Ns3Icmpv6TooBig_methods(root_module, cls): 'ns3::TypeId', [], is_static=True) - ## icmpv6-header.h: void ns3::Icmpv6TooBig::Print(std::ostream & os) [member function] + ## icmpv6-header.h: void ns3::Icmpv6TooBig::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], - is_virtual=True) + is_const=True, is_virtual=True) ## icmpv6-header.h: void ns3::Icmpv6TooBig::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', @@ -1702,11 +1743,11 @@ def register_Ns3Icmpv6DestinationUnreachable_methods(root_module, cls): 'ns3::TypeId', [], is_static=True) - ## icmpv6-header.h: void ns3::Icmpv6DestinationUnreachable::Print(std::ostream & os) [member function] + ## icmpv6-header.h: void ns3::Icmpv6DestinationUnreachable::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], - is_virtual=True) + is_const=True, is_virtual=True) ## icmpv6-header.h: void ns3::Icmpv6DestinationUnreachable::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', @@ -1976,6 +2017,435 @@ def register_Ns3Ipv4L4Protocol_methods(root_module, cls): is_virtual=True) return +def register_Ns3Ipv6L3Protocol_methods(root_module, cls): + ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True) + ## ipv6-l3-protocol.h: static ns3::TypeId ns3::Ipv6L3Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol::Ipv6L3Protocol() [constructor] + cls.add_constructor([]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::Insert(ns3::Ptr protocol) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Ptr< ns3::Ipv6L4Protocol >', 'protocol')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::Remove(ns3::Ptr protocol) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Ptr< ns3::Ipv6L4Protocol >', 'protocol')]) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetProtocol(int protocolNumber) const [member function] + cls.add_method('GetProtocol', + 'ns3::Ptr< ns3::Ipv6L4Protocol >', + [param('int', 'protocolNumber')], + is_const=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::CreateRawSocket() [member function] + cls.add_method('CreateRawSocket', + 'ns3::Ptr< ns3::Socket >', + []) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::DeleteRawSocket(ns3::Ptr socket) [member function] + cls.add_method('DeleteRawSocket', + 'void', + [param('ns3::Ptr< ns3::Socket >', 'socket')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetDefaultTtl(uint8_t ttl) [member function] + cls.add_method('SetDefaultTtl', + 'void', + [param('uint8_t', 'ttl')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::Receive(ns3::Ptr device, ns3::Ptr p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function] + cls.add_method('Receive', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'from'), param('ns3::Address const &', 'to'), param('ns3::NetDevice::PacketType', 'packetType')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::Send(ns3::Ptr packet, ns3::Ipv6Address source, ns3::Ipv6Address destination, uint8_t protocol, ns3::Ptr route) [member function] + cls.add_method('Send', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'source'), param('ns3::Ipv6Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv6Route >', 'route')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetRoutingProtocol(ns3::Ptr routingProtocol) [member function] + cls.add_method('SetRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::Ipv6RoutingProtocol >', 'routingProtocol')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetRoutingProtocol() const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::Ipv6RoutingProtocol >', + [], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: uint32_t ns3::Ipv6L3Protocol::AddInterface(ns3::Ptr device) [member function] + cls.add_method('AddInterface', + 'uint32_t', + [param('ns3::Ptr< ns3::NetDevice >', 'device')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetInterface(uint32_t i) const [member function] + cls.add_method('GetInterface', + 'ns3::Ptr< ns3::Ipv6Interface >', + [param('uint32_t', 'i')], + is_const=True) + ## ipv6-l3-protocol.h: uint32_t ns3::Ipv6L3Protocol::GetNInterfaces() const [member function] + cls.add_method('GetNInterfaces', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: int32_t ns3::Ipv6L3Protocol::GetInterfaceForAddress(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetInterfaceForAddress', + 'int32_t', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: int32_t ns3::Ipv6L3Protocol::GetInterfaceForPrefix(ns3::Ipv6Address addr, ns3::Ipv6Prefix mask) const [member function] + cls.add_method('GetInterfaceForPrefix', + 'int32_t', + [param('ns3::Ipv6Address', 'addr'), param('ns3::Ipv6Prefix', 'mask')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: int32_t ns3::Ipv6L3Protocol::GetInterfaceForDevice(ns3::Ptr device) const [member function] + cls.add_method('GetInterfaceForDevice', + 'int32_t', + [param('ns3::Ptr< ns3::NetDevice const >', 'device')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::AddAddress(uint32_t i, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('AddAddress', + 'bool', + [param('uint32_t', 'i'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ipv6InterfaceAddress ns3::Ipv6L3Protocol::GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const [member function] + cls.add_method('GetAddress', + 'ns3::Ipv6InterfaceAddress', + [param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: uint32_t ns3::Ipv6L3Protocol::GetNAddresses(uint32_t interface) const [member function] + cls.add_method('GetNAddresses', + 'uint32_t', + [param('uint32_t', 'interface')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex) [member function] + cls.add_method('RemoveAddress', + 'bool', + [param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')], + is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetMetric(uint32_t i, uint16_t metric) [member function] + cls.add_method('SetMetric', + 'void', + [param('uint32_t', 'i'), param('uint16_t', 'metric')], + is_virtual=True) + ## ipv6-l3-protocol.h: uint16_t ns3::Ipv6L3Protocol::GetMetric(uint32_t i) const [member function] + cls.add_method('GetMetric', + 'uint16_t', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: uint16_t ns3::Ipv6L3Protocol::GetMtu(uint32_t i) const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::IsUp(uint32_t i) const [member function] + cls.add_method('IsUp', + 'bool', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetUp(uint32_t i) [member function] + cls.add_method('SetUp', + 'void', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetDown(uint32_t i) [member function] + cls.add_method('SetDown', + 'void', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::IsForwarding(uint32_t i) const [member function] + cls.add_method('IsForwarding', + 'bool', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetForwarding(uint32_t i, bool val) [member function] + cls.add_method('SetForwarding', + 'void', + [param('uint32_t', 'i'), param('bool', 'val')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetNetDevice(uint32_t i) [member function] + cls.add_method('GetNetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetIcmpv6() const [member function] + cls.add_method('GetIcmpv6', + 'ns3::Ptr< ns3::Icmpv6L4Protocol >', + [], + is_const=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::AddAutoconfiguredAddress(uint32_t interface, ns3::Ipv6Address network, ns3::Ipv6Prefix mask, uint8_t flags, uint32_t validTime, uint32_t preferredTime, ns3::Ipv6Address defaultRouter=ns3::Ipv6Address::GetZero( )) [member function] + cls.add_method('AddAutoconfiguredAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'mask'), param('uint8_t', 'flags'), param('uint32_t', 'validTime'), param('uint32_t', 'preferredTime'), param('ns3::Ipv6Address', 'defaultRouter', default_value='ns3::Ipv6Address::GetZero( )')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress(uint32_t interface, ns3::Ipv6Address network, ns3::Ipv6Prefix mask, ns3::Ipv6Address defaultRouter) [member function] + cls.add_method('RemoveAutoconfiguredAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'mask'), param('ns3::Ipv6Address', 'defaultRouter')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + visibility='protected', is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetIpForward(bool forward) [member function] + cls.add_method('SetIpForward', + 'void', + [param('bool', 'forward')], + visibility='private', is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::GetIpForward() const [member function] + cls.add_method('GetIpForward', + 'bool', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3Ipv6L4Protocol_methods(root_module, cls): + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::Ipv6L4Protocol() [constructor] + cls.add_constructor([]) + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::Ipv6L4Protocol(ns3::Ipv6L4Protocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6L4Protocol const &', 'arg0')]) + ## ipv6-l4-protocol.h: int ns3::Ipv6L4Protocol::GetProtocolNumber() const [member function] + cls.add_method('GetProtocolNumber', + 'int', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6-l4-protocol.h: static ns3::TypeId ns3::Ipv6L4Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::RxStatus_e ns3::Ipv6L4Protocol::Receive(ns3::Ptr p, ns3::Ipv6Address const & src, ns3::Ipv6Address const & dst, ns3::Ptr incomingInterface) [member function] + cls.add_method('Receive', + 'ns3::Ipv6L4Protocol::RxStatus_e', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Address const &', 'src'), param('ns3::Ipv6Address const &', 'dst'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-l4-protocol.h: void ns3::Ipv6L4Protocol::ReceiveIcmp(ns3::Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv6Address payloadSource, ns3::Ipv6Address payloadDestination, uint8_t const * payload) [member function] + cls.add_method('ReceiveIcmp', + 'void', + [param('ns3::Ipv6Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv6Address', 'payloadSource'), param('ns3::Ipv6Address', 'payloadDestination'), param('uint8_t const *', 'payload')], + is_virtual=True) + return + +def register_Ns3NdiscCache_methods(root_module, cls): + ## ndisc-cache.h: ns3::NdiscCache::NdiscCache() [constructor] + cls.add_constructor([]) + ## ndisc-cache.h: ns3::NdiscCache::Entry * ns3::NdiscCache::Add(ns3::Ipv6Address to) [member function] + cls.add_method('Add', + 'ns3::NdiscCache::Entry *', + [param('ns3::Ipv6Address', 'to')]) + ## ndisc-cache.h: void ns3::NdiscCache::Flush() [member function] + cls.add_method('Flush', + 'void', + []) + ## ndisc-cache.h: ns3::Ptr ns3::NdiscCache::GetDevice() const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [], + is_const=True) + ## ndisc-cache.h: ns3::Ptr ns3::NdiscCache::GetInterface() const [member function] + cls.add_method('GetInterface', + 'ns3::Ptr< ns3::Ipv6Interface >', + [], + is_const=True) + ## ndisc-cache.h: static ns3::TypeId ns3::NdiscCache::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ndisc-cache.h: uint32_t ns3::NdiscCache::GetUnresQlen() [member function] + cls.add_method('GetUnresQlen', + 'uint32_t', + []) + ## ndisc-cache.h: ns3::NdiscCache::Entry * ns3::NdiscCache::Lookup(ns3::Ipv6Address dst) [member function] + cls.add_method('Lookup', + 'ns3::NdiscCache::Entry *', + [param('ns3::Ipv6Address', 'dst')]) + ## ndisc-cache.h: void ns3::NdiscCache::Remove(ns3::NdiscCache::Entry * entry) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::NdiscCache::Entry *', 'entry')]) + ## ndisc-cache.h: void ns3::NdiscCache::SetDevice(ns3::Ptr device, ns3::Ptr interface) [member function] + cls.add_method('SetDevice', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')]) + ## ndisc-cache.h: void ns3::NdiscCache::SetUnresQlen(uint32_t unresQlen) [member function] + cls.add_method('SetUnresQlen', + 'void', + [param('uint32_t', 'unresQlen')]) + ## ndisc-cache.h: ns3::NdiscCache::DEFAULT_UNRES_QLEN [variable] + cls.add_static_attribute('DEFAULT_UNRES_QLEN', 'uint32_t const', is_const=True) + ## ndisc-cache.h: void ns3::NdiscCache::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3NdiscCacheEntry_methods(root_module, cls): + ## ndisc-cache.h: ns3::NdiscCache::Entry::Entry(ns3::NdiscCache::Entry const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NdiscCache::Entry const &', 'arg0')]) + ## ndisc-cache.h: ns3::NdiscCache::Entry::Entry(ns3::NdiscCache * nd) [constructor] + cls.add_constructor([param('ns3::NdiscCache *', 'nd')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::AddWaitingPacket(ns3::Ptr p) [member function] + cls.add_method('AddWaitingPacket', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::ClearWaitingPacket() [member function] + cls.add_method('ClearWaitingPacket', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::FunctionDelayTimeout() [member function] + cls.add_method('FunctionDelayTimeout', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::FunctionProbeTimeout() [member function] + cls.add_method('FunctionProbeTimeout', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::FunctionReachableTimeout() [member function] + cls.add_method('FunctionReachableTimeout', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::FunctionRetransmitTimeout() [member function] + cls.add_method('FunctionRetransmitTimeout', + 'void', + []) + ## ndisc-cache.h: ns3::Time ns3::NdiscCache::Entry::GetLastReachabilityConfirmation() const [member function] + cls.add_method('GetLastReachabilityConfirmation', + 'ns3::Time', + [], + is_const=True) + ## ndisc-cache.h: ns3::Address ns3::NdiscCache::Entry::GetMacAddress() const [member function] + cls.add_method('GetMacAddress', + 'ns3::Address', + [], + is_const=True) + ## ndisc-cache.h: uint8_t ns3::NdiscCache::Entry::GetNSRetransmit() const [member function] + cls.add_method('GetNSRetransmit', + 'uint8_t', + [], + is_const=True) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::IncNSRetransmit() [member function] + cls.add_method('IncNSRetransmit', + 'void', + []) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsDelay() const [member function] + cls.add_method('IsDelay', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsIncomplete() const [member function] + cls.add_method('IsIncomplete', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsProbe() const [member function] + cls.add_method('IsProbe', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsReachable() const [member function] + cls.add_method('IsReachable', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsRouter() const [member function] + cls.add_method('IsRouter', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsStale() const [member function] + cls.add_method('IsStale', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkDelay() [member function] + cls.add_method('MarkDelay', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkIncomplete(ns3::Ptr p) [member function] + cls.add_method('MarkIncomplete', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkProbe() [member function] + cls.add_method('MarkProbe', + 'void', + []) + ## ndisc-cache.h: std::list, std::allocator > > ns3::NdiscCache::Entry::MarkReachable(ns3::Address mac) [member function] + cls.add_method('MarkReachable', + 'std::list< ns3::Ptr< ns3::Packet > >', + [param('ns3::Address', 'mac')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkReachable() [member function] + cls.add_method('MarkReachable', + 'void', + []) + ## ndisc-cache.h: std::list, std::allocator > > ns3::NdiscCache::Entry::MarkStale(ns3::Address mac) [member function] + cls.add_method('MarkStale', + 'std::list< ns3::Ptr< ns3::Packet > >', + [param('ns3::Address', 'mac')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkStale() [member function] + cls.add_method('MarkStale', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::ResetNSRetransmit() [member function] + cls.add_method('ResetNSRetransmit', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::SetIpv6Address(ns3::Ipv6Address ipv6Address) [member function] + cls.add_method('SetIpv6Address', + 'void', + [param('ns3::Ipv6Address', 'ipv6Address')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::SetMacAddress(ns3::Address mac) [member function] + cls.add_method('SetMacAddress', + 'void', + [param('ns3::Address', 'mac')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::SetRouter(bool router) [member function] + cls.add_method('SetRouter', + 'void', + [param('bool', 'router')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StartDelayTimer() [member function] + cls.add_method('StartDelayTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StartProbeTimer() [member function] + cls.add_method('StartProbeTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StartReachableTimer() [member function] + cls.add_method('StartReachableTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StartRetransmitTimer() [member function] + cls.add_method('StartRetransmitTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StopDelayTimer() [member function] + cls.add_method('StopDelayTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StopProbeTimer() [member function] + cls.add_method('StopProbeTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StopReachableTimer() [member function] + cls.add_method('StopReachableTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StopRetransmitTimer() [member function] + cls.add_method('StopRetransmitTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::UpdateLastReachabilityconfirmation() [member function] + cls.add_method('UpdateLastReachabilityconfirmation', + 'void', + []) + return + def register_Ns3TcpL4Protocol_methods(root_module, cls): ## tcp-l4-protocol.h: ns3::TcpL4Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) @@ -2178,11 +2648,185 @@ def register_Ns3Icmpv4L4Protocol_methods(root_module, cls): visibility='private', is_virtual=True) return +def register_Ns3Icmpv6L4Protocol_methods(root_module, cls): + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::Icmpv6L4Protocol(ns3::Icmpv6L4Protocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6L4Protocol const &', 'arg0')]) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::Icmpv6L4Protocol() [constructor] + cls.add_constructor([]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::CreateCache(ns3::Ptr device, ns3::Ptr interface) [member function] + cls.add_method('CreateCache', + 'ns3::Ptr< ns3::NdiscCache >', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::DoDAD(ns3::Ipv6Address target, ns3::Ptr interface) [member function] + cls.add_method('DoDAD', + 'void', + [param('ns3::Ipv6Address', 'target'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::DoDad(ns3::Ipv6Address addr, ns3::Ptr interface) [member function] + cls.add_method('DoDad', + 'void', + [param('ns3::Ipv6Address', 'addr'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::ForgeEchoRequest(ns3::Ipv6Address src, ns3::Ipv6Address dst, uint16_t id, uint16_t seq, ns3::Ptr data) [member function] + cls.add_method('ForgeEchoRequest', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('uint16_t', 'id'), param('uint16_t', 'seq'), param('ns3::Ptr< ns3::Packet >', 'data')]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::ForgeNA(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Address * hardwareAddress, uint8_t flags) [member function] + cls.add_method('ForgeNA', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Address *', 'hardwareAddress'), param('uint8_t', 'flags')]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::ForgeNS(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Ipv6Address target, ns3::Address hardwareAddress) [member function] + cls.add_method('ForgeNS', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Address', 'target'), param('ns3::Address', 'hardwareAddress')]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::ForgeRS(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Address hardwareAddress) [member function] + cls.add_method('ForgeRS', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Address', 'hardwareAddress')]) + ## icmpv6-l4-protocol.h: static void ns3::Icmpv6L4Protocol::FunctionDadTimeout(ns3::Ptr icmpv6, ns3::Ipv6Interface * interface, ns3::Ipv6Address addr) [member function] + cls.add_method('FunctionDadTimeout', + 'void', + [param('ns3::Ptr< ns3::Icmpv6L4Protocol >', 'icmpv6'), param('ns3::Ipv6Interface *', 'interface'), param('ns3::Ipv6Address', 'addr')], + is_static=True) + ## icmpv6-l4-protocol.h: int ns3::Icmpv6L4Protocol::GetProtocolNumber() const [member function] + cls.add_method('GetProtocolNumber', + 'int', + [], + is_const=True, is_virtual=True) + ## icmpv6-l4-protocol.h: static uint16_t ns3::Icmpv6L4Protocol::GetStaticProtocolNumber() [member function] + cls.add_method('GetStaticProtocolNumber', + 'uint16_t', + [], + is_static=True) + ## icmpv6-l4-protocol.h: static ns3::TypeId ns3::Icmpv6L4Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-l4-protocol.h: int ns3::Icmpv6L4Protocol::GetVersion() const [member function] + cls.add_method('GetVersion', + 'int', + [], + is_const=True, is_virtual=True) + ## icmpv6-l4-protocol.h: bool ns3::Icmpv6L4Protocol::IsAlwaysDad() const [member function] + cls.add_method('IsAlwaysDad', + 'bool', + [], + is_const=True) + ## icmpv6-l4-protocol.h: bool ns3::Icmpv6L4Protocol::Lookup(ns3::Ipv6Address dst, ns3::Ptr device, ns3::Ptr cache, ns3::Address * hardwareDestination) [member function] + cls.add_method('Lookup', + 'bool', + [param('ns3::Ipv6Address', 'dst'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::NdiscCache >', 'cache'), param('ns3::Address *', 'hardwareDestination')]) + ## icmpv6-l4-protocol.h: bool ns3::Icmpv6L4Protocol::Lookup(ns3::Ptr p, ns3::Ipv6Address dst, ns3::Ptr device, ns3::Ptr cache, ns3::Address * hardwareDestination) [member function] + cls.add_method('Lookup', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Address', 'dst'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::NdiscCache >', 'cache'), param('ns3::Address *', 'hardwareDestination')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + is_virtual=True) + ## icmpv6-l4-protocol.h: ns3::Ipv6L4Protocol::RxStatus_e ns3::Icmpv6L4Protocol::Receive(ns3::Ptr p, ns3::Ipv6Address const & src, ns3::Ipv6Address const & dst, ns3::Ptr interface) [member function] + cls.add_method('Receive', + 'ns3::Ipv6L4Protocol::RxStatus_e', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Address const &', 'src'), param('ns3::Ipv6Address const &', 'dst'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')], + is_virtual=True) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendEchoReply(ns3::Ipv6Address src, ns3::Ipv6Address dst, uint16_t id, uint16_t seq, ns3::Ptr data) [member function] + cls.add_method('SendEchoReply', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('uint16_t', 'id'), param('uint16_t', 'seq'), param('ns3::Ptr< ns3::Packet >', 'data')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendErrorDestinationUnreachable(ns3::Ptr malformedPacket, ns3::Ipv6Address dst, uint8_t code) [member function] + cls.add_method('SendErrorDestinationUnreachable', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'malformedPacket'), param('ns3::Ipv6Address', 'dst'), param('uint8_t', 'code')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendErrorParameterError(ns3::Ptr malformedPacket, ns3::Ipv6Address dst, uint8_t code, uint32_t ptr) [member function] + cls.add_method('SendErrorParameterError', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'malformedPacket'), param('ns3::Ipv6Address', 'dst'), param('uint8_t', 'code'), param('uint32_t', 'ptr')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendErrorTimeExceeded(ns3::Ptr malformedPacket, ns3::Ipv6Address dst, uint8_t code) [member function] + cls.add_method('SendErrorTimeExceeded', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'malformedPacket'), param('ns3::Ipv6Address', 'dst'), param('uint8_t', 'code')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendErrorTooBig(ns3::Ptr malformedPacket, ns3::Ipv6Address dst, uint32_t mtu) [member function] + cls.add_method('SendErrorTooBig', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'malformedPacket'), param('ns3::Ipv6Address', 'dst'), param('uint32_t', 'mtu')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendMessage(ns3::Ptr packet, ns3::Ipv6Address src, ns3::Ipv6Address dst, uint8_t ttl) [member function] + cls.add_method('SendMessage', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('uint8_t', 'ttl')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendMessage(ns3::Ptr packet, ns3::Ipv6Address dst, ns3::Icmpv6Header & icmpv6Hdr, uint8_t ttl) [member function] + cls.add_method('SendMessage', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'dst'), param('ns3::Icmpv6Header &', 'icmpv6Hdr'), param('uint8_t', 'ttl')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendNA(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Address * hardwareAddress, uint8_t flags) [member function] + cls.add_method('SendNA', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Address *', 'hardwareAddress'), param('uint8_t', 'flags')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendNS(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Ipv6Address target, ns3::Address hardwareAddress) [member function] + cls.add_method('SendNS', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Address', 'target'), param('ns3::Address', 'hardwareAddress')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendRS(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Address hardwareAddress) [member function] + cls.add_method('SendRS', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Address', 'hardwareAddress')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendRedirection(ns3::Ptr redirectedPacket, ns3::Ipv6Address dst, ns3::Ipv6Address redirTarget, ns3::Ipv6Address redirDestination, ns3::Address redirHardwareTarget) [member function] + cls.add_method('SendRedirection', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'redirectedPacket'), param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Address', 'redirTarget'), param('ns3::Ipv6Address', 'redirDestination'), param('ns3::Address', 'redirHardwareTarget')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::DELAY_FIRST_PROBE_TIME [variable] + cls.add_static_attribute('DELAY_FIRST_PROBE_TIME', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_ANYCAST_DELAY_TIME [variable] + cls.add_static_attribute('MAX_ANYCAST_DELAY_TIME', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_FINAL_RTR_ADVERTISEMENTS [variable] + cls.add_static_attribute('MAX_FINAL_RTR_ADVERTISEMENTS', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_INITIAL_RTR_ADVERTISEMENTS [variable] + cls.add_static_attribute('MAX_INITIAL_RTR_ADVERTISEMENTS', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_INITIAL_RTR_ADVERT_INTERVAL [variable] + cls.add_static_attribute('MAX_INITIAL_RTR_ADVERT_INTERVAL', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_MULTICAST_SOLICIT [variable] + cls.add_static_attribute('MAX_MULTICAST_SOLICIT', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_NEIGHBOR_ADVERTISEMENT [variable] + cls.add_static_attribute('MAX_NEIGHBOR_ADVERTISEMENT', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_RANDOM_FACTOR [variable] + cls.add_static_attribute('MAX_RANDOM_FACTOR', 'double const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_RA_DELAY_TIME [variable] + cls.add_static_attribute('MAX_RA_DELAY_TIME', 'uint32_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_RTR_SOLICITATIONS [variable] + cls.add_static_attribute('MAX_RTR_SOLICITATIONS', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_RTR_SOLICITATION_DELAY [variable] + cls.add_static_attribute('MAX_RTR_SOLICITATION_DELAY', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_UNICAST_SOLICIT [variable] + cls.add_static_attribute('MAX_UNICAST_SOLICIT', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MIN_DELAY_BETWEEN_RAS [variable] + cls.add_static_attribute('MIN_DELAY_BETWEEN_RAS', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MIN_RANDOM_FACTOR [variable] + cls.add_static_attribute('MIN_RANDOM_FACTOR', 'double const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::REACHABLE_TIME [variable] + cls.add_static_attribute('REACHABLE_TIME', 'uint32_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::RETRANS_TIMER [variable] + cls.add_static_attribute('RETRANS_TIMER', 'uint32_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::RTR_SOLICITATION_INTERVAL [variable] + cls.add_static_attribute('RTR_SOLICITATION_INTERVAL', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + def register_functions(root_module): module = root_module register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -2196,6 +2840,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_list_routing.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_list_routing.py similarity index 95% rename from bindings/python/ns3_module_list_routing.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_list_routing.py index 83a246a33..36415514e 100644 --- a/bindings/python/ns3_module_list_routing.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_list_routing.py @@ -26,6 +26,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -50,6 +62,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -212,6 +232,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -225,6 +247,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_mesh.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_mesh.py new file mode 100644 index 000000000..e4e3ce76d --- /dev/null +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_mesh.py @@ -0,0 +1,727 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## wifi-information-element-vector.h: ns3::WifiElementId [enumeration] + module.add_enum('WifiElementId', ['IE11S_MESH_CONFIGURATION', 'IE11S_MESH_ID', 'IE11S_LINK_METRIC_REPORT', 'IE11S_CONGESTION_NOTIFICATION', 'IE11S_PEERING_MANAGEMENT', 'IE11S_SUPP_MBSS_REG_CLASSES_CHANNELS', 'IE11S_MESH_CHANNEL_SWITCH_ANNOUNCEMENT', 'IE11S_MESH_TIM', 'IE11S_AWAKE_WINDOW', 'IE11S_BEACON_TIMING', 'IE11S_MCCAOP_SETUP_REQUEST', 'IE11S_MCCAOP_SETUP_REPLY', 'IE11S_MCCAOP_ADVERTISEMENT', 'IE11S_MCCAOP_RESERVATION_TEARDOWN', 'IE11S_PORTAL_ANNOUNCEMENT', 'IE11S_RANN', 'IE11S_PREQ', 'IE11S_PREP', 'IE11S_PERR', 'IE11S_PROXY_UPDATE', 'IE11S_PROXY_UPDATE_CONFIRMATION', 'IE11S_ABBREVIATED_HANDSHAKE', 'IE11S_MESH_PEERING_PROTOCOL_VERSION']) + ## mesh-wifi-beacon.h: ns3::MeshWifiBeacon [class] + module.add_class('MeshWifiBeacon') + ## wifi-information-element-vector.h: ns3::WifiInformationElement [class] + module.add_class('WifiInformationElement', parent=root_module['ns3::RefCountBase']) + ## mesh-wifi-interface-mac-plugin.h: ns3::MeshWifiInterfaceMacPlugin [class] + module.add_class('MeshWifiInterfaceMacPlugin', parent=root_module['ns3::RefCountBase']) + ## wifi-information-element-vector.h: ns3::WifiInformationElementVector [class] + module.add_class('WifiInformationElementVector', parent=root_module['ns3::Header']) + ## mesh-l2-routing-protocol.h: ns3::MeshL2RoutingProtocol [class] + module.add_class('MeshL2RoutingProtocol', parent=root_module['ns3::Object']) + ## mesh-wifi-interface-mac.h: ns3::MeshWifiInterfaceMac [class] + module.add_class('MeshWifiInterfaceMac', parent=root_module['ns3::WifiMac']) + ## mesh-point-device.h: ns3::MeshPointDevice [class] + module.add_class('MeshPointDevice', parent=root_module['ns3::NetDevice']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3MeshWifiBeacon_methods(root_module, root_module['ns3::MeshWifiBeacon']) + register_Ns3WifiInformationElement_methods(root_module, root_module['ns3::WifiInformationElement']) + register_Ns3MeshWifiInterfaceMacPlugin_methods(root_module, root_module['ns3::MeshWifiInterfaceMacPlugin']) + register_Ns3WifiInformationElementVector_methods(root_module, root_module['ns3::WifiInformationElementVector']) + register_Ns3MeshL2RoutingProtocol_methods(root_module, root_module['ns3::MeshL2RoutingProtocol']) + register_Ns3MeshWifiInterfaceMac_methods(root_module, root_module['ns3::MeshWifiInterfaceMac']) + register_Ns3MeshPointDevice_methods(root_module, root_module['ns3::MeshPointDevice']) + return + +def register_Ns3MeshWifiBeacon_methods(root_module, cls): + ## mesh-wifi-beacon.h: ns3::MeshWifiBeacon::MeshWifiBeacon(ns3::MeshWifiBeacon const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshWifiBeacon const &', 'arg0')]) + ## mesh-wifi-beacon.h: ns3::MeshWifiBeacon::MeshWifiBeacon(ns3::Ssid ssid, ns3::SupportedRates rates, uint64_t us) [constructor] + cls.add_constructor([param('ns3::Ssid', 'ssid'), param('ns3::SupportedRates', 'rates'), param('uint64_t', 'us')]) + ## mesh-wifi-beacon.h: void ns3::MeshWifiBeacon::AddInformationElement(ns3::Ptr ie) [member function] + cls.add_method('AddInformationElement', + 'void', + [param('ns3::Ptr< ns3::WifiInformationElement >', 'ie')]) + ## mesh-wifi-beacon.h: ns3::MgtBeaconHeader ns3::MeshWifiBeacon::BeaconHeader() const [member function] + cls.add_method('BeaconHeader', + 'ns3::MgtBeaconHeader', + [], + is_const=True) + ## mesh-wifi-beacon.h: ns3::WifiMacHeader ns3::MeshWifiBeacon::CreateHeader(ns3::Mac48Address address, ns3::Mac48Address mpAddress) [member function] + cls.add_method('CreateHeader', + 'ns3::WifiMacHeader', + [param('ns3::Mac48Address', 'address'), param('ns3::Mac48Address', 'mpAddress')]) + ## mesh-wifi-beacon.h: ns3::Ptr ns3::MeshWifiBeacon::CreatePacket() [member function] + cls.add_method('CreatePacket', + 'ns3::Ptr< ns3::Packet >', + []) + return + +def register_Ns3WifiInformationElement_methods(root_module, cls): + cls.add_binary_comparison_operator('<') + cls.add_binary_comparison_operator('==') + ## wifi-information-element-vector.h: ns3::WifiInformationElement::WifiInformationElement() [constructor] + cls.add_constructor([]) + ## wifi-information-element-vector.h: ns3::WifiInformationElement::WifiInformationElement(ns3::WifiInformationElement const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiInformationElement const &', 'arg0')]) + ## wifi-information-element-vector.h: uint8_t ns3::WifiInformationElement::DeserializeInformation(ns3::Buffer::Iterator start, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')], + is_pure_virtual=True, is_virtual=True) + ## wifi-information-element-vector.h: ns3::WifiElementId ns3::WifiInformationElement::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: uint8_t ns3::WifiInformationElement::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElement::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElement::SerializeInformation(ns3::Buffer::Iterator start) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3MeshWifiInterfaceMacPlugin_methods(root_module, cls): + ## mesh-wifi-interface-mac-plugin.h: ns3::MeshWifiInterfaceMacPlugin::MeshWifiInterfaceMacPlugin() [constructor] + cls.add_constructor([]) + ## mesh-wifi-interface-mac-plugin.h: ns3::MeshWifiInterfaceMacPlugin::MeshWifiInterfaceMacPlugin(ns3::MeshWifiInterfaceMacPlugin const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshWifiInterfaceMacPlugin const &', 'arg0')]) + ## mesh-wifi-interface-mac-plugin.h: bool ns3::MeshWifiInterfaceMacPlugin::Receive(ns3::Ptr packet, ns3::WifiMacHeader const & header) [member function] + cls.add_method('Receive', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::WifiMacHeader const &', 'header')], + is_pure_virtual=True, is_virtual=True) + ## mesh-wifi-interface-mac-plugin.h: void ns3::MeshWifiInterfaceMacPlugin::SetParent(ns3::Ptr parent) [member function] + cls.add_method('SetParent', + 'void', + [param('ns3::Ptr< ns3::MeshWifiInterfaceMac >', 'parent')], + is_pure_virtual=True, is_virtual=True) + ## mesh-wifi-interface-mac-plugin.h: void ns3::MeshWifiInterfaceMacPlugin::UpdateBeacon(ns3::MeshWifiBeacon & beacon) const [member function] + cls.add_method('UpdateBeacon', + 'void', + [param('ns3::MeshWifiBeacon &', 'beacon')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac-plugin.h: bool ns3::MeshWifiInterfaceMacPlugin::UpdateOutcomingFrame(ns3::Ptr packet, ns3::WifiMacHeader & header, ns3::Mac48Address from, ns3::Mac48Address to) [member function] + cls.add_method('UpdateOutcomingFrame', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::WifiMacHeader &', 'header'), param('ns3::Mac48Address', 'from'), param('ns3::Mac48Address', 'to')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3WifiInformationElementVector_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + ## wifi-information-element-vector.h: ns3::WifiInformationElementVector::WifiInformationElementVector(ns3::WifiInformationElementVector const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiInformationElementVector const &', 'arg0')]) + ## wifi-information-element-vector.h: ns3::WifiInformationElementVector::WifiInformationElementVector() [constructor] + cls.add_constructor([]) + ## wifi-information-element-vector.h: bool ns3::WifiInformationElementVector::AddInformationElement(ns3::Ptr element) [member function] + cls.add_method('AddInformationElement', + 'bool', + [param('ns3::Ptr< ns3::WifiInformationElement >', 'element')]) + ## wifi-information-element-vector.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::WifiInformationElementVector::Begin() [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::WifiInformationElement >, std::vector< ns3::Ptr< ns3::WifiInformationElement > > >', + []) + ## wifi-information-element-vector.h: uint32_t ns3::WifiInformationElementVector::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## wifi-information-element-vector.h: uint32_t ns3::WifiInformationElementVector::DeserializeSingleIe(ns3::Buffer::Iterator start) [member function] + cls.add_method('DeserializeSingleIe', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## wifi-information-element-vector.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::WifiInformationElementVector::End() [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::WifiInformationElement >, std::vector< ns3::Ptr< ns3::WifiInformationElement > > >', + []) + ## wifi-information-element-vector.h: ns3::Ptr ns3::WifiInformationElementVector::FindFirst(ns3::WifiElementId id) const [member function] + cls.add_method('FindFirst', + 'ns3::Ptr< ns3::WifiInformationElement >', + [param('ns3::WifiElementId', 'id')], + is_const=True) + ## wifi-information-element-vector.h: ns3::TypeId ns3::WifiInformationElementVector::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: uint32_t ns3::WifiInformationElementVector::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: static ns3::TypeId ns3::WifiInformationElementVector::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElementVector::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElementVector::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElementVector::SetMaxSize(uint16_t size) [member function] + cls.add_method('SetMaxSize', + 'void', + [param('uint16_t', 'size')]) + return + +def register_Ns3MeshL2RoutingProtocol_methods(root_module, cls): + ## mesh-l2-routing-protocol.h: ns3::MeshL2RoutingProtocol::MeshL2RoutingProtocol() [constructor] + cls.add_constructor([]) + ## mesh-l2-routing-protocol.h: ns3::MeshL2RoutingProtocol::MeshL2RoutingProtocol(ns3::MeshL2RoutingProtocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshL2RoutingProtocol const &', 'arg0')]) + ## mesh-l2-routing-protocol.h: ns3::Ptr ns3::MeshL2RoutingProtocol::GetMeshPoint() const [member function] + cls.add_method('GetMeshPoint', + 'ns3::Ptr< ns3::MeshPointDevice >', + [], + is_const=True) + ## mesh-l2-routing-protocol.h: static ns3::TypeId ns3::MeshL2RoutingProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mesh-l2-routing-protocol.h: bool ns3::MeshL2RoutingProtocol::RemoveRoutingStuff(uint32_t fromIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t & protocolType) [member function] + cls.add_method('RemoveRoutingStuff', + 'bool', + [param('uint32_t', 'fromIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t &', 'protocolType')], + is_pure_virtual=True, is_virtual=True) + ## mesh-l2-routing-protocol.h: bool ns3::MeshL2RoutingProtocol::RequestRoute(uint32_t sourceIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t protocolType, ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty> routeReply) [member function] + cls.add_method('RequestRoute', + 'bool', + [param('uint32_t', 'sourceIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocolType'), param('ns3::Callback< void, bool, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty >', 'routeReply')], + is_pure_virtual=True, is_virtual=True) + ## mesh-l2-routing-protocol.h: void ns3::MeshL2RoutingProtocol::SetMeshPoint(ns3::Ptr mp) [member function] + cls.add_method('SetMeshPoint', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'mp')]) + return + +def register_Ns3MeshWifiInterfaceMac_methods(root_module, cls): + ## mesh-wifi-interface-mac.h: ns3::MeshWifiInterfaceMac::MeshWifiInterfaceMac(ns3::MeshWifiInterfaceMac const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshWifiInterfaceMac const &', 'arg0')]) + ## mesh-wifi-interface-mac.h: ns3::MeshWifiInterfaceMac::MeshWifiInterfaceMac() [constructor] + cls.add_constructor([]) + ## mesh-wifi-interface-mac.h: bool ns3::MeshWifiInterfaceMac::CheckSupportedRates(ns3::SupportedRates rates) const [member function] + cls.add_method('CheckSupportedRates', + 'bool', + [param('ns3::SupportedRates', 'rates')], + is_const=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Mac48Address ns3::MeshWifiInterfaceMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetBeaconInterval() const [member function] + cls.add_method('GetBeaconInterval', + 'ns3::Time', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: ns3::Mac48Address ns3::MeshWifiInterfaceMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: uint16_t ns3::MeshWifiInterfaceMac::GetFrequencyChannel() const [member function] + cls.add_method('GetFrequencyChannel', + 'uint16_t', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: uint32_t ns3::MeshWifiInterfaceMac::GetLinkMetric(ns3::Mac48Address peerAddress) [member function] + cls.add_method('GetLinkMetric', + 'uint32_t', + [param('ns3::Mac48Address', 'peerAddress')]) + ## mesh-wifi-interface-mac.h: ns3::Mac48Address ns3::MeshWifiInterfaceMac::GetMeshPointAddress() const [member function] + cls.add_method('GetMeshPointAddress', + 'ns3::Mac48Address', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Ssid ns3::MeshWifiInterfaceMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Ptr ns3::MeshWifiInterfaceMac::GetStationManager() [member function] + cls.add_method('GetStationManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + []) + ## mesh-wifi-interface-mac.h: ns3::SupportedRates ns3::MeshWifiInterfaceMac::GetSupportedRates() const [member function] + cls.add_method('GetSupportedRates', + 'ns3::SupportedRates', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetTbtt() const [member function] + cls.add_method('GetTbtt', + 'ns3::Time', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: static ns3::TypeId ns3::MeshWifiInterfaceMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::InstallPlugin(ns3::Ptr plugin) [member function] + cls.add_method('InstallPlugin', + 'void', + [param('ns3::Ptr< ns3::MeshWifiInterfaceMacPlugin >', 'plugin')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::Report(std::ostream & arg0) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'arg0')], + is_const=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SendManagementFrame(ns3::Ptr frame, ns3::WifiMacHeader const & hdr) [member function] + cls.add_method('SendManagementFrame', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'frame'), param('ns3::WifiMacHeader const &', 'hdr')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetBeaconGeneration(bool enable) [member function] + cls.add_method('SetBeaconGeneration', + 'void', + [param('bool', 'enable')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetBeaconInterval(ns3::Time interval) [member function] + cls.add_method('SetBeaconInterval', + 'void', + [param('ns3::Time', 'interval')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetLinkMetricCallback(ns3::Callback, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetLinkMetricCallback', + 'void', + [param('ns3::Callback< unsigned int, ns3::Mac48Address, ns3::Ptr< ns3::MeshWifiInterfaceMac >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetMeshPointAddress(ns3::Mac48Address arg0) [member function] + cls.add_method('SetMeshPointAddress', + 'void', + [param('ns3::Mac48Address', 'arg0')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetQueue(ns3::AccessClass ac) [member function] + cls.add_method('SetQueue', + 'void', + [param('ns3::AccessClass', 'ac')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetRandomStartDelay(ns3::Time interval) [member function] + cls.add_method('SetRandomStartDelay', + 'void', + [param('ns3::Time', 'interval')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::ShiftTbtt(ns3::Time shift) [member function] + cls.add_method('ShiftTbtt', + 'void', + [param('ns3::Time', 'shift')]) + ## mesh-wifi-interface-mac.h: bool ns3::MeshWifiInterfaceMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SwitchFrequencyChannel(uint16_t new_id) [member function] + cls.add_method('SwitchFrequencyChannel', + 'void', + [param('uint16_t', 'new_id')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::ForwardUp(ns3::Ptr packet, ns3::Mac48Address src, ns3::Mac48Address dst) [member function] + cls.add_method('ForwardUp', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], + visibility='private', is_virtual=True) + return + +def register_Ns3MeshPointDevice_methods(root_module, cls): + ## mesh-point-device.h: ns3::MeshPointDevice::MeshPointDevice(ns3::MeshPointDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshPointDevice const &', 'arg0')]) + ## mesh-point-device.h: ns3::MeshPointDevice::MeshPointDevice() [constructor] + cls.add_constructor([]) + ## mesh-point-device.h: void ns3::MeshPointDevice::AddInterface(ns3::Ptr port) [member function] + cls.add_method('AddInterface', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'port')]) + ## mesh-point-device.h: void ns3::MeshPointDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## mesh-point-device.h: ns3::Address ns3::MeshPointDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Address ns3::MeshPointDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Ptr ns3::MeshPointDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: uint32_t ns3::MeshPointDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Ptr ns3::MeshPointDevice::GetInterface(uint32_t id) const [member function] + cls.add_method('GetInterface', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'id')], + is_const=True) + ## mesh-point-device.h: std::vector, std::allocator > > ns3::MeshPointDevice::GetInterfaces() const [member function] + cls.add_method('GetInterfaces', + 'std::vector< ns3::Ptr< ns3::NetDevice > >', + [], + is_const=True) + ## mesh-point-device.h: uint16_t ns3::MeshPointDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Address ns3::MeshPointDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Address ns3::MeshPointDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## mesh-point-device.h: uint32_t ns3::MeshPointDevice::GetNInterfaces() const [member function] + cls.add_method('GetNInterfaces', + 'uint32_t', + [], + is_const=True) + ## mesh-point-device.h: ns3::Ptr ns3::MeshPointDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Ptr ns3::MeshPointDevice::GetRoutingProtocol() const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::MeshL2RoutingProtocol >', + [], + is_const=True) + ## mesh-point-device.h: static ns3::TypeId ns3::MeshPointDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::Report(std::ostream & os) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + ## mesh-point-device.h: bool ns3::MeshPointDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetAddress(ns3::Address a) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'a')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetRoutingProtocol(ns3::Ptr protocol) [member function] + cls.add_method('SetRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::MeshL2RoutingProtocol >', 'protocol')]) + ## mesh-point-device.h: bool ns3::MeshPointDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/ns3_module_mobility.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_mobility.py similarity index 98% rename from bindings/python/ns3_module_mobility.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_mobility.py index ceb42c25f..b7556135d 100644 --- a/bindings/python/ns3_module_mobility.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_mobility.py @@ -62,6 +62,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -86,6 +98,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -686,6 +706,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -699,6 +721,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_nix_vector_routing.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_nix_vector_routing.py new file mode 100644 index 000000000..f027a698f --- /dev/null +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_nix_vector_routing.py @@ -0,0 +1,180 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting [class] + module.add_class('Ipv4NixVectorRouting', parent=root_module['ns3::Ipv4RoutingProtocol']) + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >', 'ns3::NixMap_t') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >*', 'ns3::NixMap_t*') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >&', 'ns3::NixMap_t&') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >', 'ns3::Ipv4RouteMap_t') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >*', 'ns3::Ipv4RouteMap_t*') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >&', 'ns3::Ipv4RouteMap_t&') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Ipv4NixVectorRouting_methods(root_module, root_module['ns3::Ipv4NixVectorRouting']) + return + +def register_Ns3Ipv4NixVectorRouting_methods(root_module, cls): + ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting::Ipv4NixVectorRouting(ns3::Ipv4NixVectorRouting const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4NixVectorRouting const &', 'arg0')]) + ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting::Ipv4NixVectorRouting() [constructor] + cls.add_constructor([]) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::FlushGlobalNixRoutingCache() [member function] + cls.add_method('FlushGlobalNixRoutingCache', + 'void', + []) + ## ipv4-nix-vector-routing.h: static ns3::TypeId ns3::Ipv4NixVectorRouting::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::SetNode(ns3::Ptr arg0) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'arg0')]) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: bool ns3::Ipv4NixVectorRouting::RouteInput(ns3::Ptr p, ns3::Ipv4Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: ns3::Ptr ns3::Ipv4NixVectorRouting::RouteOutput(ns3::Ptr p, ns3::Ipv4Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv4Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::SetIpv4(ns3::Ptr ipv4) [member function] + cls.add_method('SetIpv4', + 'void', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/ns3_module_node.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_node.py similarity index 73% rename from bindings/python/ns3_module_node.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_node.py index cfa70586f..9c9c6855d 100644 --- a/bindings/python/ns3_module_node.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_node.py @@ -3,6 +3,8 @@ from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandler def register_types(module): root_module = module.get_root() + ## packetbb.h: ns3::PbbAddressLength [enumeration] + module.add_enum('PbbAddressLength', ['IPV4', 'IPV6']) ## ethernet-header.h: ns3::ethernet_header_t [enumeration] module.add_enum('ethernet_header_t', ['LENGTH', 'VLAN', 'QINQ']) ## address.h: ns3::Address [class] @@ -55,6 +57,24 @@ def register_types(module): module.add_class('PacketSocketAddress') ## packet-socket-address.h: ns3::PacketSocketAddress [class] root_module['ns3::PacketSocketAddress'].implicitly_converts_to(root_module['ns3::Address']) + ## packetbb.h: ns3::PbbAddressBlock [class] + module.add_class('PbbAddressBlock', allow_subclassing=True) + ## packetbb.h: ns3::PbbAddressBlockIpv4 [class] + module.add_class('PbbAddressBlockIpv4', parent=root_module['ns3::PbbAddressBlock']) + ## packetbb.h: ns3::PbbAddressBlockIpv6 [class] + module.add_class('PbbAddressBlockIpv6', parent=root_module['ns3::PbbAddressBlock']) + ## packetbb.h: ns3::PbbAddressTlvBlock [class] + module.add_class('PbbAddressTlvBlock') + ## packetbb.h: ns3::PbbMessage [class] + module.add_class('PbbMessage', allow_subclassing=True) + ## packetbb.h: ns3::PbbMessageIpv4 [class] + module.add_class('PbbMessageIpv4', parent=root_module['ns3::PbbMessage']) + ## packetbb.h: ns3::PbbMessageIpv6 [class] + module.add_class('PbbMessageIpv6', parent=root_module['ns3::PbbMessage']) + ## packetbb.h: ns3::PbbTlv [class] + module.add_class('PbbTlv') + ## packetbb.h: ns3::PbbTlvBlock [class] + module.add_class('PbbTlvBlock') ## ipv4-address.h: ns3::Ipv4AddressChecker [class] module.add_class('Ipv4AddressChecker', parent=root_module['ns3::AttributeChecker']) ## ipv4-address.h: ns3::Ipv4AddressValue [class] @@ -91,6 +111,10 @@ def register_types(module): module.add_class('Mac48AddressChecker', parent=root_module['ns3::AttributeChecker']) ## mac48-address.h: ns3::Mac48AddressValue [class] module.add_class('Mac48AddressValue', parent=root_module['ns3::AttributeValue']) + ## packetbb.h: ns3::PbbAddressTlv [class] + module.add_class('PbbAddressTlv', parent=root_module['ns3::PbbTlv']) + ## packetbb.h: ns3::PbbPacket [class] + module.add_class('PbbPacket', parent=root_module['ns3::Header']) ## queue.h: ns3::Queue [class] module.add_class('Queue', parent=root_module['ns3::Object']) ## socket.h: ns3::Socket [class] @@ -174,6 +198,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -198,6 +234,15 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + module.add_container('std::vector< ns3::Mac48Address >', 'ns3::Mac48Address', container_type='vector') + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -221,6 +266,15 @@ def register_methods(root_module): register_Ns3Mac64Address_methods(root_module, root_module['ns3::Mac64Address']) register_Ns3NodeList_methods(root_module, root_module['ns3::NodeList']) register_Ns3PacketSocketAddress_methods(root_module, root_module['ns3::PacketSocketAddress']) + register_Ns3PbbAddressBlock_methods(root_module, root_module['ns3::PbbAddressBlock']) + register_Ns3PbbAddressBlockIpv4_methods(root_module, root_module['ns3::PbbAddressBlockIpv4']) + register_Ns3PbbAddressBlockIpv6_methods(root_module, root_module['ns3::PbbAddressBlockIpv6']) + register_Ns3PbbAddressTlvBlock_methods(root_module, root_module['ns3::PbbAddressTlvBlock']) + register_Ns3PbbMessage_methods(root_module, root_module['ns3::PbbMessage']) + register_Ns3PbbMessageIpv4_methods(root_module, root_module['ns3::PbbMessageIpv4']) + register_Ns3PbbMessageIpv6_methods(root_module, root_module['ns3::PbbMessageIpv6']) + register_Ns3PbbTlv_methods(root_module, root_module['ns3::PbbTlv']) + register_Ns3PbbTlvBlock_methods(root_module, root_module['ns3::PbbTlvBlock']) register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker']) register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue']) register_Ns3Ipv4Header_methods(root_module, root_module['ns3::Ipv4Header']) @@ -238,6 +292,8 @@ def register_methods(root_module): register_Ns3LlcSnapHeader_methods(root_module, root_module['ns3::LlcSnapHeader']) register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker']) register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue']) + register_Ns3PbbAddressTlv_methods(root_module, root_module['ns3::PbbAddressTlv']) + register_Ns3PbbPacket_methods(root_module, root_module['ns3::PbbPacket']) register_Ns3Queue_methods(root_module, root_module['ns3::Queue']) register_Ns3Socket_methods(root_module, root_module['ns3::Socket']) register_Ns3SocketAddressTag_methods(root_module, root_module['ns3::SocketAddressTag']) @@ -1163,6 +1219,1021 @@ def register_Ns3PacketSocketAddress_methods(root_module, cls): [param('uint32_t', 'device')]) return +def register_Ns3PbbAddressBlock_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbAddressBlock::PbbAddressBlock(ns3::PbbAddressBlock const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressBlock const &', 'arg0')]) + ## packetbb.h: ns3::PbbAddressBlock::PbbAddressBlock() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Address ns3::PbbAddressBlock::AddressBack() const [member function] + cls.add_method('AddressBack', + 'ns3::Address', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressBegin() [member function] + cls.add_method('AddressBegin', + 'std::_List_iterator< ns3::Address >', + []) + ## packetbb.h: std::_List_const_iterator ns3::PbbAddressBlock::AddressBegin() const [member function] + cls.add_method('AddressBegin', + 'std::_List_const_iterator< ns3::Address >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::AddressClear() [member function] + cls.add_method('AddressClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbAddressBlock::AddressEmpty() const [member function] + cls.add_method('AddressEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressEnd() [member function] + cls.add_method('AddressEnd', + 'std::_List_iterator< ns3::Address >', + []) + ## packetbb.h: std::_List_const_iterator ns3::PbbAddressBlock::AddressEnd() const [member function] + cls.add_method('AddressEnd', + 'std::_List_const_iterator< ns3::Address >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressErase(std::_List_iterator position) [member function] + cls.add_method('AddressErase', + 'std::_List_iterator< ns3::Address >', + [param('std::_List_iterator< ns3::Address >', 'position')]) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressErase(std::_List_iterator first, std::_List_iterator last) [member function] + cls.add_method('AddressErase', + 'std::_List_iterator< ns3::Address >', + [param('std::_List_iterator< ns3::Address >', 'first'), param('std::_List_iterator< ns3::Address >', 'last')]) + ## packetbb.h: ns3::Address ns3::PbbAddressBlock::AddressFront() const [member function] + cls.add_method('AddressFront', + 'ns3::Address', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressInsert(std::_List_iterator position, ns3::Address const value) [member function] + cls.add_method('AddressInsert', + 'std::_List_iterator< ns3::Address >', + [param('std::_List_iterator< ns3::Address >', 'position'), param('ns3::Address const', 'value')]) + ## packetbb.h: void ns3::PbbAddressBlock::AddressPopBack() [member function] + cls.add_method('AddressPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::AddressPopFront() [member function] + cls.add_method('AddressPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::AddressPushBack(ns3::Address address) [member function] + cls.add_method('AddressPushBack', + 'void', + [param('ns3::Address', 'address')]) + ## packetbb.h: void ns3::PbbAddressBlock::AddressPushFront(ns3::Address address) [member function] + cls.add_method('AddressPushFront', + 'void', + [param('ns3::Address', 'address')]) + ## packetbb.h: int ns3::PbbAddressBlock::AddressSize() const [member function] + cls.add_method('AddressSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: uint32_t ns3::PbbAddressBlock::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbAddressBlock::PrefixBack() const [member function] + cls.add_method('PrefixBack', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixBegin() [member function] + cls.add_method('PrefixBegin', + 'std::_List_iterator< unsigned char >', + []) + ## packetbb.h: std::_List_const_iterator ns3::PbbAddressBlock::PrefixBegin() const [member function] + cls.add_method('PrefixBegin', + 'std::_List_const_iterator< unsigned char >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixClear() [member function] + cls.add_method('PrefixClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbAddressBlock::PrefixEmpty() const [member function] + cls.add_method('PrefixEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixEnd() [member function] + cls.add_method('PrefixEnd', + 'std::_List_iterator< unsigned char >', + []) + ## packetbb.h: std::_List_const_iterator ns3::PbbAddressBlock::PrefixEnd() const [member function] + cls.add_method('PrefixEnd', + 'std::_List_const_iterator< unsigned char >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixErase(std::_List_iterator position) [member function] + cls.add_method('PrefixErase', + 'std::_List_iterator< unsigned char >', + [param('std::_List_iterator< unsigned char >', 'position')]) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixErase(std::_List_iterator first, std::_List_iterator last) [member function] + cls.add_method('PrefixErase', + 'std::_List_iterator< unsigned char >', + [param('std::_List_iterator< unsigned char >', 'first'), param('std::_List_iterator< unsigned char >', 'last')]) + ## packetbb.h: uint8_t ns3::PbbAddressBlock::PrefixFront() const [member function] + cls.add_method('PrefixFront', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixInsert(std::_List_iterator position, uint8_t const value) [member function] + cls.add_method('PrefixInsert', + 'std::_List_iterator< unsigned char >', + [param('std::_List_iterator< unsigned char >', 'position'), param('uint8_t const', 'value')]) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixPopBack() [member function] + cls.add_method('PrefixPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixPopFront() [member function] + cls.add_method('PrefixPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixPushBack(uint8_t prefix) [member function] + cls.add_method('PrefixPushBack', + 'void', + [param('uint8_t', 'prefix')]) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixPushFront(uint8_t prefix) [member function] + cls.add_method('PrefixPushFront', + 'void', + [param('uint8_t', 'prefix')]) + ## packetbb.h: int ns3::PbbAddressBlock::PrefixSize() const [member function] + cls.add_method('PrefixSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbAddressBlock::TlvBack() [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbAddressTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbAddressBlock::TlvBack() const [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbAddressTlv > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvBegin() [member function] + cls.add_method('TlvBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbAddressBlock::TlvBegin() const [member function] + cls.add_method('TlvBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::TlvClear() [member function] + cls.add_method('TlvClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbAddressBlock::TlvEmpty() const [member function] + cls.add_method('TlvEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvEnd() [member function] + cls.add_method('TlvEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbAddressBlock::TlvEnd() const [member function] + cls.add_method('TlvEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvErase(std::_List_iterator > position) [member function] + cls.add_method('TlvErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvErase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('TlvErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbAddressBlock::TlvFront() [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbAddressTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbAddressBlock::TlvFront() const [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbAddressTlv > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvInsert(std::_List_iterator > position, ns3::Ptr const value) [member function] + cls.add_method('TlvInsert', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position'), param('ns3::Ptr< ns3::PbbTlv > const', 'value')]) + ## packetbb.h: void ns3::PbbAddressBlock::TlvPopBack() [member function] + cls.add_method('TlvPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::TlvPopFront() [member function] + cls.add_method('TlvPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::TlvPushBack(ns3::Ptr address) [member function] + cls.add_method('TlvPushBack', + 'void', + [param('ns3::Ptr< ns3::PbbAddressTlv >', 'address')]) + ## packetbb.h: void ns3::PbbAddressBlock::TlvPushFront(ns3::Ptr address) [member function] + cls.add_method('TlvPushFront', + 'void', + [param('ns3::Ptr< ns3::PbbAddressTlv >', 'address')]) + ## packetbb.h: int ns3::PbbAddressBlock::TlvSize() const [member function] + cls.add_method('TlvSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## packetbb.h: ns3::Address ns3::PbbAddressBlock::DeserializeAddress(uint8_t * buffer) const [member function] + cls.add_method('DeserializeAddress', + 'ns3::Address', + [param('uint8_t *', 'buffer')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: uint8_t ns3::PbbAddressBlock::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'uint8_t', + [], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlock::PrintAddress(std::ostream & os, std::_List_const_iterator iter) const [member function] + cls.add_method('PrintAddress', + 'void', + [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlock::SerializeAddress(uint8_t * buffer, std::_List_const_iterator iter) const [member function] + cls.add_method('SerializeAddress', + 'void', + [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbAddressBlockIpv4_methods(root_module, cls): + ## packetbb.h: ns3::PbbAddressBlockIpv4::PbbAddressBlockIpv4(ns3::PbbAddressBlockIpv4 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressBlockIpv4 const &', 'arg0')]) + ## packetbb.h: ns3::PbbAddressBlockIpv4::PbbAddressBlockIpv4() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Address ns3::PbbAddressBlockIpv4::DeserializeAddress(uint8_t * buffer) const [member function] + cls.add_method('DeserializeAddress', + 'ns3::Address', + [param('uint8_t *', 'buffer')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: uint8_t ns3::PbbAddressBlockIpv4::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'uint8_t', + [], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlockIpv4::PrintAddress(std::ostream & os, std::_List_const_iterator iter) const [member function] + cls.add_method('PrintAddress', + 'void', + [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlockIpv4::SerializeAddress(uint8_t * buffer, std::_List_const_iterator iter) const [member function] + cls.add_method('SerializeAddress', + 'void', + [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbAddressBlockIpv6_methods(root_module, cls): + ## packetbb.h: ns3::PbbAddressBlockIpv6::PbbAddressBlockIpv6(ns3::PbbAddressBlockIpv6 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressBlockIpv6 const &', 'arg0')]) + ## packetbb.h: ns3::PbbAddressBlockIpv6::PbbAddressBlockIpv6() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Address ns3::PbbAddressBlockIpv6::DeserializeAddress(uint8_t * buffer) const [member function] + cls.add_method('DeserializeAddress', + 'ns3::Address', + [param('uint8_t *', 'buffer')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: uint8_t ns3::PbbAddressBlockIpv6::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'uint8_t', + [], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlockIpv6::PrintAddress(std::ostream & os, std::_List_const_iterator iter) const [member function] + cls.add_method('PrintAddress', + 'void', + [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlockIpv6::SerializeAddress(uint8_t * buffer, std::_List_const_iterator iter) const [member function] + cls.add_method('SerializeAddress', + 'void', + [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbAddressTlvBlock_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbAddressTlvBlock::PbbAddressTlvBlock() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::PbbAddressTlvBlock::PbbAddressTlvBlock(ns3::PbbAddressTlvBlock const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressTlvBlock const &', 'arg0')]) + ## packetbb.h: ns3::Ptr ns3::PbbAddressTlvBlock::Back() const [member function] + cls.add_method('Back', + 'ns3::Ptr< ns3::PbbAddressTlv >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::Begin() [member function] + cls.add_method('Begin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbAddressTlvBlock::Begin() const [member function] + cls.add_method('Begin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Clear() [member function] + cls.add_method('Clear', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: bool ns3::PbbAddressTlvBlock::Empty() const [member function] + cls.add_method('Empty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::End() [member function] + cls.add_method('End', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbAddressTlvBlock::End() const [member function] + cls.add_method('End', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::Erase(std::_List_iterator > position) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::Erase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbAddressTlvBlock::Front() const [member function] + cls.add_method('Front', + 'ns3::Ptr< ns3::PbbAddressTlv >', + [], + is_const=True) + ## packetbb.h: uint32_t ns3::PbbAddressTlvBlock::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::Insert(std::_List_iterator > position, ns3::Ptr const tlv) [member function] + cls.add_method('Insert', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position'), param('ns3::Ptr< ns3::PbbAddressTlv > const', 'tlv')]) + ## packetbb.h: void ns3::PbbAddressTlvBlock::PopBack() [member function] + cls.add_method('PopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressTlvBlock::PopFront() [member function] + cls.add_method('PopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbAddressTlvBlock::PushBack(ns3::Ptr tlv) [member function] + cls.add_method('PushBack', + 'void', + [param('ns3::Ptr< ns3::PbbAddressTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbAddressTlvBlock::PushFront(ns3::Ptr tlv) [member function] + cls.add_method('PushFront', + 'void', + [param('ns3::Ptr< ns3::PbbAddressTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: int ns3::PbbAddressTlvBlock::Size() const [member function] + cls.add_method('Size', + 'int', + [], + is_const=True) + return + +def register_Ns3PbbMessage_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbMessage::PbbMessage(ns3::PbbMessage const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbMessage const &', 'arg0')]) + ## packetbb.h: ns3::PbbMessage::PbbMessage() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::AddressBlockBack() [member function] + cls.add_method('AddressBlockBack', + 'ns3::Ptr< ns3::PbbAddressBlock >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbMessage::AddressBlockBack() const [member function] + cls.add_method('AddressBlockBack', + 'ns3::Ptr< ns3::PbbAddressBlock > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::AddressBlockBegin() [member function] + cls.add_method('AddressBlockBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbMessage::AddressBlockBegin() const [member function] + cls.add_method('AddressBlockBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::AddressBlockClear() [member function] + cls.add_method('AddressBlockClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbMessage::AddressBlockEmpty() const [member function] + cls.add_method('AddressBlockEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::AddressBlockEnd() [member function] + cls.add_method('AddressBlockEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbMessage::AddressBlockEnd() const [member function] + cls.add_method('AddressBlockEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::AddressBlockErase(std::_List_iterator > position) [member function] + cls.add_method('AddressBlockErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::AddressBlockErase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('AddressBlockErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::AddressBlockFront() [member function] + cls.add_method('AddressBlockFront', + 'ns3::Ptr< ns3::PbbAddressBlock >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbMessage::AddressBlockFront() const [member function] + cls.add_method('AddressBlockFront', + 'ns3::Ptr< ns3::PbbAddressBlock > const', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::AddressBlockPopBack() [member function] + cls.add_method('AddressBlockPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbMessage::AddressBlockPopFront() [member function] + cls.add_method('AddressBlockPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbMessage::AddressBlockPushBack(ns3::Ptr block) [member function] + cls.add_method('AddressBlockPushBack', + 'void', + [param('ns3::Ptr< ns3::PbbAddressBlock >', 'block')]) + ## packetbb.h: void ns3::PbbMessage::AddressBlockPushFront(ns3::Ptr block) [member function] + cls.add_method('AddressBlockPushFront', + 'void', + [param('ns3::Ptr< ns3::PbbAddressBlock >', 'block')]) + ## packetbb.h: int ns3::PbbMessage::AddressBlockSize() const [member function] + cls.add_method('AddressBlockSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: static ns3::Ptr ns3::PbbMessage::DeserializeMessage(ns3::Buffer::Iterator & start) [member function] + cls.add_method('DeserializeMessage', + 'ns3::Ptr< ns3::PbbMessage >', + [param('ns3::Buffer::Iterator &', 'start')], + is_static=True) + ## packetbb.h: uint8_t ns3::PbbMessage::GetHopCount() const [member function] + cls.add_method('GetHopCount', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbMessage::GetHopLimit() const [member function] + cls.add_method('GetHopLimit', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: ns3::Address ns3::PbbMessage::GetOriginatorAddress() const [member function] + cls.add_method('GetOriginatorAddress', + 'ns3::Address', + [], + is_const=True) + ## packetbb.h: uint16_t ns3::PbbMessage::GetSequenceNumber() const [member function] + cls.add_method('GetSequenceNumber', + 'uint16_t', + [], + is_const=True) + ## packetbb.h: uint32_t ns3::PbbMessage::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbMessage::GetType() const [member function] + cls.add_method('GetType', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbMessage::HasHopCount() const [member function] + cls.add_method('HasHopCount', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbMessage::HasHopLimit() const [member function] + cls.add_method('HasHopLimit', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbMessage::HasOriginatorAddress() const [member function] + cls.add_method('HasOriginatorAddress', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbMessage::HasSequenceNumber() const [member function] + cls.add_method('HasSequenceNumber', + 'bool', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::SetHopCount(uint8_t hopcount) [member function] + cls.add_method('SetHopCount', + 'void', + [param('uint8_t', 'hopcount')]) + ## packetbb.h: void ns3::PbbMessage::SetHopLimit(uint8_t hoplimit) [member function] + cls.add_method('SetHopLimit', + 'void', + [param('uint8_t', 'hoplimit')]) + ## packetbb.h: void ns3::PbbMessage::SetOriginatorAddress(ns3::Address address) [member function] + cls.add_method('SetOriginatorAddress', + 'void', + [param('ns3::Address', 'address')]) + ## packetbb.h: void ns3::PbbMessage::SetSequenceNumber(uint16_t seqnum) [member function] + cls.add_method('SetSequenceNumber', + 'void', + [param('uint16_t', 'seqnum')]) + ## packetbb.h: void ns3::PbbMessage::SetType(uint8_t type) [member function] + cls.add_method('SetType', + 'void', + [param('uint8_t', 'type')]) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::TlvBack() [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbMessage::TlvBack() const [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbTlv > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::TlvBegin() [member function] + cls.add_method('TlvBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbMessage::TlvBegin() const [member function] + cls.add_method('TlvBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::TlvClear() [member function] + cls.add_method('TlvClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbMessage::TlvEmpty() const [member function] + cls.add_method('TlvEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::TlvEnd() [member function] + cls.add_method('TlvEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbMessage::TlvEnd() const [member function] + cls.add_method('TlvEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::TlvErase(std::_List_iterator > position) [member function] + cls.add_method('TlvErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::TlvErase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('TlvErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::TlvFront() [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbMessage::TlvFront() const [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbTlv > const', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::TlvPopBack() [member function] + cls.add_method('TlvPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbMessage::TlvPopFront() [member function] + cls.add_method('TlvPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbMessage::TlvPushBack(ns3::Ptr tlv) [member function] + cls.add_method('TlvPushBack', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbMessage::TlvPushFront(ns3::Ptr tlv) [member function] + cls.add_method('TlvPushFront', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: int ns3::PbbMessage::TlvSize() const [member function] + cls.add_method('TlvSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('AddressBlockDeserialize', + 'ns3::Ptr< ns3::PbbAddressBlock >', + [param('ns3::Buffer::Iterator &', 'start')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::Address ns3::PbbMessage::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('DeserializeOriginatorAddress', + 'ns3::Address', + [param('ns3::Buffer::Iterator &', 'start')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::PbbAddressLength ns3::PbbMessage::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'ns3::PbbAddressLength', + [], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessage::PrintOriginatorAddress(std::ostream & os) const [member function] + cls.add_method('PrintOriginatorAddress', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessage::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('SerializeOriginatorAddress', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbMessageIpv4_methods(root_module, cls): + ## packetbb.h: ns3::PbbMessageIpv4::PbbMessageIpv4(ns3::PbbMessageIpv4 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbMessageIpv4 const &', 'arg0')]) + ## packetbb.h: ns3::PbbMessageIpv4::PbbMessageIpv4() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Ptr ns3::PbbMessageIpv4::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('AddressBlockDeserialize', + 'ns3::Ptr< ns3::PbbAddressBlock >', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::Address ns3::PbbMessageIpv4::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('DeserializeOriginatorAddress', + 'ns3::Address', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::PbbAddressLength ns3::PbbMessageIpv4::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'ns3::PbbAddressLength', + [], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessageIpv4::PrintOriginatorAddress(std::ostream & os) const [member function] + cls.add_method('PrintOriginatorAddress', + 'void', + [param('std::ostream &', 'os')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessageIpv4::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('SerializeOriginatorAddress', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbMessageIpv6_methods(root_module, cls): + ## packetbb.h: ns3::PbbMessageIpv6::PbbMessageIpv6(ns3::PbbMessageIpv6 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbMessageIpv6 const &', 'arg0')]) + ## packetbb.h: ns3::PbbMessageIpv6::PbbMessageIpv6() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Ptr ns3::PbbMessageIpv6::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('AddressBlockDeserialize', + 'ns3::Ptr< ns3::PbbAddressBlock >', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::Address ns3::PbbMessageIpv6::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('DeserializeOriginatorAddress', + 'ns3::Address', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::PbbAddressLength ns3::PbbMessageIpv6::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'ns3::PbbAddressLength', + [], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessageIpv6::PrintOriginatorAddress(std::ostream & os) const [member function] + cls.add_method('PrintOriginatorAddress', + 'void', + [param('std::ostream &', 'os')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessageIpv6::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('SerializeOriginatorAddress', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbTlv_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbTlv::PbbTlv(ns3::PbbTlv const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbTlv const &', 'arg0')]) + ## packetbb.h: ns3::PbbTlv::PbbTlv() [constructor] + cls.add_constructor([]) + ## packetbb.h: void ns3::PbbTlv::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: uint32_t ns3::PbbTlv::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbTlv::GetType() const [member function] + cls.add_method('GetType', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbTlv::GetTypeExt() const [member function] + cls.add_method('GetTypeExt', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: ns3::Buffer ns3::PbbTlv::GetValue() const [member function] + cls.add_method('GetValue', + 'ns3::Buffer', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbTlv::HasTypeExt() const [member function] + cls.add_method('HasTypeExt', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbTlv::HasValue() const [member function] + cls.add_method('HasValue', + 'bool', + [], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::SetType(uint8_t type) [member function] + cls.add_method('SetType', + 'void', + [param('uint8_t', 'type')]) + ## packetbb.h: void ns3::PbbTlv::SetTypeExt(uint8_t type) [member function] + cls.add_method('SetTypeExt', + 'void', + [param('uint8_t', 'type')]) + ## packetbb.h: void ns3::PbbTlv::SetValue(ns3::Buffer start) [member function] + cls.add_method('SetValue', + 'void', + [param('ns3::Buffer', 'start')]) + ## packetbb.h: void ns3::PbbTlv::SetValue(uint8_t const * buffer, uint32_t size) [member function] + cls.add_method('SetValue', + 'void', + [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) + ## packetbb.h: void ns3::PbbTlv::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbTlv::GetIndexStart() const [member function] + cls.add_method('GetIndexStart', + 'uint8_t', + [], + is_const=True, visibility='protected') + ## packetbb.h: uint8_t ns3::PbbTlv::GetIndexStop() const [member function] + cls.add_method('GetIndexStop', + 'uint8_t', + [], + is_const=True, visibility='protected') + ## packetbb.h: bool ns3::PbbTlv::HasIndexStart() const [member function] + cls.add_method('HasIndexStart', + 'bool', + [], + is_const=True, visibility='protected') + ## packetbb.h: bool ns3::PbbTlv::HasIndexStop() const [member function] + cls.add_method('HasIndexStop', + 'bool', + [], + is_const=True, visibility='protected') + ## packetbb.h: bool ns3::PbbTlv::IsMultivalue() const [member function] + cls.add_method('IsMultivalue', + 'bool', + [], + is_const=True, visibility='protected') + ## packetbb.h: void ns3::PbbTlv::SetIndexStart(uint8_t index) [member function] + cls.add_method('SetIndexStart', + 'void', + [param('uint8_t', 'index')], + visibility='protected') + ## packetbb.h: void ns3::PbbTlv::SetIndexStop(uint8_t index) [member function] + cls.add_method('SetIndexStop', + 'void', + [param('uint8_t', 'index')], + visibility='protected') + ## packetbb.h: void ns3::PbbTlv::SetMultivalue(bool isMultivalue) [member function] + cls.add_method('SetMultivalue', + 'void', + [param('bool', 'isMultivalue')], + visibility='protected') + return + +def register_Ns3PbbTlvBlock_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbTlvBlock::PbbTlvBlock() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::PbbTlvBlock::PbbTlvBlock(ns3::PbbTlvBlock const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbTlvBlock const &', 'arg0')]) + ## packetbb.h: ns3::Ptr ns3::PbbTlvBlock::Back() const [member function] + cls.add_method('Back', + 'ns3::Ptr< ns3::PbbTlv >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::Begin() [member function] + cls.add_method('Begin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbTlvBlock::Begin() const [member function] + cls.add_method('Begin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbTlvBlock::Clear() [member function] + cls.add_method('Clear', + 'void', + []) + ## packetbb.h: void ns3::PbbTlvBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: bool ns3::PbbTlvBlock::Empty() const [member function] + cls.add_method('Empty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::End() [member function] + cls.add_method('End', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbTlvBlock::End() const [member function] + cls.add_method('End', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::Erase(std::_List_iterator > position) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::Erase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbTlvBlock::Front() const [member function] + cls.add_method('Front', + 'ns3::Ptr< ns3::PbbTlv >', + [], + is_const=True) + ## packetbb.h: uint32_t ns3::PbbTlvBlock::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::Insert(std::_List_iterator > position, ns3::Ptr const tlv) [member function] + cls.add_method('Insert', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position'), param('ns3::Ptr< ns3::PbbTlv > const', 'tlv')]) + ## packetbb.h: void ns3::PbbTlvBlock::PopBack() [member function] + cls.add_method('PopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbTlvBlock::PopFront() [member function] + cls.add_method('PopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbTlvBlock::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbTlvBlock::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbTlvBlock::PushBack(ns3::Ptr tlv) [member function] + cls.add_method('PushBack', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbTlvBlock::PushFront(ns3::Ptr tlv) [member function] + cls.add_method('PushFront', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbTlvBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: int ns3::PbbTlvBlock::Size() const [member function] + cls.add_method('Size', + 'int', + [], + is_const=True) + return + def register_Ns3Ipv4AddressChecker_methods(root_module, cls): ## ipv4-address.h: ns3::Ipv4AddressChecker::Ipv4AddressChecker() [constructor] cls.add_constructor([]) @@ -1835,6 +2906,271 @@ def register_Ns3Mac48AddressValue_methods(root_module, cls): [param('ns3::Mac48Address const &', 'value')]) return +def register_Ns3PbbAddressTlv_methods(root_module, cls): + ## packetbb.h: ns3::PbbAddressTlv::PbbAddressTlv() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::PbbAddressTlv::PbbAddressTlv(ns3::PbbAddressTlv const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressTlv const &', 'arg0')]) + ## packetbb.h: uint8_t ns3::PbbAddressTlv::GetIndexStart() const [member function] + cls.add_method('GetIndexStart', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbAddressTlv::GetIndexStop() const [member function] + cls.add_method('GetIndexStop', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbAddressTlv::HasIndexStart() const [member function] + cls.add_method('HasIndexStart', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbAddressTlv::HasIndexStop() const [member function] + cls.add_method('HasIndexStop', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbAddressTlv::IsMultivalue() const [member function] + cls.add_method('IsMultivalue', + 'bool', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressTlv::SetIndexStart(uint8_t index) [member function] + cls.add_method('SetIndexStart', + 'void', + [param('uint8_t', 'index')]) + ## packetbb.h: void ns3::PbbAddressTlv::SetIndexStop(uint8_t index) [member function] + cls.add_method('SetIndexStop', + 'void', + [param('uint8_t', 'index')]) + ## packetbb.h: void ns3::PbbAddressTlv::SetMultivalue(bool isMultivalue) [member function] + cls.add_method('SetMultivalue', + 'void', + [param('bool', 'isMultivalue')]) + return + +def register_Ns3PbbPacket_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbPacket::PbbPacket(ns3::PbbPacket const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbPacket const &', 'arg0')]) + ## packetbb.h: ns3::PbbPacket::PbbPacket() [constructor] + cls.add_constructor([]) + ## packetbb.h: uint32_t ns3::PbbPacket::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::Erase(std::_List_iterator > position) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::Erase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::Erase(std::_List_iterator > position) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::Erase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'last')]) + ## packetbb.h: ns3::TypeId ns3::PbbPacket::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## packetbb.h: uint16_t ns3::PbbPacket::GetSequenceNumber() const [member function] + cls.add_method('GetSequenceNumber', + 'uint16_t', + [], + is_const=True) + ## packetbb.h: uint32_t ns3::PbbPacket::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## packetbb.h: static ns3::TypeId ns3::PbbPacket::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## packetbb.h: uint8_t ns3::PbbPacket::GetVersion() const [member function] + cls.add_method('GetVersion', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbPacket::HasSequenceNumber() const [member function] + cls.add_method('HasSequenceNumber', + 'bool', + [], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbPacket::MessageBack() [member function] + cls.add_method('MessageBack', + 'ns3::Ptr< ns3::PbbMessage >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbPacket::MessageBack() const [member function] + cls.add_method('MessageBack', + 'ns3::Ptr< ns3::PbbMessage > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::MessageBegin() [member function] + cls.add_method('MessageBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbPacket::MessageBegin() const [member function] + cls.add_method('MessageBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbMessage > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::MessageClear() [member function] + cls.add_method('MessageClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbPacket::MessageEmpty() const [member function] + cls.add_method('MessageEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::MessageEnd() [member function] + cls.add_method('MessageEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbPacket::MessageEnd() const [member function] + cls.add_method('MessageEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbMessage > >', + [], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbPacket::MessageFront() [member function] + cls.add_method('MessageFront', + 'ns3::Ptr< ns3::PbbMessage >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbPacket::MessageFront() const [member function] + cls.add_method('MessageFront', + 'ns3::Ptr< ns3::PbbMessage > const', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::MessagePopBack() [member function] + cls.add_method('MessagePopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbPacket::MessagePopFront() [member function] + cls.add_method('MessagePopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbPacket::MessagePushBack(ns3::Ptr message) [member function] + cls.add_method('MessagePushBack', + 'void', + [param('ns3::Ptr< ns3::PbbMessage >', 'message')]) + ## packetbb.h: void ns3::PbbPacket::MessagePushFront(ns3::Ptr message) [member function] + cls.add_method('MessagePushFront', + 'void', + [param('ns3::Ptr< ns3::PbbMessage >', 'message')]) + ## packetbb.h: int ns3::PbbPacket::MessageSize() const [member function] + cls.add_method('MessageSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## packetbb.h: void ns3::PbbPacket::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## packetbb.h: void ns3::PbbPacket::SetSequenceNumber(uint16_t number) [member function] + cls.add_method('SetSequenceNumber', + 'void', + [param('uint16_t', 'number')]) + ## packetbb.h: ns3::Ptr ns3::PbbPacket::TlvBack() [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbPacket::TlvBack() const [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbTlv > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::TlvBegin() [member function] + cls.add_method('TlvBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbPacket::TlvBegin() const [member function] + cls.add_method('TlvBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::TlvClear() [member function] + cls.add_method('TlvClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbPacket::TlvEmpty() const [member function] + cls.add_method('TlvEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::TlvEnd() [member function] + cls.add_method('TlvEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbPacket::TlvEnd() const [member function] + cls.add_method('TlvEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbPacket::TlvFront() [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbPacket::TlvFront() const [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbTlv > const', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::TlvPopBack() [member function] + cls.add_method('TlvPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbPacket::TlvPopFront() [member function] + cls.add_method('TlvPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbPacket::TlvPushBack(ns3::Ptr tlv) [member function] + cls.add_method('TlvPushBack', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbPacket::TlvPushFront(ns3::Ptr tlv) [member function] + cls.add_method('TlvPushFront', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: int ns3::PbbPacket::TlvSize() const [member function] + cls.add_method('TlvSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::SerializePacketTlv(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('SerializePacketTlv', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected') + return + def register_Ns3Queue_methods(root_module, cls): ## queue.h: ns3::Queue::Queue(ns3::Queue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Queue const &', 'arg0')]) @@ -3604,6 +4940,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -3621,6 +4959,12 @@ def register_functions_ns3_addressUtils(module, root_module): [param('ns3::Address const &', 'ad')]) return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_olsr.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_olsr.py similarity index 98% rename from bindings/python/ns3_module_olsr.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_olsr.py index 519176de4..c90959202 100644 --- a/bindings/python/ns3_module_olsr.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_olsr.py @@ -30,6 +30,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -54,6 +66,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -104,27 +124,27 @@ def register_types_ns3_olsr(module): typehandlers.add_type_alias('std::vector< ns3::olsr::DuplicateTuple, std::allocator< ns3::olsr::DuplicateTuple > >', 'ns3::olsr::DuplicateSet') typehandlers.add_type_alias('std::vector< ns3::olsr::DuplicateTuple, std::allocator< ns3::olsr::DuplicateTuple > >*', 'ns3::olsr::DuplicateSet*') typehandlers.add_type_alias('std::vector< ns3::olsr::DuplicateTuple, std::allocator< ns3::olsr::DuplicateTuple > >&', 'ns3::olsr::DuplicateSet&') + 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::NeighborTuple, std::allocator< ns3::olsr::NeighborTuple > >*', 'ns3::olsr::NeighborSet*') + typehandlers.add_type_alias('std::vector< ns3::olsr::NeighborTuple, std::allocator< ns3::olsr::NeighborTuple > >&', 'ns3::olsr::NeighborSet&') typehandlers.add_type_alias('std::set< ns3::Ipv4Address, std::less< ns3::Ipv4Address >, std::allocator< ns3::Ipv4Address > >', 'ns3::olsr::MprSet') typehandlers.add_type_alias('std::set< ns3::Ipv4Address, std::less< ns3::Ipv4Address >, std::allocator< ns3::Ipv4Address > >*', 'ns3::olsr::MprSet*') 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::MprSelectorTuple, std::allocator< ns3::olsr::MprSelectorTuple > >*', 'ns3::olsr::MprSelectorSet*') 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::TopologyTuple, std::allocator< ns3::olsr::TopologyTuple > >', 'ns3::olsr::TopologySet') + 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::TopologyTuple, std::allocator< ns3::olsr::TopologyTuple > >&', 'ns3::olsr::TopologySet&') 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::MessageHeader, std::allocator< ns3::olsr::MessageHeader > >*', 'ns3::olsr::MessageList*') 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::IfaceAssocTuple, std::allocator< ns3::olsr::IfaceAssocTuple > >*', 'ns3::olsr::IfaceAssocSet*') 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::NeighborTuple, std::allocator< ns3::olsr::NeighborTuple > >*', 'ns3::olsr::NeighborSet*') - 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::TwoHopNeighborTuple, std::allocator< ns3::olsr::TwoHopNeighborTuple > >*', 'ns3::olsr::TwoHopNeighborSet*') 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::TopologyTuple, std::allocator< ns3::olsr::TopologyTuple > >*', 'ns3::olsr::TopologySet*') - 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') typehandlers.add_type_alias('std::vector< ns3::olsr::LinkTuple, std::allocator< ns3::olsr::LinkTuple > >*', 'ns3::olsr::LinkSet*') typehandlers.add_type_alias('std::vector< ns3::olsr::LinkTuple, std::allocator< ns3::olsr::LinkTuple > >&', 'ns3::olsr::LinkSet&') @@ -863,6 +883,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -876,6 +898,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_onoff.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_onoff.py similarity index 84% rename from bindings/python/ns3_module_onoff.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_onoff.py index 3afe4c317..d22c42dca 100644 --- a/bindings/python/ns3_module_onoff.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_onoff.py @@ -24,6 +24,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -48,6 +60,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -96,6 +116,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -109,6 +131,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_packet_sink.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_packet_sink.py similarity index 82% rename from bindings/python/ns3_module_packet_sink.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_packet_sink.py index 63087a766..abb082d98 100644 --- a/bindings/python/ns3_module_packet_sink.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_packet_sink.py @@ -24,6 +24,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -48,6 +60,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -92,6 +112,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -105,6 +127,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_ping6.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_ping6.py similarity index 84% rename from bindings/python/ns3_module_ping6.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_ping6.py index cf5bf3347..f66bb20fb 100644 --- a/bindings/python/ns3_module_ping6.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_ping6.py @@ -24,6 +24,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -48,6 +60,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -104,6 +124,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -117,6 +139,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_point_to_point.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_point_to_point.py similarity index 95% rename from bindings/python/ns3_module_point_to_point.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_point_to_point.py index b7f1d2d74..817a3baac 100644 --- a/bindings/python/ns3_module_point_to_point.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_point_to_point.py @@ -28,6 +28,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -52,6 +64,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -313,6 +333,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -326,6 +348,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_radvd.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_radvd.py similarity index 95% rename from bindings/python/ns3_module_radvd.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_radvd.py index ec622d886..aad164940 100644 --- a/bindings/python/ns3_module_radvd.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_radvd.py @@ -28,6 +28,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -52,6 +64,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -368,6 +388,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -381,6 +403,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_simulator.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py similarity index 99% rename from bindings/python/ns3_module_simulator.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py index 5fdb9ce1a..8f0850175 100644 --- a/bindings/python/ns3_module_simulator.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py @@ -92,6 +92,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -118,6 +130,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -1534,6 +1554,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -1555,6 +1577,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_static_routing.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_static_routing.py similarity index 98% rename from bindings/python/ns3_module_static_routing.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_static_routing.py index c64dfd9f2..22b6f3c13 100644 --- a/bindings/python/ns3_module_static_routing.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_static_routing.py @@ -34,6 +34,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -58,6 +70,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -602,6 +622,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -615,6 +637,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_stats.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_stats.py similarity index 97% rename from bindings/python/ns3_module_stats.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_stats.py index c0e72cf13..610739ccc 100644 --- a/bindings/python/ns3_module_stats.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_stats.py @@ -50,6 +50,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -74,6 +86,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -427,6 +447,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -440,6 +462,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_tap_bridge.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_tap_bridge.py similarity index 94% rename from bindings/python/ns3_module_tap_bridge.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_tap_bridge.py index c3e9256cd..cf1171490 100644 --- a/bindings/python/ns3_module_tap_bridge.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_tap_bridge.py @@ -26,6 +26,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -50,6 +62,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -238,6 +258,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -251,6 +273,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_udp_echo.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_udp_echo.py similarity index 89% rename from bindings/python/ns3_module_udp_echo.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_udp_echo.py index d85d1a899..b79097d2f 100644 --- a/bindings/python/ns3_module_udp_echo.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_udp_echo.py @@ -26,6 +26,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -50,6 +62,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -147,6 +167,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -160,6 +182,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_v4ping.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_v4ping.py similarity index 82% rename from bindings/python/ns3_module_v4ping.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_v4ping.py index e80c90110..b087bfb02 100644 --- a/bindings/python/ns3_module_v4ping.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_v4ping.py @@ -24,6 +24,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -48,6 +60,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -92,6 +112,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -105,6 +127,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_virtual_net_device.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_virtual_net_device.py similarity index 94% rename from bindings/python/ns3_module_virtual_net_device.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_virtual_net_device.py index 5947af204..f03bcc785 100644 --- a/bindings/python/ns3_module_virtual_net_device.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_virtual_net_device.py @@ -24,6 +24,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -48,6 +60,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -222,6 +242,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -235,6 +257,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3_module_wifi.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_wifi.py similarity index 99% rename from bindings/python/ns3_module_wifi.py rename to bindings/python/apidefs/gcc-ILP32/ns3_module_wifi.py index eca0e07d8..7d28518e3 100644 --- a/bindings/python/ns3_module_wifi.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_wifi.py @@ -104,7 +104,7 @@ def register_types(module): ## wifi-phy.h: ns3::WifiPhy [class] module.add_class('WifiPhy', parent=root_module['ns3::Object']) ## wifi-phy.h: ns3::WifiPhy::State [enumeration] - module.add_enum('State', ['SYNC', 'TX', 'CCA_BUSY', 'IDLE'], outer_class=root_module['ns3::WifiPhy']) + module.add_enum('State', ['SYNC', 'TX', 'CCA_BUSY', 'IDLE', 'SWITCHING'], outer_class=root_module['ns3::WifiPhy']) ## wifi-remote-station-manager.h: ns3::WifiRemoteStationManager [class] module.add_class('WifiRemoteStationManager', parent=root_module['ns3::Object']) ## yans-wifi-phy.h: ns3::YansWifiPhy [class] @@ -203,6 +203,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -227,6 +239,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -408,6 +428,10 @@ def register_Ns3DcfManager_methods(root_module, cls): cls.add_method('NotifyRxStartNow', 'void', [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::NotifySwitchingStartNow(ns3::Time duration) [member function] + cls.add_method('NotifySwitchingStartNow', + 'void', + [param('ns3::Time', 'duration')]) ## dcf-manager.h: void ns3::DcfManager::NotifyTxStartNow(ns3::Time duration) [member function] cls.add_method('NotifyTxStartNow', 'void', @@ -497,6 +521,11 @@ def register_Ns3DcfState_methods(root_module, cls): 'void', [], is_pure_virtual=True, visibility='private', is_virtual=True) + ## dcf-manager.h: void ns3::DcfState::DoNotifyChannelSwitching() [member function] + cls.add_method('DoNotifyChannelSwitching', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) ## dcf-manager.h: void ns3::DcfState::DoNotifyCollision() [member function] cls.add_method('DoNotifyCollision', 'void', @@ -525,6 +554,10 @@ def register_Ns3InterferenceHelper_methods(root_module, cls): 'ns3::Time', [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], is_static=True) + ## interference-helper.h: void ns3::InterferenceHelper::EraseEvents() [member function] + cls.add_method('EraseEvents', + 'void', + []) ## interference-helper.h: ns3::Time ns3::InterferenceHelper::GetEnergyDuration(double energyW) [member function] cls.add_method('GetEnergyDuration', 'ns3::Time', @@ -1055,6 +1088,11 @@ def register_Ns3WifiPhyListener_methods(root_module, cls): 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] + cls.add_method('NotifySwitchingStart', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h: void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration) [member function] cls.add_method('NotifyTxStart', 'void', @@ -3335,6 +3373,11 @@ def register_Ns3YansWifiPhy_methods(root_module, cls): 'bool', [], is_virtual=True) + ## yans-wifi-phy.h: bool ns3::YansWifiPhy::IsStateSwitching() [member function] + cls.add_method('IsStateSwitching', + 'bool', + [], + is_virtual=True) ## yans-wifi-phy.h: ns3::Time ns3::YansWifiPhy::GetStateDuration() [member function] cls.add_method('GetStateDuration', 'ns3::Time', @@ -3857,6 +3900,10 @@ def register_Ns3EdcaTxopN_methods(root_module, cls): cls.add_method('NotifyCollision', 'void', []) + ## edca-txop-n.h: void ns3::EdcaTxopN::NotifyChannelSwitching() [member function] + cls.add_method('NotifyChannelSwitching', + 'void', + []) ## edca-txop-n.h: void ns3::EdcaTxopN::GotCts(double snr, ns3::WifiMode txMode) [member function] cls.add_method('GotCts', 'void', @@ -4170,6 +4217,10 @@ def register_Ns3MacLow_methods(root_module, cls): 'ns3::Time', [], is_const=True) + ## mac-low.h: void ns3::MacLow::NotifySwitchingStartNow(ns3::Time duration) [member function] + cls.add_method('NotifySwitchingStartNow', + 'void', + [param('ns3::Time', 'duration')]) ## mac-low.h: void ns3::MacLow::ReceiveError(ns3::Ptr packet, double rxSnr) [member function] cls.add_method('ReceiveError', 'void', @@ -5486,6 +5537,8 @@ def register_functions(root_module): register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -5499,6 +5552,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/apidefs/gcc-ILP32/ns3modulegen_generated.py b/bindings/python/apidefs/gcc-ILP32/ns3modulegen_generated.py new file mode 100644 index 000000000..54d94901b --- /dev/null +++ b/bindings/python/apidefs/gcc-ILP32/ns3modulegen_generated.py @@ -0,0 +1,1347 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + + +import pybindgen.settings +import warnings + +class ErrorHandler(pybindgen.settings.ErrorHandler): + def handle_error(self, wrapper, exception, traceback_): + warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) + return True +pybindgen.settings.error_handler = ErrorHandler() + + +import sys +import ns3_module_core +import ns3_module_simulator +import ns3_module_mobility +import ns3_module_common +import ns3_module_node +import ns3_module_contrib +import ns3_module_point_to_point +import ns3_module_internet_stack +import ns3_module_tap_bridge +import ns3_module_csma +import ns3_module_wifi +import ns3_module_static_routing +import ns3_module_v4ping +import ns3_module_virtual_net_device +import ns3_module_packet_sink +import ns3_module_global_routing +import ns3_module_stats +import ns3_module_list_routing +import ns3_module_emu +import ns3_module_bridge +import ns3_module_onoff +import ns3_module_udp_echo +import ns3_module_ping6 +import ns3_module_nix_vector_routing +import ns3_module_olsr +import ns3_module_flow_monitor +import ns3_module_radvd +import ns3_module_mesh +import ns3_module_helper +import ns3_module_dot11s +import ns3_module_flame + +def module_init(): + root_module = Module('ns3', cpp_namespace='::ns3') + return root_module + +def register_types(module): + root_module = module.get_root() + + root_module.begin_section('ns3_module_core') + ns3_module_core.register_types(module) + + try: + import ns3_module_core__local + except ImportError: + pass + else: + ns3_module_core__local.register_types(module) + + root_module.end_section('ns3_module_core') + root_module.begin_section('ns3_module_simulator') + ns3_module_simulator.register_types(module) + + try: + import ns3_module_simulator__local + except ImportError: + pass + else: + ns3_module_simulator__local.register_types(module) + + root_module.end_section('ns3_module_simulator') + root_module.begin_section('ns3_module_mobility') + ns3_module_mobility.register_types(module) + + try: + import ns3_module_mobility__local + except ImportError: + pass + else: + ns3_module_mobility__local.register_types(module) + + root_module.end_section('ns3_module_mobility') + root_module.begin_section('ns3_module_common') + ns3_module_common.register_types(module) + + try: + import ns3_module_common__local + except ImportError: + pass + else: + ns3_module_common__local.register_types(module) + + root_module.end_section('ns3_module_common') + root_module.begin_section('ns3_module_node') + ns3_module_node.register_types(module) + + try: + import ns3_module_node__local + except ImportError: + pass + else: + ns3_module_node__local.register_types(module) + + root_module.end_section('ns3_module_node') + root_module.begin_section('ns3_module_contrib') + ns3_module_contrib.register_types(module) + + try: + import ns3_module_contrib__local + except ImportError: + pass + else: + ns3_module_contrib__local.register_types(module) + + root_module.end_section('ns3_module_contrib') + root_module.begin_section('ns3_module_point_to_point') + ns3_module_point_to_point.register_types(module) + + try: + import ns3_module_point_to_point__local + except ImportError: + pass + else: + ns3_module_point_to_point__local.register_types(module) + + root_module.end_section('ns3_module_point_to_point') + root_module.begin_section('ns3_module_internet_stack') + ns3_module_internet_stack.register_types(module) + + try: + import ns3_module_internet_stack__local + except ImportError: + pass + else: + ns3_module_internet_stack__local.register_types(module) + + root_module.end_section('ns3_module_internet_stack') + root_module.begin_section('ns3_module_tap_bridge') + ns3_module_tap_bridge.register_types(module) + + try: + import ns3_module_tap_bridge__local + except ImportError: + pass + else: + ns3_module_tap_bridge__local.register_types(module) + + root_module.end_section('ns3_module_tap_bridge') + root_module.begin_section('ns3_module_csma') + ns3_module_csma.register_types(module) + + try: + import ns3_module_csma__local + except ImportError: + pass + else: + ns3_module_csma__local.register_types(module) + + root_module.end_section('ns3_module_csma') + root_module.begin_section('ns3_module_wifi') + ns3_module_wifi.register_types(module) + + try: + import ns3_module_wifi__local + except ImportError: + pass + else: + ns3_module_wifi__local.register_types(module) + + root_module.end_section('ns3_module_wifi') + root_module.begin_section('ns3_module_static_routing') + ns3_module_static_routing.register_types(module) + + try: + import ns3_module_static_routing__local + except ImportError: + pass + else: + ns3_module_static_routing__local.register_types(module) + + root_module.end_section('ns3_module_static_routing') + root_module.begin_section('ns3_module_v4ping') + ns3_module_v4ping.register_types(module) + + try: + import ns3_module_v4ping__local + except ImportError: + pass + else: + ns3_module_v4ping__local.register_types(module) + + root_module.end_section('ns3_module_v4ping') + root_module.begin_section('ns3_module_virtual_net_device') + ns3_module_virtual_net_device.register_types(module) + + try: + import ns3_module_virtual_net_device__local + except ImportError: + pass + else: + ns3_module_virtual_net_device__local.register_types(module) + + root_module.end_section('ns3_module_virtual_net_device') + root_module.begin_section('ns3_module_packet_sink') + ns3_module_packet_sink.register_types(module) + + try: + import ns3_module_packet_sink__local + except ImportError: + pass + else: + ns3_module_packet_sink__local.register_types(module) + + root_module.end_section('ns3_module_packet_sink') + root_module.begin_section('ns3_module_global_routing') + ns3_module_global_routing.register_types(module) + + try: + import ns3_module_global_routing__local + except ImportError: + pass + else: + ns3_module_global_routing__local.register_types(module) + + root_module.end_section('ns3_module_global_routing') + root_module.begin_section('ns3_module_stats') + ns3_module_stats.register_types(module) + + try: + import ns3_module_stats__local + except ImportError: + pass + else: + ns3_module_stats__local.register_types(module) + + root_module.end_section('ns3_module_stats') + root_module.begin_section('ns3_module_list_routing') + ns3_module_list_routing.register_types(module) + + try: + import ns3_module_list_routing__local + except ImportError: + pass + else: + ns3_module_list_routing__local.register_types(module) + + root_module.end_section('ns3_module_list_routing') + root_module.begin_section('ns3_module_emu') + ns3_module_emu.register_types(module) + + try: + import ns3_module_emu__local + except ImportError: + pass + else: + ns3_module_emu__local.register_types(module) + + root_module.end_section('ns3_module_emu') + root_module.begin_section('ns3_module_bridge') + ns3_module_bridge.register_types(module) + + try: + import ns3_module_bridge__local + except ImportError: + pass + else: + ns3_module_bridge__local.register_types(module) + + root_module.end_section('ns3_module_bridge') + root_module.begin_section('ns3_module_onoff') + ns3_module_onoff.register_types(module) + + try: + import ns3_module_onoff__local + except ImportError: + pass + else: + ns3_module_onoff__local.register_types(module) + + root_module.end_section('ns3_module_onoff') + root_module.begin_section('ns3_module_udp_echo') + ns3_module_udp_echo.register_types(module) + + try: + import ns3_module_udp_echo__local + except ImportError: + pass + else: + ns3_module_udp_echo__local.register_types(module) + + root_module.end_section('ns3_module_udp_echo') + root_module.begin_section('ns3_module_ping6') + ns3_module_ping6.register_types(module) + + try: + import ns3_module_ping6__local + except ImportError: + pass + else: + ns3_module_ping6__local.register_types(module) + + root_module.end_section('ns3_module_ping6') + root_module.begin_section('ns3_module_nix_vector_routing') + ns3_module_nix_vector_routing.register_types(module) + + try: + import ns3_module_nix_vector_routing__local + except ImportError: + pass + else: + ns3_module_nix_vector_routing__local.register_types(module) + + root_module.end_section('ns3_module_nix_vector_routing') + root_module.begin_section('ns3_module_olsr') + ns3_module_olsr.register_types(module) + + try: + import ns3_module_olsr__local + except ImportError: + pass + else: + ns3_module_olsr__local.register_types(module) + + root_module.end_section('ns3_module_olsr') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_types(module) + + try: + import ns3_module_flow_monitor__local + except ImportError: + pass + else: + ns3_module_flow_monitor__local.register_types(module) + + root_module.end_section('ns3_module_flow_monitor') + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_types(module) + + try: + import ns3_module_radvd__local + except ImportError: + pass + else: + ns3_module_radvd__local.register_types(module) + + root_module.end_section('ns3_module_radvd') + root_module.begin_section('ns3_module_mesh') + ns3_module_mesh.register_types(module) + + try: + import ns3_module_mesh__local + except ImportError: + pass + else: + ns3_module_mesh__local.register_types(module) + + root_module.end_section('ns3_module_mesh') + root_module.begin_section('ns3_module_helper') + ns3_module_helper.register_types(module) + + try: + import ns3_module_helper__local + except ImportError: + pass + else: + ns3_module_helper__local.register_types(module) + + root_module.end_section('ns3_module_helper') + root_module.begin_section('ns3_module_dot11s') + ns3_module_dot11s.register_types(module) + + try: + import ns3_module_dot11s__local + except ImportError: + pass + else: + ns3_module_dot11s__local.register_types(module) + + root_module.end_section('ns3_module_dot11s') + root_module.begin_section('ns3_module_flame') + ns3_module_flame.register_types(module) + + try: + import ns3_module_flame__local + except ImportError: + pass + else: + ns3_module_flame__local.register_types(module) + + root_module.end_section('ns3_module_flame') + ## animation-interface.h: ns3::AnimationInterface [class] + module.add_class('AnimationInterface') + ## point-to-point-dumbbell-helper.h: ns3::PointToPointDumbbellHelper [class] + module.add_class('PointToPointDumbbellHelper', allow_subclassing=False) + ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper [class] + module.add_class('PointToPointGridHelper', allow_subclassing=False) + ## node-location.h: ns3::NodeLocation [class] + module.add_class('NodeLocation', parent=root_module['ns3::Object']) + module.add_container('std::vector< unsigned int >', 'unsigned int', container_type='vector') + module.add_container('std::vector< bool >', 'bool', container_type='vector') + module.add_container('std::vector< unsigned long long >', 'long long unsigned int', container_type='vector') + module.add_container('std::list< unsigned int >', 'unsigned int', container_type='list') + module.add_container('std::list< std::pair< ns3::Ptr< ns3::Packet >, ns3::AmsduSubframeHeader > >', 'std::pair< ns3::Ptr< ns3::Packet >, ns3::AmsduSubframeHeader >', container_type='list') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + module.add_container('std::vector< std::string >', 'std::string', container_type='vector') + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3AnimationInterface_methods(root_module, root_module['ns3::AnimationInterface']) + register_Ns3PointToPointDumbbellHelper_methods(root_module, root_module['ns3::PointToPointDumbbellHelper']) + register_Ns3PointToPointGridHelper_methods(root_module, root_module['ns3::PointToPointGridHelper']) + register_Ns3NodeLocation_methods(root_module, root_module['ns3::NodeLocation']) + root_module.begin_section('ns3_module_core') + ns3_module_core.register_methods(root_module) + + try: + import ns3_module_core__local + except ImportError: + pass + else: + ns3_module_core__local.register_methods(root_module) + + root_module.end_section('ns3_module_core') + root_module.begin_section('ns3_module_simulator') + ns3_module_simulator.register_methods(root_module) + + try: + import ns3_module_simulator__local + except ImportError: + pass + else: + ns3_module_simulator__local.register_methods(root_module) + + root_module.end_section('ns3_module_simulator') + root_module.begin_section('ns3_module_mobility') + ns3_module_mobility.register_methods(root_module) + + try: + import ns3_module_mobility__local + except ImportError: + pass + else: + ns3_module_mobility__local.register_methods(root_module) + + root_module.end_section('ns3_module_mobility') + root_module.begin_section('ns3_module_common') + ns3_module_common.register_methods(root_module) + + try: + import ns3_module_common__local + except ImportError: + pass + else: + ns3_module_common__local.register_methods(root_module) + + root_module.end_section('ns3_module_common') + root_module.begin_section('ns3_module_node') + ns3_module_node.register_methods(root_module) + + try: + import ns3_module_node__local + except ImportError: + pass + else: + ns3_module_node__local.register_methods(root_module) + + root_module.end_section('ns3_module_node') + root_module.begin_section('ns3_module_contrib') + ns3_module_contrib.register_methods(root_module) + + try: + import ns3_module_contrib__local + except ImportError: + pass + else: + ns3_module_contrib__local.register_methods(root_module) + + root_module.end_section('ns3_module_contrib') + root_module.begin_section('ns3_module_point_to_point') + ns3_module_point_to_point.register_methods(root_module) + + try: + import ns3_module_point_to_point__local + except ImportError: + pass + else: + ns3_module_point_to_point__local.register_methods(root_module) + + root_module.end_section('ns3_module_point_to_point') + root_module.begin_section('ns3_module_internet_stack') + ns3_module_internet_stack.register_methods(root_module) + + try: + import ns3_module_internet_stack__local + except ImportError: + pass + else: + ns3_module_internet_stack__local.register_methods(root_module) + + root_module.end_section('ns3_module_internet_stack') + root_module.begin_section('ns3_module_tap_bridge') + ns3_module_tap_bridge.register_methods(root_module) + + try: + import ns3_module_tap_bridge__local + except ImportError: + pass + else: + ns3_module_tap_bridge__local.register_methods(root_module) + + root_module.end_section('ns3_module_tap_bridge') + root_module.begin_section('ns3_module_csma') + ns3_module_csma.register_methods(root_module) + + try: + import ns3_module_csma__local + except ImportError: + pass + else: + ns3_module_csma__local.register_methods(root_module) + + root_module.end_section('ns3_module_csma') + root_module.begin_section('ns3_module_wifi') + ns3_module_wifi.register_methods(root_module) + + try: + import ns3_module_wifi__local + except ImportError: + pass + else: + ns3_module_wifi__local.register_methods(root_module) + + root_module.end_section('ns3_module_wifi') + root_module.begin_section('ns3_module_static_routing') + ns3_module_static_routing.register_methods(root_module) + + try: + import ns3_module_static_routing__local + except ImportError: + pass + else: + ns3_module_static_routing__local.register_methods(root_module) + + root_module.end_section('ns3_module_static_routing') + root_module.begin_section('ns3_module_v4ping') + ns3_module_v4ping.register_methods(root_module) + + try: + import ns3_module_v4ping__local + except ImportError: + pass + else: + ns3_module_v4ping__local.register_methods(root_module) + + root_module.end_section('ns3_module_v4ping') + root_module.begin_section('ns3_module_virtual_net_device') + ns3_module_virtual_net_device.register_methods(root_module) + + try: + import ns3_module_virtual_net_device__local + except ImportError: + pass + else: + ns3_module_virtual_net_device__local.register_methods(root_module) + + root_module.end_section('ns3_module_virtual_net_device') + root_module.begin_section('ns3_module_packet_sink') + ns3_module_packet_sink.register_methods(root_module) + + try: + import ns3_module_packet_sink__local + except ImportError: + pass + else: + ns3_module_packet_sink__local.register_methods(root_module) + + root_module.end_section('ns3_module_packet_sink') + root_module.begin_section('ns3_module_global_routing') + ns3_module_global_routing.register_methods(root_module) + + try: + import ns3_module_global_routing__local + except ImportError: + pass + else: + ns3_module_global_routing__local.register_methods(root_module) + + root_module.end_section('ns3_module_global_routing') + root_module.begin_section('ns3_module_stats') + ns3_module_stats.register_methods(root_module) + + try: + import ns3_module_stats__local + except ImportError: + pass + else: + ns3_module_stats__local.register_methods(root_module) + + root_module.end_section('ns3_module_stats') + root_module.begin_section('ns3_module_list_routing') + ns3_module_list_routing.register_methods(root_module) + + try: + import ns3_module_list_routing__local + except ImportError: + pass + else: + ns3_module_list_routing__local.register_methods(root_module) + + root_module.end_section('ns3_module_list_routing') + root_module.begin_section('ns3_module_emu') + ns3_module_emu.register_methods(root_module) + + try: + import ns3_module_emu__local + except ImportError: + pass + else: + ns3_module_emu__local.register_methods(root_module) + + root_module.end_section('ns3_module_emu') + root_module.begin_section('ns3_module_bridge') + ns3_module_bridge.register_methods(root_module) + + try: + import ns3_module_bridge__local + except ImportError: + pass + else: + ns3_module_bridge__local.register_methods(root_module) + + root_module.end_section('ns3_module_bridge') + root_module.begin_section('ns3_module_onoff') + ns3_module_onoff.register_methods(root_module) + + try: + import ns3_module_onoff__local + except ImportError: + pass + else: + ns3_module_onoff__local.register_methods(root_module) + + root_module.end_section('ns3_module_onoff') + root_module.begin_section('ns3_module_udp_echo') + ns3_module_udp_echo.register_methods(root_module) + + try: + import ns3_module_udp_echo__local + except ImportError: + pass + else: + ns3_module_udp_echo__local.register_methods(root_module) + + root_module.end_section('ns3_module_udp_echo') + root_module.begin_section('ns3_module_ping6') + ns3_module_ping6.register_methods(root_module) + + try: + import ns3_module_ping6__local + except ImportError: + pass + else: + ns3_module_ping6__local.register_methods(root_module) + + root_module.end_section('ns3_module_ping6') + root_module.begin_section('ns3_module_nix_vector_routing') + ns3_module_nix_vector_routing.register_methods(root_module) + + try: + import ns3_module_nix_vector_routing__local + except ImportError: + pass + else: + ns3_module_nix_vector_routing__local.register_methods(root_module) + + root_module.end_section('ns3_module_nix_vector_routing') + root_module.begin_section('ns3_module_olsr') + ns3_module_olsr.register_methods(root_module) + + try: + import ns3_module_olsr__local + except ImportError: + pass + else: + ns3_module_olsr__local.register_methods(root_module) + + root_module.end_section('ns3_module_olsr') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_methods(root_module) + + try: + import ns3_module_flow_monitor__local + except ImportError: + pass + else: + ns3_module_flow_monitor__local.register_methods(root_module) + + root_module.end_section('ns3_module_flow_monitor') + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_methods(root_module) + + try: + import ns3_module_radvd__local + except ImportError: + pass + else: + ns3_module_radvd__local.register_methods(root_module) + + root_module.end_section('ns3_module_radvd') + root_module.begin_section('ns3_module_mesh') + ns3_module_mesh.register_methods(root_module) + + try: + import ns3_module_mesh__local + except ImportError: + pass + else: + ns3_module_mesh__local.register_methods(root_module) + + root_module.end_section('ns3_module_mesh') + root_module.begin_section('ns3_module_helper') + ns3_module_helper.register_methods(root_module) + + try: + import ns3_module_helper__local + except ImportError: + pass + else: + ns3_module_helper__local.register_methods(root_module) + + root_module.end_section('ns3_module_helper') + root_module.begin_section('ns3_module_dot11s') + ns3_module_dot11s.register_methods(root_module) + + try: + import ns3_module_dot11s__local + except ImportError: + pass + else: + ns3_module_dot11s__local.register_methods(root_module) + + root_module.end_section('ns3_module_dot11s') + root_module.begin_section('ns3_module_flame') + ns3_module_flame.register_methods(root_module) + + try: + import ns3_module_flame__local + except ImportError: + pass + else: + ns3_module_flame__local.register_methods(root_module) + + root_module.end_section('ns3_module_flame') + return + +def register_Ns3AnimationInterface_methods(root_module, cls): + ## animation-interface.h: ns3::AnimationInterface::AnimationInterface(ns3::AnimationInterface const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AnimationInterface const &', 'arg0')]) + ## animation-interface.h: ns3::AnimationInterface::AnimationInterface() [constructor] + cls.add_constructor([]) + ## animation-interface.h: bool ns3::AnimationInterface::SetInternalAnimation() [member function] + cls.add_method('SetInternalAnimation', + 'bool', + []) + ## animation-interface.h: bool ns3::AnimationInterface::SetOutputFile(std::string const & fn) [member function] + cls.add_method('SetOutputFile', + 'bool', + [param('std::string const &', 'fn')]) + ## animation-interface.h: bool ns3::AnimationInterface::SetServerPort(uint16_t port) [member function] + cls.add_method('SetServerPort', + 'bool', + [param('uint16_t', 'port')]) + ## animation-interface.h: void ns3::AnimationInterface::StartAnimation() [member function] + cls.add_method('StartAnimation', + 'void', + []) + ## animation-interface.h: void ns3::AnimationInterface::StopAnimation() [member function] + cls.add_method('StopAnimation', + 'void', + []) + return + +def register_Ns3PointToPointDumbbellHelper_methods(root_module, cls): + ## point-to-point-dumbbell-helper.h: ns3::PointToPointDumbbellHelper::PointToPointDumbbellHelper(ns3::PointToPointDumbbellHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointDumbbellHelper const &', 'arg0')]) + ## point-to-point-dumbbell-helper.h: ns3::PointToPointDumbbellHelper::PointToPointDumbbellHelper(uint32_t nLeftLeaf, ns3::PointToPointHelper & leftHelper, uint32_t nRightLeaf, ns3::PointToPointHelper & rightHelper, ns3::PointToPointHelper & bottleneckHelper) [constructor] + cls.add_constructor([param('uint32_t', 'nLeftLeaf'), param('ns3::PointToPointHelper &', 'leftHelper'), param('uint32_t', 'nRightLeaf'), param('ns3::PointToPointHelper &', 'rightHelper'), param('ns3::PointToPointHelper &', 'bottleneckHelper')]) + ## point-to-point-dumbbell-helper.h: void ns3::PointToPointDumbbellHelper::AssignAddresses(ns3::Ipv4AddressHelper leftIp, ns3::Ipv4AddressHelper rightIp, ns3::Ipv4AddressHelper routerIp) [member function] + cls.add_method('AssignAddresses', + 'void', + [param('ns3::Ipv4AddressHelper', 'leftIp'), param('ns3::Ipv4AddressHelper', 'rightIp'), param('ns3::Ipv4AddressHelper', 'routerIp')]) + ## point-to-point-dumbbell-helper.h: void ns3::PointToPointDumbbellHelper::BoundingBox(double arg0, double arg1, double arg2, double arg3) [member function] + cls.add_method('BoundingBox', + 'void', + [param('double', 'arg0'), param('double', 'arg1'), param('double', 'arg2'), param('double', 'arg3')]) + ## point-to-point-dumbbell-helper.h: ns3::Ptr ns3::PointToPointDumbbellHelper::GetLeft() const [member function] + cls.add_method('GetLeft', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ptr ns3::PointToPointDumbbellHelper::GetLeft(uint32_t arg0) const [member function] + cls.add_method('GetLeft', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ipv4Address ns3::PointToPointDumbbellHelper::GetLeftAddress(uint32_t arg0) const [member function] + cls.add_method('GetLeftAddress', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ptr ns3::PointToPointDumbbellHelper::GetRight() const [member function] + cls.add_method('GetRight', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ptr ns3::PointToPointDumbbellHelper::GetRight(uint32_t arg0) const [member function] + cls.add_method('GetRight', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ipv4Address ns3::PointToPointDumbbellHelper::GetRightAddress(uint32_t arg0) const [member function] + cls.add_method('GetRightAddress', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-dumbbell-helper.h: void ns3::PointToPointDumbbellHelper::InstallStack(ns3::InternetStackHelper stack) [member function] + cls.add_method('InstallStack', + 'void', + [param('ns3::InternetStackHelper', 'stack')]) + ## point-to-point-dumbbell-helper.h: uint32_t ns3::PointToPointDumbbellHelper::LeftCount() const [member function] + cls.add_method('LeftCount', + 'uint32_t', + [], + is_const=True) + ## point-to-point-dumbbell-helper.h: uint32_t ns3::PointToPointDumbbellHelper::RightCount() const [member function] + cls.add_method('RightCount', + 'uint32_t', + [], + is_const=True) + return + +def register_Ns3PointToPointGridHelper_methods(root_module, cls): + ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper::PointToPointGridHelper(ns3::PointToPointGridHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointGridHelper const &', 'arg0')]) + ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper::PointToPointGridHelper(uint32_t nRows, uint32_t nCols, ns3::PointToPointHelper pointToPoint) [constructor] + cls.add_constructor([param('uint32_t', 'nRows'), param('uint32_t', 'nCols'), param('ns3::PointToPointHelper', 'pointToPoint')]) + ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper::PointToPointGridHelper(uint32_t nRows, uint32_t nCols, ns3::PointToPointHelper pointToPoint, uint16_t mpiSize) [constructor] + cls.add_constructor([param('uint32_t', 'nRows'), param('uint32_t', 'nCols'), param('ns3::PointToPointHelper', 'pointToPoint'), param('uint16_t', 'mpiSize')]) + ## point-to-point-grid-helper.h: void ns3::PointToPointGridHelper::AssignAddresses(ns3::Ipv4AddressHelper rowIp, ns3::Ipv4AddressHelper colIp) [member function] + cls.add_method('AssignAddresses', + 'void', + [param('ns3::Ipv4AddressHelper', 'rowIp'), param('ns3::Ipv4AddressHelper', 'colIp')]) + ## point-to-point-grid-helper.h: void ns3::PointToPointGridHelper::BoundingBox(double ulx, double uly, double lrx, double lry) [member function] + cls.add_method('BoundingBox', + 'void', + [param('double', 'ulx'), param('double', 'uly'), param('double', 'lrx'), param('double', 'lry')]) + ## point-to-point-grid-helper.h: ns3::Ipv4Address ns3::PointToPointGridHelper::GetAddress(uint32_t row, uint32_t col) [member function] + cls.add_method('GetAddress', + 'ns3::Ipv4Address', + [param('uint32_t', 'row'), param('uint32_t', 'col')]) + ## point-to-point-grid-helper.h: ns3::Ptr ns3::PointToPointGridHelper::GetNode(uint32_t row, uint32_t col) [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'row'), param('uint32_t', 'col')]) + ## point-to-point-grid-helper.h: void ns3::PointToPointGridHelper::InstallStack(ns3::InternetStackHelper stack) [member function] + cls.add_method('InstallStack', + 'void', + [param('ns3::InternetStackHelper', 'stack')]) + return + +def register_Ns3NodeLocation_methods(root_module, cls): + ## node-location.h: ns3::NodeLocation::NodeLocation(ns3::NodeLocation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NodeLocation const &', 'arg0')]) + ## node-location.h: ns3::NodeLocation::NodeLocation() [constructor] + cls.add_constructor([]) + ## node-location.h: ns3::Vector ns3::NodeLocation::GetLocation() const [member function] + cls.add_method('GetLocation', + 'ns3::Vector', + [], + is_const=True) + ## node-location.h: static ns3::TypeId ns3::NodeLocation::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## node-location.h: void ns3::NodeLocation::SetLocation(ns3::Vector const & location) [member function] + cls.add_method('SetLocation', + 'void', + [param('ns3::Vector const &', 'location')]) + return + +def register_functions(root_module): + module = root_module + root_module.begin_section('ns3_module_core') + ns3_module_core.register_functions(root_module) + + try: + import ns3_module_core__local + except ImportError: + pass + else: + ns3_module_core__local.register_functions(root_module) + + root_module.end_section('ns3_module_core') + root_module.begin_section('ns3_module_simulator') + ns3_module_simulator.register_functions(root_module) + + try: + import ns3_module_simulator__local + except ImportError: + pass + else: + ns3_module_simulator__local.register_functions(root_module) + + root_module.end_section('ns3_module_simulator') + root_module.begin_section('ns3_module_mobility') + ns3_module_mobility.register_functions(root_module) + + try: + import ns3_module_mobility__local + except ImportError: + pass + else: + ns3_module_mobility__local.register_functions(root_module) + + root_module.end_section('ns3_module_mobility') + root_module.begin_section('ns3_module_common') + ns3_module_common.register_functions(root_module) + + try: + import ns3_module_common__local + except ImportError: + pass + else: + ns3_module_common__local.register_functions(root_module) + + root_module.end_section('ns3_module_common') + root_module.begin_section('ns3_module_node') + ns3_module_node.register_functions(root_module) + + try: + import ns3_module_node__local + except ImportError: + pass + else: + ns3_module_node__local.register_functions(root_module) + + root_module.end_section('ns3_module_node') + root_module.begin_section('ns3_module_contrib') + ns3_module_contrib.register_functions(root_module) + + try: + import ns3_module_contrib__local + except ImportError: + pass + else: + ns3_module_contrib__local.register_functions(root_module) + + root_module.end_section('ns3_module_contrib') + root_module.begin_section('ns3_module_point_to_point') + ns3_module_point_to_point.register_functions(root_module) + + try: + import ns3_module_point_to_point__local + except ImportError: + pass + else: + ns3_module_point_to_point__local.register_functions(root_module) + + root_module.end_section('ns3_module_point_to_point') + root_module.begin_section('ns3_module_internet_stack') + ns3_module_internet_stack.register_functions(root_module) + + try: + import ns3_module_internet_stack__local + except ImportError: + pass + else: + ns3_module_internet_stack__local.register_functions(root_module) + + root_module.end_section('ns3_module_internet_stack') + root_module.begin_section('ns3_module_tap_bridge') + ns3_module_tap_bridge.register_functions(root_module) + + try: + import ns3_module_tap_bridge__local + except ImportError: + pass + else: + ns3_module_tap_bridge__local.register_functions(root_module) + + root_module.end_section('ns3_module_tap_bridge') + root_module.begin_section('ns3_module_csma') + ns3_module_csma.register_functions(root_module) + + try: + import ns3_module_csma__local + except ImportError: + pass + else: + ns3_module_csma__local.register_functions(root_module) + + root_module.end_section('ns3_module_csma') + root_module.begin_section('ns3_module_wifi') + ns3_module_wifi.register_functions(root_module) + + try: + import ns3_module_wifi__local + except ImportError: + pass + else: + ns3_module_wifi__local.register_functions(root_module) + + root_module.end_section('ns3_module_wifi') + root_module.begin_section('ns3_module_static_routing') + ns3_module_static_routing.register_functions(root_module) + + try: + import ns3_module_static_routing__local + except ImportError: + pass + else: + ns3_module_static_routing__local.register_functions(root_module) + + root_module.end_section('ns3_module_static_routing') + root_module.begin_section('ns3_module_v4ping') + ns3_module_v4ping.register_functions(root_module) + + try: + import ns3_module_v4ping__local + except ImportError: + pass + else: + ns3_module_v4ping__local.register_functions(root_module) + + root_module.end_section('ns3_module_v4ping') + root_module.begin_section('ns3_module_virtual_net_device') + ns3_module_virtual_net_device.register_functions(root_module) + + try: + import ns3_module_virtual_net_device__local + except ImportError: + pass + else: + ns3_module_virtual_net_device__local.register_functions(root_module) + + root_module.end_section('ns3_module_virtual_net_device') + root_module.begin_section('ns3_module_packet_sink') + ns3_module_packet_sink.register_functions(root_module) + + try: + import ns3_module_packet_sink__local + except ImportError: + pass + else: + ns3_module_packet_sink__local.register_functions(root_module) + + root_module.end_section('ns3_module_packet_sink') + root_module.begin_section('ns3_module_global_routing') + ns3_module_global_routing.register_functions(root_module) + + try: + import ns3_module_global_routing__local + except ImportError: + pass + else: + ns3_module_global_routing__local.register_functions(root_module) + + root_module.end_section('ns3_module_global_routing') + root_module.begin_section('ns3_module_stats') + ns3_module_stats.register_functions(root_module) + + try: + import ns3_module_stats__local + except ImportError: + pass + else: + ns3_module_stats__local.register_functions(root_module) + + root_module.end_section('ns3_module_stats') + root_module.begin_section('ns3_module_list_routing') + ns3_module_list_routing.register_functions(root_module) + + try: + import ns3_module_list_routing__local + except ImportError: + pass + else: + ns3_module_list_routing__local.register_functions(root_module) + + root_module.end_section('ns3_module_list_routing') + root_module.begin_section('ns3_module_emu') + ns3_module_emu.register_functions(root_module) + + try: + import ns3_module_emu__local + except ImportError: + pass + else: + ns3_module_emu__local.register_functions(root_module) + + root_module.end_section('ns3_module_emu') + root_module.begin_section('ns3_module_bridge') + ns3_module_bridge.register_functions(root_module) + + try: + import ns3_module_bridge__local + except ImportError: + pass + else: + ns3_module_bridge__local.register_functions(root_module) + + root_module.end_section('ns3_module_bridge') + root_module.begin_section('ns3_module_onoff') + ns3_module_onoff.register_functions(root_module) + + try: + import ns3_module_onoff__local + except ImportError: + pass + else: + ns3_module_onoff__local.register_functions(root_module) + + root_module.end_section('ns3_module_onoff') + root_module.begin_section('ns3_module_udp_echo') + ns3_module_udp_echo.register_functions(root_module) + + try: + import ns3_module_udp_echo__local + except ImportError: + pass + else: + ns3_module_udp_echo__local.register_functions(root_module) + + root_module.end_section('ns3_module_udp_echo') + root_module.begin_section('ns3_module_ping6') + ns3_module_ping6.register_functions(root_module) + + try: + import ns3_module_ping6__local + except ImportError: + pass + else: + ns3_module_ping6__local.register_functions(root_module) + + root_module.end_section('ns3_module_ping6') + root_module.begin_section('ns3_module_nix_vector_routing') + ns3_module_nix_vector_routing.register_functions(root_module) + + try: + import ns3_module_nix_vector_routing__local + except ImportError: + pass + else: + ns3_module_nix_vector_routing__local.register_functions(root_module) + + root_module.end_section('ns3_module_nix_vector_routing') + root_module.begin_section('ns3_module_olsr') + ns3_module_olsr.register_functions(root_module) + + try: + import ns3_module_olsr__local + except ImportError: + pass + else: + ns3_module_olsr__local.register_functions(root_module) + + root_module.end_section('ns3_module_olsr') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_functions(root_module) + + try: + import ns3_module_flow_monitor__local + except ImportError: + pass + else: + ns3_module_flow_monitor__local.register_functions(root_module) + + root_module.end_section('ns3_module_flow_monitor') + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_functions(root_module) + + try: + import ns3_module_radvd__local + except ImportError: + pass + else: + ns3_module_radvd__local.register_functions(root_module) + + root_module.end_section('ns3_module_radvd') + root_module.begin_section('ns3_module_mesh') + ns3_module_mesh.register_functions(root_module) + + try: + import ns3_module_mesh__local + except ImportError: + pass + else: + ns3_module_mesh__local.register_functions(root_module) + + root_module.end_section('ns3_module_mesh') + root_module.begin_section('ns3_module_helper') + ns3_module_helper.register_functions(root_module) + + try: + import ns3_module_helper__local + except ImportError: + pass + else: + ns3_module_helper__local.register_functions(root_module) + + root_module.end_section('ns3_module_helper') + root_module.begin_section('ns3_module_dot11s') + ns3_module_dot11s.register_functions(root_module) + + try: + import ns3_module_dot11s__local + except ImportError: + pass + else: + ns3_module_dot11s__local.register_functions(root_module) + + root_module.end_section('ns3_module_dot11s') + root_module.begin_section('ns3_module_flame') + ns3_module_flame.register_functions(root_module) + + try: + import ns3_module_flame__local + except ImportError: + pass + else: + ns3_module_flame__local.register_functions(root_module) + + root_module.end_section('ns3_module_flame') + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + +def main(): + out = FileCodeSink(sys.stdout) + root_module = module_init() + register_types(root_module) + register_methods(root_module) + register_functions(root_module) + root_module.generate(out) + +if __name__ == '__main__': + main() + diff --git a/bindings/python/apidefs/gcc-LP64/callbacks_list.py b/bindings/python/apidefs/gcc-LP64/callbacks_list.py new file mode 100644 index 000000000..da45e917c --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/callbacks_list.py @@ -0,0 +1,21 @@ +callback_classes = [ + ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['bool', 'ns3::Ptr', 'ns3::Address const&', 'ns3::Address const&', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Ptr', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Mac48Address', 'ns3::Mac48Address', 'unsigned int', 'bool', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'unsigned int', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::dot11s::PeerLink::PeerState', 'ns3::dot11s::PeerLink::PeerState', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::WifiMacHeader const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['unsigned int', 'ns3::Mac48Address', 'ns3::Ptr', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Ptr', 'ns3::WifiMacHeader const*', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Ptr', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Ptr', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Ptr', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['bool', 'ns3::Ptr', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['std::vector >', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'bool', 'ns3::Ptr', 'ns3::Mac48Address', 'ns3::Mac48Address', 'unsigned short', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['bool', 'std::string', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['bool', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['bool', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Ptr', 'ns3::Ipv4Address', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], +] diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_bridge.py b/bindings/python/apidefs/gcc-LP64/ns3_module_bridge.py new file mode 100644 index 000000000..76c1401b9 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_bridge.py @@ -0,0 +1,319 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## bridge-channel.h: ns3::BridgeChannel [class] + module.add_class('BridgeChannel', parent=root_module['ns3::Channel']) + ## bridge-net-device.h: ns3::BridgeNetDevice [class] + module.add_class('BridgeNetDevice', parent=root_module['ns3::NetDevice']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3BridgeChannel_methods(root_module, root_module['ns3::BridgeChannel']) + register_Ns3BridgeNetDevice_methods(root_module, root_module['ns3::BridgeNetDevice']) + return + +def register_Ns3BridgeChannel_methods(root_module, cls): + ## bridge-channel.h: ns3::BridgeChannel::BridgeChannel(ns3::BridgeChannel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BridgeChannel const &', 'arg0')]) + ## bridge-channel.h: ns3::BridgeChannel::BridgeChannel() [constructor] + cls.add_constructor([]) + ## bridge-channel.h: void ns3::BridgeChannel::AddChannel(ns3::Ptr bridgedChannel) [member function] + cls.add_method('AddChannel', + 'void', + [param('ns3::Ptr< ns3::Channel >', 'bridgedChannel')]) + ## bridge-channel.h: ns3::Ptr ns3::BridgeChannel::GetDevice(uint32_t i) const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## bridge-channel.h: uint32_t ns3::BridgeChannel::GetNDevices() const [member function] + cls.add_method('GetNDevices', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## bridge-channel.h: static ns3::TypeId ns3::BridgeChannel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3BridgeNetDevice_methods(root_module, cls): + ## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice(ns3::BridgeNetDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BridgeNetDevice const &', 'arg0')]) + ## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice() [constructor] + cls.add_constructor([]) + ## bridge-net-device.h: void ns3::BridgeNetDevice::AddBridgePort(ns3::Ptr bridgePort) [member function] + cls.add_method('AddBridgePort', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'bridgePort')]) + ## bridge-net-device.h: void ns3::BridgeNetDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: ns3::Ptr ns3::BridgeNetDevice::GetBridgePort(uint32_t n) const [member function] + cls.add_method('GetBridgePort', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'n')], + is_const=True) + ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: ns3::Ptr ns3::BridgeNetDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: uint32_t ns3::BridgeNetDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: uint16_t ns3::BridgeNetDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## bridge-net-device.h: uint32_t ns3::BridgeNetDevice::GetNBridgePorts() const [member function] + cls.add_method('GetNBridgePorts', + 'uint32_t', + [], + is_const=True) + ## bridge-net-device.h: ns3::Ptr ns3::BridgeNetDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: static ns3::TypeId ns3::BridgeNetDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## bridge-net-device.h: void ns3::BridgeNetDevice::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + is_virtual=True) + ## bridge-net-device.h: void ns3::BridgeNetDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## bridge-net-device.h: void ns3::BridgeNetDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## bridge-net-device.h: void ns3::BridgeNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## bridge-net-device.h: void ns3::BridgeNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## bridge-net-device.h: bool ns3::BridgeNetDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## bridge-net-device.h: void ns3::BridgeNetDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardBroadcast(ns3::Ptr incomingPort, ns3::Ptr packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function] + cls.add_method('ForwardBroadcast', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], + visibility='protected') + ## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardUnicast(ns3::Ptr incomingPort, ns3::Ptr packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function] + cls.add_method('ForwardUnicast', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], + visibility='protected') + ## bridge-net-device.h: ns3::Ptr ns3::BridgeNetDevice::GetLearnedState(ns3::Mac48Address source) [member function] + cls.add_method('GetLearnedState', + 'ns3::Ptr< ns3::NetDevice >', + [param('ns3::Mac48Address', 'source')], + visibility='protected') + ## bridge-net-device.h: void ns3::BridgeNetDevice::Learn(ns3::Mac48Address source, ns3::Ptr port) [member function] + cls.add_method('Learn', + 'void', + [param('ns3::Mac48Address', 'source'), param('ns3::Ptr< ns3::NetDevice >', 'port')], + visibility='protected') + ## bridge-net-device.h: void ns3::BridgeNetDevice::ReceiveFromDevice(ns3::Ptr device, ns3::Ptr packet, uint16_t protocol, ns3::Address const & source, ns3::Address const & destination, ns3::NetDevice::PacketType packetType) [member function] + cls.add_method('ReceiveFromDevice', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'destination'), param('ns3::NetDevice::PacketType', 'packetType')], + visibility='protected') + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_common.py b/bindings/python/apidefs/gcc-LP64/ns3_module_common.py new file mode 100644 index 000000000..a7a0c4975 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_common.py @@ -0,0 +1,1471 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## error-model.h: ns3::ErrorUnit [enumeration] + module.add_enum('ErrorUnit', ['EU_BIT', 'EU_BYTE', 'EU_PKT']) + ## buffer.h: ns3::Buffer [class] + module.add_class('Buffer') + ## buffer.h: ns3::Buffer::Iterator [class] + module.add_class('Iterator', outer_class=root_module['ns3::Buffer']) + ## packet.h: ns3::ByteTagIterator [class] + module.add_class('ByteTagIterator') + ## packet.h: ns3::ByteTagIterator::Item [class] + module.add_class('Item', outer_class=root_module['ns3::ByteTagIterator']) + ## byte-tag-list.h: ns3::ByteTagList [class] + module.add_class('ByteTagList') + ## byte-tag-list.h: ns3::ByteTagList::Iterator [class] + module.add_class('Iterator', outer_class=root_module['ns3::ByteTagList']) + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item [struct] + module.add_class('Item', outer_class=root_module['ns3::ByteTagList::Iterator']) + ## data-rate.h: ns3::DataRate [class] + module.add_class('DataRate') + ## packet.h: ns3::Packet [class] + module.add_class('Packet', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) + ## packet-metadata.h: ns3::PacketMetadata [class] + module.add_class('PacketMetadata') + ## packet-metadata.h: ns3::PacketMetadata::Item [struct] + module.add_class('Item', outer_class=root_module['ns3::PacketMetadata']) + ## packet-metadata.h: ns3::PacketMetadata::Item [enumeration] + module.add_enum('', ['PAYLOAD', 'HEADER', 'TRAILER'], outer_class=root_module['ns3::PacketMetadata::Item']) + ## packet-metadata.h: ns3::PacketMetadata::ItemIterator [class] + module.add_class('ItemIterator', outer_class=root_module['ns3::PacketMetadata']) + ## packet.h: ns3::PacketTagIterator [class] + module.add_class('PacketTagIterator') + ## packet.h: ns3::PacketTagIterator::Item [class] + module.add_class('Item', outer_class=root_module['ns3::PacketTagIterator']) + ## packet-tag-list.h: ns3::PacketTagList [class] + module.add_class('PacketTagList') + ## packet-tag-list.h: ns3::PacketTagList::TagData [struct] + module.add_class('TagData', outer_class=root_module['ns3::PacketTagList']) + ## pcap-file.h: ns3::PcapFile [class] + module.add_class('PcapFile') + ## tag.h: ns3::Tag [class] + module.add_class('Tag', parent=root_module['ns3::ObjectBase']) + ## tag-buffer.h: ns3::TagBuffer [class] + module.add_class('TagBuffer') + ## ascii-writer.h: ns3::AsciiWriter [class] + module.add_class('AsciiWriter', parent=root_module['ns3::RefCountBase']) + ## ascii-writer.h: ns3::AsciiWriter::Type [enumeration] + module.add_enum('Type', ['ENQUEUE', 'DEQUEUE', 'DROP', 'TX', 'RX'], outer_class=root_module['ns3::AsciiWriter']) + ## chunk.h: ns3::Chunk [class] + module.add_class('Chunk', parent=root_module['ns3::ObjectBase']) + ## data-rate.h: ns3::DataRateChecker [class] + module.add_class('DataRateChecker', parent=root_module['ns3::AttributeChecker']) + ## data-rate.h: ns3::DataRateValue [class] + module.add_class('DataRateValue', parent=root_module['ns3::AttributeValue']) + ## header.h: ns3::Header [class] + module.add_class('Header', parent=root_module['ns3::Chunk']) + ## pcap-writer.h: ns3::PcapWriter [class] + module.add_class('PcapWriter', parent=root_module['ns3::Object']) + ## trailer.h: ns3::Trailer [class] + module.add_class('Trailer', parent=root_module['ns3::Chunk']) + ## error-model.h: ns3::ErrorModel [class] + module.add_class('ErrorModel', parent=root_module['ns3::Object']) + ## error-model.h: ns3::ListErrorModel [class] + module.add_class('ListErrorModel', parent=root_module['ns3::ErrorModel']) + ## nix-vector.h: ns3::NixVector [class] + module.add_class('NixVector', parent=root_module['ns3::Object']) + ## error-model.h: ns3::RateErrorModel [class] + module.add_class('RateErrorModel', parent=root_module['ns3::ErrorModel']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Buffer_methods(root_module, root_module['ns3::Buffer']) + register_Ns3BufferIterator_methods(root_module, root_module['ns3::Buffer::Iterator']) + register_Ns3ByteTagIterator_methods(root_module, root_module['ns3::ByteTagIterator']) + register_Ns3ByteTagIteratorItem_methods(root_module, root_module['ns3::ByteTagIterator::Item']) + register_Ns3ByteTagList_methods(root_module, root_module['ns3::ByteTagList']) + register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator']) + register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item']) + register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate']) + register_Ns3Packet_methods(root_module, root_module['ns3::Packet']) + register_Ns3PacketMetadata_methods(root_module, root_module['ns3::PacketMetadata']) + register_Ns3PacketMetadataItem_methods(root_module, root_module['ns3::PacketMetadata::Item']) + register_Ns3PacketMetadataItemIterator_methods(root_module, root_module['ns3::PacketMetadata::ItemIterator']) + register_Ns3PacketTagIterator_methods(root_module, root_module['ns3::PacketTagIterator']) + register_Ns3PacketTagIteratorItem_methods(root_module, root_module['ns3::PacketTagIterator::Item']) + register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList']) + register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData']) + register_Ns3PcapFile_methods(root_module, root_module['ns3::PcapFile']) + register_Ns3Tag_methods(root_module, root_module['ns3::Tag']) + register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer']) + register_Ns3AsciiWriter_methods(root_module, root_module['ns3::AsciiWriter']) + register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) + register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker']) + register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue']) + register_Ns3Header_methods(root_module, root_module['ns3::Header']) + register_Ns3PcapWriter_methods(root_module, root_module['ns3::PcapWriter']) + register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) + register_Ns3ErrorModel_methods(root_module, root_module['ns3::ErrorModel']) + register_Ns3ListErrorModel_methods(root_module, root_module['ns3::ListErrorModel']) + register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector']) + register_Ns3RateErrorModel_methods(root_module, root_module['ns3::RateErrorModel']) + return + +def register_Ns3Buffer_methods(root_module, cls): + ## buffer.h: ns3::Buffer::Buffer(ns3::Buffer const & o) [copy constructor] + cls.add_constructor([param('ns3::Buffer const &', 'o')]) + ## buffer.h: ns3::Buffer::Buffer() [constructor] + cls.add_constructor([]) + ## buffer.h: ns3::Buffer::Buffer(uint32_t dataSize) [constructor] + cls.add_constructor([param('uint32_t', 'dataSize')]) + ## buffer.h: bool ns3::Buffer::AddAtEnd(uint32_t end) [member function] + cls.add_method('AddAtEnd', + 'bool', + [param('uint32_t', 'end')]) + ## buffer.h: void ns3::Buffer::AddAtEnd(ns3::Buffer const & o) [member function] + cls.add_method('AddAtEnd', + 'void', + [param('ns3::Buffer const &', 'o')]) + ## buffer.h: bool ns3::Buffer::AddAtStart(uint32_t start) [member function] + cls.add_method('AddAtStart', + 'bool', + [param('uint32_t', 'start')]) + ## buffer.h: ns3::Buffer::Iterator ns3::Buffer::Begin() const [member function] + cls.add_method('Begin', + 'ns3::Buffer::Iterator', + [], + is_const=True) + ## buffer.h: void ns3::Buffer::CopyData(std::ostream * os, uint32_t size) const [member function] + cls.add_method('CopyData', + 'void', + [param('std::ostream *', 'os'), param('uint32_t', 'size')], + is_const=True) + ## buffer.h: ns3::Buffer ns3::Buffer::CreateFragment(uint32_t start, uint32_t length) const [member function] + cls.add_method('CreateFragment', + 'ns3::Buffer', + [param('uint32_t', 'start'), param('uint32_t', 'length')], + is_const=True) + ## buffer.h: ns3::Buffer ns3::Buffer::CreateFullCopy() const [member function] + cls.add_method('CreateFullCopy', + 'ns3::Buffer', + [], + is_const=True) + ## buffer.h: ns3::Buffer::Iterator ns3::Buffer::End() const [member function] + cls.add_method('End', + 'ns3::Buffer::Iterator', + [], + is_const=True) + ## buffer.h: int32_t ns3::Buffer::GetCurrentEndOffset() const [member function] + cls.add_method('GetCurrentEndOffset', + 'int32_t', + [], + is_const=True) + ## buffer.h: int32_t ns3::Buffer::GetCurrentStartOffset() const [member function] + cls.add_method('GetCurrentStartOffset', + 'int32_t', + [], + is_const=True) + ## buffer.h: uint32_t ns3::Buffer::GetSize() const [member function] + cls.add_method('GetSize', + 'uint32_t', + [], + is_const=True) + ## buffer.h: uint8_t const * ns3::Buffer::PeekData() const [member function] + cls.add_method('PeekData', + 'uint8_t const *', + [], + is_const=True) + ## buffer.h: void ns3::Buffer::RemoveAtEnd(uint32_t end) [member function] + cls.add_method('RemoveAtEnd', + 'void', + [param('uint32_t', 'end')]) + ## buffer.h: void ns3::Buffer::RemoveAtStart(uint32_t start) [member function] + cls.add_method('RemoveAtStart', + 'void', + [param('uint32_t', 'start')]) + return + +def register_Ns3BufferIterator_methods(root_module, cls): + ## buffer.h: ns3::Buffer::Iterator::Iterator(ns3::Buffer::Iterator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Buffer::Iterator const &', 'arg0')]) + ## buffer.h: ns3::Buffer::Iterator::Iterator() [constructor] + cls.add_constructor([]) + ## buffer.h: uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size) [member function] + cls.add_method('CalculateIpChecksum', + 'uint16_t', + [param('uint16_t', 'size')]) + ## buffer.h: uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size, uint32_t initialChecksum) [member function] + cls.add_method('CalculateIpChecksum', + 'uint16_t', + [param('uint16_t', 'size'), param('uint32_t', 'initialChecksum')]) + ## buffer.h: uint32_t ns3::Buffer::Iterator::GetDistanceFrom(ns3::Buffer::Iterator const & o) const [member function] + cls.add_method('GetDistanceFrom', + 'uint32_t', + [param('ns3::Buffer::Iterator const &', 'o')], + is_const=True) + ## buffer.h: uint32_t ns3::Buffer::Iterator::GetSize() const [member function] + cls.add_method('GetSize', + 'uint32_t', + [], + is_const=True) + ## buffer.h: bool ns3::Buffer::Iterator::IsEnd() const [member function] + cls.add_method('IsEnd', + 'bool', + [], + is_const=True) + ## buffer.h: bool ns3::Buffer::Iterator::IsStart() const [member function] + cls.add_method('IsStart', + 'bool', + [], + is_const=True) + ## buffer.h: void ns3::Buffer::Iterator::Next() [member function] + cls.add_method('Next', + 'void', + []) + ## buffer.h: void ns3::Buffer::Iterator::Next(uint32_t delta) [member function] + cls.add_method('Next', + 'void', + [param('uint32_t', 'delta')]) + ## buffer.h: void ns3::Buffer::Iterator::Prev() [member function] + cls.add_method('Prev', + 'void', + []) + ## buffer.h: void ns3::Buffer::Iterator::Prev(uint32_t delta) [member function] + cls.add_method('Prev', + 'void', + [param('uint32_t', 'delta')]) + ## buffer.h: void ns3::Buffer::Iterator::Read(uint8_t * buffer, uint32_t size) [member function] + cls.add_method('Read', + 'void', + [param('uint8_t *', 'buffer'), param('uint32_t', 'size')]) + ## buffer.h: uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function] + cls.add_method('ReadLsbtohU16', + 'uint16_t', + []) + ## buffer.h: uint32_t ns3::Buffer::Iterator::ReadLsbtohU32() [member function] + cls.add_method('ReadLsbtohU32', + 'uint32_t', + []) + ## buffer.h: uint64_t ns3::Buffer::Iterator::ReadLsbtohU64() [member function] + cls.add_method('ReadLsbtohU64', + 'uint64_t', + []) + ## buffer.h: uint16_t ns3::Buffer::Iterator::ReadNtohU16() [member function] + cls.add_method('ReadNtohU16', + 'uint16_t', + []) + ## buffer.h: uint32_t ns3::Buffer::Iterator::ReadNtohU32() [member function] + cls.add_method('ReadNtohU32', + 'uint32_t', + []) + ## buffer.h: uint64_t ns3::Buffer::Iterator::ReadNtohU64() [member function] + cls.add_method('ReadNtohU64', + 'uint64_t', + []) + ## buffer.h: uint16_t ns3::Buffer::Iterator::ReadU16() [member function] + cls.add_method('ReadU16', + 'uint16_t', + []) + ## buffer.h: uint32_t ns3::Buffer::Iterator::ReadU32() [member function] + cls.add_method('ReadU32', + 'uint32_t', + []) + ## buffer.h: uint64_t ns3::Buffer::Iterator::ReadU64() [member function] + cls.add_method('ReadU64', + 'uint64_t', + []) + ## buffer.h: uint8_t ns3::Buffer::Iterator::ReadU8() [member function] + cls.add_method('ReadU8', + 'uint8_t', + []) + ## buffer.h: void ns3::Buffer::Iterator::Write(uint8_t const * buffer, uint32_t size) [member function] + cls.add_method('Write', + 'void', + [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) + ## buffer.h: void ns3::Buffer::Iterator::Write(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function] + cls.add_method('Write', + 'void', + [param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteHtolsbU16(uint16_t data) [member function] + cls.add_method('WriteHtolsbU16', + 'void', + [param('uint16_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteHtolsbU32(uint32_t data) [member function] + cls.add_method('WriteHtolsbU32', + 'void', + [param('uint32_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteHtolsbU64(uint64_t data) [member function] + cls.add_method('WriteHtolsbU64', + 'void', + [param('uint64_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteHtonU16(uint16_t data) [member function] + cls.add_method('WriteHtonU16', + 'void', + [param('uint16_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteHtonU32(uint32_t data) [member function] + cls.add_method('WriteHtonU32', + 'void', + [param('uint32_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteHtonU64(uint64_t data) [member function] + cls.add_method('WriteHtonU64', + 'void', + [param('uint64_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteU16(uint16_t data) [member function] + cls.add_method('WriteU16', + 'void', + [param('uint16_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteU32(uint32_t data) [member function] + cls.add_method('WriteU32', + 'void', + [param('uint32_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteU64(uint64_t data) [member function] + cls.add_method('WriteU64', + 'void', + [param('uint64_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteU8(uint8_t data) [member function] + cls.add_method('WriteU8', + 'void', + [param('uint8_t', 'data')]) + ## buffer.h: void ns3::Buffer::Iterator::WriteU8(uint8_t data, uint32_t len) [member function] + cls.add_method('WriteU8', + 'void', + [param('uint8_t', 'data'), param('uint32_t', 'len')]) + return + +def register_Ns3ByteTagIterator_methods(root_module, cls): + ## packet.h: ns3::ByteTagIterator::ByteTagIterator(ns3::ByteTagIterator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ByteTagIterator const &', 'arg0')]) + ## packet.h: bool ns3::ByteTagIterator::HasNext() const [member function] + cls.add_method('HasNext', + 'bool', + [], + is_const=True) + ## packet.h: ns3::ByteTagIterator::Item ns3::ByteTagIterator::Next() [member function] + cls.add_method('Next', + 'ns3::ByteTagIterator::Item', + []) + return + +def register_Ns3ByteTagIteratorItem_methods(root_module, cls): + ## packet.h: ns3::ByteTagIterator::Item::Item(ns3::ByteTagIterator::Item const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ByteTagIterator::Item const &', 'arg0')]) + ## packet.h: uint32_t ns3::ByteTagIterator::Item::GetEnd() const [member function] + cls.add_method('GetEnd', + 'uint32_t', + [], + is_const=True) + ## packet.h: uint32_t ns3::ByteTagIterator::Item::GetStart() const [member function] + cls.add_method('GetStart', + 'uint32_t', + [], + is_const=True) + ## packet.h: void ns3::ByteTagIterator::Item::GetTag(ns3::Tag & tag) const [member function] + cls.add_method('GetTag', + 'void', + [param('ns3::Tag &', 'tag')], + is_const=True) + ## packet.h: ns3::TypeId ns3::ByteTagIterator::Item::GetTypeId() const [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_const=True) + return + +def register_Ns3ByteTagList_methods(root_module, cls): + ## byte-tag-list.h: ns3::ByteTagList::ByteTagList() [constructor] + cls.add_constructor([]) + ## byte-tag-list.h: ns3::ByteTagList::ByteTagList(ns3::ByteTagList const & o) [copy constructor] + cls.add_constructor([param('ns3::ByteTagList const &', 'o')]) + ## byte-tag-list.h: ns3::TagBuffer ns3::ByteTagList::Add(ns3::TypeId tid, uint32_t bufferSize, int32_t start, int32_t end) [member function] + cls.add_method('Add', + 'ns3::TagBuffer', + [param('ns3::TypeId', 'tid'), param('uint32_t', 'bufferSize'), param('int32_t', 'start'), param('int32_t', 'end')]) + ## byte-tag-list.h: void ns3::ByteTagList::Add(ns3::ByteTagList const & o) [member function] + cls.add_method('Add', + 'void', + [param('ns3::ByteTagList const &', 'o')]) + ## byte-tag-list.h: void ns3::ByteTagList::AddAtEnd(int32_t adjustment, int32_t appendOffset) [member function] + cls.add_method('AddAtEnd', + 'void', + [param('int32_t', 'adjustment'), param('int32_t', 'appendOffset')]) + ## byte-tag-list.h: void ns3::ByteTagList::AddAtStart(int32_t adjustment, int32_t prependOffset) [member function] + cls.add_method('AddAtStart', + 'void', + [param('int32_t', 'adjustment'), param('int32_t', 'prependOffset')]) + ## byte-tag-list.h: ns3::ByteTagList::Iterator ns3::ByteTagList::Begin(int32_t offsetStart, int32_t offsetEnd) const [member function] + cls.add_method('Begin', + 'ns3::ByteTagList::Iterator', + [param('int32_t', 'offsetStart'), param('int32_t', 'offsetEnd')], + is_const=True) + ## byte-tag-list.h: void ns3::ByteTagList::RemoveAll() [member function] + cls.add_method('RemoveAll', + 'void', + []) + return + +def register_Ns3ByteTagListIterator_methods(root_module, cls): + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Iterator(ns3::ByteTagList::Iterator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ByteTagList::Iterator const &', 'arg0')]) + ## byte-tag-list.h: uint32_t ns3::ByteTagList::Iterator::GetOffsetStart() const [member function] + cls.add_method('GetOffsetStart', + 'uint32_t', + [], + is_const=True) + ## byte-tag-list.h: bool ns3::ByteTagList::Iterator::HasNext() const [member function] + cls.add_method('HasNext', + 'bool', + [], + is_const=True) + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item ns3::ByteTagList::Iterator::Next() [member function] + cls.add_method('Next', + 'ns3::ByteTagList::Iterator::Item', + []) + return + +def register_Ns3ByteTagListIteratorItem_methods(root_module, cls): + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item::Item(ns3::ByteTagList::Iterator::Item const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ByteTagList::Iterator::Item const &', 'arg0')]) + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item::Item(ns3::TagBuffer buf) [constructor] + cls.add_constructor([param('ns3::TagBuffer', 'buf')]) + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item::buf [variable] + cls.add_instance_attribute('buf', 'ns3::TagBuffer', is_const=False) + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item::end [variable] + cls.add_instance_attribute('end', 'int32_t', is_const=False) + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item::size [variable] + cls.add_instance_attribute('size', 'uint32_t', is_const=False) + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item::start [variable] + cls.add_instance_attribute('start', 'int32_t', is_const=False) + ## byte-tag-list.h: ns3::ByteTagList::Iterator::Item::tid [variable] + cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) + return + +def register_Ns3DataRate_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('!=') + cls.add_binary_comparison_operator('<') + cls.add_binary_comparison_operator('<=') + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('>') + cls.add_binary_comparison_operator('>=') + ## data-rate.h: ns3::DataRate::DataRate(ns3::DataRate const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DataRate const &', 'arg0')]) + ## data-rate.h: ns3::DataRate::DataRate() [constructor] + cls.add_constructor([]) + ## data-rate.h: ns3::DataRate::DataRate(uint64_t bps) [constructor] + cls.add_constructor([param('uint64_t', 'bps')]) + ## data-rate.h: ns3::DataRate::DataRate(std::string rate) [constructor] + cls.add_constructor([param('std::string', 'rate')]) + ## data-rate.h: double ns3::DataRate::CalculateTxTime(uint32_t bytes) const [member function] + cls.add_method('CalculateTxTime', + 'double', + [param('uint32_t', 'bytes')], + is_const=True) + ## data-rate.h: uint64_t ns3::DataRate::GetBitRate() const [member function] + cls.add_method('GetBitRate', + 'uint64_t', + [], + is_const=True) + return + +def register_Ns3Packet_methods(root_module, cls): + cls.add_output_stream_operator() + ## packet.h: ns3::Packet::Packet() [constructor] + cls.add_constructor([]) + ## packet.h: ns3::Packet::Packet(ns3::Packet const & o) [copy constructor] + cls.add_constructor([param('ns3::Packet const &', 'o')]) + ## packet.h: ns3::Packet::Packet(uint32_t size) [constructor] + cls.add_constructor([param('uint32_t', 'size')]) + ## packet.h: ns3::Packet::Packet(uint8_t const * buffer, uint32_t size) [constructor] + cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) + ## packet.h: void ns3::Packet::AddAtEnd(ns3::Ptr packet) [member function] + cls.add_method('AddAtEnd', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## packet.h: void ns3::Packet::AddByteTag(ns3::Tag const & tag) const [member function] + cls.add_method('AddByteTag', + 'void', + [param('ns3::Tag const &', 'tag')], + is_const=True) + ## packet.h: void ns3::Packet::AddHeader(ns3::Header const & header) [member function] + cls.add_method('AddHeader', + 'void', + [param('ns3::Header const &', 'header')]) + ## packet.h: void ns3::Packet::AddPacketTag(ns3::Tag const & tag) const [member function] + cls.add_method('AddPacketTag', + 'void', + [param('ns3::Tag const &', 'tag')], + is_const=True) + ## packet.h: void ns3::Packet::AddPaddingAtEnd(uint32_t size) [member function] + cls.add_method('AddPaddingAtEnd', + 'void', + [param('uint32_t', 'size')]) + ## packet.h: void ns3::Packet::AddTrailer(ns3::Trailer const & trailer) [member function] + cls.add_method('AddTrailer', + 'void', + [param('ns3::Trailer const &', 'trailer')]) + ## packet.h: ns3::PacketMetadata::ItemIterator ns3::Packet::BeginItem() const [member function] + cls.add_method('BeginItem', + 'ns3::PacketMetadata::ItemIterator', + [], + is_const=True) + ## packet.h: ns3::Ptr ns3::Packet::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::Packet >', + [], + is_const=True) + ## packet.h: uint32_t ns3::Packet::CopyData(uint8_t * buffer, uint32_t size) const [member function] + cls.add_method('CopyData', + 'uint32_t', + [param('uint8_t *', 'buffer'), param('uint32_t', 'size')], + is_const=True) + ## packet.h: void ns3::Packet::CopyData(std::ostream * os, uint32_t size) const [member function] + cls.add_method('CopyData', + 'void', + [param('std::ostream *', 'os'), param('uint32_t', 'size')], + is_const=True) + ## packet.h: ns3::Ptr ns3::Packet::CreateFragment(uint32_t start, uint32_t length) const [member function] + cls.add_method('CreateFragment', + 'ns3::Ptr< ns3::Packet >', + [param('uint32_t', 'start'), param('uint32_t', 'length')], + is_const=True) + ## packet.h: void ns3::Packet::Deserialize(ns3::Buffer buffer) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer', 'buffer')]) + ## packet.h: static void ns3::Packet::EnableChecking() [member function] + cls.add_method('EnableChecking', + 'void', + [], + is_static=True) + ## packet.h: static void ns3::Packet::EnablePrinting() [member function] + cls.add_method('EnablePrinting', + 'void', + [], + is_static=True) + ## packet.h: bool ns3::Packet::FindFirstMatchingByteTag(ns3::Tag & tag) const [member function] + cls.add_method('FindFirstMatchingByteTag', + 'bool', + [param('ns3::Tag &', 'tag')], + is_const=True) + ## packet.h: ns3::ByteTagIterator ns3::Packet::GetByteTagIterator() const [member function] + cls.add_method('GetByteTagIterator', + 'ns3::ByteTagIterator', + [], + is_const=True) + ## packet.h: ns3::Ptr ns3::Packet::GetNixVector() const [member function] + cls.add_method('GetNixVector', + 'ns3::Ptr< ns3::NixVector >', + [], + is_const=True) + ## packet.h: ns3::PacketTagIterator ns3::Packet::GetPacketTagIterator() const [member function] + cls.add_method('GetPacketTagIterator', + 'ns3::PacketTagIterator', + [], + is_const=True) + ## packet.h: uint32_t ns3::Packet::GetSize() const [member function] + cls.add_method('GetSize', + 'uint32_t', + [], + is_const=True) + ## packet.h: uint32_t ns3::Packet::GetUid() const [member function] + cls.add_method('GetUid', + 'uint32_t', + [], + is_const=True) + ## packet.h: uint8_t const * ns3::Packet::PeekData() const [member function] + cls.add_method('PeekData', + 'uint8_t const *', + [], + is_const=True) + ## packet.h: uint32_t ns3::Packet::PeekHeader(ns3::Header & header) const [member function] + cls.add_method('PeekHeader', + 'uint32_t', + [param('ns3::Header &', 'header')], + is_const=True) + ## packet.h: bool ns3::Packet::PeekPacketTag(ns3::Tag & tag) const [member function] + cls.add_method('PeekPacketTag', + 'bool', + [param('ns3::Tag &', 'tag')], + is_const=True) + ## packet.h: uint32_t ns3::Packet::PeekTrailer(ns3::Trailer & trailer) [member function] + cls.add_method('PeekTrailer', + 'uint32_t', + [param('ns3::Trailer &', 'trailer')]) + ## packet.h: void ns3::Packet::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packet.h: void ns3::Packet::PrintByteTags(std::ostream & os) const [member function] + cls.add_method('PrintByteTags', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packet.h: void ns3::Packet::PrintPacketTags(std::ostream & os) const [member function] + cls.add_method('PrintPacketTags', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packet.h: void ns3::Packet::RemoveAllByteTags() [member function] + cls.add_method('RemoveAllByteTags', + 'void', + []) + ## packet.h: void ns3::Packet::RemoveAllPacketTags() [member function] + cls.add_method('RemoveAllPacketTags', + 'void', + []) + ## packet.h: void ns3::Packet::RemoveAtEnd(uint32_t size) [member function] + cls.add_method('RemoveAtEnd', + 'void', + [param('uint32_t', 'size')]) + ## packet.h: void ns3::Packet::RemoveAtStart(uint32_t size) [member function] + cls.add_method('RemoveAtStart', + 'void', + [param('uint32_t', 'size')]) + ## packet.h: uint32_t ns3::Packet::RemoveHeader(ns3::Header & header) [member function] + cls.add_method('RemoveHeader', + 'uint32_t', + [param('ns3::Header &', 'header')]) + ## packet.h: bool ns3::Packet::RemovePacketTag(ns3::Tag & tag) [member function] + cls.add_method('RemovePacketTag', + 'bool', + [param('ns3::Tag &', 'tag')]) + ## packet.h: uint32_t ns3::Packet::RemoveTrailer(ns3::Trailer & trailer) [member function] + cls.add_method('RemoveTrailer', + 'uint32_t', + [param('ns3::Trailer &', 'trailer')]) + ## packet.h: ns3::Buffer ns3::Packet::Serialize() const [member function] + cls.add_method('Serialize', + 'ns3::Buffer', + [], + is_const=True) + ## packet.h: void ns3::Packet::SetNixVector(ns3::Ptr arg0) [member function] + cls.add_method('SetNixVector', + 'void', + [param('ns3::Ptr< ns3::NixVector >', 'arg0')]) + return + +def register_Ns3PacketMetadata_methods(root_module, cls): + ## packet-metadata.h: ns3::PacketMetadata::PacketMetadata(uint32_t uid, uint32_t size) [constructor] + cls.add_constructor([param('uint32_t', 'uid'), param('uint32_t', 'size')]) + ## packet-metadata.h: ns3::PacketMetadata::PacketMetadata(ns3::PacketMetadata const & o) [copy constructor] + cls.add_constructor([param('ns3::PacketMetadata const &', 'o')]) + ## packet-metadata.h: void ns3::PacketMetadata::AddAtEnd(ns3::PacketMetadata const & o) [member function] + cls.add_method('AddAtEnd', + 'void', + [param('ns3::PacketMetadata const &', 'o')]) + ## packet-metadata.h: void ns3::PacketMetadata::AddHeader(ns3::Header const & header, uint32_t size) [member function] + cls.add_method('AddHeader', + 'void', + [param('ns3::Header const &', 'header'), param('uint32_t', 'size')]) + ## packet-metadata.h: void ns3::PacketMetadata::AddPaddingAtEnd(uint32_t end) [member function] + cls.add_method('AddPaddingAtEnd', + 'void', + [param('uint32_t', 'end')]) + ## packet-metadata.h: void ns3::PacketMetadata::AddTrailer(ns3::Trailer const & trailer, uint32_t size) [member function] + cls.add_method('AddTrailer', + 'void', + [param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')]) + ## packet-metadata.h: ns3::PacketMetadata::ItemIterator ns3::PacketMetadata::BeginItem(ns3::Buffer buffer) const [member function] + cls.add_method('BeginItem', + 'ns3::PacketMetadata::ItemIterator', + [param('ns3::Buffer', 'buffer')], + is_const=True) + ## packet-metadata.h: ns3::PacketMetadata ns3::PacketMetadata::CreateFragment(uint32_t start, uint32_t end) const [member function] + cls.add_method('CreateFragment', + 'ns3::PacketMetadata', + [param('uint32_t', 'start'), param('uint32_t', 'end')], + is_const=True) + ## packet-metadata.h: uint32_t ns3::PacketMetadata::Deserialize(ns3::Buffer::Iterator i) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'i')]) + ## packet-metadata.h: static void ns3::PacketMetadata::Enable() [member function] + cls.add_method('Enable', + 'void', + [], + is_static=True) + ## packet-metadata.h: static void ns3::PacketMetadata::EnableChecking() [member function] + cls.add_method('EnableChecking', + 'void', + [], + is_static=True) + ## packet-metadata.h: uint32_t ns3::PacketMetadata::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packet-metadata.h: uint32_t ns3::PacketMetadata::GetUid() const [member function] + cls.add_method('GetUid', + 'uint32_t', + [], + is_const=True) + ## packet-metadata.h: void ns3::PacketMetadata::RemoveAtEnd(uint32_t end) [member function] + cls.add_method('RemoveAtEnd', + 'void', + [param('uint32_t', 'end')]) + ## packet-metadata.h: void ns3::PacketMetadata::RemoveAtStart(uint32_t start) [member function] + cls.add_method('RemoveAtStart', + 'void', + [param('uint32_t', 'start')]) + ## packet-metadata.h: void ns3::PacketMetadata::RemoveHeader(ns3::Header const & header, uint32_t size) [member function] + cls.add_method('RemoveHeader', + 'void', + [param('ns3::Header const &', 'header'), param('uint32_t', 'size')]) + ## packet-metadata.h: void ns3::PacketMetadata::RemoveTrailer(ns3::Trailer const & trailer, uint32_t size) [member function] + cls.add_method('RemoveTrailer', + 'void', + [param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')]) + ## packet-metadata.h: void ns3::PacketMetadata::Serialize(ns3::Buffer::Iterator i, uint32_t size) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'i'), param('uint32_t', 'size')], + is_const=True) + return + +def register_Ns3PacketMetadataItem_methods(root_module, cls): + ## packet-metadata.h: ns3::PacketMetadata::Item::Item() [constructor] + cls.add_constructor([]) + ## packet-metadata.h: ns3::PacketMetadata::Item::Item(ns3::PacketMetadata::Item const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketMetadata::Item const &', 'arg0')]) + ## packet-metadata.h: ns3::PacketMetadata::Item::current [variable] + cls.add_instance_attribute('current', 'ns3::Buffer::Iterator', is_const=False) + ## packet-metadata.h: ns3::PacketMetadata::Item::currentSize [variable] + cls.add_instance_attribute('currentSize', 'uint32_t', is_const=False) + ## packet-metadata.h: ns3::PacketMetadata::Item::currentTrimedFromEnd [variable] + cls.add_instance_attribute('currentTrimedFromEnd', 'uint32_t', is_const=False) + ## packet-metadata.h: ns3::PacketMetadata::Item::currentTrimedFromStart [variable] + cls.add_instance_attribute('currentTrimedFromStart', 'uint32_t', is_const=False) + ## packet-metadata.h: ns3::PacketMetadata::Item::isFragment [variable] + cls.add_instance_attribute('isFragment', 'bool', is_const=False) + ## packet-metadata.h: ns3::PacketMetadata::Item::tid [variable] + cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) + return + +def register_Ns3PacketMetadataItemIterator_methods(root_module, cls): + ## packet-metadata.h: ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata::ItemIterator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketMetadata::ItemIterator const &', 'arg0')]) + ## packet-metadata.h: ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata const * metadata, ns3::Buffer buffer) [constructor] + cls.add_constructor([param('ns3::PacketMetadata const *', 'metadata'), param('ns3::Buffer', 'buffer')]) + ## packet-metadata.h: bool ns3::PacketMetadata::ItemIterator::HasNext() const [member function] + cls.add_method('HasNext', + 'bool', + [], + is_const=True) + ## packet-metadata.h: ns3::PacketMetadata::Item ns3::PacketMetadata::ItemIterator::Next() [member function] + cls.add_method('Next', + 'ns3::PacketMetadata::Item', + []) + return + +def register_Ns3PacketTagIterator_methods(root_module, cls): + ## packet.h: ns3::PacketTagIterator::PacketTagIterator(ns3::PacketTagIterator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketTagIterator const &', 'arg0')]) + ## packet.h: bool ns3::PacketTagIterator::HasNext() const [member function] + cls.add_method('HasNext', + 'bool', + [], + is_const=True) + ## packet.h: ns3::PacketTagIterator::Item ns3::PacketTagIterator::Next() [member function] + cls.add_method('Next', + 'ns3::PacketTagIterator::Item', + []) + return + +def register_Ns3PacketTagIteratorItem_methods(root_module, cls): + ## packet.h: ns3::PacketTagIterator::Item::Item(ns3::PacketTagIterator::Item const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketTagIterator::Item const &', 'arg0')]) + ## packet.h: void ns3::PacketTagIterator::Item::GetTag(ns3::Tag & tag) const [member function] + cls.add_method('GetTag', + 'void', + [param('ns3::Tag &', 'tag')], + is_const=True) + ## packet.h: ns3::TypeId ns3::PacketTagIterator::Item::GetTypeId() const [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_const=True) + return + +def register_Ns3PacketTagList_methods(root_module, cls): + ## packet-tag-list.h: ns3::PacketTagList::PacketTagList() [constructor] + cls.add_constructor([]) + ## packet-tag-list.h: ns3::PacketTagList::PacketTagList(ns3::PacketTagList const & o) [copy constructor] + cls.add_constructor([param('ns3::PacketTagList const &', 'o')]) + ## packet-tag-list.h: void ns3::PacketTagList::Add(ns3::Tag const & tag) const [member function] + cls.add_method('Add', + 'void', + [param('ns3::Tag const &', 'tag')], + is_const=True) + ## packet-tag-list.h: ns3::PacketTagList::TagData const * ns3::PacketTagList::Head() const [member function] + cls.add_method('Head', + 'ns3::PacketTagList::TagData const *', + [], + is_const=True) + ## packet-tag-list.h: bool ns3::PacketTagList::Peek(ns3::Tag & tag) const [member function] + cls.add_method('Peek', + 'bool', + [param('ns3::Tag &', 'tag')], + is_const=True) + ## packet-tag-list.h: bool ns3::PacketTagList::Remove(ns3::Tag & tag) [member function] + cls.add_method('Remove', + 'bool', + [param('ns3::Tag &', 'tag')]) + ## packet-tag-list.h: void ns3::PacketTagList::RemoveAll() [member function] + cls.add_method('RemoveAll', + 'void', + []) + return + +def register_Ns3PacketTagListTagData_methods(root_module, cls): + ## packet-tag-list.h: ns3::PacketTagList::TagData::TagData() [constructor] + cls.add_constructor([]) + ## packet-tag-list.h: ns3::PacketTagList::TagData::TagData(ns3::PacketTagList::TagData const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketTagList::TagData const &', 'arg0')]) + ## packet-tag-list.h: ns3::PacketTagList::TagData::count [variable] + cls.add_instance_attribute('count', 'uint32_t', is_const=False) + ## packet-tag-list.h: ns3::PacketTagList::TagData::data [variable] + cls.add_instance_attribute('data', 'uint8_t [ 20 ]', is_const=False) + ## packet-tag-list.h: ns3::PacketTagList::TagData::next [variable] + cls.add_instance_attribute('next', 'ns3::PacketTagList::TagData *', is_const=False) + ## packet-tag-list.h: ns3::PacketTagList::TagData::tid [variable] + cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) + return + +def register_Ns3PcapFile_methods(root_module, cls): + ## pcap-file.h: ns3::PcapFile::PcapFile(ns3::PcapFile const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapFile const &', 'arg0')]) + ## pcap-file.h: ns3::PcapFile::PcapFile() [constructor] + cls.add_constructor([]) + ## pcap-file.h: void ns3::PcapFile::Close() [member function] + cls.add_method('Close', + 'void', + []) + ## pcap-file.h: uint32_t ns3::PcapFile::GetDataLinkType() [member function] + cls.add_method('GetDataLinkType', + 'uint32_t', + []) + ## pcap-file.h: uint32_t ns3::PcapFile::GetMagic() [member function] + cls.add_method('GetMagic', + 'uint32_t', + []) + ## pcap-file.h: uint32_t ns3::PcapFile::GetSigFigs() [member function] + cls.add_method('GetSigFigs', + 'uint32_t', + []) + ## pcap-file.h: uint32_t ns3::PcapFile::GetSnapLen() [member function] + cls.add_method('GetSnapLen', + 'uint32_t', + []) + ## pcap-file.h: bool ns3::PcapFile::GetSwapMode() [member function] + cls.add_method('GetSwapMode', + 'bool', + []) + ## pcap-file.h: int32_t ns3::PcapFile::GetTimeZoneOffset() [member function] + cls.add_method('GetTimeZoneOffset', + 'int32_t', + []) + ## pcap-file.h: uint16_t ns3::PcapFile::GetVersionMajor() [member function] + cls.add_method('GetVersionMajor', + 'uint16_t', + []) + ## pcap-file.h: uint16_t ns3::PcapFile::GetVersionMinor() [member function] + cls.add_method('GetVersionMinor', + 'uint16_t', + []) + ## pcap-file.h: bool ns3::PcapFile::Init(uint32_t dataLinkType, uint32_t snapLen=ns3::PcapFile::SNAPLEN_DEFAULT, int32_t timeZoneCorrection=ns3::PcapFile::ZONE_DEFAULT, bool swapMode=false) [member function] + cls.add_method('Init', + 'bool', + [param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT'), param('int32_t', 'timeZoneCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT'), param('bool', 'swapMode', default_value='false')]) + ## pcap-file.h: bool ns3::PcapFile::Open(std::string const & filename, std::string const & mode) [member function] + cls.add_method('Open', + 'bool', + [param('std::string const &', 'filename'), param('std::string const &', 'mode')]) + ## pcap-file.h: bool ns3::PcapFile::Read(uint8_t * const data, uint32_t maxBytes, uint32_t & tsSec, uint32_t & tsUsec, uint32_t & inclLen, uint32_t & origLen, uint32_t & readLen) [member function] + cls.add_method('Read', + 'bool', + [param('uint8_t * const', 'data'), param('uint32_t', 'maxBytes'), param('uint32_t &', 'tsSec'), param('uint32_t &', 'tsUsec'), param('uint32_t &', 'inclLen'), param('uint32_t &', 'origLen'), param('uint32_t &', 'readLen')]) + ## pcap-file.h: bool ns3::PcapFile::Write(uint32_t tsSec, uint32_t tsUsec, uint8_t const * const data, uint32_t totalLen) [member function] + cls.add_method('Write', + 'bool', + [param('uint32_t', 'tsSec'), param('uint32_t', 'tsUsec'), param('uint8_t const * const', 'data'), param('uint32_t', 'totalLen')]) + ## pcap-file.h: ns3::PcapFile::SNAPLEN_DEFAULT [variable] + cls.add_static_attribute('SNAPLEN_DEFAULT', 'uint32_t const', is_const=True) + ## pcap-file.h: ns3::PcapFile::ZONE_DEFAULT [variable] + cls.add_static_attribute('ZONE_DEFAULT', 'int32_t const', is_const=True) + return + +def register_Ns3Tag_methods(root_module, cls): + ## tag.h: ns3::Tag::Tag() [constructor] + cls.add_constructor([]) + ## tag.h: ns3::Tag::Tag(ns3::Tag const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Tag const &', 'arg0')]) + ## tag.h: void ns3::Tag::Deserialize(ns3::TagBuffer i) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_pure_virtual=True, is_virtual=True) + ## tag.h: uint32_t ns3::Tag::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## tag.h: static ns3::TypeId ns3::Tag::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tag.h: void ns3::Tag::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## tag.h: void ns3::Tag::Serialize(ns3::TagBuffer i) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3TagBuffer_methods(root_module, cls): + ## tag-buffer.h: ns3::TagBuffer::TagBuffer(ns3::TagBuffer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TagBuffer const &', 'arg0')]) + ## tag-buffer.h: ns3::TagBuffer::TagBuffer(uint8_t * start, uint8_t * end) [constructor] + cls.add_constructor([param('uint8_t *', 'start'), param('uint8_t *', 'end')]) + ## tag-buffer.h: void ns3::TagBuffer::CopyFrom(ns3::TagBuffer o) [member function] + cls.add_method('CopyFrom', + 'void', + [param('ns3::TagBuffer', 'o')]) + ## tag-buffer.h: void ns3::TagBuffer::Read(uint8_t * buffer, uint32_t size) [member function] + cls.add_method('Read', + 'void', + [param('uint8_t *', 'buffer'), param('uint32_t', 'size')]) + ## tag-buffer.h: double ns3::TagBuffer::ReadDouble() [member function] + cls.add_method('ReadDouble', + 'double', + []) + ## tag-buffer.h: uint16_t ns3::TagBuffer::ReadU16() [member function] + cls.add_method('ReadU16', + 'uint16_t', + []) + ## tag-buffer.h: uint32_t ns3::TagBuffer::ReadU32() [member function] + cls.add_method('ReadU32', + 'uint32_t', + []) + ## tag-buffer.h: uint64_t ns3::TagBuffer::ReadU64() [member function] + cls.add_method('ReadU64', + 'uint64_t', + []) + ## tag-buffer.h: uint8_t ns3::TagBuffer::ReadU8() [member function] + cls.add_method('ReadU8', + 'uint8_t', + []) + ## tag-buffer.h: void ns3::TagBuffer::TrimAtEnd(uint32_t trim) [member function] + cls.add_method('TrimAtEnd', + 'void', + [param('uint32_t', 'trim')]) + ## tag-buffer.h: void ns3::TagBuffer::Write(uint8_t const * buffer, uint32_t size) [member function] + cls.add_method('Write', + 'void', + [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) + ## tag-buffer.h: void ns3::TagBuffer::WriteDouble(double v) [member function] + cls.add_method('WriteDouble', + 'void', + [param('double', 'v')]) + ## tag-buffer.h: void ns3::TagBuffer::WriteU16(uint16_t data) [member function] + cls.add_method('WriteU16', + 'void', + [param('uint16_t', 'data')]) + ## tag-buffer.h: void ns3::TagBuffer::WriteU32(uint32_t data) [member function] + cls.add_method('WriteU32', + 'void', + [param('uint32_t', 'data')]) + ## tag-buffer.h: void ns3::TagBuffer::WriteU64(uint64_t v) [member function] + cls.add_method('WriteU64', + 'void', + [param('uint64_t', 'v')]) + ## tag-buffer.h: void ns3::TagBuffer::WriteU8(uint8_t v) [member function] + cls.add_method('WriteU8', + 'void', + [param('uint8_t', 'v')]) + return + +def register_Ns3AsciiWriter_methods(root_module, cls): + ## ascii-writer.h: ns3::AsciiWriter::AsciiWriter(ns3::AsciiWriter const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AsciiWriter const &', 'arg0')]) + ## ascii-writer.h: static ns3::Ptr ns3::AsciiWriter::Get(std::ostream & os) [member function] + cls.add_method('Get', + 'ns3::Ptr< ns3::AsciiWriter >', + [param('std::ostream &', 'os')], + is_static=True) + ## ascii-writer.h: void ns3::AsciiWriter::WritePacket(ns3::AsciiWriter::Type type, std::string message, ns3::Ptr p) [member function] + cls.add_method('WritePacket', + 'void', + [param('ns3::AsciiWriter::Type', 'type'), param('std::string', 'message'), param('ns3::Ptr< ns3::Packet const >', 'p')]) + return + +def register_Ns3Chunk_methods(root_module, cls): + ## chunk.h: ns3::Chunk::Chunk() [constructor] + cls.add_constructor([]) + ## chunk.h: ns3::Chunk::Chunk(ns3::Chunk const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Chunk const &', 'arg0')]) + ## chunk.h: uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_virtual=True) + ## chunk.h: static ns3::TypeId ns3::Chunk::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## chunk.h: void ns3::Chunk::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3DataRateChecker_methods(root_module, cls): + ## data-rate.h: ns3::DataRateChecker::DataRateChecker() [constructor] + cls.add_constructor([]) + ## data-rate.h: ns3::DataRateChecker::DataRateChecker(ns3::DataRateChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DataRateChecker const &', 'arg0')]) + return + +def register_Ns3DataRateValue_methods(root_module, cls): + ## data-rate.h: ns3::DataRateValue::DataRateValue() [constructor] + cls.add_constructor([]) + ## data-rate.h: ns3::DataRateValue::DataRateValue(ns3::DataRateValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DataRateValue const &', 'arg0')]) + ## data-rate.h: ns3::DataRateValue::DataRateValue(ns3::DataRate const & value) [constructor] + cls.add_constructor([param('ns3::DataRate const &', 'value')]) + ## data-rate.h: ns3::Ptr ns3::DataRateValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## data-rate.h: bool ns3::DataRateValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## data-rate.h: ns3::DataRate ns3::DataRateValue::Get() const [member function] + cls.add_method('Get', + 'ns3::DataRate', + [], + is_const=True) + ## data-rate.h: std::string ns3::DataRateValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## data-rate.h: void ns3::DataRateValue::Set(ns3::DataRate const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::DataRate const &', 'value')]) + return + +def register_Ns3Header_methods(root_module, cls): + cls.add_output_stream_operator() + ## header.h: ns3::Header::Header() [constructor] + cls.add_constructor([]) + ## header.h: ns3::Header::Header(ns3::Header const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Header const &', 'arg0')]) + ## header.h: uint32_t ns3::Header::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_virtual=True) + ## header.h: uint32_t ns3::Header::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## header.h: static ns3::TypeId ns3::Header::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## header.h: void ns3::Header::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## header.h: void ns3::Header::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3PcapWriter_methods(root_module, cls): + ## pcap-writer.h: ns3::PcapWriter::PcapWriter(ns3::PcapWriter const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapWriter const &', 'arg0')]) + ## pcap-writer.h: ns3::PcapWriter::PcapWriter() [constructor] + cls.add_constructor([]) + ## pcap-writer.h: static ns3::TypeId ns3::PcapWriter::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## pcap-writer.h: void ns3::PcapWriter::Open(std::string const & name) [member function] + cls.add_method('Open', + 'void', + [param('std::string const &', 'name')]) + ## pcap-writer.h: void ns3::PcapWriter::SetCaptureSize(uint32_t size) [member function] + cls.add_method('SetCaptureSize', + 'void', + [param('uint32_t', 'size')]) + ## pcap-writer.h: void ns3::PcapWriter::WriteEthernetHeader() [member function] + cls.add_method('WriteEthernetHeader', + 'void', + []) + ## pcap-writer.h: void ns3::PcapWriter::WriteIpHeader() [member function] + cls.add_method('WriteIpHeader', + 'void', + []) + ## pcap-writer.h: void ns3::PcapWriter::WritePacket(ns3::Ptr packet) [member function] + cls.add_method('WritePacket', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## pcap-writer.h: void ns3::PcapWriter::WritePppHeader() [member function] + cls.add_method('WritePppHeader', + 'void', + []) + ## pcap-writer.h: void ns3::PcapWriter::WriteWifiHeader() [member function] + cls.add_method('WriteWifiHeader', + 'void', + []) + ## pcap-writer.h: void ns3::PcapWriter::WriteWifiMonitorPacket(ns3::Ptr packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm) [member function] + cls.add_method('WriteWifiMonitorPacket', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('bool', 'isTx'), param('double', 'signalDbm'), param('double', 'noiseDbm')]) + ## pcap-writer.h: void ns3::PcapWriter::WriteWifiPrismHeader() [member function] + cls.add_method('WriteWifiPrismHeader', + 'void', + []) + ## pcap-writer.h: void ns3::PcapWriter::WriteWifiRadiotapHeader() [member function] + cls.add_method('WriteWifiRadiotapHeader', + 'void', + []) + return + +def register_Ns3Trailer_methods(root_module, cls): + cls.add_output_stream_operator() + ## trailer.h: ns3::Trailer::Trailer() [constructor] + cls.add_constructor([]) + ## trailer.h: ns3::Trailer::Trailer(ns3::Trailer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Trailer const &', 'arg0')]) + ## trailer.h: uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator end) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'end')], + is_pure_virtual=True, is_virtual=True) + ## trailer.h: uint32_t ns3::Trailer::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## trailer.h: static ns3::TypeId ns3::Trailer::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## trailer.h: void ns3::Trailer::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## trailer.h: void ns3::Trailer::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3ErrorModel_methods(root_module, cls): + ## error-model.h: ns3::ErrorModel::ErrorModel(ns3::ErrorModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ErrorModel const &', 'arg0')]) + ## error-model.h: ns3::ErrorModel::ErrorModel() [constructor] + cls.add_constructor([]) + ## error-model.h: void ns3::ErrorModel::Disable() [member function] + cls.add_method('Disable', + 'void', + []) + ## error-model.h: void ns3::ErrorModel::Enable() [member function] + cls.add_method('Enable', + 'void', + []) + ## error-model.h: static ns3::TypeId ns3::ErrorModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## error-model.h: bool ns3::ErrorModel::IsCorrupt(ns3::Ptr pkt) [member function] + cls.add_method('IsCorrupt', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'pkt')]) + ## error-model.h: bool ns3::ErrorModel::IsEnabled() const [member function] + cls.add_method('IsEnabled', + 'bool', + [], + is_const=True) + ## error-model.h: void ns3::ErrorModel::Reset() [member function] + cls.add_method('Reset', + 'void', + []) + ## error-model.h: bool ns3::ErrorModel::DoCorrupt(ns3::Ptr arg0) [member function] + cls.add_method('DoCorrupt', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'arg0')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## error-model.h: void ns3::ErrorModel::DoReset() [member function] + cls.add_method('DoReset', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3ListErrorModel_methods(root_module, cls): + ## error-model.h: ns3::ListErrorModel::ListErrorModel(ns3::ListErrorModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ListErrorModel const &', 'arg0')]) + ## error-model.h: ns3::ListErrorModel::ListErrorModel() [constructor] + cls.add_constructor([]) + ## error-model.h: std::list > ns3::ListErrorModel::GetList() const [member function] + cls.add_method('GetList', + 'std::list< unsigned int >', + [], + is_const=True) + ## error-model.h: static ns3::TypeId ns3::ListErrorModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## error-model.h: void ns3::ListErrorModel::SetList(std::list > const & packetlist) [member function] + cls.add_method('SetList', + 'void', + [param('std::list< unsigned int > const &', 'packetlist')]) + ## error-model.h: bool ns3::ListErrorModel::DoCorrupt(ns3::Ptr p) [member function] + cls.add_method('DoCorrupt', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + visibility='private', is_virtual=True) + ## error-model.h: void ns3::ListErrorModel::DoReset() [member function] + cls.add_method('DoReset', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3NixVector_methods(root_module, cls): + cls.add_output_stream_operator() + ## nix-vector.h: ns3::NixVector::NixVector() [constructor] + cls.add_constructor([]) + ## nix-vector.h: ns3::NixVector::NixVector(ns3::NixVector const & o) [copy constructor] + cls.add_constructor([param('ns3::NixVector const &', 'o')]) + ## nix-vector.h: void ns3::NixVector::AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits) [member function] + cls.add_method('AddNeighborIndex', + 'void', + [param('uint32_t', 'newBits'), param('uint32_t', 'numberOfBits')]) + ## nix-vector.h: uint32_t ns3::NixVector::BitCount(uint32_t numberOfNeighbors) const [member function] + cls.add_method('BitCount', + 'uint32_t', + [param('uint32_t', 'numberOfNeighbors')], + is_const=True) + ## nix-vector.h: ns3::Ptr ns3::NixVector::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::NixVector >', + [], + is_const=True) + ## nix-vector.h: uint32_t ns3::NixVector::Deserialize(ns3::Buffer::Iterator i) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'i')]) + ## nix-vector.h: void ns3::NixVector::DumpNixVector(std::ostream & os) const [member function] + cls.add_method('DumpNixVector', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## nix-vector.h: uint32_t ns3::NixVector::ExtractNeighborIndex(uint32_t numberOfBits) [member function] + cls.add_method('ExtractNeighborIndex', + 'uint32_t', + [param('uint32_t', 'numberOfBits')]) + ## nix-vector.h: uint32_t ns3::NixVector::GetRemainingBits() [member function] + cls.add_method('GetRemainingBits', + 'uint32_t', + []) + ## nix-vector.h: uint32_t ns3::NixVector::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## nix-vector.h: static ns3::TypeId ns3::NixVector::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## nix-vector.h: void ns3::NixVector::Serialize(ns3::Buffer::Iterator i, uint32_t size) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'i'), param('uint32_t', 'size')], + is_const=True) + return + +def register_Ns3RateErrorModel_methods(root_module, cls): + ## error-model.h: ns3::RateErrorModel::RateErrorModel(ns3::RateErrorModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RateErrorModel const &', 'arg0')]) + ## error-model.h: ns3::RateErrorModel::RateErrorModel() [constructor] + cls.add_constructor([]) + ## error-model.h: double ns3::RateErrorModel::GetRate() const [member function] + cls.add_method('GetRate', + 'double', + [], + is_const=True) + ## error-model.h: static ns3::TypeId ns3::RateErrorModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## error-model.h: ns3::ErrorUnit ns3::RateErrorModel::GetUnit() const [member function] + cls.add_method('GetUnit', + 'ns3::ErrorUnit', + [], + is_const=True) + ## error-model.h: void ns3::RateErrorModel::SetRandomVariable(ns3::RandomVariable const & ranvar) [member function] + cls.add_method('SetRandomVariable', + 'void', + [param('ns3::RandomVariable const &', 'ranvar')]) + ## error-model.h: void ns3::RateErrorModel::SetRate(double rate) [member function] + cls.add_method('SetRate', + 'void', + [param('double', 'rate')]) + ## error-model.h: void ns3::RateErrorModel::SetUnit(ns3::ErrorUnit error_unit) [member function] + cls.add_method('SetUnit', + 'void', + [param('ns3::ErrorUnit', 'error_unit')]) + ## error-model.h: bool ns3::RateErrorModel::DoCorrupt(ns3::Ptr p) [member function] + cls.add_method('DoCorrupt', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + visibility='private', is_virtual=True) + ## error-model.h: bool ns3::RateErrorModel::DoCorruptBit(ns3::Ptr p) [member function] + cls.add_method('DoCorruptBit', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + visibility='private', is_virtual=True) + ## error-model.h: bool ns3::RateErrorModel::DoCorruptByte(ns3::Ptr p) [member function] + cls.add_method('DoCorruptByte', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + visibility='private', is_virtual=True) + ## error-model.h: bool ns3::RateErrorModel::DoCorruptPkt(ns3::Ptr p) [member function] + cls.add_method('DoCorruptPkt', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + visibility='private', is_virtual=True) + ## error-model.h: void ns3::RateErrorModel::DoReset() [member function] + cls.add_method('DoReset', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + ## data-rate.h: extern ns3::Ptr ns3::MakeDataRateChecker() [free function] + module.add_function('MakeDataRateChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_contrib.py b/bindings/python/apidefs/gcc-LP64/ns3_module_contrib.py new file mode 100644 index 000000000..e953c1869 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_contrib.py @@ -0,0 +1,530 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## delay-jitter-estimation.h: ns3::DelayJitterEstimation [class] + module.add_class('DelayJitterEstimation') + ## event-garbage-collector.h: ns3::EventGarbageCollector [class] + module.add_class('EventGarbageCollector') + ## file-config.h: ns3::FileConfig [class] + module.add_class('FileConfig', allow_subclassing=True) + ## gnuplot.h: ns3::Gnuplot [class] + module.add_class('Gnuplot') + ## gnuplot.h: ns3::GnuplotCollection [class] + module.add_class('GnuplotCollection') + ## gnuplot.h: ns3::GnuplotDataset [class] + module.add_class('GnuplotDataset') + ## gtk-config-store.h: ns3::GtkConfigStore [class] + module.add_class('GtkConfigStore') + ## file-config.h: ns3::NoneFileConfig [class] + module.add_class('NoneFileConfig', parent=root_module['ns3::FileConfig']) + ## config-store.h: ns3::ConfigStore [class] + module.add_class('ConfigStore', parent=root_module['ns3::ObjectBase']) + ## config-store.h: ns3::ConfigStore::Mode [enumeration] + module.add_enum('Mode', ['LOAD', 'SAVE', 'NONE'], outer_class=root_module['ns3::ConfigStore']) + ## config-store.h: ns3::ConfigStore::FileFormat [enumeration] + module.add_enum('FileFormat', ['XML', 'RAW_TEXT'], outer_class=root_module['ns3::ConfigStore']) + ## flow-id-tag.h: ns3::FlowIdTag [class] + module.add_class('FlowIdTag', parent=root_module['ns3::Tag']) + ## gnuplot.h: ns3::Gnuplot2dDataset [class] + module.add_class('Gnuplot2dDataset', parent=root_module['ns3::GnuplotDataset']) + ## gnuplot.h: ns3::Gnuplot2dDataset::Style [enumeration] + module.add_enum('Style', ['LINES', 'POINTS', 'LINES_POINTS', 'DOTS', 'IMPULSES', 'STEPS', 'FSTEPS', 'HISTEPS'], outer_class=root_module['ns3::Gnuplot2dDataset']) + ## gnuplot.h: ns3::Gnuplot2dDataset::ErrorBars [enumeration] + module.add_enum('ErrorBars', ['NONE', 'X', 'Y', 'XY'], outer_class=root_module['ns3::Gnuplot2dDataset']) + ## gnuplot.h: ns3::Gnuplot2dFunction [class] + module.add_class('Gnuplot2dFunction', parent=root_module['ns3::GnuplotDataset']) + ## gnuplot.h: ns3::Gnuplot3dDataset [class] + module.add_class('Gnuplot3dDataset', parent=root_module['ns3::GnuplotDataset']) + ## gnuplot.h: ns3::Gnuplot3dFunction [class] + module.add_class('Gnuplot3dFunction', parent=root_module['ns3::GnuplotDataset']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3DelayJitterEstimation_methods(root_module, root_module['ns3::DelayJitterEstimation']) + register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector']) + register_Ns3FileConfig_methods(root_module, root_module['ns3::FileConfig']) + register_Ns3Gnuplot_methods(root_module, root_module['ns3::Gnuplot']) + register_Ns3GnuplotCollection_methods(root_module, root_module['ns3::GnuplotCollection']) + register_Ns3GnuplotDataset_methods(root_module, root_module['ns3::GnuplotDataset']) + register_Ns3GtkConfigStore_methods(root_module, root_module['ns3::GtkConfigStore']) + register_Ns3NoneFileConfig_methods(root_module, root_module['ns3::NoneFileConfig']) + register_Ns3ConfigStore_methods(root_module, root_module['ns3::ConfigStore']) + register_Ns3FlowIdTag_methods(root_module, root_module['ns3::FlowIdTag']) + register_Ns3Gnuplot2dDataset_methods(root_module, root_module['ns3::Gnuplot2dDataset']) + register_Ns3Gnuplot2dFunction_methods(root_module, root_module['ns3::Gnuplot2dFunction']) + register_Ns3Gnuplot3dDataset_methods(root_module, root_module['ns3::Gnuplot3dDataset']) + register_Ns3Gnuplot3dFunction_methods(root_module, root_module['ns3::Gnuplot3dFunction']) + return + +def register_Ns3DelayJitterEstimation_methods(root_module, cls): + ## delay-jitter-estimation.h: ns3::DelayJitterEstimation::DelayJitterEstimation(ns3::DelayJitterEstimation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DelayJitterEstimation const &', 'arg0')]) + ## delay-jitter-estimation.h: ns3::DelayJitterEstimation::DelayJitterEstimation() [constructor] + cls.add_constructor([]) + ## delay-jitter-estimation.h: ns3::Time ns3::DelayJitterEstimation::GetLastDelay() const [member function] + cls.add_method('GetLastDelay', + 'ns3::Time', + [], + is_const=True) + ## delay-jitter-estimation.h: ns3::Time ns3::DelayJitterEstimation::GetLastJitter() const [member function] + cls.add_method('GetLastJitter', + 'ns3::Time', + [], + is_const=True) + ## delay-jitter-estimation.h: static void ns3::DelayJitterEstimation::PrepareTx(ns3::Ptr packet) [member function] + cls.add_method('PrepareTx', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')], + is_static=True) + ## delay-jitter-estimation.h: void ns3::DelayJitterEstimation::RecordRx(ns3::Ptr packet) [member function] + cls.add_method('RecordRx', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + return + +def register_Ns3EventGarbageCollector_methods(root_module, cls): + ## event-garbage-collector.h: ns3::EventGarbageCollector::EventGarbageCollector(ns3::EventGarbageCollector const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EventGarbageCollector const &', 'arg0')]) + ## event-garbage-collector.h: ns3::EventGarbageCollector::EventGarbageCollector() [constructor] + cls.add_constructor([]) + ## event-garbage-collector.h: void ns3::EventGarbageCollector::Track(ns3::EventId event) [member function] + cls.add_method('Track', + 'void', + [param('ns3::EventId', 'event')]) + return + +def register_Ns3FileConfig_methods(root_module, cls): + ## file-config.h: ns3::FileConfig::FileConfig() [constructor] + cls.add_constructor([]) + ## file-config.h: ns3::FileConfig::FileConfig(ns3::FileConfig const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FileConfig const &', 'arg0')]) + ## file-config.h: void ns3::FileConfig::Attributes() [member function] + cls.add_method('Attributes', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## file-config.h: void ns3::FileConfig::Default() [member function] + cls.add_method('Default', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## file-config.h: void ns3::FileConfig::Global() [member function] + cls.add_method('Global', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## file-config.h: void ns3::FileConfig::SetFilename(std::string filename) [member function] + cls.add_method('SetFilename', + 'void', + [param('std::string', 'filename')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3Gnuplot_methods(root_module, cls): + ## gnuplot.h: ns3::Gnuplot::Gnuplot(ns3::Gnuplot const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Gnuplot const &', 'arg0')]) + ## gnuplot.h: ns3::Gnuplot::Gnuplot(std::string const & outputFilename="", std::string const & title="") [constructor] + cls.add_constructor([param('std::string const &', 'outputFilename', default_value='""'), param('std::string const &', 'title', default_value='""')]) + ## gnuplot.h: void ns3::Gnuplot::AddDataset(ns3::GnuplotDataset const & dataset) [member function] + cls.add_method('AddDataset', + 'void', + [param('ns3::GnuplotDataset const &', 'dataset')]) + ## gnuplot.h: void ns3::Gnuplot::AppendExtra(std::string const & extra) [member function] + cls.add_method('AppendExtra', + 'void', + [param('std::string const &', 'extra')]) + ## gnuplot.h: static std::string ns3::Gnuplot::DetectTerminal(std::string const & filename) [member function] + cls.add_method('DetectTerminal', + 'std::string', + [param('std::string const &', 'filename')], + is_static=True) + ## gnuplot.h: void ns3::Gnuplot::GenerateOutput(std::ostream & os) const [member function] + cls.add_method('GenerateOutput', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## gnuplot.h: void ns3::Gnuplot::SetExtra(std::string const & extra) [member function] + cls.add_method('SetExtra', + 'void', + [param('std::string const &', 'extra')]) + ## gnuplot.h: void ns3::Gnuplot::SetLegend(std::string const & xLegend, std::string const & yLegend) [member function] + cls.add_method('SetLegend', + 'void', + [param('std::string const &', 'xLegend'), param('std::string const &', 'yLegend')]) + ## gnuplot.h: void ns3::Gnuplot::SetTerminal(std::string const & terminal) [member function] + cls.add_method('SetTerminal', + 'void', + [param('std::string const &', 'terminal')]) + ## gnuplot.h: void ns3::Gnuplot::SetTitle(std::string const & title) [member function] + cls.add_method('SetTitle', + 'void', + [param('std::string const &', 'title')]) + return + +def register_Ns3GnuplotCollection_methods(root_module, cls): + ## gnuplot.h: ns3::GnuplotCollection::GnuplotCollection(ns3::GnuplotCollection const & arg0) [copy constructor] + cls.add_constructor([param('ns3::GnuplotCollection const &', 'arg0')]) + ## gnuplot.h: ns3::GnuplotCollection::GnuplotCollection(std::string const & outputFilename) [constructor] + cls.add_constructor([param('std::string const &', 'outputFilename')]) + ## gnuplot.h: void ns3::GnuplotCollection::AddPlot(ns3::Gnuplot const & plot) [member function] + cls.add_method('AddPlot', + 'void', + [param('ns3::Gnuplot const &', 'plot')]) + ## gnuplot.h: void ns3::GnuplotCollection::GenerateOutput(std::ostream & os) const [member function] + cls.add_method('GenerateOutput', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## gnuplot.h: ns3::Gnuplot & ns3::GnuplotCollection::GetPlot(unsigned int id) [member function] + cls.add_method('GetPlot', + 'ns3::Gnuplot &', + [param('unsigned int', 'id')]) + ## gnuplot.h: void ns3::GnuplotCollection::SetTerminal(std::string const & terminal) [member function] + cls.add_method('SetTerminal', + 'void', + [param('std::string const &', 'terminal')]) + return + +def register_Ns3GnuplotDataset_methods(root_module, cls): + ## gnuplot.h: ns3::GnuplotDataset::GnuplotDataset(ns3::GnuplotDataset const & original) [copy constructor] + cls.add_constructor([param('ns3::GnuplotDataset const &', 'original')]) + ## gnuplot.h: static void ns3::GnuplotDataset::SetDefaultExtra(std::string const & extra) [member function] + cls.add_method('SetDefaultExtra', + 'void', + [param('std::string const &', 'extra')], + is_static=True) + ## gnuplot.h: void ns3::GnuplotDataset::SetExtra(std::string const & extra) [member function] + cls.add_method('SetExtra', + 'void', + [param('std::string const &', 'extra')]) + ## gnuplot.h: void ns3::GnuplotDataset::SetTitle(std::string const & title) [member function] + cls.add_method('SetTitle', + 'void', + [param('std::string const &', 'title')]) + ## gnuplot.h: ns3::GnuplotDataset::GnuplotDataset(ns3::GnuplotDataset::Data * data) [constructor] + cls.add_constructor([param('ns3::GnuplotDataset::Data *', 'data')], + visibility='protected') + return + +def register_Ns3GtkConfigStore_methods(root_module, cls): + ## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore(ns3::GtkConfigStore const & arg0) [copy constructor] + cls.add_constructor([param('ns3::GtkConfigStore const &', 'arg0')]) + ## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore() [constructor] + cls.add_constructor([]) + ## gtk-config-store.h: void ns3::GtkConfigStore::ConfigureAttributes() [member function] + cls.add_method('ConfigureAttributes', + 'void', + []) + ## gtk-config-store.h: void ns3::GtkConfigStore::ConfigureDefaults() [member function] + cls.add_method('ConfigureDefaults', + 'void', + []) + return + +def register_Ns3NoneFileConfig_methods(root_module, cls): + ## file-config.h: ns3::NoneFileConfig::NoneFileConfig(ns3::NoneFileConfig const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NoneFileConfig const &', 'arg0')]) + ## file-config.h: ns3::NoneFileConfig::NoneFileConfig() [constructor] + cls.add_constructor([]) + ## file-config.h: void ns3::NoneFileConfig::Attributes() [member function] + cls.add_method('Attributes', + 'void', + [], + is_virtual=True) + ## file-config.h: void ns3::NoneFileConfig::Default() [member function] + cls.add_method('Default', + 'void', + [], + is_virtual=True) + ## file-config.h: void ns3::NoneFileConfig::Global() [member function] + cls.add_method('Global', + 'void', + [], + is_virtual=True) + ## file-config.h: void ns3::NoneFileConfig::SetFilename(std::string filename) [member function] + cls.add_method('SetFilename', + 'void', + [param('std::string', 'filename')], + is_virtual=True) + return + +def register_Ns3ConfigStore_methods(root_module, cls): + ## config-store.h: ns3::ConfigStore::ConfigStore(ns3::ConfigStore const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConfigStore const &', 'arg0')]) + ## config-store.h: ns3::ConfigStore::ConfigStore() [constructor] + cls.add_constructor([]) + ## config-store.h: void ns3::ConfigStore::ConfigureAttributes() [member function] + cls.add_method('ConfigureAttributes', + 'void', + []) + ## config-store.h: void ns3::ConfigStore::ConfigureDefaults() [member function] + cls.add_method('ConfigureDefaults', + 'void', + []) + ## config-store.h: ns3::TypeId ns3::ConfigStore::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## config-store.h: static ns3::TypeId ns3::ConfigStore::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## config-store.h: void ns3::ConfigStore::SetFileFormat(ns3::ConfigStore::FileFormat format) [member function] + cls.add_method('SetFileFormat', + 'void', + [param('ns3::ConfigStore::FileFormat', 'format')]) + ## config-store.h: void ns3::ConfigStore::SetFilename(std::string filename) [member function] + cls.add_method('SetFilename', + 'void', + [param('std::string', 'filename')]) + ## config-store.h: void ns3::ConfigStore::SetMode(ns3::ConfigStore::Mode mode) [member function] + cls.add_method('SetMode', + 'void', + [param('ns3::ConfigStore::Mode', 'mode')]) + return + +def register_Ns3FlowIdTag_methods(root_module, cls): + ## flow-id-tag.h: ns3::FlowIdTag::FlowIdTag(ns3::FlowIdTag const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowIdTag const &', 'arg0')]) + ## flow-id-tag.h: ns3::FlowIdTag::FlowIdTag() [constructor] + cls.add_constructor([]) + ## flow-id-tag.h: ns3::FlowIdTag::FlowIdTag(uint32_t flowId) [constructor] + cls.add_constructor([param('uint32_t', 'flowId')]) + ## flow-id-tag.h: static uint32_t ns3::FlowIdTag::AllocateFlowId() [member function] + cls.add_method('AllocateFlowId', + 'uint32_t', + [], + is_static=True) + ## flow-id-tag.h: void ns3::FlowIdTag::Deserialize(ns3::TagBuffer buf) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'buf')], + is_virtual=True) + ## flow-id-tag.h: uint32_t ns3::FlowIdTag::GetFlowId() const [member function] + cls.add_method('GetFlowId', + 'uint32_t', + [], + is_const=True) + ## flow-id-tag.h: ns3::TypeId ns3::FlowIdTag::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## flow-id-tag.h: uint32_t ns3::FlowIdTag::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## flow-id-tag.h: static ns3::TypeId ns3::FlowIdTag::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flow-id-tag.h: void ns3::FlowIdTag::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## flow-id-tag.h: void ns3::FlowIdTag::Serialize(ns3::TagBuffer buf) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'buf')], + is_const=True, is_virtual=True) + ## flow-id-tag.h: void ns3::FlowIdTag::SetFlowId(uint32_t flowId) [member function] + cls.add_method('SetFlowId', + 'void', + [param('uint32_t', 'flowId')]) + return + +def register_Ns3Gnuplot2dDataset_methods(root_module, cls): + ## gnuplot.h: ns3::Gnuplot2dDataset::Gnuplot2dDataset(ns3::Gnuplot2dDataset const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Gnuplot2dDataset const &', 'arg0')]) + ## gnuplot.h: ns3::Gnuplot2dDataset::Gnuplot2dDataset(std::string const & title="Untitled") [constructor] + cls.add_constructor([param('std::string const &', 'title', default_value='"Untitled"')]) + ## gnuplot.h: void ns3::Gnuplot2dDataset::Add(double x, double y) [member function] + cls.add_method('Add', + 'void', + [param('double', 'x'), param('double', 'y')]) + ## gnuplot.h: void ns3::Gnuplot2dDataset::Add(double x, double y, double errorDelta) [member function] + cls.add_method('Add', + 'void', + [param('double', 'x'), param('double', 'y'), param('double', 'errorDelta')]) + ## gnuplot.h: void ns3::Gnuplot2dDataset::Add(double x, double y, double minY, double maxY) [member function] + cls.add_method('Add', + 'void', + [param('double', 'x'), param('double', 'y'), param('double', 'minY'), param('double', 'maxY')]) + ## gnuplot.h: void ns3::Gnuplot2dDataset::AddEmptyLine() [member function] + cls.add_method('AddEmptyLine', + 'void', + []) + ## gnuplot.h: static void ns3::Gnuplot2dDataset::SetDefaultErrorBars(ns3::Gnuplot2dDataset::ErrorBars errorBars) [member function] + cls.add_method('SetDefaultErrorBars', + 'void', + [param('ns3::Gnuplot2dDataset::ErrorBars', 'errorBars')], + is_static=True) + ## gnuplot.h: static void ns3::Gnuplot2dDataset::SetDefaultStyle(ns3::Gnuplot2dDataset::Style style) [member function] + cls.add_method('SetDefaultStyle', + 'void', + [param('ns3::Gnuplot2dDataset::Style', 'style')], + is_static=True) + ## gnuplot.h: void ns3::Gnuplot2dDataset::SetErrorBars(ns3::Gnuplot2dDataset::ErrorBars errorBars) [member function] + cls.add_method('SetErrorBars', + 'void', + [param('ns3::Gnuplot2dDataset::ErrorBars', 'errorBars')]) + ## gnuplot.h: void ns3::Gnuplot2dDataset::SetStyle(ns3::Gnuplot2dDataset::Style style) [member function] + cls.add_method('SetStyle', + 'void', + [param('ns3::Gnuplot2dDataset::Style', 'style')]) + return + +def register_Ns3Gnuplot2dFunction_methods(root_module, cls): + ## gnuplot.h: ns3::Gnuplot2dFunction::Gnuplot2dFunction(ns3::Gnuplot2dFunction const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Gnuplot2dFunction const &', 'arg0')]) + ## gnuplot.h: ns3::Gnuplot2dFunction::Gnuplot2dFunction(std::string const & title="Untitled", std::string const & function="") [constructor] + cls.add_constructor([param('std::string const &', 'title', default_value='"Untitled"'), param('std::string const &', 'function', default_value='""')]) + ## gnuplot.h: void ns3::Gnuplot2dFunction::SetFunction(std::string const & function) [member function] + cls.add_method('SetFunction', + 'void', + [param('std::string const &', 'function')]) + return + +def register_Ns3Gnuplot3dDataset_methods(root_module, cls): + ## gnuplot.h: ns3::Gnuplot3dDataset::Gnuplot3dDataset(ns3::Gnuplot3dDataset const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Gnuplot3dDataset const &', 'arg0')]) + ## gnuplot.h: ns3::Gnuplot3dDataset::Gnuplot3dDataset(std::string const & title="Untitled") [constructor] + cls.add_constructor([param('std::string const &', 'title', default_value='"Untitled"')]) + ## gnuplot.h: void ns3::Gnuplot3dDataset::Add(double x, double y, double z) [member function] + cls.add_method('Add', + 'void', + [param('double', 'x'), param('double', 'y'), param('double', 'z')]) + ## gnuplot.h: void ns3::Gnuplot3dDataset::AddEmptyLine() [member function] + cls.add_method('AddEmptyLine', + 'void', + []) + ## gnuplot.h: static void ns3::Gnuplot3dDataset::SetDefaultStyle(std::string const & style) [member function] + cls.add_method('SetDefaultStyle', + 'void', + [param('std::string const &', 'style')], + is_static=True) + ## gnuplot.h: void ns3::Gnuplot3dDataset::SetStyle(std::string const & style) [member function] + cls.add_method('SetStyle', + 'void', + [param('std::string const &', 'style')]) + return + +def register_Ns3Gnuplot3dFunction_methods(root_module, cls): + ## gnuplot.h: ns3::Gnuplot3dFunction::Gnuplot3dFunction(ns3::Gnuplot3dFunction const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Gnuplot3dFunction const &', 'arg0')]) + ## gnuplot.h: ns3::Gnuplot3dFunction::Gnuplot3dFunction(std::string const & title="Untitled", std::string const & function="") [constructor] + cls.add_constructor([param('std::string const &', 'title', default_value='"Untitled"'), param('std::string const &', 'function', default_value='""')]) + ## gnuplot.h: void ns3::Gnuplot3dFunction::SetFunction(std::string const & function) [member function] + cls.add_method('SetFunction', + 'void', + [param('std::string const &', 'function')]) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_core.py b/bindings/python/apidefs/gcc-LP64/ns3_module_core.py new file mode 100644 index 000000000..7203fa363 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_core.py @@ -0,0 +1,2779 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## log.h: ns3::LogLevel [enumeration] + module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME']) + ## attribute-list.h: ns3::AttributeList [class] + module.add_class('AttributeList') + ## callback.h: ns3::CallbackBase [class] + module.add_class('CallbackBase') + ## callback.h: ns3::CallbackImplBase [class] + module.add_class('CallbackImplBase', allow_subclassing=True, memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) + ## command-line.h: ns3::CommandLine [class] + module.add_class('CommandLine', allow_subclassing=True) + ## system-mutex.h: ns3::CriticalSection [class] + module.add_class('CriticalSection') + ## global-value.h: ns3::GlobalValue [class] + module.add_class('GlobalValue') + ## int-to-type.h: ns3::IntToType<0> [struct] + module.add_class('IntToType', template_parameters=['0']) + ## int-to-type.h: ns3::IntToType<0>::v_e [enumeration] + module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 0 >']) + ## int-to-type.h: ns3::IntToType<1> [struct] + module.add_class('IntToType', template_parameters=['1']) + ## int-to-type.h: ns3::IntToType<1>::v_e [enumeration] + module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 1 >']) + ## int-to-type.h: ns3::IntToType<2> [struct] + module.add_class('IntToType', template_parameters=['2']) + ## int-to-type.h: ns3::IntToType<2>::v_e [enumeration] + module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 2 >']) + ## int-to-type.h: ns3::IntToType<3> [struct] + module.add_class('IntToType', template_parameters=['3']) + ## int-to-type.h: ns3::IntToType<3>::v_e [enumeration] + module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 3 >']) + ## int-to-type.h: ns3::IntToType<4> [struct] + module.add_class('IntToType', template_parameters=['4']) + ## int-to-type.h: ns3::IntToType<4>::v_e [enumeration] + module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 4 >']) + ## int-to-type.h: ns3::IntToType<5> [struct] + module.add_class('IntToType', template_parameters=['5']) + ## int-to-type.h: ns3::IntToType<5>::v_e [enumeration] + module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 5 >']) + ## int-to-type.h: ns3::IntToType<6> [struct] + module.add_class('IntToType', template_parameters=['6']) + ## int-to-type.h: ns3::IntToType<6>::v_e [enumeration] + module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 6 >']) + ## names.h: ns3::Names [class] + module.add_class('Names') + ## object-base.h: ns3::ObjectBase [class] + module.add_class('ObjectBase', allow_subclassing=True) + ## object-factory.h: ns3::ObjectFactory [class] + module.add_class('ObjectFactory') + ## random-variable.h: ns3::RandomVariable [class] + module.add_class('RandomVariable') + ## ref-count-base.h: ns3::RefCountBase [class] + module.add_class('RefCountBase', automatic_type_narrowing=True, memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) + ## rng-stream.h: ns3::RngStream [class] + module.add_class('RngStream') + ## random-variable.h: ns3::SeedManager [class] + module.add_class('SeedManager') + ## random-variable.h: ns3::SequentialVariable [class] + module.add_class('SequentialVariable', parent=root_module['ns3::RandomVariable']) + ## system-condition.h: ns3::SystemCondition [class] + module.add_class('SystemCondition') + ## system-mutex.h: ns3::SystemMutex [class] + module.add_class('SystemMutex') + ## system-thread.h: ns3::SystemThread [class] + module.add_class('SystemThread') + ## system-wall-clock-ms.h: ns3::SystemWallClockMs [class] + module.add_class('SystemWallClockMs') + ## test.h: ns3::TestCase [class] + module.add_class('TestCase', allow_subclassing=True) + ## test.h: ns3::TestRunner [class] + module.add_class('TestRunner') + ## test.h: ns3::TestSuite [class] + module.add_class('TestSuite', allow_subclassing=True) + ## test.h: ns3::TestSuite::TestType [enumeration] + module.add_enum('TestType', ['BVT', 'UNIT', 'SYSTEM', 'EXAMPLE', 'PERFORMANCE'], outer_class=root_module['ns3::TestSuite']) + ## trace-source-accessor.h: ns3::TraceSourceAccessor [class] + module.add_class('TraceSourceAccessor', allow_subclassing=True) + ## random-variable.h: ns3::TriangularVariable [class] + module.add_class('TriangularVariable', parent=root_module['ns3::RandomVariable']) + ## type-id.h: ns3::TypeId [class] + module.add_class('TypeId') + ## type-id.h: ns3::TypeId::AttributeFlag [enumeration] + module.add_enum('AttributeFlag', ['ATTR_GET', 'ATTR_SET', 'ATTR_CONSTRUCT', 'ATTR_SGC'], outer_class=root_module['ns3::TypeId']) + ## type-id.h: ns3::TypeId::AttributeInfo [struct] + module.add_class('AttributeInfo', outer_class=root_module['ns3::TypeId']) + ## random-variable.h: ns3::UniformVariable [class] + module.add_class('UniformVariable', parent=root_module['ns3::RandomVariable']) + ## attribute-list.h: ns3::UnsafeAttributeList [class] + module.add_class('UnsafeAttributeList') + ## vector.h: ns3::Vector2D [class] + module.add_class('Vector2D') + ## vector.h: ns3::Vector3D [class] + module.add_class('Vector3D') + ## random-variable.h: ns3::WeibullVariable [class] + module.add_class('WeibullVariable', parent=root_module['ns3::RandomVariable']) + ## random-variable.h: ns3::ZipfVariable [class] + module.add_class('ZipfVariable', parent=root_module['ns3::RandomVariable']) + ## empty.h: ns3::empty [class] + module.add_class('empty') + ## attribute.h: ns3::AttributeAccessor [class] + module.add_class('AttributeAccessor', parent=root_module['ns3::RefCountBase']) + ## attribute.h: ns3::AttributeChecker [class] + module.add_class('AttributeChecker', allow_subclassing=False, automatic_type_narrowing=True, parent=root_module['ns3::RefCountBase']) + ## attribute.h: ns3::AttributeValue [class] + module.add_class('AttributeValue', allow_subclassing=False, automatic_type_narrowing=True, parent=root_module['ns3::RefCountBase']) + ## boolean.h: ns3::BooleanChecker [class] + module.add_class('BooleanChecker', parent=root_module['ns3::AttributeChecker']) + ## boolean.h: ns3::BooleanValue [class] + module.add_class('BooleanValue', parent=root_module['ns3::AttributeValue']) + ## callback.h: ns3::CallbackChecker [class] + module.add_class('CallbackChecker', parent=root_module['ns3::AttributeChecker']) + ## callback.h: ns3::CallbackValue [class] + module.add_class('CallbackValue', parent=root_module['ns3::AttributeValue']) + ## random-variable.h: ns3::ConstantVariable [class] + module.add_class('ConstantVariable', parent=root_module['ns3::RandomVariable']) + ## random-variable.h: ns3::DeterministicVariable [class] + module.add_class('DeterministicVariable', parent=root_module['ns3::RandomVariable']) + ## double.h: ns3::DoubleValue [class] + module.add_class('DoubleValue', parent=root_module['ns3::AttributeValue']) + ## random-variable.h: ns3::EmpiricalVariable [class] + module.add_class('EmpiricalVariable', parent=root_module['ns3::RandomVariable']) + ## attribute.h: ns3::EmptyAttributeValue [class] + module.add_class('EmptyAttributeValue', parent=root_module['ns3::AttributeValue']) + ## enum.h: ns3::EnumChecker [class] + module.add_class('EnumChecker', parent=root_module['ns3::AttributeChecker']) + ## enum.h: ns3::EnumValue [class] + module.add_class('EnumValue', parent=root_module['ns3::AttributeValue']) + ## random-variable.h: ns3::ErlangVariable [class] + module.add_class('ErlangVariable', parent=root_module['ns3::RandomVariable']) + ## random-variable.h: ns3::ExponentialVariable [class] + module.add_class('ExponentialVariable', parent=root_module['ns3::RandomVariable']) + ## random-variable.h: ns3::GammaVariable [class] + module.add_class('GammaVariable', parent=root_module['ns3::RandomVariable']) + ## random-variable.h: ns3::IntEmpiricalVariable [class] + module.add_class('IntEmpiricalVariable', parent=root_module['ns3::EmpiricalVariable']) + ## integer.h: ns3::IntegerValue [class] + module.add_class('IntegerValue', parent=root_module['ns3::AttributeValue']) + ## random-variable.h: ns3::LogNormalVariable [class] + module.add_class('LogNormalVariable', parent=root_module['ns3::RandomVariable']) + ## random-variable.h: ns3::NormalVariable [class] + module.add_class('NormalVariable', parent=root_module['ns3::RandomVariable']) + ## object.h: ns3::Object [class] + module.add_class('Object', automatic_type_narrowing=True, parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) + ## object.h: ns3::Object::AggregateIterator [class] + module.add_class('AggregateIterator', outer_class=root_module['ns3::Object']) + ## object-factory.h: ns3::ObjectFactoryChecker [class] + module.add_class('ObjectFactoryChecker', parent=root_module['ns3::AttributeChecker']) + ## object-factory.h: ns3::ObjectFactoryValue [class] + module.add_class('ObjectFactoryValue', parent=root_module['ns3::AttributeValue']) + ## object-vector.h: ns3::ObjectVectorAccessor [class] + module.add_class('ObjectVectorAccessor', parent=root_module['ns3::AttributeAccessor']) + ## object-vector.h: ns3::ObjectVectorChecker [class] + module.add_class('ObjectVectorChecker', parent=root_module['ns3::AttributeChecker']) + ## object-vector.h: ns3::ObjectVectorValue [class] + module.add_class('ObjectVectorValue', parent=root_module['ns3::AttributeValue']) + ## random-variable.h: ns3::ParetoVariable [class] + module.add_class('ParetoVariable', parent=root_module['ns3::RandomVariable']) + ## pointer.h: ns3::PointerChecker [class] + module.add_class('PointerChecker', parent=root_module['ns3::AttributeChecker']) + ## pointer.h: ns3::PointerValue [class] + module.add_class('PointerValue', parent=root_module['ns3::AttributeValue']) + ## random-variable.h: ns3::RandomVariableChecker [class] + module.add_class('RandomVariableChecker', parent=root_module['ns3::AttributeChecker']) + ## random-variable.h: ns3::RandomVariableValue [class] + module.add_class('RandomVariableValue', parent=root_module['ns3::AttributeValue']) + ## string.h: ns3::StringChecker [class] + module.add_class('StringChecker', parent=root_module['ns3::AttributeChecker']) + ## string.h: ns3::StringValue [class] + module.add_class('StringValue', parent=root_module['ns3::AttributeValue']) + ## type-id.h: ns3::TypeIdChecker [class] + module.add_class('TypeIdChecker', parent=root_module['ns3::AttributeChecker']) + ## type-id.h: ns3::TypeIdValue [class] + module.add_class('TypeIdValue', parent=root_module['ns3::AttributeValue']) + ## uinteger.h: ns3::UintegerValue [class] + module.add_class('UintegerValue', parent=root_module['ns3::AttributeValue']) + ## vector.h: ns3::Vector2DChecker [class] + module.add_class('Vector2DChecker', parent=root_module['ns3::AttributeChecker']) + ## vector.h: ns3::Vector2DValue [class] + module.add_class('Vector2DValue', parent=root_module['ns3::AttributeValue']) + ## vector.h: ns3::Vector3DChecker [class] + module.add_class('Vector3DChecker', parent=root_module['ns3::AttributeChecker']) + ## vector.h: ns3::Vector3DValue [class] + module.add_class('Vector3DValue', parent=root_module['ns3::AttributeValue']) + ## traced-value.h: ns3::TracedValue [class] + module.add_class('TracedValue', template_parameters=['unsigned int']) + ## traced-value.h: ns3::TracedValue [class] + root_module['ns3::TracedValue< unsigned int >'].implicitly_converts_to(root_module['ns3::IntegerValue']) + ## traced-value.h: ns3::TracedValue [class] + root_module['ns3::TracedValue< unsigned int >'].implicitly_converts_to(root_module['ns3::UintegerValue']) + ## traced-value.h: ns3::TracedValue [class] + root_module['ns3::TracedValue< unsigned int >'].implicitly_converts_to(root_module['ns3::BooleanValue']) + ## traced-value.h: ns3::TracedValue [class] + root_module['ns3::TracedValue< unsigned int >'].implicitly_converts_to(root_module['ns3::EnumValue']) + module.add_container('std::list< ns3::Ptr< ns3::RadvdPrefix > >', 'ns3::Ptr< ns3::RadvdPrefix >', container_type='list') + module.add_container('std::list< ns3::Ptr< ns3::Packet > >', 'ns3::Ptr< ns3::Packet >', container_type='list') + module.add_container('std::vector< ns3::Ptr< ns3::FlowProbe > >', 'ns3::Ptr< ns3::FlowProbe >', container_type='vector') + module.add_container('std::vector< ns3::Ptr< ns3::NetDevice > >', 'ns3::Ptr< ns3::NetDevice >', container_type='vector') + typehandlers.add_type_alias('ns3::Vector3D', 'ns3::Vector') + typehandlers.add_type_alias('ns3::Vector3D*', 'ns3::Vector*') + typehandlers.add_type_alias('ns3::Vector3D&', 'ns3::Vector&') + module.add_typedef(root_module['ns3::Vector3D'], 'Vector') + typehandlers.add_type_alias('ns3::Vector3DValue', 'ns3::VectorValue') + typehandlers.add_type_alias('ns3::Vector3DValue*', 'ns3::VectorValue*') + typehandlers.add_type_alias('ns3::Vector3DValue&', 'ns3::VectorValue&') + module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue') + typehandlers.add_type_alias('ns3::Vector3DChecker', 'ns3::VectorChecker') + typehandlers.add_type_alias('ns3::Vector3DChecker*', 'ns3::VectorChecker*') + typehandlers.add_type_alias('ns3::Vector3DChecker&', 'ns3::VectorChecker&') + module.add_typedef(root_module['ns3::Vector3DChecker'], 'VectorChecker') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + ## config.h: ns3::Config::MatchContainer [class] + module.add_class('MatchContainer') + module.add_container('std::vector< ns3::Ptr< ns3::Object > >', 'ns3::Ptr< ns3::Object >', container_type='vector') + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + module.add_container('std::vector< ns3::Ptr< ns3::dot11s::IeBeaconTimingUnit > >', 'ns3::Ptr< ns3::dot11s::IeBeaconTimingUnit >', container_type='vector') + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3AttributeList_methods(root_module, root_module['ns3::AttributeList']) + register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase']) + register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) + register_Ns3CommandLine_methods(root_module, root_module['ns3::CommandLine']) + register_Ns3CriticalSection_methods(root_module, root_module['ns3::CriticalSection']) + register_Ns3GlobalValue_methods(root_module, root_module['ns3::GlobalValue']) + register_Ns3IntToType__0_methods(root_module, root_module['ns3::IntToType< 0 >']) + register_Ns3IntToType__1_methods(root_module, root_module['ns3::IntToType< 1 >']) + register_Ns3IntToType__2_methods(root_module, root_module['ns3::IntToType< 2 >']) + register_Ns3IntToType__3_methods(root_module, root_module['ns3::IntToType< 3 >']) + register_Ns3IntToType__4_methods(root_module, root_module['ns3::IntToType< 4 >']) + register_Ns3IntToType__5_methods(root_module, root_module['ns3::IntToType< 5 >']) + register_Ns3IntToType__6_methods(root_module, root_module['ns3::IntToType< 6 >']) + register_Ns3Names_methods(root_module, root_module['ns3::Names']) + register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase']) + register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory']) + register_Ns3RandomVariable_methods(root_module, root_module['ns3::RandomVariable']) + register_Ns3RefCountBase_methods(root_module, root_module['ns3::RefCountBase']) + register_Ns3RngStream_methods(root_module, root_module['ns3::RngStream']) + register_Ns3SeedManager_methods(root_module, root_module['ns3::SeedManager']) + register_Ns3SequentialVariable_methods(root_module, root_module['ns3::SequentialVariable']) + register_Ns3SystemCondition_methods(root_module, root_module['ns3::SystemCondition']) + register_Ns3SystemMutex_methods(root_module, root_module['ns3::SystemMutex']) + register_Ns3SystemThread_methods(root_module, root_module['ns3::SystemThread']) + register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs']) + register_Ns3TestCase_methods(root_module, root_module['ns3::TestCase']) + register_Ns3TestRunner_methods(root_module, root_module['ns3::TestRunner']) + register_Ns3TestSuite_methods(root_module, root_module['ns3::TestSuite']) + register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor']) + register_Ns3TriangularVariable_methods(root_module, root_module['ns3::TriangularVariable']) + register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId']) + register_Ns3TypeIdAttributeInfo_methods(root_module, root_module['ns3::TypeId::AttributeInfo']) + register_Ns3UniformVariable_methods(root_module, root_module['ns3::UniformVariable']) + register_Ns3UnsafeAttributeList_methods(root_module, root_module['ns3::UnsafeAttributeList']) + register_Ns3Vector2D_methods(root_module, root_module['ns3::Vector2D']) + register_Ns3Vector3D_methods(root_module, root_module['ns3::Vector3D']) + register_Ns3WeibullVariable_methods(root_module, root_module['ns3::WeibullVariable']) + register_Ns3ZipfVariable_methods(root_module, root_module['ns3::ZipfVariable']) + register_Ns3Empty_methods(root_module, root_module['ns3::empty']) + register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor']) + register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker']) + register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue']) + register_Ns3BooleanChecker_methods(root_module, root_module['ns3::BooleanChecker']) + register_Ns3BooleanValue_methods(root_module, root_module['ns3::BooleanValue']) + register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker']) + register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) + register_Ns3ConstantVariable_methods(root_module, root_module['ns3::ConstantVariable']) + register_Ns3DeterministicVariable_methods(root_module, root_module['ns3::DeterministicVariable']) + register_Ns3DoubleValue_methods(root_module, root_module['ns3::DoubleValue']) + register_Ns3EmpiricalVariable_methods(root_module, root_module['ns3::EmpiricalVariable']) + register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue']) + register_Ns3EnumChecker_methods(root_module, root_module['ns3::EnumChecker']) + register_Ns3EnumValue_methods(root_module, root_module['ns3::EnumValue']) + register_Ns3ErlangVariable_methods(root_module, root_module['ns3::ErlangVariable']) + register_Ns3ExponentialVariable_methods(root_module, root_module['ns3::ExponentialVariable']) + register_Ns3GammaVariable_methods(root_module, root_module['ns3::GammaVariable']) + register_Ns3IntEmpiricalVariable_methods(root_module, root_module['ns3::IntEmpiricalVariable']) + register_Ns3IntegerValue_methods(root_module, root_module['ns3::IntegerValue']) + register_Ns3LogNormalVariable_methods(root_module, root_module['ns3::LogNormalVariable']) + register_Ns3NormalVariable_methods(root_module, root_module['ns3::NormalVariable']) + register_Ns3Object_methods(root_module, root_module['ns3::Object']) + register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator']) + register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker']) + register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue']) + register_Ns3ObjectVectorAccessor_methods(root_module, root_module['ns3::ObjectVectorAccessor']) + register_Ns3ObjectVectorChecker_methods(root_module, root_module['ns3::ObjectVectorChecker']) + register_Ns3ObjectVectorValue_methods(root_module, root_module['ns3::ObjectVectorValue']) + register_Ns3ParetoVariable_methods(root_module, root_module['ns3::ParetoVariable']) + register_Ns3PointerChecker_methods(root_module, root_module['ns3::PointerChecker']) + register_Ns3PointerValue_methods(root_module, root_module['ns3::PointerValue']) + register_Ns3RandomVariableChecker_methods(root_module, root_module['ns3::RandomVariableChecker']) + register_Ns3RandomVariableValue_methods(root_module, root_module['ns3::RandomVariableValue']) + register_Ns3StringChecker_methods(root_module, root_module['ns3::StringChecker']) + register_Ns3StringValue_methods(root_module, root_module['ns3::StringValue']) + register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker']) + register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue']) + register_Ns3UintegerValue_methods(root_module, root_module['ns3::UintegerValue']) + register_Ns3Vector2DChecker_methods(root_module, root_module['ns3::Vector2DChecker']) + register_Ns3Vector2DValue_methods(root_module, root_module['ns3::Vector2DValue']) + register_Ns3Vector3DChecker_methods(root_module, root_module['ns3::Vector3DChecker']) + register_Ns3Vector3DValue_methods(root_module, root_module['ns3::Vector3DValue']) + register_Ns3TracedValue__Unsigned_int_methods(root_module, root_module['ns3::TracedValue< unsigned int >']) + register_Ns3ConfigMatchContainer_methods(root_module, root_module['ns3::Config::MatchContainer']) + return + +def register_Ns3AttributeList_methods(root_module, cls): + ## attribute-list.h: ns3::AttributeList::AttributeList() [constructor] + cls.add_constructor([]) + ## attribute-list.h: ns3::AttributeList::AttributeList(ns3::AttributeList const & o) [copy constructor] + cls.add_constructor([param('ns3::AttributeList const &', 'o')]) + ## attribute-list.h: bool ns3::AttributeList::DeserializeFromString(std::string value) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value')]) + ## attribute-list.h: static ns3::AttributeList * ns3::AttributeList::GetGlobal() [member function] + cls.add_method('GetGlobal', + 'ns3::AttributeList *', + [], + is_static=True) + ## attribute-list.h: void ns3::AttributeList::Reset() [member function] + cls.add_method('Reset', + 'void', + []) + ## attribute-list.h: std::string ns3::AttributeList::SerializeToString() const [member function] + cls.add_method('SerializeToString', + 'std::string', + [], + is_const=True) + ## attribute-list.h: void ns3::AttributeList::Set(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## attribute-list.h: bool ns3::AttributeList::SetFailSafe(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetFailSafe', + 'bool', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## attribute-list.h: void ns3::AttributeList::SetWithTid(ns3::TypeId tid, std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetWithTid', + 'void', + [param('ns3::TypeId', 'tid'), param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + return + +def register_Ns3CallbackBase_methods(root_module, cls): + ## callback.h: ns3::CallbackBase::CallbackBase(ns3::CallbackBase const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CallbackBase const &', 'arg0')]) + ## callback.h: ns3::CallbackBase::CallbackBase() [constructor] + cls.add_constructor([]) + ## callback.h: ns3::Ptr ns3::CallbackBase::GetImpl() const [member function] + cls.add_method('GetImpl', + 'ns3::Ptr< ns3::CallbackImplBase >', + [], + is_const=True) + ## callback.h: ns3::CallbackBase::CallbackBase(ns3::Ptr impl) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::CallbackImplBase >', 'impl')], + visibility='protected') + ## callback.h: static std::string ns3::CallbackBase::Demangle(std::string const & mangled) [member function] + cls.add_method('Demangle', + 'std::string', + [param('std::string const &', 'mangled')], + is_static=True, visibility='protected') + return + +def register_Ns3CallbackImplBase_methods(root_module, cls): + ## callback.h: ns3::CallbackImplBase::CallbackImplBase(ns3::CallbackImplBase const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CallbackImplBase const &', 'arg0')]) + ## callback.h: ns3::CallbackImplBase::CallbackImplBase() [constructor] + cls.add_constructor([]) + ## callback.h: bool ns3::CallbackImplBase::IsEqual(ns3::Ptr other) const [member function] + cls.add_method('IsEqual', + 'bool', + [param('ns3::Ptr< ns3::CallbackImplBase const >', 'other')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3CommandLine_methods(root_module, cls): + ## command-line.h: ns3::CommandLine::CommandLine() [constructor] + cls.add_constructor([]) + ## command-line.h: ns3::CommandLine::CommandLine(ns3::CommandLine const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CommandLine const &', 'arg0')]) + ## command-line.h: void ns3::CommandLine::AddValue(std::string const & name, std::string const & help, ns3::Callback callback) [member function] + cls.add_method('AddValue', + 'void', + [param('std::string const &', 'name'), param('std::string const &', 'help'), param('ns3::Callback< bool, std::string, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + return + +def register_Ns3CriticalSection_methods(root_module, cls): + ## system-mutex.h: ns3::CriticalSection::CriticalSection(ns3::CriticalSection const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CriticalSection const &', 'arg0')]) + ## system-mutex.h: ns3::CriticalSection::CriticalSection(ns3::SystemMutex & mutex) [constructor] + cls.add_constructor([param('ns3::SystemMutex &', 'mutex')]) + return + +def register_Ns3GlobalValue_methods(root_module, cls): + ## global-value.h: ns3::GlobalValue::GlobalValue(ns3::GlobalValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::GlobalValue const &', 'arg0')]) + ## global-value.h: ns3::GlobalValue::GlobalValue(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr checker) [constructor] + cls.add_constructor([param('std::string', 'name'), param('std::string', 'help'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')]) + ## global-value.h: static __gnu_cxx::__normal_iterator > > ns3::GlobalValue::Begin() [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::GlobalValue * const *, std::vector< ns3::GlobalValue * > >', + [], + is_static=True) + ## global-value.h: static void ns3::GlobalValue::Bind(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('Bind', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')], + is_static=True) + ## global-value.h: static bool ns3::GlobalValue::BindFailSafe(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('BindFailSafe', + 'bool', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')], + is_static=True) + ## global-value.h: static __gnu_cxx::__normal_iterator > > ns3::GlobalValue::End() [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::GlobalValue * const *, std::vector< ns3::GlobalValue * > >', + [], + is_static=True) + ## global-value.h: ns3::Ptr ns3::GlobalValue::GetChecker() const [member function] + cls.add_method('GetChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + [], + is_const=True) + ## global-value.h: std::string ns3::GlobalValue::GetHelp() const [member function] + cls.add_method('GetHelp', + 'std::string', + [], + is_const=True) + ## global-value.h: std::string ns3::GlobalValue::GetName() const [member function] + cls.add_method('GetName', + 'std::string', + [], + is_const=True) + ## global-value.h: void ns3::GlobalValue::GetValue(ns3::AttributeValue & value) const [member function] + cls.add_method('GetValue', + 'void', + [param('ns3::AttributeValue &', 'value')], + is_const=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) + ## 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: bool ns3::GlobalValue::SetValue(ns3::AttributeValue const & value) [member function] + cls.add_method('SetValue', + 'bool', + [param('ns3::AttributeValue const &', 'value')]) + return + +def register_Ns3IntToType__0_methods(root_module, cls): + ## int-to-type.h: ns3::IntToType<0>::IntToType() [constructor] + cls.add_constructor([]) + ## int-to-type.h: ns3::IntToType<0>::IntToType(ns3::IntToType<0> const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntToType< 0 > const &', 'arg0')]) + return + +def register_Ns3IntToType__1_methods(root_module, cls): + ## int-to-type.h: ns3::IntToType<1>::IntToType() [constructor] + cls.add_constructor([]) + ## int-to-type.h: ns3::IntToType<1>::IntToType(ns3::IntToType<1> const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntToType< 1 > const &', 'arg0')]) + return + +def register_Ns3IntToType__2_methods(root_module, cls): + ## int-to-type.h: ns3::IntToType<2>::IntToType() [constructor] + cls.add_constructor([]) + ## int-to-type.h: ns3::IntToType<2>::IntToType(ns3::IntToType<2> const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntToType< 2 > const &', 'arg0')]) + return + +def register_Ns3IntToType__3_methods(root_module, cls): + ## int-to-type.h: ns3::IntToType<3>::IntToType() [constructor] + cls.add_constructor([]) + ## int-to-type.h: ns3::IntToType<3>::IntToType(ns3::IntToType<3> const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntToType< 3 > const &', 'arg0')]) + return + +def register_Ns3IntToType__4_methods(root_module, cls): + ## int-to-type.h: ns3::IntToType<4>::IntToType() [constructor] + cls.add_constructor([]) + ## int-to-type.h: ns3::IntToType<4>::IntToType(ns3::IntToType<4> const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntToType< 4 > const &', 'arg0')]) + return + +def register_Ns3IntToType__5_methods(root_module, cls): + ## int-to-type.h: ns3::IntToType<5>::IntToType() [constructor] + cls.add_constructor([]) + ## int-to-type.h: ns3::IntToType<5>::IntToType(ns3::IntToType<5> const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntToType< 5 > const &', 'arg0')]) + return + +def register_Ns3IntToType__6_methods(root_module, cls): + ## int-to-type.h: ns3::IntToType<6>::IntToType() [constructor] + cls.add_constructor([]) + ## int-to-type.h: ns3::IntToType<6>::IntToType(ns3::IntToType<6> const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntToType< 6 > const &', 'arg0')]) + return + +def register_Ns3Names_methods(root_module, cls): + ## names.h: ns3::Names::Names() [constructor] + cls.add_constructor([]) + ## names.h: ns3::Names::Names(ns3::Names const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Names const &', 'arg0')]) + ## names.h: static void ns3::Names::Add(std::string name, ns3::Ptr object) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'name'), param('ns3::Ptr< ns3::Object >', 'object')], + is_static=True) + ## names.h: static void ns3::Names::Add(std::string path, std::string name, ns3::Ptr object) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'path'), param('std::string', 'name'), param('ns3::Ptr< ns3::Object >', 'object')], + is_static=True) + ## names.h: static void ns3::Names::Add(ns3::Ptr context, std::string name, ns3::Ptr object) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::Object >', 'context'), param('std::string', 'name'), param('ns3::Ptr< ns3::Object >', 'object')], + is_static=True) + ## names.h: static void ns3::Names::Delete() [member function] + cls.add_method('Delete', + 'void', + [], + is_static=True) + ## names.h: static std::string ns3::Names::FindName(ns3::Ptr object) [member function] + cls.add_method('FindName', + 'std::string', + [param('ns3::Ptr< ns3::Object >', 'object')], + is_static=True) + ## names.h: static std::string ns3::Names::FindPath(ns3::Ptr object) [member function] + cls.add_method('FindPath', + 'std::string', + [param('ns3::Ptr< ns3::Object >', 'object')], + is_static=True) + ## names.h: static void ns3::Names::Rename(std::string oldpath, std::string newname) [member function] + cls.add_method('Rename', + 'void', + [param('std::string', 'oldpath'), param('std::string', 'newname')], + is_static=True) + ## names.h: static void ns3::Names::Rename(std::string path, std::string oldname, std::string newname) [member function] + cls.add_method('Rename', + 'void', + [param('std::string', 'path'), param('std::string', 'oldname'), param('std::string', 'newname')], + is_static=True) + ## names.h: static void ns3::Names::Rename(ns3::Ptr context, std::string oldname, std::string newname) [member function] + cls.add_method('Rename', + 'void', + [param('ns3::Ptr< ns3::Object >', 'context'), param('std::string', 'oldname'), param('std::string', 'newname')], + is_static=True) + return + +def register_Ns3ObjectBase_methods(root_module, cls): + ## object-base.h: ns3::ObjectBase::ObjectBase() [constructor] + cls.add_constructor([]) + ## object-base.h: ns3::ObjectBase::ObjectBase(ns3::ObjectBase const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ObjectBase const &', 'arg0')]) + ## object-base.h: void ns3::ObjectBase::GetAttribute(std::string name, ns3::AttributeValue & value) const [member function] + cls.add_method('GetAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], + is_const=True) + ## object-base.h: bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & attribute) const [member function] + cls.add_method('GetAttributeFailSafe', + 'bool', + [param('std::string', 'name'), param('ns3::AttributeValue &', 'attribute')], + is_const=True) + ## object-base.h: ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## object-base.h: static ns3::TypeId ns3::ObjectBase::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## object-base.h: void ns3::ObjectBase::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## object-base.h: bool ns3::ObjectBase::SetAttributeFailSafe(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetAttributeFailSafe', + 'bool', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## object-base.h: bool ns3::ObjectBase::TraceConnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function] + cls.add_method('TraceConnect', + 'bool', + [param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')]) + ## object-base.h: bool ns3::ObjectBase::TraceConnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function] + cls.add_method('TraceConnectWithoutContext', + 'bool', + [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) + ## object-base.h: bool ns3::ObjectBase::TraceDisconnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function] + cls.add_method('TraceDisconnect', + 'bool', + [param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')]) + ## object-base.h: bool ns3::ObjectBase::TraceDisconnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function] + cls.add_method('TraceDisconnectWithoutContext', + 'bool', + [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) + ## object-base.h: void ns3::ObjectBase::ConstructSelf(ns3::AttributeList const & attributes) [member function] + cls.add_method('ConstructSelf', + 'void', + [param('ns3::AttributeList const &', 'attributes')], + visibility='protected') + ## object-base.h: void ns3::ObjectBase::NotifyConstructionCompleted() [member function] + cls.add_method('NotifyConstructionCompleted', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3ObjectFactory_methods(root_module, cls): + cls.add_output_stream_operator() + ## object-factory.h: ns3::ObjectFactory::ObjectFactory(ns3::ObjectFactory const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ObjectFactory const &', 'arg0')]) + ## object-factory.h: ns3::ObjectFactory::ObjectFactory() [constructor] + cls.add_constructor([]) + ## object-factory.h: ns3::Ptr ns3::ObjectFactory::Create() const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Object >', + [], + is_const=True) + ## object-factory.h: ns3::TypeId ns3::ObjectFactory::GetTypeId() const [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_const=True) + ## object-factory.h: void ns3::ObjectFactory::Set(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## object-factory.h: void ns3::ObjectFactory::Set(ns3::AttributeList const & list) [member function] + cls.add_method('Set', + 'void', + [param('ns3::AttributeList const &', 'list')]) + ## object-factory.h: void ns3::ObjectFactory::SetTypeId(ns3::TypeId tid) [member function] + cls.add_method('SetTypeId', + 'void', + [param('ns3::TypeId', 'tid')]) + ## object-factory.h: void ns3::ObjectFactory::SetTypeId(char const * tid) [member function] + cls.add_method('SetTypeId', + 'void', + [param('char const *', 'tid')]) + ## object-factory.h: void ns3::ObjectFactory::SetTypeId(std::string tid) [member function] + cls.add_method('SetTypeId', + 'void', + [param('std::string', 'tid')]) + return + +def register_Ns3RandomVariable_methods(root_module, cls): + cls.add_output_stream_operator() + ## random-variable.h: ns3::RandomVariable::RandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::RandomVariable::RandomVariable(ns3::RandomVariable const & o) [copy constructor] + cls.add_constructor([param('ns3::RandomVariable const &', 'o')]) + ## random-variable.h: uint32_t ns3::RandomVariable::GetInteger() const [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_const=True) + ## random-variable.h: double ns3::RandomVariable::GetValue() const [member function] + cls.add_method('GetValue', + 'double', + [], + is_const=True) + return + +def register_Ns3RefCountBase_methods(root_module, cls): + ## ref-count-base.h: ns3::RefCountBase::RefCountBase() [constructor] + cls.add_constructor([]) + ## ref-count-base.h: ns3::RefCountBase::RefCountBase(ns3::RefCountBase const & o) [copy constructor] + cls.add_constructor([param('ns3::RefCountBase const &', 'o')]) + return + +def register_Ns3RngStream_methods(root_module, cls): + ## rng-stream.h: ns3::RngStream::RngStream() [constructor] + cls.add_constructor([]) + ## rng-stream.h: ns3::RngStream::RngStream(ns3::RngStream const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RngStream const &', 'arg0')]) + ## rng-stream.h: void ns3::RngStream::AdvanceState(int32_t e, int32_t c) [member function] + cls.add_method('AdvanceState', + 'void', + [param('int32_t', 'e'), param('int32_t', 'c')]) + ## rng-stream.h: static bool ns3::RngStream::CheckSeed(uint32_t const * seed) [member function] + cls.add_method('CheckSeed', + 'bool', + [param('uint32_t const *', 'seed')], + is_static=True) + ## rng-stream.h: static bool ns3::RngStream::CheckSeed(uint32_t seed) [member function] + cls.add_method('CheckSeed', + 'bool', + [param('uint32_t', 'seed')], + is_static=True) + ## rng-stream.h: static uint32_t ns3::RngStream::GetPackageRun() [member function] + cls.add_method('GetPackageRun', + 'uint32_t', + [], + is_static=True) + ## rng-stream.h: static void ns3::RngStream::GetPackageSeed(uint32_t * seed) [member function] + cls.add_method('GetPackageSeed', + 'void', + [param('uint32_t *', 'seed')], + is_static=True) + ## rng-stream.h: void ns3::RngStream::GetState(uint32_t * seed) const [member function] + cls.add_method('GetState', + 'void', + [param('uint32_t *', 'seed')], + is_const=True) + ## rng-stream.h: void ns3::RngStream::IncreasedPrecis(bool incp) [member function] + cls.add_method('IncreasedPrecis', + 'void', + [param('bool', 'incp')]) + ## rng-stream.h: void ns3::RngStream::InitializeStream() [member function] + cls.add_method('InitializeStream', + 'void', + []) + ## rng-stream.h: int32_t ns3::RngStream::RandInt(int32_t i, int32_t j) [member function] + cls.add_method('RandInt', + 'int32_t', + [param('int32_t', 'i'), param('int32_t', 'j')]) + ## rng-stream.h: double ns3::RngStream::RandU01() [member function] + cls.add_method('RandU01', + 'double', + []) + ## rng-stream.h: void ns3::RngStream::ResetNextSubstream() [member function] + cls.add_method('ResetNextSubstream', + 'void', + []) + ## rng-stream.h: void ns3::RngStream::ResetNthSubstream(uint32_t N) [member function] + cls.add_method('ResetNthSubstream', + 'void', + [param('uint32_t', 'N')]) + ## rng-stream.h: void ns3::RngStream::ResetStartStream() [member function] + cls.add_method('ResetStartStream', + 'void', + []) + ## rng-stream.h: void ns3::RngStream::ResetStartSubstream() [member function] + cls.add_method('ResetStartSubstream', + 'void', + []) + ## rng-stream.h: void ns3::RngStream::SetAntithetic(bool a) [member function] + cls.add_method('SetAntithetic', + 'void', + [param('bool', 'a')]) + ## rng-stream.h: static void ns3::RngStream::SetPackageRun(uint32_t run) [member function] + cls.add_method('SetPackageRun', + 'void', + [param('uint32_t', 'run')], + is_static=True) + ## rng-stream.h: static bool ns3::RngStream::SetPackageSeed(uint32_t seed) [member function] + cls.add_method('SetPackageSeed', + 'bool', + [param('uint32_t', 'seed')], + is_static=True) + ## rng-stream.h: static bool ns3::RngStream::SetPackageSeed(uint32_t const * seed) [member function] + cls.add_method('SetPackageSeed', + 'bool', + [param('uint32_t const *', 'seed')], + is_static=True) + ## rng-stream.h: bool ns3::RngStream::SetSeeds(uint32_t const * seed) [member function] + cls.add_method('SetSeeds', + 'bool', + [param('uint32_t const *', 'seed')]) + return + +def register_Ns3SeedManager_methods(root_module, cls): + ## random-variable.h: ns3::SeedManager::SeedManager() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::SeedManager::SeedManager(ns3::SeedManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SeedManager const &', 'arg0')]) + ## random-variable.h: static bool ns3::SeedManager::CheckSeed(uint32_t seed) [member function] + cls.add_method('CheckSeed', + 'bool', + [param('uint32_t', 'seed')], + is_static=True) + ## random-variable.h: static uint32_t ns3::SeedManager::GetRun() [member function] + cls.add_method('GetRun', + 'uint32_t', + [], + is_static=True) + ## random-variable.h: static uint32_t ns3::SeedManager::GetSeed() [member function] + cls.add_method('GetSeed', + 'uint32_t', + [], + is_static=True) + ## random-variable.h: static void ns3::SeedManager::SetRun(uint32_t run) [member function] + cls.add_method('SetRun', + 'void', + [param('uint32_t', 'run')], + is_static=True) + ## random-variable.h: static void ns3::SeedManager::SetSeed(uint32_t seed) [member function] + cls.add_method('SetSeed', + 'void', + [param('uint32_t', 'seed')], + is_static=True) + return + +def register_Ns3SequentialVariable_methods(root_module, cls): + ## random-variable.h: ns3::SequentialVariable::SequentialVariable(ns3::SequentialVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SequentialVariable const &', 'arg0')]) + ## random-variable.h: ns3::SequentialVariable::SequentialVariable(double f, double l, double i=1, uint32_t c=1) [constructor] + cls.add_constructor([param('double', 'f'), param('double', 'l'), param('double', 'i', default_value='1'), param('uint32_t', 'c', default_value='1')]) + ## random-variable.h: ns3::SequentialVariable::SequentialVariable(double f, double l, ns3::RandomVariable const & i, uint32_t c=1) [constructor] + cls.add_constructor([param('double', 'f'), param('double', 'l'), param('ns3::RandomVariable const &', 'i'), param('uint32_t', 'c', default_value='1')]) + return + +def register_Ns3SystemCondition_methods(root_module, cls): + ## system-condition.h: ns3::SystemCondition::SystemCondition(ns3::SystemCondition const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SystemCondition const &', 'arg0')]) + ## system-condition.h: ns3::SystemCondition::SystemCondition() [constructor] + cls.add_constructor([]) + ## system-condition.h: void ns3::SystemCondition::Broadcast() [member function] + cls.add_method('Broadcast', + 'void', + []) + ## system-condition.h: bool ns3::SystemCondition::GetCondition() [member function] + cls.add_method('GetCondition', + 'bool', + []) + ## system-condition.h: void ns3::SystemCondition::SetCondition(bool condition) [member function] + cls.add_method('SetCondition', + 'void', + [param('bool', 'condition')]) + ## system-condition.h: void ns3::SystemCondition::Signal() [member function] + cls.add_method('Signal', + 'void', + []) + ## system-condition.h: bool ns3::SystemCondition::TimedWait(uint64_t ns) [member function] + cls.add_method('TimedWait', + 'bool', + [param('uint64_t', 'ns')]) + ## system-condition.h: void ns3::SystemCondition::Wait() [member function] + cls.add_method('Wait', + 'void', + []) + return + +def register_Ns3SystemMutex_methods(root_module, cls): + ## system-mutex.h: ns3::SystemMutex::SystemMutex(ns3::SystemMutex const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SystemMutex const &', 'arg0')]) + ## system-mutex.h: ns3::SystemMutex::SystemMutex() [constructor] + cls.add_constructor([]) + ## system-mutex.h: void ns3::SystemMutex::Lock() [member function] + cls.add_method('Lock', + 'void', + []) + ## system-mutex.h: void ns3::SystemMutex::Unlock() [member function] + cls.add_method('Unlock', + 'void', + []) + return + +def register_Ns3SystemThread_methods(root_module, cls): + ## system-thread.h: ns3::SystemThread::SystemThread(ns3::SystemThread const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SystemThread const &', 'arg0')]) + ## system-thread.h: ns3::SystemThread::SystemThread(ns3::Callback callback) [constructor] + cls.add_constructor([param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## system-thread.h: bool ns3::SystemThread::Break() [member function] + cls.add_method('Break', + 'bool', + []) + ## system-thread.h: void ns3::SystemThread::Join() [member function] + cls.add_method('Join', + 'void', + []) + ## system-thread.h: void ns3::SystemThread::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## system-thread.h: void ns3::SystemThread::Shutdown() [member function] + cls.add_method('Shutdown', + 'void', + []) + ## system-thread.h: void ns3::SystemThread::Start() [member function] + cls.add_method('Start', + 'void', + []) + ## system-thread.h: void ns3::SystemThread::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + return + +def register_Ns3SystemWallClockMs_methods(root_module, cls): + ## system-wall-clock-ms.h: ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')]) + ## system-wall-clock-ms.h: ns3::SystemWallClockMs::SystemWallClockMs() [constructor] + cls.add_constructor([]) + ## system-wall-clock-ms.h: long long unsigned int ns3::SystemWallClockMs::End() [member function] + cls.add_method('End', + 'long long unsigned int', + []) + ## system-wall-clock-ms.h: void ns3::SystemWallClockMs::Start() [member function] + cls.add_method('Start', + 'void', + []) + return + +def register_Ns3TestCase_methods(root_module, cls): + ## test.h: ns3::TestCase::TestCase(std::string name) [constructor] + cls.add_constructor([param('std::string', 'name')]) + ## test.h: bool ns3::TestCase::Run() [member function] + cls.add_method('Run', + 'bool', + []) + ## test.h: void ns3::TestCase::SetVerbose(bool verbose) [member function] + cls.add_method('SetVerbose', + 'void', + [param('bool', 'verbose')]) + ## test.h: void ns3::TestCase::SetName(std::string name) [member function] + cls.add_method('SetName', + 'void', + [param('std::string', 'name')]) + ## test.h: std::string ns3::TestCase::GetName() [member function] + cls.add_method('GetName', + 'std::string', + []) + ## test.h: void ns3::TestCase::SetBaseDir(std::string dir) [member function] + cls.add_method('SetBaseDir', + 'void', + [param('std::string', 'dir')]) + ## test.h: std::string ns3::TestCase::GetBaseDir() [member function] + cls.add_method('GetBaseDir', + 'std::string', + []) + ## test.h: std::string ns3::TestCase::GetSourceDir(std::string file) [member function] + cls.add_method('GetSourceDir', + 'std::string', + [param('std::string', 'file')]) + ## test.h: void ns3::TestCase::SetStream(std::ofstream * ofs) [member function] + cls.add_method('SetStream', + 'void', + [param('std::ofstream *', 'ofs')]) + ## test.h: std::ofstream * ns3::TestCase::GetStream() [member function] + cls.add_method('GetStream', + 'std::ofstream *', + []) + ## test.h: void ns3::TestCase::SetErrorStatus(bool error) [member function] + cls.add_method('SetErrorStatus', + 'void', + [param('bool', 'error')]) + ## test.h: bool ns3::TestCase::GetErrorStatus() [member function] + cls.add_method('GetErrorStatus', + 'bool', + []) + ## test.h: void ns3::TestCase::ReportStart() [member function] + cls.add_method('ReportStart', + 'void', + []) + ## test.h: void ns3::TestCase::ReportSuccess() [member function] + cls.add_method('ReportSuccess', + 'void', + []) + ## test.h: void ns3::TestCase::ReportFailure(std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) [member function] + cls.add_method('ReportFailure', + 'void', + [param('std::string', 'cond'), param('std::string', 'actual'), param('std::string', 'limit'), param('std::string', 'message'), param('std::string', 'file'), param('int32_t', 'line')]) + ## test.h: void ns3::TestCase::ReportEnd() [member function] + cls.add_method('ReportEnd', + 'void', + []) + ## test.h: void ns3::TestCase::DoReportStart() [member function] + cls.add_method('DoReportStart', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoReportSuccess() [member function] + cls.add_method('DoReportSuccess', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoReportFailure(std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) [member function] + cls.add_method('DoReportFailure', + 'void', + [param('std::string', 'cond'), param('std::string', 'actual'), param('std::string', 'limit'), param('std::string', 'message'), param('std::string', 'file'), param('int32_t', 'line')], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoReportEnd() [member function] + cls.add_method('DoReportEnd', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoSetup() [member function] + cls.add_method('DoSetup', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: bool ns3::TestCase::DoRun() [member function] + cls.add_method('DoRun', + 'bool', + [], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## test.h: void ns3::TestCase::DoTeardown() [member function] + cls.add_method('DoTeardown', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3TestRunner_methods(root_module, cls): + ## test.h: ns3::TestRunner::TestRunner() [constructor] + cls.add_constructor([]) + ## test.h: ns3::TestRunner::TestRunner(ns3::TestRunner const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TestRunner const &', 'arg0')]) + ## test.h: static uint32_t ns3::TestRunner::AddTestSuite(ns3::TestSuite * testSuite) [member function] + cls.add_method('AddTestSuite', + 'uint32_t', + [param('ns3::TestSuite *', 'testSuite')], + is_static=True) + ## test.h: static uint32_t ns3::TestRunner::GetNTestSuites() [member function] + cls.add_method('GetNTestSuites', + 'uint32_t', + [], + is_static=True) + ## test.h: static ns3::TestSuite * ns3::TestRunner::GetTestSuite(uint32_t n) [member function] + cls.add_method('GetTestSuite', + 'ns3::TestSuite *', + [param('uint32_t', 'n')], + is_static=True) + return + +def register_Ns3TestSuite_methods(root_module, cls): + ## test.h: ns3::TestSuite::TestSuite(std::string name, ns3::TestSuite::TestType type=::ns3::TestSuite::UNIT) [constructor] + cls.add_constructor([param('std::string', 'name'), param('ns3::TestSuite::TestType', 'type', default_value='::ns3::TestSuite::UNIT')]) + ## test.h: bool ns3::TestSuite::Run() [member function] + cls.add_method('Run', + 'bool', + []) + ## test.h: uint32_t ns3::TestSuite::AddTestCase(ns3::TestCase * testCase) [member function] + cls.add_method('AddTestCase', + 'uint32_t', + [param('ns3::TestCase *', 'testCase')]) + ## test.h: uint32_t ns3::TestSuite::GetNTestCases() [member function] + cls.add_method('GetNTestCases', + 'uint32_t', + []) + ## test.h: ns3::TestCase * ns3::TestSuite::GetTestCase(uint32_t i) [member function] + cls.add_method('GetTestCase', + 'ns3::TestCase *', + [param('uint32_t', 'i')]) + ## test.h: ns3::TestSuite::TestType ns3::TestSuite::GetTestType() [member function] + cls.add_method('GetTestType', + 'ns3::TestSuite::TestType', + []) + ## test.h: void ns3::TestSuite::SetVerbose(bool verbose) [member function] + cls.add_method('SetVerbose', + 'void', + [param('bool', 'verbose')]) + ## test.h: void ns3::TestSuite::SetName(std::string name) [member function] + cls.add_method('SetName', + 'void', + [param('std::string', 'name')]) + ## test.h: std::string ns3::TestSuite::GetName() [member function] + cls.add_method('GetName', + 'std::string', + []) + ## test.h: void ns3::TestSuite::SetBaseDir(std::string basedir) [member function] + cls.add_method('SetBaseDir', + 'void', + [param('std::string', 'basedir')]) + ## test.h: std::string ns3::TestSuite::GetBaseDir() [member function] + cls.add_method('GetBaseDir', + 'std::string', + []) + ## test.h: void ns3::TestSuite::SetStream(std::ofstream * ofs) [member function] + cls.add_method('SetStream', + 'void', + [param('std::ofstream *', 'ofs')]) + ## test.h: void ns3::TestSuite::ReportStart() [member function] + cls.add_method('ReportStart', + 'void', + []) + ## test.h: void ns3::TestSuite::ReportSuccess() [member function] + cls.add_method('ReportSuccess', + 'void', + []) + ## test.h: void ns3::TestSuite::ReportFailure() [member function] + cls.add_method('ReportFailure', + 'void', + []) + ## test.h: void ns3::TestSuite::ReportEnd() [member function] + cls.add_method('ReportEnd', + 'void', + []) + ## test.h: void ns3::TestSuite::DoReportStart() [member function] + cls.add_method('DoReportStart', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoReportSuccess() [member function] + cls.add_method('DoReportSuccess', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoReportFailure() [member function] + cls.add_method('DoReportFailure', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoReportEnd() [member function] + cls.add_method('DoReportEnd', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoSetup() [member function] + cls.add_method('DoSetup', + 'void', + [], + visibility='protected', is_virtual=True) + ## test.h: bool ns3::TestSuite::DoRun() [member function] + cls.add_method('DoRun', + 'bool', + [], + visibility='protected', is_virtual=True) + ## test.h: void ns3::TestSuite::DoTeardown() [member function] + cls.add_method('DoTeardown', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3TraceSourceAccessor_methods(root_module, cls): + ## trace-source-accessor.h: ns3::TraceSourceAccessor::TraceSourceAccessor(ns3::TraceSourceAccessor const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TraceSourceAccessor const &', 'arg0')]) + ## trace-source-accessor.h: ns3::TraceSourceAccessor::TraceSourceAccessor() [constructor] + cls.add_constructor([]) + ## trace-source-accessor.h: bool ns3::TraceSourceAccessor::Connect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function] + cls.add_method('Connect', + 'bool', + [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## trace-source-accessor.h: bool ns3::TraceSourceAccessor::ConnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function] + cls.add_method('ConnectWithoutContext', + 'bool', + [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## trace-source-accessor.h: bool ns3::TraceSourceAccessor::Disconnect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function] + cls.add_method('Disconnect', + 'bool', + [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## trace-source-accessor.h: bool ns3::TraceSourceAccessor::DisconnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function] + cls.add_method('DisconnectWithoutContext', + 'bool', + [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## trace-source-accessor.h: void ns3::TraceSourceAccessor::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## trace-source-accessor.h: void ns3::TraceSourceAccessor::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + return + +def register_Ns3TriangularVariable_methods(root_module, cls): + ## random-variable.h: ns3::TriangularVariable::TriangularVariable(ns3::TriangularVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TriangularVariable const &', 'arg0')]) + ## random-variable.h: ns3::TriangularVariable::TriangularVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::TriangularVariable::TriangularVariable(double s, double l, double mean) [constructor] + cls.add_constructor([param('double', 's'), param('double', 'l'), param('double', 'mean')]) + return + +def register_Ns3TypeId_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_binary_comparison_operator('<') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## type-id.h: ns3::TypeId::TypeId(char const * name) [constructor] + cls.add_constructor([param('char const *', 'name')]) + ## type-id.h: ns3::TypeId::TypeId() [constructor] + cls.add_constructor([]) + ## type-id.h: ns3::TypeId::TypeId(ns3::TypeId const & o) [copy constructor] + cls.add_constructor([param('ns3::TypeId const &', 'o')]) + ## type-id.h: ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr accessor, ns3::Ptr checker) [member function] + cls.add_method('AddAttribute', + 'ns3::TypeId', + [param('std::string', 'name'), param('std::string', 'help'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')]) + ## type-id.h: ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, uint32_t flags, ns3::AttributeValue const & initialValue, ns3::Ptr accessor, ns3::Ptr checker) [member function] + cls.add_method('AddAttribute', + 'ns3::TypeId', + [param('std::string', 'name'), param('std::string', 'help'), param('uint32_t', 'flags'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')]) + ## type-id.h: ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr accessor) [member function] + cls.add_method('AddTraceSource', + 'ns3::TypeId', + [param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')]) + ## type-id.h: ns3::Ptr ns3::TypeId::GetAttributeAccessor(uint32_t i) const [member function] + cls.add_method('GetAttributeAccessor', + 'ns3::Ptr< ns3::AttributeAccessor const >', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: ns3::Ptr ns3::TypeId::GetAttributeChecker(uint32_t i) const [member function] + cls.add_method('GetAttributeChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: uint32_t ns3::TypeId::GetAttributeFlags(uint32_t i) const [member function] + cls.add_method('GetAttributeFlags', + 'uint32_t', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: std::string ns3::TypeId::GetAttributeFullName(uint32_t i) const [member function] + cls.add_method('GetAttributeFullName', + 'std::string', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: std::string ns3::TypeId::GetAttributeHelp(uint32_t i) const [member function] + cls.add_method('GetAttributeHelp', + 'std::string', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: ns3::Ptr ns3::TypeId::GetAttributeInitialValue(uint32_t i) const [member function] + cls.add_method('GetAttributeInitialValue', + 'ns3::Ptr< ns3::AttributeValue const >', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: uint32_t ns3::TypeId::GetAttributeN() const [member function] + cls.add_method('GetAttributeN', + 'uint32_t', + [], + is_const=True) + ## type-id.h: std::string ns3::TypeId::GetAttributeName(uint32_t i) const [member function] + cls.add_method('GetAttributeName', + 'std::string', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: ns3::Callback ns3::TypeId::GetConstructor() const [member function] + cls.add_method('GetConstructor', + 'ns3::Callback< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', + [], + is_const=True) + ## type-id.h: std::string ns3::TypeId::GetGroupName() const [member function] + cls.add_method('GetGroupName', + 'std::string', + [], + is_const=True) + ## type-id.h: std::string ns3::TypeId::GetName() const [member function] + cls.add_method('GetName', + 'std::string', + [], + is_const=True) + ## type-id.h: ns3::TypeId ns3::TypeId::GetParent() const [member function] + cls.add_method('GetParent', + 'ns3::TypeId', + [], + is_const=True) + ## type-id.h: static ns3::TypeId ns3::TypeId::GetRegistered(uint32_t i) [member function] + cls.add_method('GetRegistered', + 'ns3::TypeId', + [param('uint32_t', 'i')], + is_static=True) + ## type-id.h: static uint32_t ns3::TypeId::GetRegisteredN() [member function] + cls.add_method('GetRegisteredN', + 'uint32_t', + [], + is_static=True) + ## type-id.h: ns3::Ptr ns3::TypeId::GetTraceSourceAccessor(uint32_t i) const [member function] + cls.add_method('GetTraceSourceAccessor', + 'ns3::Ptr< ns3::TraceSourceAccessor const >', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: std::string ns3::TypeId::GetTraceSourceHelp(uint32_t i) const [member function] + cls.add_method('GetTraceSourceHelp', + 'std::string', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: uint32_t ns3::TypeId::GetTraceSourceN() const [member function] + cls.add_method('GetTraceSourceN', + 'uint32_t', + [], + is_const=True) + ## type-id.h: std::string ns3::TypeId::GetTraceSourceName(uint32_t i) const [member function] + cls.add_method('GetTraceSourceName', + 'std::string', + [param('uint32_t', 'i')], + is_const=True) + ## type-id.h: uint16_t ns3::TypeId::GetUid() const [member function] + cls.add_method('GetUid', + 'uint16_t', + [], + is_const=True) + ## type-id.h: bool ns3::TypeId::HasConstructor() const [member function] + cls.add_method('HasConstructor', + 'bool', + [], + is_const=True) + ## type-id.h: bool ns3::TypeId::HasParent() const [member function] + cls.add_method('HasParent', + 'bool', + [], + is_const=True) + ## type-id.h: ns3::TypeId ns3::TypeId::HideFromDocumentation() [member function] + cls.add_method('HideFromDocumentation', + 'ns3::TypeId', + []) + ## type-id.h: bool ns3::TypeId::IsChildOf(ns3::TypeId other) const [member function] + cls.add_method('IsChildOf', + 'bool', + [param('ns3::TypeId', 'other')], + is_const=True) + ## type-id.h: static bool ns3::TypeId::LookupAttributeByFullName(std::string fullName, ns3::TypeId::AttributeInfo * info) [member function] + cls.add_method('LookupAttributeByFullName', + 'bool', + [param('std::string', 'fullName'), param('ns3::TypeId::AttributeInfo *', 'info')], + is_static=True) + ## type-id.h: bool ns3::TypeId::LookupAttributeByName(std::string name, ns3::TypeId::AttributeInfo * info) const [member function] + cls.add_method('LookupAttributeByName', + 'bool', + [param('std::string', 'name'), param('ns3::TypeId::AttributeInfo *', 'info', transfer_ownership=False)], + is_const=True) + ## type-id.h: static ns3::TypeId ns3::TypeId::LookupByName(std::string name) [member function] + cls.add_method('LookupByName', + 'ns3::TypeId', + [param('std::string', 'name')], + is_static=True) + ## type-id.h: ns3::Ptr ns3::TypeId::LookupTraceSourceByName(std::string name) const [member function] + cls.add_method('LookupTraceSourceByName', + 'ns3::Ptr< ns3::TraceSourceAccessor const >', + [param('std::string', 'name')], + is_const=True) + ## type-id.h: bool ns3::TypeId::MustHideFromDocumentation() const [member function] + cls.add_method('MustHideFromDocumentation', + 'bool', + [], + is_const=True) + ## type-id.h: ns3::TypeId ns3::TypeId::SetGroupName(std::string groupName) [member function] + cls.add_method('SetGroupName', + 'ns3::TypeId', + [param('std::string', 'groupName')]) + ## type-id.h: ns3::TypeId ns3::TypeId::SetParent(ns3::TypeId tid) [member function] + cls.add_method('SetParent', + 'ns3::TypeId', + [param('ns3::TypeId', 'tid')]) + ## type-id.h: void ns3::TypeId::SetUid(uint16_t tid) [member function] + cls.add_method('SetUid', + 'void', + [param('uint16_t', 'tid')]) + return + +def register_Ns3TypeIdAttributeInfo_methods(root_module, cls): + ## type-id.h: ns3::TypeId::AttributeInfo::AttributeInfo() [constructor] + cls.add_constructor([]) + ## type-id.h: ns3::TypeId::AttributeInfo::AttributeInfo(ns3::TypeId::AttributeInfo const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TypeId::AttributeInfo const &', 'arg0')]) + ## type-id.h: ns3::TypeId::AttributeInfo::accessor [variable] + cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::AttributeAccessor const >', is_const=False) + ## type-id.h: ns3::TypeId::AttributeInfo::checker [variable] + cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False) + ## type-id.h: ns3::TypeId::AttributeInfo::flags [variable] + cls.add_instance_attribute('flags', 'uint32_t', is_const=False) + ## type-id.h: ns3::TypeId::AttributeInfo::initialValue [variable] + cls.add_instance_attribute('initialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False) + return + +def register_Ns3UniformVariable_methods(root_module, cls): + ## random-variable.h: ns3::UniformVariable::UniformVariable(ns3::UniformVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UniformVariable const &', 'arg0')]) + ## random-variable.h: ns3::UniformVariable::UniformVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::UniformVariable::UniformVariable(double s, double l) [constructor] + cls.add_constructor([param('double', 's'), param('double', 'l')]) + ## random-variable.h: uint32_t ns3::UniformVariable::GetInteger(uint32_t s, uint32_t l) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 's'), param('uint32_t', 'l')]) + ## random-variable.h: double ns3::UniformVariable::GetValue() const [member function] + cls.add_method('GetValue', + 'double', + [], + is_const=True) + ## random-variable.h: double ns3::UniformVariable::GetValue(double s, double l) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 's'), param('double', 'l')]) + return + +def register_Ns3UnsafeAttributeList_methods(root_module, cls): + ## attribute-list.h: ns3::UnsafeAttributeList::UnsafeAttributeList() [constructor] + cls.add_constructor([]) + ## attribute-list.h: ns3::UnsafeAttributeList::UnsafeAttributeList(ns3::UnsafeAttributeList const & o) [copy constructor] + cls.add_constructor([param('ns3::UnsafeAttributeList const &', 'o')]) + ## attribute-list.h: ns3::AttributeList ns3::UnsafeAttributeList::GetSafe(std::string name) const [member function] + cls.add_method('GetSafe', + 'ns3::AttributeList', + [param('std::string', 'name')], + is_const=True) + ## attribute-list.h: void ns3::UnsafeAttributeList::Set(std::string name, ns3::AttributeValue const & param) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'param')]) + return + +def register_Ns3Vector2D_methods(root_module, cls): + cls.add_output_stream_operator() + ## vector.h: ns3::Vector2D::Vector2D(ns3::Vector2D const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Vector2D const &', 'arg0')]) + ## vector.h: ns3::Vector2D::Vector2D(double _x, double _y) [constructor] + cls.add_constructor([param('double', '_x'), param('double', '_y')]) + ## vector.h: ns3::Vector2D::Vector2D() [constructor] + cls.add_constructor([]) + ## vector.h: ns3::Vector2D::x [variable] + cls.add_instance_attribute('x', 'double', is_const=False) + ## vector.h: ns3::Vector2D::y [variable] + cls.add_instance_attribute('y', 'double', is_const=False) + return + +def register_Ns3Vector3D_methods(root_module, cls): + cls.add_output_stream_operator() + ## vector.h: ns3::Vector3D::Vector3D(ns3::Vector3D const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Vector3D const &', 'arg0')]) + ## vector.h: ns3::Vector3D::Vector3D(double _x, double _y, double _z) [constructor] + cls.add_constructor([param('double', '_x'), param('double', '_y'), param('double', '_z')]) + ## vector.h: ns3::Vector3D::Vector3D() [constructor] + cls.add_constructor([]) + ## vector.h: ns3::Vector3D::x [variable] + cls.add_instance_attribute('x', 'double', is_const=False) + ## vector.h: ns3::Vector3D::y [variable] + cls.add_instance_attribute('y', 'double', is_const=False) + ## vector.h: ns3::Vector3D::z [variable] + cls.add_instance_attribute('z', 'double', is_const=False) + return + +def register_Ns3WeibullVariable_methods(root_module, cls): + ## random-variable.h: ns3::WeibullVariable::WeibullVariable(ns3::WeibullVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WeibullVariable const &', 'arg0')]) + ## random-variable.h: ns3::WeibullVariable::WeibullVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::WeibullVariable::WeibullVariable(double m) [constructor] + cls.add_constructor([param('double', 'm')]) + ## random-variable.h: ns3::WeibullVariable::WeibullVariable(double m, double s) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 's')]) + ## random-variable.h: ns3::WeibullVariable::WeibullVariable(double m, double s, double b) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 's'), param('double', 'b')]) + return + +def register_Ns3ZipfVariable_methods(root_module, cls): + ## random-variable.h: ns3::ZipfVariable::ZipfVariable(ns3::ZipfVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ZipfVariable const &', 'arg0')]) + ## random-variable.h: ns3::ZipfVariable::ZipfVariable(long int n, double alpha) [constructor] + cls.add_constructor([param('long int', 'n'), param('double', 'alpha')]) + ## random-variable.h: ns3::ZipfVariable::ZipfVariable() [constructor] + cls.add_constructor([]) + return + +def register_Ns3Empty_methods(root_module, cls): + ## empty.h: ns3::empty::empty() [constructor] + cls.add_constructor([]) + ## empty.h: ns3::empty::empty(ns3::empty const & arg0) [copy constructor] + cls.add_constructor([param('ns3::empty const &', 'arg0')]) + return + +def register_Ns3AttributeAccessor_methods(root_module, cls): + ## attribute.h: ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')]) + ## attribute.h: ns3::AttributeAccessor::AttributeAccessor() [constructor] + cls.add_constructor([]) + ## attribute.h: bool ns3::AttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function] + cls.add_method('Get', + 'bool', + [param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: bool ns3::AttributeAccessor::HasGetter() const [member function] + cls.add_method('HasGetter', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: bool ns3::AttributeAccessor::HasSetter() const [member function] + cls.add_method('HasSetter', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: bool ns3::AttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function] + cls.add_method('Set', + 'bool', + [param('ns3::ObjectBase *', 'object', transfer_ownership=False), param('ns3::AttributeValue const &', 'value')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3AttributeChecker_methods(root_module, cls): + ## attribute.h: ns3::AttributeChecker::AttributeChecker(ns3::AttributeChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AttributeChecker const &', 'arg0')]) + ## attribute.h: ns3::AttributeChecker::AttributeChecker() [constructor] + cls.add_constructor([]) + ## attribute.h: bool ns3::AttributeChecker::Check(ns3::AttributeValue const & value) const [member function] + cls.add_method('Check', + 'bool', + [param('ns3::AttributeValue const &', 'value')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: bool ns3::AttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function] + cls.add_method('Copy', + 'bool', + [param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: ns3::Ptr ns3::AttributeChecker::Create() const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: std::string ns3::AttributeChecker::GetUnderlyingTypeInformation() const [member function] + cls.add_method('GetUnderlyingTypeInformation', + 'std::string', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: std::string ns3::AttributeChecker::GetValueTypeName() const [member function] + cls.add_method('GetValueTypeName', + 'std::string', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: bool ns3::AttributeChecker::HasUnderlyingTypeInformation() const [member function] + cls.add_method('HasUnderlyingTypeInformation', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3AttributeValue_methods(root_module, cls): + ## attribute.h: ns3::AttributeValue::AttributeValue(ns3::AttributeValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AttributeValue const &', 'arg0')]) + ## attribute.h: ns3::AttributeValue::AttributeValue() [constructor] + cls.add_constructor([]) + ## attribute.h: ns3::Ptr ns3::AttributeValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## attribute.h: bool ns3::AttributeValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_pure_virtual=True, is_virtual=True) + ## attribute.h: std::string ns3::AttributeValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3BooleanChecker_methods(root_module, cls): + ## boolean.h: ns3::BooleanChecker::BooleanChecker() [constructor] + cls.add_constructor([]) + ## boolean.h: ns3::BooleanChecker::BooleanChecker(ns3::BooleanChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BooleanChecker const &', 'arg0')]) + return + +def register_Ns3BooleanValue_methods(root_module, cls): + cls.add_output_stream_operator() + ## boolean.h: ns3::BooleanValue::BooleanValue(ns3::BooleanValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BooleanValue const &', 'arg0')]) + ## boolean.h: ns3::BooleanValue::BooleanValue() [constructor] + cls.add_constructor([]) + ## boolean.h: ns3::BooleanValue::BooleanValue(bool value) [constructor] + cls.add_constructor([param('bool', 'value')]) + ## boolean.h: ns3::Ptr ns3::BooleanValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## boolean.h: bool ns3::BooleanValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## boolean.h: bool ns3::BooleanValue::Get() const [member function] + cls.add_method('Get', + 'bool', + [], + is_const=True) + ## boolean.h: std::string ns3::BooleanValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## boolean.h: void ns3::BooleanValue::Set(bool value) [member function] + cls.add_method('Set', + 'void', + [param('bool', 'value')]) + return + +def register_Ns3CallbackChecker_methods(root_module, cls): + ## callback.h: ns3::CallbackChecker::CallbackChecker() [constructor] + cls.add_constructor([]) + ## callback.h: ns3::CallbackChecker::CallbackChecker(ns3::CallbackChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CallbackChecker const &', 'arg0')]) + return + +def register_Ns3CallbackValue_methods(root_module, cls): + ## callback.h: ns3::CallbackValue::CallbackValue(ns3::CallbackValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CallbackValue const &', 'arg0')]) + ## callback.h: ns3::CallbackValue::CallbackValue() [constructor] + cls.add_constructor([]) + ## callback.h: ns3::CallbackValue::CallbackValue(ns3::CallbackBase const & base) [constructor] + cls.add_constructor([param('ns3::CallbackBase const &', 'base')]) + ## callback.h: ns3::Ptr ns3::CallbackValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## callback.h: bool ns3::CallbackValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## callback.h: std::string ns3::CallbackValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## callback.h: void ns3::CallbackValue::Set(ns3::CallbackBase base) [member function] + cls.add_method('Set', + 'void', + [param('ns3::CallbackBase', 'base')]) + return + +def register_Ns3ConstantVariable_methods(root_module, cls): + ## random-variable.h: ns3::ConstantVariable::ConstantVariable(ns3::ConstantVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConstantVariable const &', 'arg0')]) + ## random-variable.h: ns3::ConstantVariable::ConstantVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::ConstantVariable::ConstantVariable(double c) [constructor] + cls.add_constructor([param('double', 'c')]) + ## random-variable.h: void ns3::ConstantVariable::SetConstant(double c) [member function] + cls.add_method('SetConstant', + 'void', + [param('double', 'c')]) + return + +def register_Ns3DeterministicVariable_methods(root_module, cls): + ## random-variable.h: ns3::DeterministicVariable::DeterministicVariable(ns3::DeterministicVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DeterministicVariable const &', 'arg0')]) + ## random-variable.h: ns3::DeterministicVariable::DeterministicVariable(double * d, uint32_t c) [constructor] + cls.add_constructor([param('double *', 'd'), param('uint32_t', 'c')]) + return + +def register_Ns3DoubleValue_methods(root_module, cls): + ## double.h: ns3::DoubleValue::DoubleValue() [constructor] + cls.add_constructor([]) + ## double.h: ns3::DoubleValue::DoubleValue(ns3::DoubleValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DoubleValue const &', 'arg0')]) + ## double.h: ns3::DoubleValue::DoubleValue(double const & value) [constructor] + cls.add_constructor([param('double const &', 'value')]) + ## double.h: ns3::Ptr ns3::DoubleValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## double.h: bool ns3::DoubleValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## double.h: double ns3::DoubleValue::Get() const [member function] + cls.add_method('Get', + 'double', + [], + is_const=True) + ## double.h: std::string ns3::DoubleValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## double.h: void ns3::DoubleValue::Set(double const & value) [member function] + cls.add_method('Set', + 'void', + [param('double const &', 'value')]) + return + +def register_Ns3EmpiricalVariable_methods(root_module, cls): + ## random-variable.h: ns3::EmpiricalVariable::EmpiricalVariable(ns3::EmpiricalVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EmpiricalVariable const &', 'arg0')]) + ## random-variable.h: ns3::EmpiricalVariable::EmpiricalVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: void ns3::EmpiricalVariable::CDF(double v, double c) [member function] + cls.add_method('CDF', + 'void', + [param('double', 'v'), param('double', 'c')]) + return + +def register_Ns3EmptyAttributeValue_methods(root_module, cls): + ## attribute.h: ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')]) + ## attribute.h: ns3::EmptyAttributeValue::EmptyAttributeValue() [constructor] + cls.add_constructor([]) + ## attribute.h: ns3::Ptr ns3::EmptyAttributeValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, visibility='private', is_virtual=True) + ## attribute.h: bool ns3::EmptyAttributeValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + visibility='private', is_virtual=True) + ## attribute.h: std::string ns3::EmptyAttributeValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3EnumChecker_methods(root_module, cls): + ## enum.h: ns3::EnumChecker::EnumChecker(ns3::EnumChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EnumChecker const &', 'arg0')]) + ## enum.h: ns3::EnumChecker::EnumChecker() [constructor] + cls.add_constructor([]) + ## enum.h: void ns3::EnumChecker::Add(int v, std::string name) [member function] + cls.add_method('Add', + 'void', + [param('int', 'v'), param('std::string', 'name')]) + ## enum.h: void ns3::EnumChecker::AddDefault(int v, std::string name) [member function] + cls.add_method('AddDefault', + 'void', + [param('int', 'v'), param('std::string', 'name')]) + ## enum.h: bool ns3::EnumChecker::Check(ns3::AttributeValue const & value) const [member function] + cls.add_method('Check', + 'bool', + [param('ns3::AttributeValue const &', 'value')], + is_const=True, is_virtual=True) + ## enum.h: bool ns3::EnumChecker::Copy(ns3::AttributeValue const & src, ns3::AttributeValue & dst) const [member function] + cls.add_method('Copy', + 'bool', + [param('ns3::AttributeValue const &', 'src'), param('ns3::AttributeValue &', 'dst')], + is_const=True, is_virtual=True) + ## enum.h: ns3::Ptr ns3::EnumChecker::Create() const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## enum.h: std::string ns3::EnumChecker::GetUnderlyingTypeInformation() const [member function] + cls.add_method('GetUnderlyingTypeInformation', + 'std::string', + [], + is_const=True, is_virtual=True) + ## enum.h: std::string ns3::EnumChecker::GetValueTypeName() const [member function] + cls.add_method('GetValueTypeName', + 'std::string', + [], + is_const=True, is_virtual=True) + ## enum.h: bool ns3::EnumChecker::HasUnderlyingTypeInformation() const [member function] + cls.add_method('HasUnderlyingTypeInformation', + 'bool', + [], + is_const=True, is_virtual=True) + return + +def register_Ns3EnumValue_methods(root_module, cls): + ## enum.h: ns3::EnumValue::EnumValue(ns3::EnumValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EnumValue const &', 'arg0')]) + ## enum.h: ns3::EnumValue::EnumValue() [constructor] + cls.add_constructor([]) + ## enum.h: ns3::EnumValue::EnumValue(int v) [constructor] + cls.add_constructor([param('int', 'v')]) + ## enum.h: ns3::Ptr ns3::EnumValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## enum.h: bool ns3::EnumValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## enum.h: int ns3::EnumValue::Get() const [member function] + cls.add_method('Get', + 'int', + [], + is_const=True) + ## enum.h: std::string ns3::EnumValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## enum.h: void ns3::EnumValue::Set(int v) [member function] + cls.add_method('Set', + 'void', + [param('int', 'v')]) + return + +def register_Ns3ErlangVariable_methods(root_module, cls): + ## random-variable.h: ns3::ErlangVariable::ErlangVariable(ns3::ErlangVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ErlangVariable const &', 'arg0')]) + ## random-variable.h: ns3::ErlangVariable::ErlangVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::ErlangVariable::ErlangVariable(unsigned int k, double lambda) [constructor] + cls.add_constructor([param('unsigned int', 'k'), param('double', 'lambda')]) + ## random-variable.h: double ns3::ErlangVariable::GetValue() const [member function] + cls.add_method('GetValue', + 'double', + [], + is_const=True) + ## random-variable.h: double ns3::ErlangVariable::GetValue(unsigned int k, double lambda) const [member function] + cls.add_method('GetValue', + 'double', + [param('unsigned int', 'k'), param('double', 'lambda')], + is_const=True) + return + +def register_Ns3ExponentialVariable_methods(root_module, cls): + ## random-variable.h: ns3::ExponentialVariable::ExponentialVariable(ns3::ExponentialVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ExponentialVariable const &', 'arg0')]) + ## random-variable.h: ns3::ExponentialVariable::ExponentialVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::ExponentialVariable::ExponentialVariable(double m) [constructor] + cls.add_constructor([param('double', 'm')]) + ## random-variable.h: ns3::ExponentialVariable::ExponentialVariable(double m, double b) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 'b')]) + return + +def register_Ns3GammaVariable_methods(root_module, cls): + ## random-variable.h: ns3::GammaVariable::GammaVariable(ns3::GammaVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::GammaVariable const &', 'arg0')]) + ## random-variable.h: ns3::GammaVariable::GammaVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::GammaVariable::GammaVariable(double alpha, double beta) [constructor] + cls.add_constructor([param('double', 'alpha'), param('double', 'beta')]) + ## random-variable.h: double ns3::GammaVariable::GetValue() const [member function] + cls.add_method('GetValue', + 'double', + [], + is_const=True) + ## random-variable.h: double ns3::GammaVariable::GetValue(double alpha, double beta) const [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'alpha'), param('double', 'beta')], + is_const=True) + return + +def register_Ns3IntEmpiricalVariable_methods(root_module, cls): + ## random-variable.h: ns3::IntEmpiricalVariable::IntEmpiricalVariable(ns3::IntEmpiricalVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntEmpiricalVariable const &', 'arg0')]) + ## random-variable.h: ns3::IntEmpiricalVariable::IntEmpiricalVariable() [constructor] + cls.add_constructor([]) + return + +def register_Ns3IntegerValue_methods(root_module, cls): + ## integer.h: ns3::IntegerValue::IntegerValue() [constructor] + cls.add_constructor([]) + ## integer.h: ns3::IntegerValue::IntegerValue(ns3::IntegerValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IntegerValue const &', 'arg0')]) + ## integer.h: ns3::IntegerValue::IntegerValue(int64_t const & value) [constructor] + cls.add_constructor([param('int64_t const &', 'value')]) + ## integer.h: ns3::Ptr ns3::IntegerValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## integer.h: bool ns3::IntegerValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## integer.h: int64_t ns3::IntegerValue::Get() const [member function] + cls.add_method('Get', + 'int64_t', + [], + is_const=True) + ## integer.h: std::string ns3::IntegerValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## integer.h: void ns3::IntegerValue::Set(int64_t const & value) [member function] + cls.add_method('Set', + 'void', + [param('int64_t const &', 'value')]) + return + +def register_Ns3LogNormalVariable_methods(root_module, cls): + ## random-variable.h: ns3::LogNormalVariable::LogNormalVariable(ns3::LogNormalVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::LogNormalVariable const &', 'arg0')]) + ## random-variable.h: ns3::LogNormalVariable::LogNormalVariable(double mu, double sigma) [constructor] + cls.add_constructor([param('double', 'mu'), param('double', 'sigma')]) + return + +def register_Ns3NormalVariable_methods(root_module, cls): + ## random-variable.h: ns3::NormalVariable::NormalVariable(ns3::NormalVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NormalVariable const &', 'arg0')]) + ## random-variable.h: ns3::NormalVariable::NormalVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::NormalVariable::NormalVariable(double m, double v) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 'v')]) + ## random-variable.h: ns3::NormalVariable::NormalVariable(double m, double v, double b) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 'v'), param('double', 'b')]) + return + +def register_Ns3Object_methods(root_module, cls): + ## object.h: ns3::Object::Object() [constructor] + cls.add_constructor([]) + ## object.h: void ns3::Object::AggregateObject(ns3::Ptr other) [member function] + cls.add_method('AggregateObject', + 'void', + [param('ns3::Ptr< ns3::Object >', 'other')]) + ## object.h: void ns3::Object::Dispose() [member function] + cls.add_method('Dispose', + 'void', + []) + ## object.h: ns3::Object::AggregateIterator ns3::Object::GetAggregateIterator() const [member function] + cls.add_method('GetAggregateIterator', + 'ns3::Object::AggregateIterator', + [], + is_const=True) + ## object.h: ns3::TypeId ns3::Object::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## object.h: ns3::Ptr ns3::Object::GetObject(ns3::TypeId tid) const [member function] + cls.add_method('GetObject', + 'ns3::Ptr< ns3::Object >', + [param('ns3::TypeId', 'tid')], + is_const=True, template_parameters=['ns3::Object'], custom_template_method_name='GetObject') + ## object.h: static ns3::TypeId ns3::Object::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## object.h: ns3::Object::Object(ns3::Object const & o) [copy constructor] + cls.add_constructor([param('ns3::Object const &', 'o')], + visibility='protected') + ## object.h: void ns3::Object::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## object.h: void ns3::Object::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3ObjectAggregateIterator_methods(root_module, cls): + ## object.h: ns3::Object::AggregateIterator::AggregateIterator(ns3::Object::AggregateIterator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Object::AggregateIterator const &', 'arg0')]) + ## object.h: ns3::Object::AggregateIterator::AggregateIterator() [constructor] + cls.add_constructor([]) + ## object.h: bool ns3::Object::AggregateIterator::HasNext() const [member function] + cls.add_method('HasNext', + 'bool', + [], + is_const=True) + ## object.h: ns3::Ptr ns3::Object::AggregateIterator::Next() [member function] + cls.add_method('Next', + 'ns3::Ptr< ns3::Object const >', + []) + return + +def register_Ns3ObjectFactoryChecker_methods(root_module, cls): + ## object-factory.h: ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor] + cls.add_constructor([]) + ## object-factory.h: ns3::ObjectFactoryChecker::ObjectFactoryChecker(ns3::ObjectFactoryChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ObjectFactoryChecker const &', 'arg0')]) + return + +def register_Ns3ObjectFactoryValue_methods(root_module, cls): + ## object-factory.h: ns3::ObjectFactoryValue::ObjectFactoryValue() [constructor] + cls.add_constructor([]) + ## object-factory.h: ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactoryValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ObjectFactoryValue const &', 'arg0')]) + ## object-factory.h: ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactory const & value) [constructor] + cls.add_constructor([param('ns3::ObjectFactory const &', 'value')]) + ## object-factory.h: ns3::Ptr ns3::ObjectFactoryValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## object-factory.h: bool ns3::ObjectFactoryValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## object-factory.h: ns3::ObjectFactory ns3::ObjectFactoryValue::Get() const [member function] + cls.add_method('Get', + 'ns3::ObjectFactory', + [], + is_const=True) + ## object-factory.h: std::string ns3::ObjectFactoryValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## object-factory.h: void ns3::ObjectFactoryValue::Set(ns3::ObjectFactory const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::ObjectFactory const &', 'value')]) + return + +def register_Ns3ObjectVectorAccessor_methods(root_module, cls): + ## object-vector.h: ns3::ObjectVectorAccessor::ObjectVectorAccessor() [constructor] + cls.add_constructor([]) + ## object-vector.h: ns3::ObjectVectorAccessor::ObjectVectorAccessor(ns3::ObjectVectorAccessor const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ObjectVectorAccessor const &', 'arg0')]) + ## object-vector.h: bool ns3::ObjectVectorAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & value) const [member function] + cls.add_method('Get', + 'bool', + [param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'value')], + is_const=True, is_virtual=True) + ## object-vector.h: bool ns3::ObjectVectorAccessor::HasGetter() const [member function] + cls.add_method('HasGetter', + 'bool', + [], + is_const=True, is_virtual=True) + ## object-vector.h: bool ns3::ObjectVectorAccessor::HasSetter() const [member function] + cls.add_method('HasSetter', + 'bool', + [], + is_const=True, is_virtual=True) + ## object-vector.h: bool ns3::ObjectVectorAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function] + cls.add_method('Set', + 'bool', + [param('ns3::ObjectBase *', 'object'), param('ns3::AttributeValue const &', 'value')], + is_const=True, is_virtual=True) + ## object-vector.h: ns3::Ptr ns3::ObjectVectorAccessor::DoGet(ns3::ObjectBase const * object, uint32_t i) const [member function] + cls.add_method('DoGet', + 'ns3::Ptr< ns3::Object >', + [param('ns3::ObjectBase const *', 'object'), param('uint32_t', 'i')], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## object-vector.h: bool ns3::ObjectVectorAccessor::DoGetN(ns3::ObjectBase const * object, uint32_t * n) const [member function] + cls.add_method('DoGetN', + 'bool', + [param('ns3::ObjectBase const *', 'object'), param('uint32_t *', 'n')], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3ObjectVectorChecker_methods(root_module, cls): + ## object-vector.h: ns3::ObjectVectorChecker::ObjectVectorChecker() [constructor] + cls.add_constructor([]) + ## object-vector.h: ns3::ObjectVectorChecker::ObjectVectorChecker(ns3::ObjectVectorChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ObjectVectorChecker const &', 'arg0')]) + ## object-vector.h: ns3::TypeId ns3::ObjectVectorChecker::GetItemTypeId() const [member function] + cls.add_method('GetItemTypeId', + 'ns3::TypeId', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3ObjectVectorValue_methods(root_module, cls): + ## object-vector.h: ns3::ObjectVectorValue::ObjectVectorValue(ns3::ObjectVectorValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ObjectVectorValue const &', 'arg0')]) + ## object-vector.h: ns3::ObjectVectorValue::ObjectVectorValue() [constructor] + cls.add_constructor([]) + ## object-vector.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::ObjectVectorValue::Begin() const [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Object > const, std::vector< ns3::Ptr< ns3::Object > > >', + [], + is_const=True) + ## object-vector.h: ns3::Ptr ns3::ObjectVectorValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## object-vector.h: bool ns3::ObjectVectorValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## object-vector.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::ObjectVectorValue::End() const [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Object > const, std::vector< ns3::Ptr< ns3::Object > > >', + [], + is_const=True) + ## object-vector.h: ns3::Ptr ns3::ObjectVectorValue::Get(uint32_t i) const [member function] + cls.add_method('Get', + 'ns3::Ptr< ns3::Object >', + [param('uint32_t', 'i')], + is_const=True) + ## object-vector.h: uint32_t ns3::ObjectVectorValue::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## object-vector.h: std::string ns3::ObjectVectorValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + return + +def register_Ns3ParetoVariable_methods(root_module, cls): + ## random-variable.h: ns3::ParetoVariable::ParetoVariable(ns3::ParetoVariable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ParetoVariable const &', 'arg0')]) + ## random-variable.h: ns3::ParetoVariable::ParetoVariable() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::ParetoVariable::ParetoVariable(double m) [constructor] + cls.add_constructor([param('double', 'm')]) + ## random-variable.h: ns3::ParetoVariable::ParetoVariable(double m, double s) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 's')]) + ## random-variable.h: ns3::ParetoVariable::ParetoVariable(double m, double s, double b) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 's'), param('double', 'b')]) + return + +def register_Ns3PointerChecker_methods(root_module, cls): + ## pointer.h: ns3::PointerChecker::PointerChecker() [constructor] + cls.add_constructor([]) + ## pointer.h: ns3::PointerChecker::PointerChecker(ns3::PointerChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointerChecker const &', 'arg0')]) + ## pointer.h: ns3::TypeId ns3::PointerChecker::GetPointeeTypeId() const [member function] + cls.add_method('GetPointeeTypeId', + 'ns3::TypeId', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3PointerValue_methods(root_module, cls): + ## pointer.h: ns3::PointerValue::PointerValue(ns3::PointerValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointerValue const &', 'arg0')]) + ## pointer.h: ns3::PointerValue::PointerValue() [constructor] + cls.add_constructor([]) + ## pointer.h: ns3::PointerValue::PointerValue(ns3::Ptr object) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::Object >', 'object')]) + ## pointer.h: ns3::Ptr ns3::PointerValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## pointer.h: bool ns3::PointerValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## pointer.h: ns3::Ptr ns3::PointerValue::GetObject() const [member function] + cls.add_method('GetObject', + 'ns3::Ptr< ns3::Object >', + [], + is_const=True) + ## pointer.h: std::string ns3::PointerValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## pointer.h: void ns3::PointerValue::SetObject(ns3::Ptr object) [member function] + cls.add_method('SetObject', + 'void', + [param('ns3::Ptr< ns3::Object >', 'object')]) + return + +def register_Ns3RandomVariableChecker_methods(root_module, cls): + ## random-variable.h: ns3::RandomVariableChecker::RandomVariableChecker() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::RandomVariableChecker::RandomVariableChecker(ns3::RandomVariableChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RandomVariableChecker const &', 'arg0')]) + return + +def register_Ns3RandomVariableValue_methods(root_module, cls): + ## random-variable.h: ns3::RandomVariableValue::RandomVariableValue() [constructor] + cls.add_constructor([]) + ## random-variable.h: ns3::RandomVariableValue::RandomVariableValue(ns3::RandomVariableValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RandomVariableValue const &', 'arg0')]) + ## random-variable.h: ns3::RandomVariableValue::RandomVariableValue(ns3::RandomVariable const & value) [constructor] + cls.add_constructor([param('ns3::RandomVariable const &', 'value')]) + ## random-variable.h: ns3::Ptr ns3::RandomVariableValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## random-variable.h: bool ns3::RandomVariableValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## random-variable.h: ns3::RandomVariable ns3::RandomVariableValue::Get() const [member function] + cls.add_method('Get', + 'ns3::RandomVariable', + [], + is_const=True) + ## random-variable.h: std::string ns3::RandomVariableValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## random-variable.h: void ns3::RandomVariableValue::Set(ns3::RandomVariable const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::RandomVariable const &', 'value')]) + return + +def register_Ns3StringChecker_methods(root_module, cls): + ## string.h: ns3::StringChecker::StringChecker() [constructor] + cls.add_constructor([]) + ## string.h: ns3::StringChecker::StringChecker(ns3::StringChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::StringChecker const &', 'arg0')]) + return + +def register_Ns3StringValue_methods(root_module, cls): + ## string.h: ns3::StringValue::StringValue() [constructor] + cls.add_constructor([]) + ## string.h: ns3::StringValue::StringValue(ns3::StringValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::StringValue const &', 'arg0')]) + ## string.h: ns3::StringValue::StringValue(std::string const & value) [constructor] + cls.add_constructor([param('std::string const &', 'value')]) + ## string.h: ns3::Ptr ns3::StringValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## string.h: bool ns3::StringValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## string.h: std::string ns3::StringValue::Get() const [member function] + cls.add_method('Get', + 'std::string', + [], + is_const=True) + ## string.h: std::string ns3::StringValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## string.h: void ns3::StringValue::Set(std::string const & value) [member function] + cls.add_method('Set', + 'void', + [param('std::string const &', 'value')]) + return + +def register_Ns3TypeIdChecker_methods(root_module, cls): + ## type-id.h: ns3::TypeIdChecker::TypeIdChecker() [constructor] + cls.add_constructor([]) + ## type-id.h: ns3::TypeIdChecker::TypeIdChecker(ns3::TypeIdChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TypeIdChecker const &', 'arg0')]) + return + +def register_Ns3TypeIdValue_methods(root_module, cls): + ## type-id.h: ns3::TypeIdValue::TypeIdValue() [constructor] + cls.add_constructor([]) + ## type-id.h: ns3::TypeIdValue::TypeIdValue(ns3::TypeIdValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TypeIdValue const &', 'arg0')]) + ## type-id.h: ns3::TypeIdValue::TypeIdValue(ns3::TypeId const & value) [constructor] + cls.add_constructor([param('ns3::TypeId const &', 'value')]) + ## type-id.h: ns3::Ptr ns3::TypeIdValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## type-id.h: bool ns3::TypeIdValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## type-id.h: ns3::TypeId ns3::TypeIdValue::Get() const [member function] + cls.add_method('Get', + 'ns3::TypeId', + [], + is_const=True) + ## type-id.h: std::string ns3::TypeIdValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## type-id.h: void ns3::TypeIdValue::Set(ns3::TypeId const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::TypeId const &', 'value')]) + return + +def register_Ns3UintegerValue_methods(root_module, cls): + ## uinteger.h: ns3::UintegerValue::UintegerValue() [constructor] + cls.add_constructor([]) + ## uinteger.h: ns3::UintegerValue::UintegerValue(ns3::UintegerValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UintegerValue const &', 'arg0')]) + ## uinteger.h: ns3::UintegerValue::UintegerValue(uint64_t const & value) [constructor] + cls.add_constructor([param('uint64_t const &', 'value')]) + ## uinteger.h: ns3::Ptr ns3::UintegerValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## uinteger.h: bool ns3::UintegerValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## uinteger.h: uint64_t ns3::UintegerValue::Get() const [member function] + cls.add_method('Get', + 'uint64_t', + [], + is_const=True) + ## uinteger.h: std::string ns3::UintegerValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## uinteger.h: void ns3::UintegerValue::Set(uint64_t const & value) [member function] + cls.add_method('Set', + 'void', + [param('uint64_t const &', 'value')]) + return + +def register_Ns3Vector2DChecker_methods(root_module, cls): + ## vector.h: ns3::Vector2DChecker::Vector2DChecker() [constructor] + cls.add_constructor([]) + ## vector.h: ns3::Vector2DChecker::Vector2DChecker(ns3::Vector2DChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Vector2DChecker const &', 'arg0')]) + return + +def register_Ns3Vector2DValue_methods(root_module, cls): + ## vector.h: ns3::Vector2DValue::Vector2DValue() [constructor] + cls.add_constructor([]) + ## vector.h: ns3::Vector2DValue::Vector2DValue(ns3::Vector2DValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Vector2DValue const &', 'arg0')]) + ## vector.h: ns3::Vector2DValue::Vector2DValue(ns3::Vector2D const & value) [constructor] + cls.add_constructor([param('ns3::Vector2D const &', 'value')]) + ## vector.h: ns3::Ptr ns3::Vector2DValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## vector.h: bool ns3::Vector2DValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## vector.h: ns3::Vector2D ns3::Vector2DValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Vector2D', + [], + is_const=True) + ## vector.h: std::string ns3::Vector2DValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## vector.h: void ns3::Vector2DValue::Set(ns3::Vector2D const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Vector2D const &', 'value')]) + return + +def register_Ns3Vector3DChecker_methods(root_module, cls): + ## vector.h: ns3::Vector3DChecker::Vector3DChecker() [constructor] + cls.add_constructor([]) + ## vector.h: ns3::Vector3DChecker::Vector3DChecker(ns3::Vector3DChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Vector3DChecker const &', 'arg0')]) + return + +def register_Ns3Vector3DValue_methods(root_module, cls): + ## vector.h: ns3::Vector3DValue::Vector3DValue() [constructor] + cls.add_constructor([]) + ## vector.h: ns3::Vector3DValue::Vector3DValue(ns3::Vector3DValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Vector3DValue const &', 'arg0')]) + ## vector.h: ns3::Vector3DValue::Vector3DValue(ns3::Vector3D const & value) [constructor] + cls.add_constructor([param('ns3::Vector3D const &', 'value')]) + ## vector.h: ns3::Ptr ns3::Vector3DValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## vector.h: bool ns3::Vector3DValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## vector.h: ns3::Vector3D ns3::Vector3DValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Vector3D', + [], + is_const=True) + ## vector.h: std::string ns3::Vector3DValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## vector.h: void ns3::Vector3DValue::Set(ns3::Vector3D const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Vector3D const &', 'value')]) + return + +def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls): + ## traced-value.h: ns3::TracedValue::TracedValue() [constructor] + cls.add_constructor([]) + ## traced-value.h: ns3::TracedValue::TracedValue(ns3::TracedValue const & o) [copy constructor] + cls.add_constructor([param('ns3::TracedValue< unsigned int > const &', 'o')]) + ## traced-value.h: ns3::TracedValue::TracedValue(unsigned int const & v) [constructor] + cls.add_constructor([param('unsigned int const &', 'v')]) + ## traced-value.h: ns3::TracedValue::TracedValue(ns3::IntegerValue const & value) [constructor] + cls.add_constructor([param('ns3::IntegerValue const &', 'value')]) + ## traced-value.h: ns3::TracedValue::TracedValue(ns3::UintegerValue const & value) [constructor] + cls.add_constructor([param('ns3::UintegerValue const &', 'value')]) + ## traced-value.h: ns3::TracedValue::TracedValue(ns3::BooleanValue const & value) [constructor] + cls.add_constructor([param('ns3::BooleanValue const &', 'value')]) + ## traced-value.h: ns3::TracedValue::TracedValue(ns3::EnumValue const & value) [constructor] + cls.add_constructor([param('ns3::EnumValue const &', 'value')]) + ## 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')]) + ## traced-value.h: void ns3::TracedValue::ConnectWithoutContext(ns3::CallbackBase const & cb) [member function] + cls.add_method('ConnectWithoutContext', + 'void', + [param('ns3::CallbackBase const &', 'cb')]) + ## 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')]) + ## traced-value.h: void ns3::TracedValue::DisconnectWithoutContext(ns3::CallbackBase const & cb) [member function] + cls.add_method('DisconnectWithoutContext', + 'void', + [param('ns3::CallbackBase const &', 'cb')]) + ## traced-value.h: unsigned int ns3::TracedValue::Get() const [member function] + cls.add_method('Get', + 'unsigned int', + [], + is_const=True) + ## traced-value.h: void ns3::TracedValue::Set(unsigned int const & v) [member function] + cls.add_method('Set', + 'void', + [param('unsigned int const &', 'v')]) + return + +def register_Ns3ConfigMatchContainer_methods(root_module, cls): + ## config.h: ns3::Config::MatchContainer::MatchContainer(ns3::Config::MatchContainer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Config::MatchContainer const &', 'arg0')]) + ## config.h: ns3::Config::MatchContainer::MatchContainer() [constructor] + cls.add_constructor([]) + ## config.h: ns3::Config::MatchContainer::MatchContainer(std::vector, std::allocator > > const & objects, std::vector > const & contexts, std::string path) [constructor] + cls.add_constructor([param('std::vector< ns3::Ptr< ns3::Object > > const &', 'objects'), param('std::vector< std::string > const &', 'contexts'), param('std::string', 'path')]) + ## config.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::Config::MatchContainer::Begin() const [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Object > const, std::vector< ns3::Ptr< ns3::Object > > >', + [], + is_const=True) + ## config.h: void ns3::Config::MatchContainer::Connect(std::string name, ns3::CallbackBase const & cb) [member function] + cls.add_method('Connect', + 'void', + [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) + ## config.h: void ns3::Config::MatchContainer::ConnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function] + cls.add_method('ConnectWithoutContext', + 'void', + [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) + ## config.h: void ns3::Config::MatchContainer::Disconnect(std::string name, ns3::CallbackBase const & cb) [member function] + cls.add_method('Disconnect', + 'void', + [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) + ## config.h: void ns3::Config::MatchContainer::DisconnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function] + cls.add_method('DisconnectWithoutContext', + 'void', + [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) + ## config.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::Config::MatchContainer::End() const [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Object > const, std::vector< ns3::Ptr< ns3::Object > > >', + [], + is_const=True) + ## config.h: ns3::Ptr ns3::Config::MatchContainer::Get(uint32_t i) const [member function] + cls.add_method('Get', + 'ns3::Ptr< ns3::Object >', + [param('uint32_t', 'i')], + is_const=True) + ## config.h: std::string ns3::Config::MatchContainer::GetMatchedPath(uint32_t i) const [member function] + cls.add_method('GetMatchedPath', + 'std::string', + [param('uint32_t', 'i')], + is_const=True) + ## config.h: uint32_t ns3::Config::MatchContainer::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## config.h: std::string ns3::Config::MatchContainer::GetPath() const [member function] + cls.add_method('GetPath', + 'std::string', + [], + is_const=True) + ## config.h: void ns3::Config::MatchContainer::Set(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + return + +def register_functions(root_module): + module = root_module + ## breakpoint.h: extern void ns3::BreakpointFallback() [free function] + module.add_function('BreakpointFallback', + 'void', + []) + ## vector.h: extern double ns3::CalculateDistance(ns3::Vector2D const & a, ns3::Vector2D const & b) [free function] + module.add_function('CalculateDistance', + 'double', + [param('ns3::Vector2D const &', 'a'), param('ns3::Vector2D const &', 'b')]) + ## vector.h: extern double ns3::CalculateDistance(ns3::Vector3D const & a, ns3::Vector3D const & b) [free function] + module.add_function('CalculateDistance', + 'double', + [param('ns3::Vector3D const &', 'a'), param('ns3::Vector3D const &', 'b')]) + ## ptr.h: extern ns3::Ptr ns3::Create() [free function] + module.add_function('Create', + 'ns3::Ptr< ns3::ObjectVectorValue >', + [], + template_parameters=['ns3::ObjectVectorValue']) + ## ptr.h: extern ns3::Ptr ns3::Create() [free function] + module.add_function('Create', + 'ns3::Ptr< ns3::PointerValue >', + [], + template_parameters=['ns3::PointerValue']) + ## log.h: extern void ns3::LogComponentDisable(char const * name, ns3::LogLevel level) [free function] + module.add_function('LogComponentDisable', + 'void', + [param('char const *', 'name'), param('ns3::LogLevel', 'level')]) + ## log.h: extern void ns3::LogComponentDisableAll(ns3::LogLevel level) [free function] + module.add_function('LogComponentDisableAll', + 'void', + [param('ns3::LogLevel', 'level')]) + ## log.h: extern void ns3::LogComponentEnable(char const * name, ns3::LogLevel level) [free function] + module.add_function('LogComponentEnable', + 'void', + [param('char const *', 'name'), param('ns3::LogLevel', 'level')]) + ## log.h: extern void ns3::LogComponentEnableAll(ns3::LogLevel level) [free function] + module.add_function('LogComponentEnableAll', + 'void', + [param('ns3::LogLevel', 'level')]) + ## boolean.h: extern ns3::Ptr ns3::MakeBooleanChecker() [free function] + module.add_function('MakeBooleanChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## callback.h: extern ns3::Ptr ns3::MakeCallbackChecker() [free function] + module.add_function('MakeCallbackChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## enum.h: extern ns3::Ptr ns3::MakeEnumChecker(int v1, std::string n1, int v2=0, std::string n2="", int v3=0, std::string n3="", int v4=0, std::string n4="", int v5=0, std::string n5="", int v6=0, std::string n6="", int v7=0, std::string n7="", int v8=0, std::string n8="", int v9=0, std::string n9="", int v10=0, std::string n10="", int v11=0, std::string n11="", int v12=0, std::string n12="") [free function] + module.add_function('MakeEnumChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + [param('int', 'v1'), param('std::string', 'n1'), param('int', 'v2', default_value='0'), param('std::string', 'n2', default_value='""'), param('int', 'v3', default_value='0'), param('std::string', 'n3', default_value='""'), param('int', 'v4', default_value='0'), param('std::string', 'n4', default_value='""'), param('int', 'v5', default_value='0'), param('std::string', 'n5', default_value='""'), param('int', 'v6', default_value='0'), param('std::string', 'n6', default_value='""'), param('int', 'v7', default_value='0'), param('std::string', 'n7', default_value='""'), param('int', 'v8', default_value='0'), param('std::string', 'n8', default_value='""'), param('int', 'v9', default_value='0'), param('std::string', 'n9', default_value='""'), param('int', 'v10', default_value='0'), param('std::string', 'n10', default_value='""'), param('int', 'v11', default_value='0'), param('std::string', 'n11', default_value='""'), param('int', 'v12', default_value='0'), param('std::string', 'n12', default_value='""')]) + ## object-factory.h: extern ns3::Ptr ns3::MakeObjectFactoryChecker() [free function] + module.add_function('MakeObjectFactoryChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## random-variable.h: extern ns3::Ptr ns3::MakeRandomVariableChecker() [free function] + module.add_function('MakeRandomVariableChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## string.h: extern ns3::Ptr ns3::MakeStringChecker() [free function] + module.add_function('MakeStringChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## type-id.h: extern ns3::Ptr ns3::MakeTypeIdChecker() [free function] + module.add_function('MakeTypeIdChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## vector.h: extern ns3::Ptr ns3::MakeVector2DChecker() [free function] + module.add_function('MakeVector2DChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## vector.h: extern ns3::Ptr ns3::MakeVector3DChecker() [free function] + module.add_function('MakeVector3DChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## vector.h: extern ns3::Ptr ns3::MakeVectorChecker() [free function] + module.add_function('MakeVectorChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## test.h: extern bool ns3::TestDoubleIsEqual(double const a, double const b, double const epsilon=std::numeric_limits::epsilon()) [free function] + module.add_function('TestDoubleIsEqual', + 'bool', + [param('double const', 'a'), param('double const', 'b'), param('double const', 'epsilon', default_value='std::numeric_limits::epsilon()')]) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['double']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['float']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['long']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['int']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['short']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['signed char']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['unsigned long']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['unsigned int']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['unsigned short']) + ## type-name.h: extern std::string ns3::TypeNameGet() [free function] + module.add_function('TypeNameGet', + 'std::string', + [], + template_parameters=['unsigned char']) + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + ## config.h: extern void ns3::Config::Connect(std::string path, ns3::CallbackBase const & cb) [free function] + module.add_function('Connect', + 'void', + [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')]) + ## config.h: extern void ns3::Config::ConnectWithoutContext(std::string path, ns3::CallbackBase const & cb) [free function] + module.add_function('ConnectWithoutContext', + 'void', + [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')]) + ## config.h: extern void ns3::Config::Disconnect(std::string path, ns3::CallbackBase const & cb) [free function] + module.add_function('Disconnect', + 'void', + [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')]) + ## config.h: extern void ns3::Config::DisconnectWithoutContext(std::string path, ns3::CallbackBase const & cb) [free function] + module.add_function('DisconnectWithoutContext', + 'void', + [param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')]) + ## config.h: extern ns3::Ptr ns3::Config::GetRootNamespaceObject(uint32_t i) [free function] + module.add_function('GetRootNamespaceObject', + 'ns3::Ptr< ns3::Object >', + [param('uint32_t', 'i')]) + ## config.h: extern uint32_t ns3::Config::GetRootNamespaceObjectN() [free function] + module.add_function('GetRootNamespaceObjectN', + 'uint32_t', + []) + ## config.h: extern ns3::Config::MatchContainer ns3::Config::LookupMatches(std::string path) [free function] + module.add_function('LookupMatches', + 'ns3::Config::MatchContainer', + [param('std::string', 'path')]) + ## config.h: extern void ns3::Config::RegisterRootNamespaceObject(ns3::Ptr obj) [free function] + module.add_function('RegisterRootNamespaceObject', + 'void', + [param('ns3::Ptr< ns3::Object >', 'obj')]) + ## config.h: extern void ns3::Config::Set(std::string path, ns3::AttributeValue const & value) [free function] + module.add_function('Set', + 'void', + [param('std::string', 'path'), param('ns3::AttributeValue const &', 'value')]) + ## config.h: extern void ns3::Config::SetDefault(std::string name, ns3::AttributeValue const & value) [free function] + module.add_function('SetDefault', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## config.h: extern bool ns3::Config::SetDefaultFailSafe(std::string name, ns3::AttributeValue const & value) [free function] + module.add_function('SetDefaultFailSafe', + 'bool', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## config.h: extern void ns3::Config::SetGlobal(std::string name, ns3::AttributeValue const & value) [free function] + module.add_function('SetGlobal', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## config.h: extern bool ns3::Config::SetGlobalFailSafe(std::string name, ns3::AttributeValue const & value) [free function] + module.add_function('SetGlobalFailSafe', + 'bool', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## config.h: extern void ns3::Config::UnregisterRootNamespaceObject(ns3::Ptr obj) [free function] + module.add_function('UnregisterRootNamespaceObject', + 'void', + [param('ns3::Ptr< ns3::Object >', 'obj')]) + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + ## double.h: extern ns3::Ptr ns3::internal::MakeDoubleChecker(double min, double max, std::string name) [free function] + module.add_function('MakeDoubleChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + [param('double', 'min'), param('double', 'max'), param('std::string', 'name')]) + ## integer.h: extern ns3::Ptr ns3::internal::MakeIntegerChecker(int64_t min, int64_t max, std::string name) [free function] + module.add_function('MakeIntegerChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + [param('int64_t', 'min'), param('int64_t', 'max'), param('std::string', 'name')]) + ## uinteger.h: extern ns3::Ptr ns3::internal::MakeUintegerChecker(uint64_t min, uint64_t max, std::string name) [free function] + module.add_function('MakeUintegerChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + [param('uint64_t', 'min'), param('uint64_t', 'max'), param('std::string', 'name')]) + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_csma.py b/bindings/python/apidefs/gcc-LP64/ns3_module_csma.py new file mode 100644 index 000000000..f70b6d99b --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_csma.py @@ -0,0 +1,473 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## csma-channel.h: ns3::WireState [enumeration] + module.add_enum('WireState', ['IDLE', 'TRANSMITTING', 'PROPAGATING']) + ## backoff.h: ns3::Backoff [class] + module.add_class('Backoff') + ## csma-channel.h: ns3::CsmaDeviceRec [class] + module.add_class('CsmaDeviceRec') + ## csma-channel.h: ns3::CsmaChannel [class] + 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::EncapsulationMode [enumeration] + module.add_enum('EncapsulationMode', ['ILLEGAL', 'DIX', 'LLC'], outer_class=root_module['ns3::CsmaNetDevice']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Backoff_methods(root_module, root_module['ns3::Backoff']) + register_Ns3CsmaDeviceRec_methods(root_module, root_module['ns3::CsmaDeviceRec']) + register_Ns3CsmaChannel_methods(root_module, root_module['ns3::CsmaChannel']) + register_Ns3CsmaNetDevice_methods(root_module, root_module['ns3::CsmaNetDevice']) + return + +def register_Ns3Backoff_methods(root_module, cls): + ## backoff.h: ns3::Backoff::Backoff(ns3::Backoff const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Backoff const &', 'arg0')]) + ## backoff.h: ns3::Backoff::Backoff() [constructor] + cls.add_constructor([]) + ## backoff.h: ns3::Backoff::Backoff(ns3::Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries) [constructor] + cls.add_constructor([param('ns3::Time', 'slotTime'), param('uint32_t', 'minSlots'), param('uint32_t', 'maxSlots'), param('uint32_t', 'ceiling'), param('uint32_t', 'maxRetries')]) + ## backoff.h: ns3::Time ns3::Backoff::GetBackoffTime() [member function] + cls.add_method('GetBackoffTime', + 'ns3::Time', + []) + ## backoff.h: void ns3::Backoff::IncrNumRetries() [member function] + cls.add_method('IncrNumRetries', + 'void', + []) + ## backoff.h: bool ns3::Backoff::MaxRetriesReached() [member function] + cls.add_method('MaxRetriesReached', + 'bool', + []) + ## backoff.h: void ns3::Backoff::ResetBackoffTime() [member function] + cls.add_method('ResetBackoffTime', + 'void', + []) + ## backoff.h: ns3::Backoff::m_ceiling [variable] + cls.add_instance_attribute('m_ceiling', 'uint32_t', is_const=False) + ## backoff.h: ns3::Backoff::m_maxRetries [variable] + cls.add_instance_attribute('m_maxRetries', 'uint32_t', is_const=False) + ## backoff.h: ns3::Backoff::m_maxSlots [variable] + cls.add_instance_attribute('m_maxSlots', 'uint32_t', is_const=False) + ## backoff.h: ns3::Backoff::m_minSlots [variable] + cls.add_instance_attribute('m_minSlots', 'uint32_t', is_const=False) + ## backoff.h: ns3::Backoff::m_slotTime [variable] + cls.add_instance_attribute('m_slotTime', 'ns3::Time', is_const=False) + return + +def register_Ns3CsmaDeviceRec_methods(root_module, cls): + ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec(ns3::CsmaDeviceRec const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CsmaDeviceRec const &', 'arg0')]) + ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec() [constructor] + cls.add_constructor([]) + ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec(ns3::Ptr device) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')]) + ## csma-channel.h: bool ns3::CsmaDeviceRec::IsActive() [member function] + cls.add_method('IsActive', + 'bool', + []) + ## csma-channel.h: ns3::CsmaDeviceRec::active [variable] + cls.add_instance_attribute('active', 'bool', is_const=False) + ## csma-channel.h: ns3::CsmaDeviceRec::devicePtr [variable] + cls.add_instance_attribute('devicePtr', 'ns3::Ptr< ns3::CsmaNetDevice >', is_const=False) + return + +def register_Ns3CsmaChannel_methods(root_module, cls): + ## csma-channel.h: ns3::CsmaChannel::CsmaChannel(ns3::CsmaChannel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CsmaChannel const &', 'arg0')]) + ## csma-channel.h: ns3::CsmaChannel::CsmaChannel() [constructor] + cls.add_constructor([]) + ## csma-channel.h: int32_t ns3::CsmaChannel::Attach(ns3::Ptr device) [member function] + cls.add_method('Attach', + 'int32_t', + [param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')]) + ## csma-channel.h: bool ns3::CsmaChannel::Detach(ns3::Ptr device) [member function] + cls.add_method('Detach', + 'bool', + [param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')]) + ## csma-channel.h: bool ns3::CsmaChannel::Detach(uint32_t deviceId) [member function] + cls.add_method('Detach', + 'bool', + [param('uint32_t', 'deviceId')]) + ## csma-channel.h: ns3::Ptr ns3::CsmaChannel::GetCsmaDevice(uint32_t i) const [member function] + cls.add_method('GetCsmaDevice', + 'ns3::Ptr< ns3::CsmaNetDevice >', + [param('uint32_t', 'i')], + is_const=True) + ## csma-channel.h: ns3::DataRate ns3::CsmaChannel::GetDataRate() [member function] + cls.add_method('GetDataRate', + 'ns3::DataRate', + []) + ## csma-channel.h: ns3::Time ns3::CsmaChannel::GetDelay() [member function] + cls.add_method('GetDelay', + 'ns3::Time', + []) + ## csma-channel.h: ns3::Ptr ns3::CsmaChannel::GetDevice(uint32_t i) const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## csma-channel.h: int32_t ns3::CsmaChannel::GetDeviceNum(ns3::Ptr device) [member function] + cls.add_method('GetDeviceNum', + 'int32_t', + [param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')]) + ## csma-channel.h: uint32_t ns3::CsmaChannel::GetNDevices() const [member function] + cls.add_method('GetNDevices', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## csma-channel.h: uint32_t ns3::CsmaChannel::GetNumActDevices() [member function] + cls.add_method('GetNumActDevices', + 'uint32_t', + []) + ## csma-channel.h: ns3::WireState ns3::CsmaChannel::GetState() [member function] + cls.add_method('GetState', + 'ns3::WireState', + []) + ## csma-channel.h: static ns3::TypeId ns3::CsmaChannel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## csma-channel.h: bool ns3::CsmaChannel::IsActive(uint32_t deviceId) [member function] + cls.add_method('IsActive', + 'bool', + [param('uint32_t', 'deviceId')]) + ## csma-channel.h: bool ns3::CsmaChannel::IsBusy() [member function] + cls.add_method('IsBusy', + 'bool', + []) + ## csma-channel.h: void ns3::CsmaChannel::PropagationCompleteEvent() [member function] + cls.add_method('PropagationCompleteEvent', + 'void', + []) + ## csma-channel.h: bool ns3::CsmaChannel::Reattach(uint32_t deviceId) [member function] + cls.add_method('Reattach', + 'bool', + [param('uint32_t', 'deviceId')]) + ## csma-channel.h: bool ns3::CsmaChannel::Reattach(ns3::Ptr device) [member function] + cls.add_method('Reattach', + 'bool', + [param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')]) + ## csma-channel.h: bool ns3::CsmaChannel::TransmitEnd() [member function] + cls.add_method('TransmitEnd', + 'bool', + []) + ## csma-channel.h: bool ns3::CsmaChannel::TransmitStart(ns3::Ptr p, uint32_t srcId) [member function] + cls.add_method('TransmitStart', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'srcId')]) + return + +def register_Ns3CsmaNetDevice_methods(root_module, cls): + ## csma-net-device.h: static ns3::TypeId ns3::CsmaNetDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## csma-net-device.h: ns3::CsmaNetDevice::CsmaNetDevice() [constructor] + cls.add_constructor([]) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetInterframeGap(ns3::Time t) [member function] + cls.add_method('SetInterframeGap', + 'void', + [param('ns3::Time', 't')]) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetBackoffParams(ns3::Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t maxRetries, uint32_t ceiling) [member function] + cls.add_method('SetBackoffParams', + 'void', + [param('ns3::Time', 'slotTime'), param('uint32_t', 'minSlots'), param('uint32_t', 'maxSlots'), param('uint32_t', 'maxRetries'), param('uint32_t', 'ceiling')]) + ## csma-net-device.h: bool ns3::CsmaNetDevice::Attach(ns3::Ptr ch) [member function] + cls.add_method('Attach', + 'bool', + [param('ns3::Ptr< ns3::CsmaChannel >', 'ch')]) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetQueue(ns3::Ptr queue) [member function] + cls.add_method('SetQueue', + 'void', + [param('ns3::Ptr< ns3::Queue >', 'queue')]) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveErrorModel(ns3::Ptr em) [member function] + cls.add_method('SetReceiveErrorModel', + 'void', + [param('ns3::Ptr< ns3::ErrorModel >', 'em')]) + ## csma-net-device.h: void ns3::CsmaNetDevice::Receive(ns3::Ptr p, ns3::Ptr sender) [member function] + cls.add_method('Receive', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ptr< ns3::CsmaNetDevice >', 'sender')]) + ## csma-net-device.h: bool ns3::CsmaNetDevice::IsSendEnabled() [member function] + cls.add_method('IsSendEnabled', + 'bool', + []) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetSendEnable(bool enable) [member function] + cls.add_method('SetSendEnable', + 'void', + [param('bool', 'enable')]) + ## csma-net-device.h: bool ns3::CsmaNetDevice::IsReceiveEnabled() [member function] + cls.add_method('IsReceiveEnabled', + 'bool', + []) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveEnable(bool enable) [member function] + cls.add_method('SetReceiveEnable', + 'void', + [param('bool', 'enable')]) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetFrameSize(uint16_t frameSize) [member function] + cls.add_method('SetFrameSize', + 'void', + [param('uint16_t', 'frameSize')]) + ## csma-net-device.h: uint16_t ns3::CsmaNetDevice::GetFrameSize() const [member function] + cls.add_method('GetFrameSize', + '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::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## csma-net-device.h: uint32_t ns3::CsmaNetDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: ns3::Ptr ns3::CsmaNetDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + 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', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## csma-net-device.h: uint16_t ns3::CsmaNetDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + 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', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: void ns3::CsmaNetDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## csma-net-device.h: bool ns3::CsmaNetDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: bool ns3::CsmaNetDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## csma-net-device.h: bool ns3::CsmaNetDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: bool ns3::CsmaNetDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: bool ns3::CsmaNetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## csma-net-device.h: bool ns3::CsmaNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## csma-net-device.h: ns3::Ptr ns3::CsmaNetDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## csma-net-device.h: bool ns3::CsmaNetDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## csma-net-device.h: void ns3::CsmaNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## csma-net-device.h: bool ns3::CsmaNetDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## csma-net-device.h: void ns3::CsmaNetDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## csma-net-device.h: ns3::Ptr ns3::CsmaNetDevice::GetQueue() const [member function] + cls.add_method('GetQueue', + 'ns3::Ptr< ns3::Queue >', + [], + is_const=True, visibility='protected') + ## csma-net-device.h: void ns3::CsmaNetDevice::AddHeader(ns3::Ptr p, ns3::Mac48Address source, ns3::Mac48Address dest, uint16_t protocolNumber) [member function] + cls.add_method('AddHeader', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Mac48Address', 'source'), param('ns3::Mac48Address', 'dest'), param('uint16_t', 'protocolNumber')], + visibility='protected') + ## csma-net-device.h: bool ns3::CsmaNetDevice::ProcessHeader(ns3::Ptr p, uint16_t & param) [member function] + cls.add_method('ProcessHeader', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t &', 'param')], + visibility='protected') + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_dot11s.py b/bindings/python/apidefs/gcc-LP64/ns3_module_dot11s.py new file mode 100644 index 000000000..6d72fd5a7 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_dot11s.py @@ -0,0 +1,782 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sSynchronizationProtocolIdentifier [enumeration] + module.add_enum('dot11sSynchronizationProtocolIdentifier', ['SYNC_NEIGHBOUR_OFFSET', 'SYNC_NULL']) + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sCongestionControlMode [enumeration] + module.add_enum('dot11sCongestionControlMode', ['CONGESTION_SIGNALING', 'CONGESTION_NULL']) + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sAuthenticationProtocol [enumeration] + module.add_enum('dot11sAuthenticationProtocol', ['AUTH_NULL', 'AUTH_SAE']) + ## ie-dot11s-peer-management.h: ns3::dot11s::PmpReasonCode [enumeration] + module.add_enum('PmpReasonCode', ['REASON11S_PEERING_CANCELLED', 'REASON11S_MESH_MAX_PEERS', 'REASON11S_MESH_CAPABILITY_POLICY_VIOLATION', 'REASON11S_MESH_CLOSE_RCVD', 'REASON11S_MESH_MAX_RETRIES', 'REASON11S_MESH_CONFIRM_TIMEOUT', 'REASON11S_MESH_INVALID_GTK', 'REASON11S_MESH_INCONSISTENT_PARAMETERS', 'REASON11S_MESH_INVALID_SECURITY_CAPABILITY', 'REASON11S_RESERVED']) + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sPathSelectionMetric [enumeration] + module.add_enum('dot11sPathSelectionMetric', ['METRIC_AIRTIME']) + ## ie-dot11s-configuration.h: ns3::dot11s::dot11sPathSelectionProtocol [enumeration] + module.add_enum('dot11sPathSelectionProtocol', ['PROTOCOL_HWMP']) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability [class] + module.add_class('Dot11sMeshCapability') + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol [class] + module.add_class('HwmpProtocol', parent=root_module['ns3::MeshL2RoutingProtocol']) + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination [struct] + module.add_class('FailedDestination', outer_class=root_module['ns3::dot11s::HwmpProtocol']) + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTiming [class] + module.add_class('IeBeaconTiming', parent=root_module['ns3::WifiInformationElement']) + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTimingUnit [class] + module.add_class('IeBeaconTimingUnit', parent=root_module['ns3::RefCountBase']) + ## ie-dot11s-configuration.h: ns3::dot11s::IeConfiguration [class] + module.add_class('IeConfiguration', parent=root_module['ns3::WifiInformationElement']) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId [class] + module.add_class('IeMeshId', parent=root_module['ns3::WifiInformationElement']) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdChecker [class] + module.add_class('IeMeshIdChecker', parent=root_module['ns3::AttributeChecker']) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdValue [class] + module.add_class('IeMeshIdValue', parent=root_module['ns3::AttributeValue']) + ## ie-dot11s-peer-management.h: ns3::dot11s::IePeerManagement [class] + module.add_class('IePeerManagement', parent=root_module['ns3::WifiInformationElement']) + ## ie-dot11s-peer-management.h: ns3::dot11s::IePeerManagement::Subtype [enumeration] + module.add_enum('Subtype', ['PEER_OPEN', 'PEER_CONFIRM', 'PEER_CLOSE'], outer_class=root_module['ns3::dot11s::IePeerManagement']) + ## peer-link.h: ns3::dot11s::PeerLink [class] + module.add_class('PeerLink', parent=root_module['ns3::Object']) + ## peer-link.h: ns3::dot11s::PeerLink::PeerState [enumeration] + module.add_enum('PeerState', ['IDLE', 'OPN_SNT', 'CNF_RCVD', 'OPN_RCVD', 'ESTAB', 'HOLDING'], outer_class=root_module['ns3::dot11s::PeerLink']) + ## peer-management-protocol.h: ns3::dot11s::PeerManagementProtocol [class] + module.add_class('PeerManagementProtocol', parent=root_module['ns3::Object']) + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Dot11sDot11sMeshCapability_methods(root_module, root_module['ns3::dot11s::Dot11sMeshCapability']) + register_Ns3Dot11sHwmpProtocol_methods(root_module, root_module['ns3::dot11s::HwmpProtocol']) + register_Ns3Dot11sHwmpProtocolFailedDestination_methods(root_module, root_module['ns3::dot11s::HwmpProtocol::FailedDestination']) + register_Ns3Dot11sIeBeaconTiming_methods(root_module, root_module['ns3::dot11s::IeBeaconTiming']) + register_Ns3Dot11sIeBeaconTimingUnit_methods(root_module, root_module['ns3::dot11s::IeBeaconTimingUnit']) + register_Ns3Dot11sIeConfiguration_methods(root_module, root_module['ns3::dot11s::IeConfiguration']) + register_Ns3Dot11sIeMeshId_methods(root_module, root_module['ns3::dot11s::IeMeshId']) + register_Ns3Dot11sIeMeshIdChecker_methods(root_module, root_module['ns3::dot11s::IeMeshIdChecker']) + register_Ns3Dot11sIeMeshIdValue_methods(root_module, root_module['ns3::dot11s::IeMeshIdValue']) + register_Ns3Dot11sIePeerManagement_methods(root_module, root_module['ns3::dot11s::IePeerManagement']) + register_Ns3Dot11sPeerLink_methods(root_module, root_module['ns3::dot11s::PeerLink']) + register_Ns3Dot11sPeerManagementProtocol_methods(root_module, root_module['ns3::dot11s::PeerManagementProtocol']) + return + +def register_Ns3Dot11sDot11sMeshCapability_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::Dot11sMeshCapability(ns3::dot11s::Dot11sMeshCapability const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::Dot11sMeshCapability const &', 'arg0')]) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::Dot11sMeshCapability() [constructor] + cls.add_constructor([]) + ## ie-dot11s-configuration.h: ns3::Buffer::Iterator ns3::dot11s::Dot11sMeshCapability::Deserialize(ns3::Buffer::Iterator i) [member function] + cls.add_method('Deserialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'i')]) + ## ie-dot11s-configuration.h: uint8_t ns3::dot11s::Dot11sMeshCapability::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint8_t', + [], + is_const=True) + ## ie-dot11s-configuration.h: uint16_t ns3::dot11s::Dot11sMeshCapability::GetUint16() const [member function] + cls.add_method('GetUint16', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-configuration.h: bool ns3::dot11s::Dot11sMeshCapability::Is(uint16_t cap, uint8_t n) const [member function] + cls.add_method('Is', + 'bool', + [param('uint16_t', 'cap'), param('uint8_t', 'n')], + is_const=True) + ## ie-dot11s-configuration.h: ns3::Buffer::Iterator ns3::dot11s::Dot11sMeshCapability::Serialize(ns3::Buffer::Iterator i) const [member function] + cls.add_method('Serialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::MCCAEnabled [variable] + cls.add_instance_attribute('MCCAEnabled', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::MCCASupported [variable] + cls.add_instance_attribute('MCCASupported', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::TBTTAdjustment [variable] + cls.add_instance_attribute('TBTTAdjustment', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::acceptPeerLinks [variable] + cls.add_instance_attribute('acceptPeerLinks', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::beaconTimingReport [variable] + cls.add_instance_attribute('beaconTimingReport', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::forwarding [variable] + cls.add_instance_attribute('forwarding', 'bool', is_const=False) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability::powerSaveLevel [variable] + cls.add_instance_attribute('powerSaveLevel', 'bool', is_const=False) + return + +def register_Ns3Dot11sHwmpProtocol_methods(root_module, cls): + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::HwmpProtocol() [constructor] + cls.add_constructor([]) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## hwmp-protocol.h: static ns3::TypeId ns3::dot11s::HwmpProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## hwmp-protocol.h: bool ns3::dot11s::HwmpProtocol::Install(ns3::Ptr arg0) [member function] + cls.add_method('Install', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'arg0')]) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::PeerLinkStatus(ns3::Mac48Address meshPontAddress, ns3::Mac48Address peerAddress, uint32_t interface, bool status) [member function] + cls.add_method('PeerLinkStatus', + 'void', + [param('ns3::Mac48Address', 'meshPontAddress'), param('ns3::Mac48Address', 'peerAddress'), param('uint32_t', 'interface'), param('bool', 'status')]) + ## hwmp-protocol.h: bool ns3::dot11s::HwmpProtocol::RemoveRoutingStuff(uint32_t fromIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t & protocolType) [member function] + cls.add_method('RemoveRoutingStuff', + 'bool', + [param('uint32_t', 'fromIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t &', 'protocolType')], + is_virtual=True) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::Report(std::ostream & arg0) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'arg0')], + is_const=True) + ## hwmp-protocol.h: bool ns3::dot11s::HwmpProtocol::RequestRoute(uint32_t sourceIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t protocolType, ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty> routeReply) [member function] + cls.add_method('RequestRoute', + 'bool', + [param('uint32_t', 'sourceIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocolType'), param('ns3::Callback< void, bool, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty >', 'routeReply')], + is_virtual=True) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::SetNeighboursCallback(ns3::Callback >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetNeighboursCallback', + 'void', + [param('ns3::Callback< std::vector< ns3::Mac48Address >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::SetRoot() [member function] + cls.add_method('SetRoot', + 'void', + []) + ## hwmp-protocol.h: void ns3::dot11s::HwmpProtocol::UnsetRoot() [member function] + cls.add_method('UnsetRoot', + 'void', + []) + return + +def register_Ns3Dot11sHwmpProtocolFailedDestination_methods(root_module, cls): + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination::FailedDestination() [constructor] + cls.add_constructor([]) + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination::FailedDestination(ns3::dot11s::HwmpProtocol::FailedDestination const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::HwmpProtocol::FailedDestination const &', 'arg0')]) + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination::destination [variable] + cls.add_instance_attribute('destination', 'ns3::Mac48Address', is_const=False) + ## hwmp-protocol.h: ns3::dot11s::HwmpProtocol::FailedDestination::seqnum [variable] + cls.add_instance_attribute('seqnum', 'uint32_t', is_const=False) + return + +def register_Ns3Dot11sIeBeaconTiming_methods(root_module, cls): + cls.add_output_stream_operator() + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTiming::IeBeaconTiming(ns3::dot11s::IeBeaconTiming const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeBeaconTiming const &', 'arg0')]) + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTiming::IeBeaconTiming() [constructor] + cls.add_constructor([]) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::AddNeighboursTimingElementUnit(uint16_t aid, ns3::Time last_beacon, ns3::Time beacon_interval) [member function] + cls.add_method('AddNeighboursTimingElementUnit', + 'void', + [param('uint16_t', 'aid'), param('ns3::Time', 'last_beacon'), param('ns3::Time', 'beacon_interval')]) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::ClearTimingElement() [member function] + cls.add_method('ClearTimingElement', + 'void', + []) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::DelNeighboursTimingElementUnit(uint16_t aid, ns3::Time last_beacon, ns3::Time beacon_interval) [member function] + cls.add_method('DelNeighboursTimingElementUnit', + 'void', + [param('uint16_t', 'aid'), param('ns3::Time', 'last_beacon'), param('ns3::Time', 'beacon_interval')]) + ## ie-dot11s-beacon-timing.h: uint8_t ns3::dot11s::IeBeaconTiming::DeserializeInformation(ns3::Buffer::Iterator i, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'i'), param('uint8_t', 'length')], + is_virtual=True) + ## ie-dot11s-beacon-timing.h: ns3::WifiElementId ns3::dot11s::IeBeaconTiming::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-beacon-timing.h: uint8_t ns3::dot11s::IeBeaconTiming::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-beacon-timing.h: std::vector, std::allocator > > ns3::dot11s::IeBeaconTiming::GetNeighboursTimingElementsList() [member function] + cls.add_method('GetNeighboursTimingElementsList', + 'std::vector< ns3::Ptr< ns3::dot11s::IeBeaconTimingUnit > >', + []) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTiming::SerializeInformation(ns3::Buffer::Iterator i) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True, is_virtual=True) + return + +def register_Ns3Dot11sIeBeaconTimingUnit_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTimingUnit::IeBeaconTimingUnit(ns3::dot11s::IeBeaconTimingUnit const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeBeaconTimingUnit const &', 'arg0')]) + ## ie-dot11s-beacon-timing.h: ns3::dot11s::IeBeaconTimingUnit::IeBeaconTimingUnit() [constructor] + cls.add_constructor([]) + ## ie-dot11s-beacon-timing.h: uint8_t ns3::dot11s::IeBeaconTimingUnit::GetAid() const [member function] + cls.add_method('GetAid', + 'uint8_t', + [], + is_const=True) + ## ie-dot11s-beacon-timing.h: uint16_t ns3::dot11s::IeBeaconTimingUnit::GetBeaconInterval() const [member function] + cls.add_method('GetBeaconInterval', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-beacon-timing.h: uint16_t ns3::dot11s::IeBeaconTimingUnit::GetLastBeacon() const [member function] + cls.add_method('GetLastBeacon', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTimingUnit::SetAid(uint8_t aid) [member function] + cls.add_method('SetAid', + 'void', + [param('uint8_t', 'aid')]) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTimingUnit::SetBeaconInterval(uint16_t beaconInterval) [member function] + cls.add_method('SetBeaconInterval', + 'void', + [param('uint16_t', 'beaconInterval')]) + ## ie-dot11s-beacon-timing.h: void ns3::dot11s::IeBeaconTimingUnit::SetLastBeacon(uint16_t lastBeacon) [member function] + cls.add_method('SetLastBeacon', + 'void', + [param('uint16_t', 'lastBeacon')]) + return + +def register_Ns3Dot11sIeConfiguration_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ie-dot11s-configuration.h: ns3::dot11s::IeConfiguration::IeConfiguration(ns3::dot11s::IeConfiguration const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeConfiguration const &', 'arg0')]) + ## ie-dot11s-configuration.h: ns3::dot11s::IeConfiguration::IeConfiguration() [constructor] + cls.add_constructor([]) + ## ie-dot11s-configuration.h: uint8_t ns3::dot11s::IeConfiguration::DeserializeInformation(ns3::Buffer::Iterator i, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'i'), param('uint8_t', 'length')], + is_virtual=True) + ## ie-dot11s-configuration.h: ns3::WifiElementId ns3::dot11s::IeConfiguration::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-configuration.h: uint8_t ns3::dot11s::IeConfiguration::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-configuration.h: uint8_t ns3::dot11s::IeConfiguration::GetNeighborCount() [member function] + cls.add_method('GetNeighborCount', + 'uint8_t', + []) + ## ie-dot11s-configuration.h: bool ns3::dot11s::IeConfiguration::IsAirtime() [member function] + cls.add_method('IsAirtime', + 'bool', + []) + ## ie-dot11s-configuration.h: bool ns3::dot11s::IeConfiguration::IsHWMP() [member function] + cls.add_method('IsHWMP', + 'bool', + []) + ## ie-dot11s-configuration.h: ns3::dot11s::Dot11sMeshCapability const & ns3::dot11s::IeConfiguration::MeshCapability() [member function] + cls.add_method('MeshCapability', + 'ns3::dot11s::Dot11sMeshCapability const &', + []) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::SerializeInformation(ns3::Buffer::Iterator i) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True, is_virtual=True) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::SetMetric(ns3::dot11s::dot11sPathSelectionMetric metricId) [member function] + cls.add_method('SetMetric', + 'void', + [param('ns3::dot11s::dot11sPathSelectionMetric', 'metricId')]) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::SetNeighborCount(uint8_t neighbors) [member function] + cls.add_method('SetNeighborCount', + 'void', + [param('uint8_t', 'neighbors')]) + ## ie-dot11s-configuration.h: void ns3::dot11s::IeConfiguration::SetRouting(ns3::dot11s::dot11sPathSelectionProtocol routingId) [member function] + cls.add_method('SetRouting', + 'void', + [param('ns3::dot11s::dot11sPathSelectionProtocol', 'routingId')]) + return + +def register_Ns3Dot11sIeMeshId_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId::IeMeshId(ns3::dot11s::IeMeshId const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeMeshId const &', 'arg0')]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId::IeMeshId() [constructor] + cls.add_constructor([]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId::IeMeshId(std::string s) [constructor] + cls.add_constructor([param('std::string', 's')]) + ## ie-dot11s-id.h: uint8_t ns3::dot11s::IeMeshId::DeserializeInformation(ns3::Buffer::Iterator start, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')], + is_virtual=True) + ## ie-dot11s-id.h: ns3::WifiElementId ns3::dot11s::IeMeshId::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: uint8_t ns3::dot11s::IeMeshId::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: bool ns3::dot11s::IeMeshId::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True) + ## ie-dot11s-id.h: bool ns3::dot11s::IeMeshId::IsEqual(ns3::dot11s::IeMeshId const & o) const [member function] + cls.add_method('IsEqual', + 'bool', + [param('ns3::dot11s::IeMeshId const &', 'o')], + is_const=True) + ## ie-dot11s-id.h: char * ns3::dot11s::IeMeshId::PeekString() const [member function] + cls.add_method('PeekString', + 'char *', + [], + is_const=True) + ## ie-dot11s-id.h: void ns3::dot11s::IeMeshId::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: void ns3::dot11s::IeMeshId::SerializeInformation(ns3::Buffer::Iterator i) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True, is_virtual=True) + return + +def register_Ns3Dot11sIeMeshIdChecker_methods(root_module, cls): + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdChecker::IeMeshIdChecker() [constructor] + cls.add_constructor([]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdChecker::IeMeshIdChecker(ns3::dot11s::IeMeshIdChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeMeshIdChecker const &', 'arg0')]) + return + +def register_Ns3Dot11sIeMeshIdValue_methods(root_module, cls): + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdValue::IeMeshIdValue() [constructor] + cls.add_constructor([]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdValue::IeMeshIdValue(ns3::dot11s::IeMeshIdValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IeMeshIdValue const &', 'arg0')]) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshIdValue::IeMeshIdValue(ns3::dot11s::IeMeshId const & value) [constructor] + cls.add_constructor([param('ns3::dot11s::IeMeshId const &', 'value')]) + ## ie-dot11s-id.h: ns3::Ptr ns3::dot11s::IeMeshIdValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: bool ns3::dot11s::IeMeshIdValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## ie-dot11s-id.h: ns3::dot11s::IeMeshId ns3::dot11s::IeMeshIdValue::Get() const [member function] + cls.add_method('Get', + 'ns3::dot11s::IeMeshId', + [], + is_const=True) + ## ie-dot11s-id.h: std::string ns3::dot11s::IeMeshIdValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## ie-dot11s-id.h: void ns3::dot11s::IeMeshIdValue::Set(ns3::dot11s::IeMeshId const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::dot11s::IeMeshId const &', 'value')]) + return + +def register_Ns3Dot11sIePeerManagement_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ie-dot11s-peer-management.h: ns3::dot11s::IePeerManagement::IePeerManagement(ns3::dot11s::IePeerManagement const & arg0) [copy constructor] + cls.add_constructor([param('ns3::dot11s::IePeerManagement const &', 'arg0')]) + ## ie-dot11s-peer-management.h: ns3::dot11s::IePeerManagement::IePeerManagement() [constructor] + cls.add_constructor([]) + ## ie-dot11s-peer-management.h: uint8_t ns3::dot11s::IePeerManagement::DeserializeInformation(ns3::Buffer::Iterator i, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'i'), param('uint8_t', 'length')], + is_virtual=True) + ## ie-dot11s-peer-management.h: ns3::WifiElementId ns3::dot11s::IePeerManagement::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-peer-management.h: uint8_t ns3::dot11s::IePeerManagement::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## ie-dot11s-peer-management.h: uint16_t ns3::dot11s::IePeerManagement::GetLocalLinkId() const [member function] + cls.add_method('GetLocalLinkId', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-peer-management.h: uint16_t ns3::dot11s::IePeerManagement::GetPeerLinkId() const [member function] + cls.add_method('GetPeerLinkId', + 'uint16_t', + [], + is_const=True) + ## ie-dot11s-peer-management.h: ns3::dot11s::PmpReasonCode ns3::dot11s::IePeerManagement::GetReasonCode() const [member function] + cls.add_method('GetReasonCode', + 'ns3::dot11s::PmpReasonCode', + [], + is_const=True) + ## ie-dot11s-peer-management.h: uint8_t ns3::dot11s::IePeerManagement::GetSubtype() const [member function] + cls.add_method('GetSubtype', + 'uint8_t', + [], + is_const=True) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::SerializeInformation(ns3::Buffer::Iterator i) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True, is_virtual=True) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, ns3::dot11s::PmpReasonCode reasonCode) [member function] + cls.add_method('SetPeerClose', + 'void', + [param('uint16_t', 'localLinkID'), param('uint16_t', 'peerLinkId'), param('ns3::dot11s::PmpReasonCode', 'reasonCode')]) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId) [member function] + cls.add_method('SetPeerConfirm', + 'void', + [param('uint16_t', 'localLinkID'), param('uint16_t', 'peerLinkId')]) + ## ie-dot11s-peer-management.h: void ns3::dot11s::IePeerManagement::SetPeerOpen(uint16_t localLinkId) [member function] + cls.add_method('SetPeerOpen', + 'void', + [param('uint16_t', 'localLinkId')]) + ## ie-dot11s-peer-management.h: bool ns3::dot11s::IePeerManagement::SubtypeIsClose() const [member function] + cls.add_method('SubtypeIsClose', + 'bool', + [], + is_const=True) + ## ie-dot11s-peer-management.h: bool ns3::dot11s::IePeerManagement::SubtypeIsConfirm() const [member function] + cls.add_method('SubtypeIsConfirm', + 'bool', + [], + is_const=True) + ## ie-dot11s-peer-management.h: bool ns3::dot11s::IePeerManagement::SubtypeIsOpen() const [member function] + cls.add_method('SubtypeIsOpen', + 'bool', + [], + is_const=True) + return + +def register_Ns3Dot11sPeerLink_methods(root_module, cls): + ## peer-link.h: static ns3::TypeId ns3::dot11s::PeerLink::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## peer-link.h: ns3::dot11s::PeerLink::PeerLink() [constructor] + cls.add_constructor([]) + ## peer-link.h: void ns3::dot11s::PeerLink::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## peer-link.h: void ns3::dot11s::PeerLink::SetBeaconInformation(ns3::Time lastBeacon, ns3::Time BeaconInterval) [member function] + cls.add_method('SetBeaconInformation', + 'void', + [param('ns3::Time', 'lastBeacon'), param('ns3::Time', 'BeaconInterval')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetLinkStatusCallback(ns3::Callback cb) [member function] + cls.add_method('SetLinkStatusCallback', + 'void', + [param('ns3::Callback< void, unsigned int, ns3::Mac48Address, bool, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetPeerAddress(ns3::Mac48Address macaddr) [member function] + cls.add_method('SetPeerAddress', + 'void', + [param('ns3::Mac48Address', 'macaddr')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetPeerMeshPointAddress(ns3::Mac48Address macaddr) [member function] + cls.add_method('SetPeerMeshPointAddress', + 'void', + [param('ns3::Mac48Address', 'macaddr')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetInterface(uint32_t interface) [member function] + cls.add_method('SetInterface', + 'void', + [param('uint32_t', 'interface')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetLocalLinkId(uint16_t id) [member function] + cls.add_method('SetLocalLinkId', + 'void', + [param('uint16_t', 'id')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetLocalAid(uint16_t aid) [member function] + cls.add_method('SetLocalAid', + 'void', + [param('uint16_t', 'aid')]) + ## peer-link.h: void ns3::dot11s::PeerLink::SetBeaconTimingElement(ns3::dot11s::IeBeaconTiming beaconTiming) [member function] + cls.add_method('SetBeaconTimingElement', + 'void', + [param('ns3::dot11s::IeBeaconTiming', 'beaconTiming')]) + ## peer-link.h: ns3::Mac48Address ns3::dot11s::PeerLink::GetPeerAddress() const [member function] + cls.add_method('GetPeerAddress', + 'ns3::Mac48Address', + [], + is_const=True) + ## peer-link.h: uint16_t ns3::dot11s::PeerLink::GetLocalAid() const [member function] + cls.add_method('GetLocalAid', + 'uint16_t', + [], + is_const=True) + ## peer-link.h: ns3::Time ns3::dot11s::PeerLink::GetLastBeacon() const [member function] + cls.add_method('GetLastBeacon', + 'ns3::Time', + [], + is_const=True) + ## peer-link.h: ns3::Time ns3::dot11s::PeerLink::GetBeaconInterval() const [member function] + cls.add_method('GetBeaconInterval', + 'ns3::Time', + [], + is_const=True) + ## peer-link.h: ns3::dot11s::IeBeaconTiming ns3::dot11s::PeerLink::GetBeaconTimingElement() const [member function] + cls.add_method('GetBeaconTimingElement', + 'ns3::dot11s::IeBeaconTiming', + [], + is_const=True) + ## peer-link.h: void ns3::dot11s::PeerLink::MLMECancelPeerLink(ns3::dot11s::PmpReasonCode reason) [member function] + cls.add_method('MLMECancelPeerLink', + 'void', + [param('ns3::dot11s::PmpReasonCode', 'reason')]) + ## peer-link.h: void ns3::dot11s::PeerLink::MLMEActivePeerLinkOpen() [member function] + cls.add_method('MLMEActivePeerLinkOpen', + 'void', + []) + ## peer-link.h: void ns3::dot11s::PeerLink::MLMEPeeringRequestReject() [member function] + cls.add_method('MLMEPeeringRequestReject', + 'void', + []) + ## peer-link.h: void ns3::dot11s::PeerLink::MLMESetSignalStatusCallback(ns3::Callback arg0) [member function] + cls.add_method('MLMESetSignalStatusCallback', + 'void', + [param('ns3::Callback< void, unsigned int, ns3::Mac48Address, ns3::Mac48Address, ns3::dot11s::PeerLink::PeerState, ns3::dot11s::PeerLink::PeerState, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arg0')]) + ## peer-link.h: void ns3::dot11s::PeerLink::TransmissionSuccess() [member function] + cls.add_method('TransmissionSuccess', + 'void', + []) + ## peer-link.h: void ns3::dot11s::PeerLink::TransmissionFailure() [member function] + cls.add_method('TransmissionFailure', + 'void', + []) + ## peer-link.h: void ns3::dot11s::PeerLink::Report(std::ostream & os) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + return + +def register_Ns3Dot11sPeerManagementProtocol_methods(root_module, cls): + ## peer-management-protocol.h: ns3::dot11s::PeerManagementProtocol::PeerManagementProtocol() [constructor] + cls.add_constructor([]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::ConfigurationMismatch(uint32_t interface, ns3::Mac48Address peerAddress) [member function] + cls.add_method('ConfigurationMismatch', + 'void', + [param('uint32_t', 'interface'), param('ns3::Mac48Address', 'peerAddress')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## peer-management-protocol.h: ns3::Ptr ns3::dot11s::PeerManagementProtocol::FindPeerLink(uint32_t interface, ns3::Mac48Address peerAddress) [member function] + cls.add_method('FindPeerLink', + 'ns3::Ptr< ns3::dot11s::PeerLink >', + [param('uint32_t', 'interface'), param('ns3::Mac48Address', 'peerAddress')]) + ## peer-management-protocol.h: std::vector > ns3::dot11s::PeerManagementProtocol::GetActiveLinks(uint32_t interface) [member function] + cls.add_method('GetActiveLinks', + 'std::vector< ns3::Mac48Address >', + [param('uint32_t', 'interface')]) + ## peer-management-protocol.h: ns3::Mac48Address ns3::dot11s::PeerManagementProtocol::GetAddress() [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + []) + ## peer-management-protocol.h: ns3::Ptr ns3::dot11s::PeerManagementProtocol::GetBeaconTimingElement(uint32_t interface) [member function] + cls.add_method('GetBeaconTimingElement', + 'ns3::Ptr< ns3::dot11s::IeBeaconTiming >', + [param('uint32_t', 'interface')]) + ## peer-management-protocol.h: ns3::Ptr ns3::dot11s::PeerManagementProtocol::GetMeshId() const [member function] + cls.add_method('GetMeshId', + 'ns3::Ptr< ns3::dot11s::IeMeshId >', + [], + is_const=True) + ## peer-management-protocol.h: uint8_t ns3::dot11s::PeerManagementProtocol::GetNumberOfLinks() [member function] + cls.add_method('GetNumberOfLinks', + 'uint8_t', + []) + ## peer-management-protocol.h: static ns3::TypeId ns3::dot11s::PeerManagementProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## peer-management-protocol.h: bool ns3::dot11s::PeerManagementProtocol::Install(ns3::Ptr arg0) [member function] + cls.add_method('Install', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'arg0')]) + ## peer-management-protocol.h: bool ns3::dot11s::PeerManagementProtocol::IsActiveLink(uint32_t interface, ns3::Mac48Address peerAddress) [member function] + cls.add_method('IsActiveLink', + 'bool', + [param('uint32_t', 'interface'), param('ns3::Mac48Address', 'peerAddress')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::ReceivePeerLinkFrame(uint32_t interface, ns3::Mac48Address peerAddress, ns3::Mac48Address peerMeshPointAddress, uint16_t aid, ns3::dot11s::IePeerManagement peerManagementElement, ns3::dot11s::IeConfiguration meshConfig) [member function] + cls.add_method('ReceivePeerLinkFrame', + 'void', + [param('uint32_t', 'interface'), param('ns3::Mac48Address', 'peerAddress'), param('ns3::Mac48Address', 'peerMeshPointAddress'), param('uint16_t', 'aid'), param('ns3::dot11s::IePeerManagement', 'peerManagementElement'), param('ns3::dot11s::IeConfiguration', 'meshConfig')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::Report(std::ostream & arg0) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'arg0')], + is_const=True) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::SetMeshId(std::string s) [member function] + cls.add_method('SetMeshId', + 'void', + [param('std::string', 's')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::SetPeerLinkStatusCallback(ns3::Callback cb) [member function] + cls.add_method('SetPeerLinkStatusCallback', + 'void', + [param('ns3::Callback< void, ns3::Mac48Address, ns3::Mac48Address, unsigned int, bool, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::TransmissionFailure(uint32_t interface, ns3::Mac48Address const peerAddress) [member function] + cls.add_method('TransmissionFailure', + 'void', + [param('uint32_t', 'interface'), param('ns3::Mac48Address const', 'peerAddress')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::TransmissionSuccess(uint32_t interface, ns3::Mac48Address const peerAddress) [member function] + cls.add_method('TransmissionSuccess', + 'void', + [param('uint32_t', 'interface'), param('ns3::Mac48Address const', 'peerAddress')]) + ## peer-management-protocol.h: void ns3::dot11s::PeerManagementProtocol::UpdatePeerBeaconTiming(uint32_t interface, bool meshBeacon, ns3::dot11s::IeBeaconTiming timingElement, ns3::Mac48Address peerAddress, ns3::Time receivingTime, ns3::Time beaconInterval) [member function] + cls.add_method('UpdatePeerBeaconTiming', + 'void', + [param('uint32_t', 'interface'), param('bool', 'meshBeacon'), param('ns3::dot11s::IeBeaconTiming', 'timingElement'), param('ns3::Mac48Address', 'peerAddress'), param('ns3::Time', 'receivingTime'), param('ns3::Time', 'beaconInterval')]) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + ## ie-dot11s-id.h: extern ns3::Ptr ns3::dot11s::MakeIeMeshIdChecker() [free function] + module.add_function('MakeIeMeshIdChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_emu.py b/bindings/python/apidefs/gcc-LP64/ns3_module_emu.py new file mode 100644 index 000000000..b69d9fbaf --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_emu.py @@ -0,0 +1,267 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## emu-net-device.h: ns3::EmuNetDevice [class] + module.add_class('EmuNetDevice', parent=root_module['ns3::NetDevice']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3EmuNetDevice_methods(root_module, root_module['ns3::EmuNetDevice']) + return + +def register_Ns3EmuNetDevice_methods(root_module, cls): + ## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice(ns3::EmuNetDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EmuNetDevice const &', 'arg0')]) + ## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice() [constructor] + cls.add_constructor([]) + ## emu-net-device.h: void ns3::EmuNetDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: ns3::Ptr ns3::EmuNetDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: uint32_t ns3::EmuNetDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: uint16_t ns3::EmuNetDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## emu-net-device.h: ns3::Ptr ns3::EmuNetDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: static ns3::TypeId ns3::EmuNetDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## emu-net-device.h: void ns3::EmuNetDevice::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + is_virtual=True) + ## emu-net-device.h: void ns3::EmuNetDevice::SetDataRate(ns3::DataRate bps) [member function] + cls.add_method('SetDataRate', + 'void', + [param('ns3::DataRate', 'bps')]) + ## emu-net-device.h: void ns3::EmuNetDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## emu-net-device.h: bool ns3::EmuNetDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## emu-net-device.h: void ns3::EmuNetDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## emu-net-device.h: void ns3::EmuNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## emu-net-device.h: void ns3::EmuNetDevice::SetQueue(ns3::Ptr queue) [member function] + cls.add_method('SetQueue', + 'void', + [param('ns3::Ptr< ns3::Queue >', 'queue')]) + ## emu-net-device.h: void ns3::EmuNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## emu-net-device.h: void ns3::EmuNetDevice::Start(ns3::Time tStart) [member function] + cls.add_method('Start', + 'void', + [param('ns3::Time', 'tStart')]) + ## emu-net-device.h: void ns3::EmuNetDevice::Stop(ns3::Time tStop) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::Time', 'tStop')]) + ## emu-net-device.h: bool ns3::EmuNetDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## emu-net-device.h: void ns3::EmuNetDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_flame.py b/bindings/python/apidefs/gcc-LP64/ns3_module_flame.py new file mode 100644 index 000000000..453d1c01d --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_flame.py @@ -0,0 +1,200 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + ## flame-protocol.h: ns3::flame::FlameProtocol [class] + module.add_class('FlameProtocol', parent=root_module['ns3::MeshL2RoutingProtocol']) + ## flame-protocol.h: ns3::flame::FlameTag [class] + module.add_class('FlameTag', parent=root_module['ns3::Tag']) + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3FlameFlameProtocol_methods(root_module, root_module['ns3::flame::FlameProtocol']) + register_Ns3FlameFlameTag_methods(root_module, root_module['ns3::flame::FlameTag']) + return + +def register_Ns3FlameFlameProtocol_methods(root_module, cls): + ## flame-protocol.h: ns3::flame::FlameProtocol::FlameProtocol() [constructor] + cls.add_constructor([]) + ## flame-protocol.h: void ns3::flame::FlameProtocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## flame-protocol.h: ns3::Mac48Address ns3::flame::FlameProtocol::GetAddress() [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + []) + ## flame-protocol.h: static ns3::TypeId ns3::flame::FlameProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flame-protocol.h: bool ns3::flame::FlameProtocol::Install(ns3::Ptr arg0) [member function] + cls.add_method('Install', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'arg0')]) + ## flame-protocol.h: bool ns3::flame::FlameProtocol::RemoveRoutingStuff(uint32_t fromIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t & protocolType) [member function] + cls.add_method('RemoveRoutingStuff', + 'bool', + [param('uint32_t', 'fromIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t &', 'protocolType')], + is_virtual=True) + ## flame-protocol.h: void ns3::flame::FlameProtocol::Report(std::ostream & arg0) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'arg0')], + is_const=True) + ## flame-protocol.h: bool ns3::flame::FlameProtocol::RequestRoute(uint32_t sourceIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t protocolType, ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty> routeReply) [member function] + cls.add_method('RequestRoute', + 'bool', + [param('uint32_t', 'sourceIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocolType'), param('ns3::Callback< void, bool, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty >', 'routeReply')], + is_virtual=True) + ## flame-protocol.h: void ns3::flame::FlameProtocol::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + return + +def register_Ns3FlameFlameTag_methods(root_module, cls): + ## flame-protocol.h: ns3::flame::FlameTag::FlameTag(ns3::flame::FlameTag const & arg0) [copy constructor] + cls.add_constructor([param('ns3::flame::FlameTag const &', 'arg0')]) + ## flame-protocol.h: ns3::flame::FlameTag::FlameTag(ns3::Mac48Address a=ns3::Mac48Address()) [constructor] + cls.add_constructor([param('ns3::Mac48Address', 'a', default_value='ns3::Mac48Address()')]) + ## flame-protocol.h: void ns3::flame::FlameTag::Deserialize(ns3::TagBuffer i) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_virtual=True) + ## flame-protocol.h: ns3::TypeId ns3::flame::FlameTag::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## flame-protocol.h: uint32_t ns3::flame::FlameTag::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## flame-protocol.h: static ns3::TypeId ns3::flame::FlameTag::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flame-protocol.h: void ns3::flame::FlameTag::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## flame-protocol.h: void ns3::flame::FlameTag::Serialize(ns3::TagBuffer i) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_const=True, is_virtual=True) + ## flame-protocol.h: ns3::flame::FlameTag::receiver [variable] + cls.add_instance_attribute('receiver', 'ns3::Mac48Address', is_const=False) + ## flame-protocol.h: ns3::flame::FlameTag::transmitter [variable] + cls.add_instance_attribute('transmitter', 'ns3::Mac48Address', is_const=False) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_flow_monitor.py b/bindings/python/apidefs/gcc-LP64/ns3_module_flow_monitor.py new file mode 100644 index 000000000..1b8d38400 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_flow_monitor.py @@ -0,0 +1,434 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## histogram.h: ns3::Histogram [class] + module.add_class('Histogram') + ## flow-classifier.h: ns3::FlowClassifier [class] + module.add_class('FlowClassifier', parent=root_module['ns3::RefCountBase']) + ## flow-probe.h: ns3::FlowProbe [class] + module.add_class('FlowProbe', parent=root_module['ns3::RefCountBase']) + ## flow-probe.h: ns3::FlowProbe::FlowStats [struct] + module.add_class('FlowStats', outer_class=root_module['ns3::FlowProbe']) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier [class] + module.add_class('Ipv4FlowClassifier', parent=root_module['ns3::FlowClassifier']) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple [struct] + module.add_class('FiveTuple', outer_class=root_module['ns3::Ipv4FlowClassifier']) + ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe [class] + module.add_class('Ipv4FlowProbe', parent=root_module['ns3::FlowProbe']) + ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::DropReason [enumeration] + module.add_enum('DropReason', ['DROP_NO_ROUTE', 'DROP_TTL_EXPIRE', 'DROP_BAD_CHECKSUM', 'DROP_INVALID_REASON'], outer_class=root_module['ns3::Ipv4FlowProbe']) + ## flow-monitor.h: ns3::FlowMonitor [class] + module.add_class('FlowMonitor', parent=root_module['ns3::Object']) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats [struct] + module.add_class('FlowStats', outer_class=root_module['ns3::FlowMonitor']) + module.add_container('std::map< unsigned int, ns3::FlowProbe::FlowStats >', ('unsigned int', 'ns3::FlowProbe::FlowStats'), container_type='map') + module.add_container('std::map< unsigned int, ns3::FlowMonitor::FlowStats >', ('unsigned int', 'ns3::FlowMonitor::FlowStats'), container_type='map') + typehandlers.add_type_alias('uint32_t', 'ns3::FlowPacketId') + typehandlers.add_type_alias('uint32_t*', 'ns3::FlowPacketId*') + typehandlers.add_type_alias('uint32_t&', 'ns3::FlowPacketId&') + typehandlers.add_type_alias('uint32_t', 'ns3::FlowId') + typehandlers.add_type_alias('uint32_t*', 'ns3::FlowId*') + typehandlers.add_type_alias('uint32_t&', 'ns3::FlowId&') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Histogram_methods(root_module, root_module['ns3::Histogram']) + register_Ns3FlowClassifier_methods(root_module, root_module['ns3::FlowClassifier']) + register_Ns3FlowProbe_methods(root_module, root_module['ns3::FlowProbe']) + register_Ns3FlowProbeFlowStats_methods(root_module, root_module['ns3::FlowProbe::FlowStats']) + register_Ns3Ipv4FlowClassifier_methods(root_module, root_module['ns3::Ipv4FlowClassifier']) + register_Ns3Ipv4FlowClassifierFiveTuple_methods(root_module, root_module['ns3::Ipv4FlowClassifier::FiveTuple']) + register_Ns3Ipv4FlowProbe_methods(root_module, root_module['ns3::Ipv4FlowProbe']) + register_Ns3FlowMonitor_methods(root_module, root_module['ns3::FlowMonitor']) + register_Ns3FlowMonitorFlowStats_methods(root_module, root_module['ns3::FlowMonitor::FlowStats']) + return + +def register_Ns3Histogram_methods(root_module, cls): + ## histogram.h: ns3::Histogram::Histogram(ns3::Histogram const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Histogram const &', 'arg0')]) + ## histogram.h: ns3::Histogram::Histogram(double binWidth) [constructor] + cls.add_constructor([param('double', 'binWidth')]) + ## histogram.h: ns3::Histogram::Histogram() [constructor] + cls.add_constructor([]) + ## histogram.h: void ns3::Histogram::AddValue(double value) [member function] + cls.add_method('AddValue', + 'void', + [param('double', 'value')]) + ## histogram.h: uint32_t ns3::Histogram::GetBinCount(uint32_t index) [member function] + cls.add_method('GetBinCount', + 'uint32_t', + [param('uint32_t', 'index')]) + ## histogram.h: double ns3::Histogram::GetBinEnd(uint32_t index) [member function] + cls.add_method('GetBinEnd', + 'double', + [param('uint32_t', 'index')]) + ## histogram.h: double ns3::Histogram::GetBinStart(uint32_t index) [member function] + cls.add_method('GetBinStart', + 'double', + [param('uint32_t', 'index')]) + ## histogram.h: double ns3::Histogram::GetBinWidth(uint32_t index) const [member function] + cls.add_method('GetBinWidth', + 'double', + [param('uint32_t', 'index')], + is_const=True) + ## histogram.h: uint32_t ns3::Histogram::GetNBins() const [member function] + cls.add_method('GetNBins', + 'uint32_t', + [], + is_const=True) + ## histogram.h: void ns3::Histogram::SerializeToXmlStream(std::ostream & os, int indent, std::string elementName) const [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent'), param('std::string', 'elementName')], + is_const=True) + ## histogram.h: void ns3::Histogram::SetDefaultBinWidth(double binWidth) [member function] + cls.add_method('SetDefaultBinWidth', + 'void', + [param('double', 'binWidth')]) + return + +def register_Ns3FlowClassifier_methods(root_module, cls): + ## flow-classifier.h: ns3::FlowClassifier::FlowClassifier(ns3::FlowClassifier const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowClassifier const &', 'arg0')]) + ## flow-classifier.h: ns3::FlowClassifier::FlowClassifier() [constructor] + cls.add_constructor([]) + ## flow-classifier.h: void ns3::FlowClassifier::SerializeToXmlStream(std::ostream & os, int indent) const [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## flow-classifier.h: ns3::FlowId ns3::FlowClassifier::GetNewFlowId() [member function] + cls.add_method('GetNewFlowId', + 'ns3::FlowId', + [], + visibility='protected') + return + +def register_Ns3FlowProbe_methods(root_module, cls): + ## flow-probe.h: ns3::FlowProbe::FlowProbe(ns3::FlowProbe const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowProbe const &', 'arg0')]) + ## flow-probe.h: void ns3::FlowProbe::AddPacketDropStats(ns3::FlowId flowId, uint32_t packetSize, uint32_t reasonCode) [member function] + cls.add_method('AddPacketDropStats', + 'void', + [param('ns3::FlowId', 'flowId'), param('uint32_t', 'packetSize'), param('uint32_t', 'reasonCode')]) + ## flow-probe.h: void ns3::FlowProbe::AddPacketStats(ns3::FlowId flowId, uint32_t packetSize, ns3::Time delayFromFirstProbe) [member function] + cls.add_method('AddPacketStats', + 'void', + [param('ns3::FlowId', 'flowId'), param('uint32_t', 'packetSize'), param('ns3::Time', 'delayFromFirstProbe')]) + ## flow-probe.h: std::map, std::allocator > > ns3::FlowProbe::GetStats() const [member function] + cls.add_method('GetStats', + 'std::map< unsigned int, ns3::FlowProbe::FlowStats >', + [], + is_const=True) + ## flow-probe.h: void ns3::FlowProbe::SerializeToXmlStream(std::ostream & os, int indent, uint32_t index) const [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent'), param('uint32_t', 'index')], + is_const=True) + ## flow-probe.h: ns3::FlowProbe::FlowProbe(ns3::Ptr flowMonitor) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::FlowMonitor >', 'flowMonitor')], + visibility='protected') + return + +def register_Ns3FlowProbeFlowStats_methods(root_module, cls): + ## flow-probe.h: ns3::FlowProbe::FlowStats::FlowStats(ns3::FlowProbe::FlowStats const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowProbe::FlowStats const &', 'arg0')]) + ## flow-probe.h: ns3::FlowProbe::FlowStats::FlowStats() [constructor] + cls.add_constructor([]) + ## flow-probe.h: ns3::FlowProbe::FlowStats::bytes [variable] + cls.add_instance_attribute('bytes', 'uint64_t', is_const=False) + ## flow-probe.h: ns3::FlowProbe::FlowStats::bytesDropped [variable] + cls.add_instance_attribute('bytesDropped', 'std::vector< unsigned long >', is_const=False) + ## flow-probe.h: ns3::FlowProbe::FlowStats::delayFromFirstProbeSum [variable] + cls.add_instance_attribute('delayFromFirstProbeSum', 'ns3::Time', is_const=False) + ## flow-probe.h: ns3::FlowProbe::FlowStats::packets [variable] + cls.add_instance_attribute('packets', 'uint32_t', is_const=False) + ## flow-probe.h: ns3::FlowProbe::FlowStats::packetsDropped [variable] + cls.add_instance_attribute('packetsDropped', 'std::vector< unsigned int >', is_const=False) + return + +def register_Ns3Ipv4FlowClassifier_methods(root_module, cls): + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::Ipv4FlowClassifier(ns3::Ipv4FlowClassifier const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4FlowClassifier const &', 'arg0')]) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::Ipv4FlowClassifier() [constructor] + cls.add_constructor([]) + ## ipv4-flow-classifier.h: bool ns3::Ipv4FlowClassifier::Classify(ns3::Ipv4Header const & ipHeader, ns3::Ptr ipPayload, uint32_t * out_flowId, uint32_t * out_packetId) [member function] + cls.add_method('Classify', + 'bool', + [param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet const >', 'ipPayload'), param('uint32_t *', 'out_flowId'), param('uint32_t *', 'out_packetId')]) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple ns3::Ipv4FlowClassifier::FindFlow(ns3::FlowId flowId) const [member function] + cls.add_method('FindFlow', + 'ns3::Ipv4FlowClassifier::FiveTuple', + [param('ns3::FlowId', 'flowId')], + is_const=True) + ## ipv4-flow-classifier.h: void ns3::Ipv4FlowClassifier::SerializeToXmlStream(std::ostream & os, int indent) const [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent')], + is_const=True, is_virtual=True) + return + +def register_Ns3Ipv4FlowClassifierFiveTuple_methods(root_module, cls): + cls.add_binary_comparison_operator('<') + cls.add_binary_comparison_operator('==') + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::FiveTuple() [constructor] + cls.add_constructor([]) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::FiveTuple(ns3::Ipv4FlowClassifier::FiveTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4FlowClassifier::FiveTuple const &', 'arg0')]) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::destinationAddress [variable] + cls.add_instance_attribute('destinationAddress', 'ns3::Ipv4Address', is_const=False) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::destinationPort [variable] + cls.add_instance_attribute('destinationPort', 'uint16_t', is_const=False) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::protocol [variable] + cls.add_instance_attribute('protocol', 'uint8_t', is_const=False) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::sourceAddress [variable] + cls.add_instance_attribute('sourceAddress', 'ns3::Ipv4Address', is_const=False) + ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple::sourcePort [variable] + cls.add_instance_attribute('sourcePort', 'uint16_t', is_const=False) + return + +def register_Ns3Ipv4FlowProbe_methods(root_module, cls): + ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::Ipv4FlowProbe(ns3::Ipv4FlowProbe const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4FlowProbe const &', 'arg0')]) + ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::Ipv4FlowProbe(ns3::Ptr monitor, ns3::Ptr classifier, ns3::Ptr node) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::FlowMonitor >', 'monitor'), param('ns3::Ptr< ns3::Ipv4FlowClassifier >', 'classifier'), param('ns3::Ptr< ns3::Node >', 'node')]) + return + +def register_Ns3FlowMonitor_methods(root_module, cls): + ## flow-monitor.h: ns3::FlowMonitor::FlowMonitor(ns3::FlowMonitor const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowMonitor const &', 'arg0')]) + ## flow-monitor.h: ns3::FlowMonitor::FlowMonitor() [constructor] + cls.add_constructor([]) + ## flow-monitor.h: void ns3::FlowMonitor::AddProbe(ns3::Ptr probe) [member function] + cls.add_method('AddProbe', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe')]) + ## flow-monitor.h: void ns3::FlowMonitor::CheckForLostPackets() [member function] + cls.add_method('CheckForLostPackets', + 'void', + []) + ## flow-monitor.h: void ns3::FlowMonitor::CheckForLostPackets(ns3::Time maxDelay) [member function] + cls.add_method('CheckForLostPackets', + 'void', + [param('ns3::Time', 'maxDelay')]) + ## flow-monitor.h: std::vector, std::allocator > > ns3::FlowMonitor::GetAllProbes() const [member function] + cls.add_method('GetAllProbes', + 'std::vector< ns3::Ptr< ns3::FlowProbe > >', + [], + is_const=True) + ## flow-monitor.h: std::map, std::allocator > > ns3::FlowMonitor::GetFlowStats() const [member function] + cls.add_method('GetFlowStats', + 'std::map< unsigned int, ns3::FlowMonitor::FlowStats >', + [], + is_const=True) + ## flow-monitor.h: ns3::TypeId ns3::FlowMonitor::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## flow-monitor.h: static ns3::TypeId ns3::FlowMonitor::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flow-monitor.h: void ns3::FlowMonitor::ReportDrop(ns3::Ptr probe, ns3::FlowId flowId, ns3::FlowPacketId packetId, uint32_t packetSize, uint32_t reasonCode) [member function] + cls.add_method('ReportDrop', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe'), param('ns3::FlowId', 'flowId'), param('ns3::FlowPacketId', 'packetId'), param('uint32_t', 'packetSize'), param('uint32_t', 'reasonCode')]) + ## flow-monitor.h: void ns3::FlowMonitor::ReportFirstTx(ns3::Ptr probe, ns3::FlowId flowId, ns3::FlowPacketId packetId, uint32_t packetSize) [member function] + cls.add_method('ReportFirstTx', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe'), param('ns3::FlowId', 'flowId'), param('ns3::FlowPacketId', 'packetId'), param('uint32_t', 'packetSize')]) + ## flow-monitor.h: void ns3::FlowMonitor::ReportForwarding(ns3::Ptr probe, ns3::FlowId flowId, ns3::FlowPacketId packetId, uint32_t packetSize) [member function] + cls.add_method('ReportForwarding', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe'), param('ns3::FlowId', 'flowId'), param('ns3::FlowPacketId', 'packetId'), param('uint32_t', 'packetSize')]) + ## flow-monitor.h: void ns3::FlowMonitor::ReportLastRx(ns3::Ptr probe, ns3::FlowId flowId, ns3::FlowPacketId packetId, uint32_t packetSize) [member function] + cls.add_method('ReportLastRx', + 'void', + [param('ns3::Ptr< ns3::FlowProbe >', 'probe'), param('ns3::FlowId', 'flowId'), param('ns3::FlowPacketId', 'packetId'), param('uint32_t', 'packetSize')]) + ## flow-monitor.h: void ns3::FlowMonitor::SerializeToXmlFile(std::string fileName, bool enableHistograms, bool enableProbes) [member function] + cls.add_method('SerializeToXmlFile', + 'void', + [param('std::string', 'fileName'), param('bool', 'enableHistograms'), param('bool', 'enableProbes')]) + ## flow-monitor.h: void ns3::FlowMonitor::SerializeToXmlStream(std::ostream & os, int indent, bool enableHistograms, bool enableProbes) [member function] + cls.add_method('SerializeToXmlStream', + 'void', + [param('std::ostream &', 'os'), param('int', 'indent'), param('bool', 'enableHistograms'), param('bool', 'enableProbes')]) + ## flow-monitor.h: std::string ns3::FlowMonitor::SerializeToXmlString(int indent, bool enableHistograms, bool enableProbes) [member function] + cls.add_method('SerializeToXmlString', + 'std::string', + [param('int', 'indent'), param('bool', 'enableHistograms'), param('bool', 'enableProbes')]) + ## flow-monitor.h: void ns3::FlowMonitor::SetFlowClassifier(ns3::Ptr classifier) [member function] + cls.add_method('SetFlowClassifier', + 'void', + [param('ns3::Ptr< ns3::FlowClassifier >', 'classifier')]) + ## flow-monitor.h: void ns3::FlowMonitor::Start(ns3::Time const & time) [member function] + cls.add_method('Start', + 'void', + [param('ns3::Time const &', 'time')]) + ## flow-monitor.h: void ns3::FlowMonitor::StartRightNow() [member function] + cls.add_method('StartRightNow', + 'void', + []) + ## flow-monitor.h: void ns3::FlowMonitor::Stop(ns3::Time const & time) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::Time const &', 'time')]) + ## flow-monitor.h: void ns3::FlowMonitor::StopRightNow() [member function] + cls.add_method('StopRightNow', + 'void', + []) + ## flow-monitor.h: void ns3::FlowMonitor::NotifyConstructionCompleted() [member function] + cls.add_method('NotifyConstructionCompleted', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3FlowMonitorFlowStats_methods(root_module, cls): + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::FlowStats() [constructor] + cls.add_constructor([]) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::FlowStats(ns3::FlowMonitor::FlowStats const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowMonitor::FlowStats const &', 'arg0')]) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::bytesDropped [variable] + cls.add_instance_attribute('bytesDropped', 'std::vector< unsigned long >', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::delayHistogram [variable] + cls.add_instance_attribute('delayHistogram', 'ns3::Histogram', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::delaySum [variable] + cls.add_instance_attribute('delaySum', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::jitterHistogram [variable] + cls.add_instance_attribute('jitterHistogram', 'ns3::Histogram', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::jitterSum [variable] + cls.add_instance_attribute('jitterSum', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::lastDelay [variable] + cls.add_instance_attribute('lastDelay', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::lostPackets [variable] + cls.add_instance_attribute('lostPackets', 'uint32_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::packetSizeHistogram [variable] + cls.add_instance_attribute('packetSizeHistogram', 'ns3::Histogram', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::packetsDropped [variable] + cls.add_instance_attribute('packetsDropped', 'std::vector< unsigned int >', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::rxBytes [variable] + cls.add_instance_attribute('rxBytes', 'uint64_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::rxPackets [variable] + cls.add_instance_attribute('rxPackets', 'uint32_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timeFirstRxPacket [variable] + cls.add_instance_attribute('timeFirstRxPacket', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timeFirstTxPacket [variable] + cls.add_instance_attribute('timeFirstTxPacket', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timeLastRxPacket [variable] + cls.add_instance_attribute('timeLastRxPacket', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timeLastTxPacket [variable] + cls.add_instance_attribute('timeLastTxPacket', 'ns3::Time', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::timesForwarded [variable] + cls.add_instance_attribute('timesForwarded', 'uint32_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::txBytes [variable] + cls.add_instance_attribute('txBytes', 'uint64_t', is_const=False) + ## flow-monitor.h: ns3::FlowMonitor::FlowStats::txPackets [variable] + cls.add_instance_attribute('txPackets', 'uint32_t', is_const=False) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_global_routing.py b/bindings/python/apidefs/gcc-LP64/ns3_module_global_routing.py new file mode 100644 index 000000000..4f44b1996 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_global_routing.py @@ -0,0 +1,466 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## global-route-manager.h: ns3::GlobalRouteManager [class] + module.add_class('GlobalRouteManager') + ## global-router-interface.h: ns3::GlobalRoutingLSA [class] + module.add_class('GlobalRoutingLSA') + ## global-router-interface.h: ns3::GlobalRoutingLSA::LSType [enumeration] + module.add_enum('LSType', ['Unknown', 'RouterLSA', 'NetworkLSA', 'SummaryLSA', 'SummaryLSA_ASBR', 'ASExternalLSAs'], outer_class=root_module['ns3::GlobalRoutingLSA']) + ## global-router-interface.h: ns3::GlobalRoutingLSA::SPFStatus [enumeration] + module.add_enum('SPFStatus', ['LSA_SPF_NOT_EXPLORED', 'LSA_SPF_CANDIDATE', 'LSA_SPF_IN_SPFTREE'], outer_class=root_module['ns3::GlobalRoutingLSA']) + ## global-router-interface.h: ns3::GlobalRoutingLinkRecord [class] + module.add_class('GlobalRoutingLinkRecord') + ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::LinkType [enumeration] + module.add_enum('LinkType', ['Unknown', 'PointToPoint', 'TransitNetwork', 'StubNetwork', 'VirtualLink'], outer_class=root_module['ns3::GlobalRoutingLinkRecord']) + ## global-router-interface.h: ns3::GlobalRouter [class] + module.add_class('GlobalRouter', is_singleton=True, parent=root_module['ns3::Object']) + ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting [class] + module.add_class('Ipv4GlobalRouting', parent=root_module['ns3::Ipv4RoutingProtocol']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3GlobalRouteManager_methods(root_module, root_module['ns3::GlobalRouteManager']) + register_Ns3GlobalRoutingLSA_methods(root_module, root_module['ns3::GlobalRoutingLSA']) + register_Ns3GlobalRoutingLinkRecord_methods(root_module, root_module['ns3::GlobalRoutingLinkRecord']) + register_Ns3GlobalRouter_methods(root_module, root_module['ns3::GlobalRouter']) + register_Ns3Ipv4GlobalRouting_methods(root_module, root_module['ns3::Ipv4GlobalRouting']) + return + +def register_Ns3GlobalRouteManager_methods(root_module, cls): + ## global-route-manager.h: static void ns3::GlobalRouteManager::PopulateRoutingTables() [member function] + cls.add_method('PopulateRoutingTables', + 'void', + [], + is_static=True, deprecated=True) + ## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function] + cls.add_method('RecomputeRoutingTables', + 'void', + [], + 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): + cls.add_output_stream_operator() + ## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA() [constructor] + cls.add_constructor([]) + ## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA(ns3::GlobalRoutingLSA::SPFStatus status, ns3::Ipv4Address linkStateId, ns3::Ipv4Address advertisingRtr) [constructor] + cls.add_constructor([param('ns3::GlobalRoutingLSA::SPFStatus', 'status'), param('ns3::Ipv4Address', 'linkStateId'), param('ns3::Ipv4Address', 'advertisingRtr')]) + ## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA(ns3::GlobalRoutingLSA & lsa) [constructor] + cls.add_constructor([param('ns3::GlobalRoutingLSA &', 'lsa')]) + ## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::AddAttachedRouter(ns3::Ipv4Address addr) [member function] + cls.add_method('AddAttachedRouter', + 'uint32_t', + [param('ns3::Ipv4Address', 'addr')]) + ## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::AddLinkRecord(ns3::GlobalRoutingLinkRecord * lr) [member function] + cls.add_method('AddLinkRecord', + 'uint32_t', + [param('ns3::GlobalRoutingLinkRecord *', 'lr')]) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::ClearLinkRecords() [member function] + cls.add_method('ClearLinkRecords', + 'void', + []) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::CopyLinkRecords(ns3::GlobalRoutingLSA const & lsa) [member function] + cls.add_method('CopyLinkRecords', + 'void', + [param('ns3::GlobalRoutingLSA const &', 'lsa')]) + ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetAdvertisingRouter() const [member function] + cls.add_method('GetAdvertisingRouter', + 'ns3::Ipv4Address', + [], + is_const=True) + ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetAttachedRouter(uint32_t n) const [member function] + cls.add_method('GetAttachedRouter', + 'ns3::Ipv4Address', + [param('uint32_t', 'n')], + is_const=True) + ## global-router-interface.h: ns3::GlobalRoutingLSA::LSType ns3::GlobalRoutingLSA::GetLSType() const [member function] + cls.add_method('GetLSType', + 'ns3::GlobalRoutingLSA::LSType', + [], + is_const=True) + ## global-router-interface.h: ns3::GlobalRoutingLinkRecord * ns3::GlobalRoutingLSA::GetLinkRecord(uint32_t n) const [member function] + cls.add_method('GetLinkRecord', + 'ns3::GlobalRoutingLinkRecord *', + [param('uint32_t', 'n')], + is_const=True) + ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetLinkStateId() const [member function] + cls.add_method('GetLinkStateId', + 'ns3::Ipv4Address', + [], + is_const=True) + ## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::GetNAttachedRouters() const [member function] + cls.add_method('GetNAttachedRouters', + 'uint32_t', + [], + is_const=True) + ## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::GetNLinkRecords() const [member function] + cls.add_method('GetNLinkRecords', + 'uint32_t', + [], + is_const=True) + ## global-router-interface.h: ns3::Ipv4Mask ns3::GlobalRoutingLSA::GetNetworkLSANetworkMask() const [member function] + cls.add_method('GetNetworkLSANetworkMask', + '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', + [], + is_const=True) + ## global-router-interface.h: bool ns3::GlobalRoutingLSA::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetAdvertisingRouter(ns3::Ipv4Address rtr) [member function] + cls.add_method('SetAdvertisingRouter', + 'void', + [param('ns3::Ipv4Address', 'rtr')]) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetLSType(ns3::GlobalRoutingLSA::LSType typ) [member function] + cls.add_method('SetLSType', + 'void', + [param('ns3::GlobalRoutingLSA::LSType', 'typ')]) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetLinkStateId(ns3::Ipv4Address addr) [member function] + cls.add_method('SetLinkStateId', + 'void', + [param('ns3::Ipv4Address', 'addr')]) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetNetworkLSANetworkMask(ns3::Ipv4Mask mask) [member function] + 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', + [param('ns3::GlobalRoutingLSA::SPFStatus', 'status')]) + return + +def register_Ns3GlobalRoutingLinkRecord_methods(root_module, cls): + ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord(ns3::GlobalRoutingLinkRecord const & arg0) [copy constructor] + cls.add_constructor([param('ns3::GlobalRoutingLinkRecord const &', 'arg0')]) + ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord() [constructor] + cls.add_constructor([]) + ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord(ns3::GlobalRoutingLinkRecord::LinkType linkType, ns3::Ipv4Address linkId, ns3::Ipv4Address linkData, uint16_t metric) [constructor] + cls.add_constructor([param('ns3::GlobalRoutingLinkRecord::LinkType', 'linkType'), param('ns3::Ipv4Address', 'linkId'), param('ns3::Ipv4Address', 'linkData'), param('uint16_t', 'metric')]) + ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLinkRecord::GetLinkData() const [member function] + cls.add_method('GetLinkData', + 'ns3::Ipv4Address', + [], + is_const=True) + ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLinkRecord::GetLinkId() const [member function] + cls.add_method('GetLinkId', + 'ns3::Ipv4Address', + [], + is_const=True) + ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::LinkType ns3::GlobalRoutingLinkRecord::GetLinkType() const [member function] + cls.add_method('GetLinkType', + 'ns3::GlobalRoutingLinkRecord::LinkType', + [], + is_const=True) + ## global-router-interface.h: uint16_t ns3::GlobalRoutingLinkRecord::GetMetric() const [member function] + cls.add_method('GetMetric', + 'uint16_t', + [], + is_const=True) + ## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkData(ns3::Ipv4Address addr) [member function] + cls.add_method('SetLinkData', + 'void', + [param('ns3::Ipv4Address', 'addr')]) + ## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkId(ns3::Ipv4Address addr) [member function] + cls.add_method('SetLinkId', + 'void', + [param('ns3::Ipv4Address', 'addr')]) + ## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkType(ns3::GlobalRoutingLinkRecord::LinkType linkType) [member function] + cls.add_method('SetLinkType', + 'void', + [param('ns3::GlobalRoutingLinkRecord::LinkType', 'linkType')]) + ## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetMetric(uint16_t metric) [member function] + cls.add_method('SetMetric', + 'void', + [param('uint16_t', 'metric')]) + return + +def register_Ns3GlobalRouter_methods(root_module, cls): + ## global-router-interface.h: static ns3::TypeId ns3::GlobalRouter::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## global-router-interface.h: ns3::GlobalRouter::GlobalRouter() [constructor] + cls.add_constructor([]) + ## global-router-interface.h: void ns3::GlobalRouter::SetRoutingProtocol(ns3::Ptr routing) [member function] + cls.add_method('SetRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::Ipv4GlobalRouting >', 'routing')]) + ## global-router-interface.h: ns3::Ptr ns3::GlobalRouter::GetRoutingProtocol() [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::Ipv4GlobalRouting >', + []) + ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRouter::GetRouterId() const [member function] + cls.add_method('GetRouterId', + 'ns3::Ipv4Address', + [], + is_const=True) + ## global-router-interface.h: uint32_t ns3::GlobalRouter::DiscoverLSAs() [member function] + cls.add_method('DiscoverLSAs', + 'uint32_t', + []) + ## global-router-interface.h: uint32_t ns3::GlobalRouter::GetNumLSAs() const [member function] + cls.add_method('GetNumLSAs', + 'uint32_t', + [], + is_const=True) + ## global-router-interface.h: bool ns3::GlobalRouter::GetLSA(uint32_t n, ns3::GlobalRoutingLSA & lsa) const [member function] + cls.add_method('GetLSA', + 'bool', + [param('uint32_t', 'n'), param('ns3::GlobalRoutingLSA &', 'lsa')], + is_const=True) + ## global-router-interface.h: void ns3::GlobalRouter::InjectRoute(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask) [member function] + cls.add_method('InjectRoute', + 'void', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask')]) + ## global-router-interface.h: uint32_t ns3::GlobalRouter::GetNInjectedRoutes() [member function] + cls.add_method('GetNInjectedRoutes', + 'uint32_t', + []) + ## global-router-interface.h: ns3::Ipv4RoutingTableEntry * ns3::GlobalRouter::GetInjectedRoute(uint32_t i) [member function] + cls.add_method('GetInjectedRoute', + 'ns3::Ipv4RoutingTableEntry *', + [param('uint32_t', 'i')]) + ## global-router-interface.h: void ns3::GlobalRouter::RemoveInjectedRoute(uint32_t i) [member function] + cls.add_method('RemoveInjectedRoute', + 'void', + [param('uint32_t', 'i')]) + ## global-router-interface.h: bool ns3::GlobalRouter::WithdrawRoute(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask) [member function] + cls.add_method('WithdrawRoute', + 'bool', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask')]) + ## global-router-interface.h: void ns3::GlobalRouter::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3Ipv4GlobalRouting_methods(root_module, cls): + ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting(ns3::Ipv4GlobalRouting const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4GlobalRouting const &', 'arg0')]) + ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting() [constructor] + cls.add_constructor([]) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddASExternalRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function] + cls.add_method('AddASExternalRouteTo', + 'void', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')]) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function] + cls.add_method('AddHostRouteTo', + 'void', + [param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')]) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function] + cls.add_method('AddHostRouteTo', + 'void', + [param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')]) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function] + cls.add_method('AddNetworkRouteTo', + 'void', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')]) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function] + cls.add_method('AddNetworkRouteTo', + 'void', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')]) + ## ipv4-global-routing.h: uint32_t ns3::Ipv4GlobalRouting::GetNRoutes() [member function] + cls.add_method('GetNRoutes', + 'uint32_t', + []) + ## ipv4-global-routing.h: ns3::Ipv4RoutingTableEntry * ns3::Ipv4GlobalRouting::GetRoute(uint32_t i) [member function] + cls.add_method('GetRoute', + 'ns3::Ipv4RoutingTableEntry *', + [param('uint32_t', 'i')]) + ## ipv4-global-routing.h: static ns3::TypeId ns3::Ipv4GlobalRouting::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_virtual=True) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_virtual=True) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::RemoveRoute(uint32_t i) [member function] + cls.add_method('RemoveRoute', + 'void', + [param('uint32_t', 'i')]) + ## ipv4-global-routing.h: bool ns3::Ipv4GlobalRouting::RouteInput(ns3::Ptr p, ns3::Ipv4Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + is_virtual=True) + ## ipv4-global-routing.h: ns3::Ptr ns3::Ipv4GlobalRouting::RouteOutput(ns3::Ptr p, ns3::Ipv4Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv4Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + is_virtual=True) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::SetIpv4(ns3::Ptr ipv4) [member function] + cls.add_method('SetIpv4', + 'void', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], + is_virtual=True) + ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py b/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py new file mode 100644 index 000000000..b859378f3 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py @@ -0,0 +1,1881 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## application-container.h: ns3::ApplicationContainer [class] + module.add_class('ApplicationContainer') + ## athstats-helper.h: ns3::AthstatsHelper [class] + module.add_class('AthstatsHelper', allow_subclassing=False) + ## bridge-helper.h: ns3::BridgeHelper [class] + module.add_class('BridgeHelper', allow_subclassing=False) + ## csma-helper.h: ns3::CsmaHelper [class] + module.add_class('CsmaHelper', allow_subclassing=False) + ## emu-helper.h: ns3::EmuHelper [class] + module.add_class('EmuHelper', allow_subclassing=False) + ## flow-monitor-helper.h: ns3::FlowMonitorHelper [class] + module.add_class('FlowMonitorHelper', allow_subclassing=False) + ## internet-stack-helper.h: ns3::InternetStackHelper [class] + module.add_class('InternetStackHelper', allow_subclassing=False) + ## ipv4-address-helper.h: ns3::Ipv4AddressHelper [class] + module.add_class('Ipv4AddressHelper', allow_subclassing=False) + ## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer [class] + module.add_class('Ipv4InterfaceContainer') + ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper [class] + module.add_class('Ipv4RoutingHelper', allow_subclassing=False) + ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper [class] + module.add_class('Ipv4StaticRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) + ## ipv6-address-helper.h: ns3::Ipv6AddressHelper [class] + module.add_class('Ipv6AddressHelper', allow_subclassing=False) + ## ipv6-interface-container.h: ns3::Ipv6InterfaceContainer [class] + module.add_class('Ipv6InterfaceContainer') + ## ipv6-routing-helper.h: ns3::Ipv6RoutingHelper [class] + module.add_class('Ipv6RoutingHelper', allow_subclassing=False) + ## ipv6-static-routing-helper.h: ns3::Ipv6StaticRoutingHelper [class] + module.add_class('Ipv6StaticRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv6RoutingHelper']) + ## mesh-helper.h: ns3::MeshHelper [class] + module.add_class('MeshHelper', allow_subclassing=False) + ## mesh-helper.h: ns3::MeshHelper::ChannelPolicy [enumeration] + module.add_enum('ChannelPolicy', ['SPREAD_CHANNELS', 'ZERO_CHANNEL'], outer_class=root_module['ns3::MeshHelper']) + ## mobility-helper.h: ns3::MobilityHelper [class] + module.add_class('MobilityHelper', allow_subclassing=False) + ## net-device-container.h: ns3::NetDeviceContainer [class] + module.add_class('NetDeviceContainer') + ## node-container.h: ns3::NodeContainer [class] + module.add_class('NodeContainer') + ## ns2-mobility-helper.h: ns3::Ns2MobilityHelper [class] + module.add_class('Ns2MobilityHelper', allow_subclassing=False) + ## olsr-helper.h: ns3::OlsrHelper [class] + module.add_class('OlsrHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) + ## on-off-helper.h: ns3::OnOffHelper [class] + module.add_class('OnOffHelper', allow_subclassing=False) + ## packet-sink-helper.h: ns3::PacketSinkHelper [class] + module.add_class('PacketSinkHelper', allow_subclassing=False) + ## packet-socket-helper.h: ns3::PacketSocketHelper [class] + module.add_class('PacketSocketHelper', allow_subclassing=False) + ## ping6-helper.h: ns3::Ping6Helper [class] + module.add_class('Ping6Helper', allow_subclassing=False) + ## point-to-point-helper.h: ns3::PointToPointHelper [class] + module.add_class('PointToPointHelper', allow_subclassing=False) + ## tap-bridge-helper.h: ns3::TapBridgeHelper [class] + module.add_class('TapBridgeHelper', allow_subclassing=False) + ## udp-echo-helper.h: ns3::UdpEchoClientHelper [class] + module.add_class('UdpEchoClientHelper', allow_subclassing=False) + ## udp-echo-helper.h: ns3::UdpEchoServerHelper [class] + module.add_class('UdpEchoServerHelper', allow_subclassing=False) + ## v4ping-helper.h: ns3::V4PingHelper [class] + module.add_class('V4PingHelper', allow_subclassing=False) + ## wifi-helper.h: ns3::WifiHelper [class] + module.add_class('WifiHelper', allow_subclassing=False) + ## wifi-helper.h: ns3::WifiMacHelper [class] + module.add_class('WifiMacHelper', allow_subclassing=False) + ## wifi-helper.h: ns3::WifiPhyHelper [class] + module.add_class('WifiPhyHelper', allow_subclassing=False) + ## yans-wifi-helper.h: ns3::YansWifiChannelHelper [class] + module.add_class('YansWifiChannelHelper', allow_subclassing=False) + ## yans-wifi-helper.h: ns3::YansWifiPhyHelper [class] + module.add_class('YansWifiPhyHelper', allow_subclassing=False, parent=root_module['ns3::WifiPhyHelper']) + ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::PcapFormat [enumeration] + module.add_enum('PcapFormat', ['PCAP_FORMAT_80211', 'PCAP_FORMAT_80211_PRISM', 'PCAP_FORMAT_80211_RADIOTAP'], outer_class=root_module['ns3::YansWifiPhyHelper']) + ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper [class] + module.add_class('Ipv4GlobalRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) + ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper [class] + module.add_class('Ipv4ListRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) + ## ipv4-nix-vector-helper.h: ns3::Ipv4NixVectorHelper [class] + module.add_class('Ipv4NixVectorHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) + ## ipv6-list-routing-helper.h: ns3::Ipv6ListRoutingHelper [class] + module.add_class('Ipv6ListRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv6RoutingHelper']) + ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper [class] + module.add_class('NqosWifiMacHelper', allow_subclassing=False, parent=root_module['ns3::WifiMacHelper']) + ## qos-wifi-mac-helper.h: ns3::QosWifiMacHelper [class] + module.add_class('QosWifiMacHelper', allow_subclassing=False, parent=root_module['ns3::WifiMacHelper']) + ## athstats-helper.h: ns3::AthstatsWifiTraceSink [class] + module.add_class('AthstatsWifiTraceSink', parent=root_module['ns3::Object']) + ## mesh-stack-installer.h: ns3::MeshStack [class] + module.add_class('MeshStack', parent=root_module['ns3::Object']) + ## dot11s-installer.h: ns3::Dot11sStack [class] + module.add_class('Dot11sStack', parent=root_module['ns3::MeshStack']) + ## flame-installer.h: ns3::FlameStack [class] + module.add_class('FlameStack', parent=root_module['ns3::MeshStack']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3ApplicationContainer_methods(root_module, root_module['ns3::ApplicationContainer']) + register_Ns3AthstatsHelper_methods(root_module, root_module['ns3::AthstatsHelper']) + register_Ns3BridgeHelper_methods(root_module, root_module['ns3::BridgeHelper']) + register_Ns3CsmaHelper_methods(root_module, root_module['ns3::CsmaHelper']) + register_Ns3EmuHelper_methods(root_module, root_module['ns3::EmuHelper']) + register_Ns3FlowMonitorHelper_methods(root_module, root_module['ns3::FlowMonitorHelper']) + register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper']) + register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper']) + register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer']) + register_Ns3Ipv4RoutingHelper_methods(root_module, root_module['ns3::Ipv4RoutingHelper']) + register_Ns3Ipv4StaticRoutingHelper_methods(root_module, root_module['ns3::Ipv4StaticRoutingHelper']) + register_Ns3Ipv6AddressHelper_methods(root_module, root_module['ns3::Ipv6AddressHelper']) + register_Ns3Ipv6InterfaceContainer_methods(root_module, root_module['ns3::Ipv6InterfaceContainer']) + register_Ns3Ipv6RoutingHelper_methods(root_module, root_module['ns3::Ipv6RoutingHelper']) + register_Ns3Ipv6StaticRoutingHelper_methods(root_module, root_module['ns3::Ipv6StaticRoutingHelper']) + register_Ns3MeshHelper_methods(root_module, root_module['ns3::MeshHelper']) + register_Ns3MobilityHelper_methods(root_module, root_module['ns3::MobilityHelper']) + register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer']) + register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer']) + register_Ns3Ns2MobilityHelper_methods(root_module, root_module['ns3::Ns2MobilityHelper']) + register_Ns3OlsrHelper_methods(root_module, root_module['ns3::OlsrHelper']) + register_Ns3OnOffHelper_methods(root_module, root_module['ns3::OnOffHelper']) + register_Ns3PacketSinkHelper_methods(root_module, root_module['ns3::PacketSinkHelper']) + register_Ns3PacketSocketHelper_methods(root_module, root_module['ns3::PacketSocketHelper']) + register_Ns3Ping6Helper_methods(root_module, root_module['ns3::Ping6Helper']) + register_Ns3PointToPointHelper_methods(root_module, root_module['ns3::PointToPointHelper']) + register_Ns3TapBridgeHelper_methods(root_module, root_module['ns3::TapBridgeHelper']) + register_Ns3UdpEchoClientHelper_methods(root_module, root_module['ns3::UdpEchoClientHelper']) + register_Ns3UdpEchoServerHelper_methods(root_module, root_module['ns3::UdpEchoServerHelper']) + register_Ns3V4PingHelper_methods(root_module, root_module['ns3::V4PingHelper']) + register_Ns3WifiHelper_methods(root_module, root_module['ns3::WifiHelper']) + register_Ns3WifiMacHelper_methods(root_module, root_module['ns3::WifiMacHelper']) + register_Ns3WifiPhyHelper_methods(root_module, root_module['ns3::WifiPhyHelper']) + register_Ns3YansWifiChannelHelper_methods(root_module, root_module['ns3::YansWifiChannelHelper']) + register_Ns3YansWifiPhyHelper_methods(root_module, root_module['ns3::YansWifiPhyHelper']) + register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, root_module['ns3::Ipv4GlobalRoutingHelper']) + register_Ns3Ipv4ListRoutingHelper_methods(root_module, root_module['ns3::Ipv4ListRoutingHelper']) + register_Ns3Ipv4NixVectorHelper_methods(root_module, root_module['ns3::Ipv4NixVectorHelper']) + register_Ns3Ipv6ListRoutingHelper_methods(root_module, root_module['ns3::Ipv6ListRoutingHelper']) + register_Ns3NqosWifiMacHelper_methods(root_module, root_module['ns3::NqosWifiMacHelper']) + register_Ns3QosWifiMacHelper_methods(root_module, root_module['ns3::QosWifiMacHelper']) + register_Ns3AthstatsWifiTraceSink_methods(root_module, root_module['ns3::AthstatsWifiTraceSink']) + register_Ns3MeshStack_methods(root_module, root_module['ns3::MeshStack']) + register_Ns3Dot11sStack_methods(root_module, root_module['ns3::Dot11sStack']) + register_Ns3FlameStack_methods(root_module, root_module['ns3::FlameStack']) + return + +def register_Ns3ApplicationContainer_methods(root_module, cls): + ## application-container.h: ns3::ApplicationContainer::ApplicationContainer(ns3::ApplicationContainer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ApplicationContainer const &', 'arg0')]) + ## application-container.h: ns3::ApplicationContainer::ApplicationContainer() [constructor] + cls.add_constructor([]) + ## application-container.h: ns3::ApplicationContainer::ApplicationContainer(ns3::Ptr application) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::Application >', 'application')]) + ## application-container.h: ns3::ApplicationContainer::ApplicationContainer(std::string name) [constructor] + cls.add_constructor([param('std::string', 'name')]) + ## application-container.h: void ns3::ApplicationContainer::Add(ns3::ApplicationContainer other) [member function] + cls.add_method('Add', + 'void', + [param('ns3::ApplicationContainer', 'other')]) + ## application-container.h: void ns3::ApplicationContainer::Add(ns3::Ptr application) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::Application >', 'application')]) + ## application-container.h: void ns3::ApplicationContainer::Add(std::string name) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'name')]) + ## application-container.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::ApplicationContainer::Begin() const [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Application > const, std::vector< ns3::Ptr< ns3::Application > > >', + [], + is_const=True) + ## application-container.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::ApplicationContainer::End() const [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Application > const, std::vector< ns3::Ptr< ns3::Application > > >', + [], + is_const=True) + ## application-container.h: ns3::Ptr ns3::ApplicationContainer::Get(uint32_t i) const [member function] + cls.add_method('Get', + 'ns3::Ptr< ns3::Application >', + [param('uint32_t', 'i')], + is_const=True) + ## application-container.h: uint32_t ns3::ApplicationContainer::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## application-container.h: void ns3::ApplicationContainer::Start(ns3::Time start) [member function] + cls.add_method('Start', + 'void', + [param('ns3::Time', 'start')]) + ## application-container.h: void ns3::ApplicationContainer::Stop(ns3::Time stop) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::Time', 'stop')]) + return + +def register_Ns3AthstatsHelper_methods(root_module, cls): + ## athstats-helper.h: ns3::AthstatsHelper::AthstatsHelper(ns3::AthstatsHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AthstatsHelper const &', 'arg0')]) + ## athstats-helper.h: ns3::AthstatsHelper::AthstatsHelper() [constructor] + cls.add_constructor([]) + ## athstats-helper.h: void ns3::AthstatsHelper::EnableAthstats(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAthstats', + 'void', + [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')]) + ## athstats-helper.h: void ns3::AthstatsHelper::EnableAthstats(std::string filename, ns3::Ptr nd) [member function] + cls.add_method('EnableAthstats', + 'void', + [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) + ## athstats-helper.h: void ns3::AthstatsHelper::EnableAthstats(std::string filename, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAthstats', + 'void', + [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')]) + ## athstats-helper.h: void ns3::AthstatsHelper::EnableAthstats(std::string filename, ns3::NodeContainer n) [member function] + cls.add_method('EnableAthstats', + 'void', + [param('std::string', 'filename'), param('ns3::NodeContainer', 'n')]) + return + +def register_Ns3BridgeHelper_methods(root_module, cls): + ## bridge-helper.h: ns3::BridgeHelper::BridgeHelper(ns3::BridgeHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BridgeHelper const &', 'arg0')]) + ## bridge-helper.h: ns3::BridgeHelper::BridgeHelper() [constructor] + cls.add_constructor([]) + ## bridge-helper.h: ns3::NetDeviceContainer ns3::BridgeHelper::Install(ns3::Ptr node, ns3::NetDeviceContainer c) [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::NetDeviceContainer', 'c')]) + ## bridge-helper.h: ns3::NetDeviceContainer ns3::BridgeHelper::Install(std::string nodeName, ns3::NetDeviceContainer c) [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName'), param('ns3::NetDeviceContainer', 'c')]) + ## bridge-helper.h: void ns3::BridgeHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetDeviceAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + return + +def register_Ns3CsmaHelper_methods(root_module, cls): + ## csma-helper.h: ns3::CsmaHelper::CsmaHelper(ns3::CsmaHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CsmaHelper const &', 'arg0')]) + ## csma-helper.h: ns3::CsmaHelper::CsmaHelper() [constructor] + cls.add_constructor([]) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::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) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=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', + [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::Ptr nd, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, std::string ndName, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('std::string', 'ndName'), param('bool', 'promiscuous')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::NodeContainer n, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnablePcapAll(std::string filename, bool promiscuous) [member function] + cls.add_method('EnablePcapAll', + 'void', + [param('std::string', 'filename'), param('bool', 'promiscuous')], + is_static=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string name) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'name')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: void ns3::CsmaHelper::InstallStar(ns3::Ptr hub, ns3::NodeContainer spokes, ns3::NetDeviceContainer & hubDevices, ns3::NetDeviceContainer & spokeDevices) [member function] + cls.add_method('InstallStar', + 'void', + [param('ns3::Ptr< ns3::Node >', 'hub'), param('ns3::NodeContainer', 'spokes'), param('ns3::NetDeviceContainer &', 'hubDevices'), param('ns3::NetDeviceContainer &', 'spokeDevices')]) + ## csma-helper.h: void ns3::CsmaHelper::InstallStar(std::string hubName, ns3::NodeContainer spokes, ns3::NetDeviceContainer & hubDevices, ns3::NetDeviceContainer & spokeDevices) [member function] + cls.add_method('InstallStar', + 'void', + [param('std::string', 'hubName'), param('ns3::NodeContainer', 'spokes'), param('ns3::NetDeviceContainer &', 'hubDevices'), param('ns3::NetDeviceContainer &', 'spokeDevices')]) + ## csma-helper.h: void ns3::CsmaHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetChannelAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## csma-helper.h: void ns3::CsmaHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetDeviceAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## csma-helper.h: void ns3::CsmaHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')]) + return + +def register_Ns3EmuHelper_methods(root_module, cls): + ## emu-helper.h: ns3::EmuHelper::EmuHelper(ns3::EmuHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EmuHelper const &', 'arg0')]) + ## emu-helper.h: ns3::EmuHelper::EmuHelper() [constructor] + cls.add_constructor([]) + ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::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) + ## emu-helper.h: static void ns3::EmuHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::Ptr nd, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, std::string ndName, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('std::string', 'ndName'), param('bool', 'promiscuous')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::NodeContainer n, bool promiscuous) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnablePcapAll(std::string filename, bool promiscuous) [member function] + cls.add_method('EnablePcapAll', + 'void', + [param('std::string', 'filename'), param('bool', 'promiscuous')], + is_static=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName')], + is_const=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::NodeContainer const & c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c')], + is_const=True) + ## emu-helper.h: void ns3::EmuHelper::SetAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## emu-helper.h: void ns3::EmuHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')]) + return + +def register_Ns3FlowMonitorHelper_methods(root_module, cls): + ## flow-monitor-helper.h: ns3::FlowMonitorHelper::FlowMonitorHelper(ns3::FlowMonitorHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlowMonitorHelper const &', 'arg0')]) + ## flow-monitor-helper.h: ns3::FlowMonitorHelper::FlowMonitorHelper() [constructor] + cls.add_constructor([]) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::GetClassifier() [member function] + cls.add_method('GetClassifier', + 'ns3::Ptr< ns3::FlowClassifier >', + []) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::GetMonitor() [member function] + cls.add_method('GetMonitor', + 'ns3::Ptr< ns3::FlowMonitor >', + []) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::Install(ns3::NodeContainer nodes) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::FlowMonitor >', + [param('ns3::NodeContainer', 'nodes')]) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::Install(ns3::Ptr node) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::FlowMonitor >', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## flow-monitor-helper.h: ns3::Ptr ns3::FlowMonitorHelper::InstallAll() [member function] + cls.add_method('InstallAll', + 'ns3::Ptr< ns3::FlowMonitor >', + []) + ## flow-monitor-helper.h: void ns3::FlowMonitorHelper::SetMonitorAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetMonitorAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + return + +def register_Ns3InternetStackHelper_methods(root_module, cls): + ## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper(ns3::InternetStackHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::InternetStackHelper const &', 'arg0')]) + ## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper() [constructor] + cls.add_constructor([]) + ## internet-stack-helper.h: static void ns3::InternetStackHelper::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) + ## internet-stack-helper.h: static void ns3::InternetStackHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=True) + ## internet-stack-helper.h: static void ns3::InternetStackHelper::EnablePcapAll(std::string filename) [member function] + cls.add_method('EnablePcapAll', + 'void', + [param('std::string', 'filename')], + is_static=True) + ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'void', + [param('std::string', 'nodeName')], + is_const=True) + ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'void', + [param('ns3::NodeContainer', 'c')], + is_const=True) + ## internet-stack-helper.h: void ns3::InternetStackHelper::InstallAll() const [member function] + cls.add_method('InstallAll', + 'void', + [], + is_const=True) + ## internet-stack-helper.h: void ns3::InternetStackHelper::SetIpv4StackInstall(bool enable) [member function] + cls.add_method('SetIpv4StackInstall', + 'void', + [param('bool', 'enable')]) + ## internet-stack-helper.h: void ns3::InternetStackHelper::SetIpv6StackInstall(bool enable) [member function] + cls.add_method('SetIpv6StackInstall', + 'void', + [param('bool', 'enable')]) + ## internet-stack-helper.h: void ns3::InternetStackHelper::SetRoutingHelper(ns3::Ipv4RoutingHelper const & routing) [member function] + cls.add_method('SetRoutingHelper', + 'void', + [param('ns3::Ipv4RoutingHelper const &', 'routing')]) + ## internet-stack-helper.h: void ns3::InternetStackHelper::SetRoutingHelper(ns3::Ipv6RoutingHelper const & routing) [member function] + cls.add_method('SetRoutingHelper', + 'void', + [param('ns3::Ipv6RoutingHelper const &', 'routing')]) + ## internet-stack-helper.h: void ns3::InternetStackHelper::SetTcp(std::string tid) [member function] + cls.add_method('SetTcp', + 'void', + [param('std::string', 'tid')]) + ## internet-stack-helper.h: void ns3::InternetStackHelper::SetTcp(std::string tid, std::string attr, ns3::AttributeValue const & val) [member function] + cls.add_method('SetTcp', + 'void', + [param('std::string', 'tid'), param('std::string', 'attr'), param('ns3::AttributeValue const &', 'val')]) + return + +def register_Ns3Ipv4AddressHelper_methods(root_module, cls): + ## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper(ns3::Ipv4AddressHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4AddressHelper const &', 'arg0')]) + ## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper() [constructor] + cls.add_constructor([]) + ## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper(ns3::Ipv4Address network, ns3::Ipv4Mask mask, ns3::Ipv4Address base="0.0.0.1") [constructor] + cls.add_constructor([param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'mask'), param('ns3::Ipv4Address', 'base', default_value='"0.0.0.1"')]) + ## ipv4-address-helper.h: ns3::Ipv4InterfaceContainer ns3::Ipv4AddressHelper::Assign(ns3::NetDeviceContainer const & c) [member function] + cls.add_method('Assign', + 'ns3::Ipv4InterfaceContainer', + [param('ns3::NetDeviceContainer const &', 'c')]) + ## ipv4-address-helper.h: ns3::Ipv4Address ns3::Ipv4AddressHelper::NewAddress() [member function] + cls.add_method('NewAddress', + 'ns3::Ipv4Address', + []) + ## ipv4-address-helper.h: ns3::Ipv4Address ns3::Ipv4AddressHelper::NewNetwork() [member function] + cls.add_method('NewNetwork', + 'ns3::Ipv4Address', + []) + ## ipv4-address-helper.h: void ns3::Ipv4AddressHelper::SetBase(ns3::Ipv4Address network, ns3::Ipv4Mask mask, ns3::Ipv4Address base="0.0.0.1") [member function] + cls.add_method('SetBase', + 'void', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'mask'), param('ns3::Ipv4Address', 'base', default_value='"0.0.0.1"')]) + return + +def register_Ns3Ipv4InterfaceContainer_methods(root_module, cls): + ## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer::Ipv4InterfaceContainer(ns3::Ipv4InterfaceContainer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4InterfaceContainer const &', 'arg0')]) + ## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer::Ipv4InterfaceContainer() [constructor] + cls.add_constructor([]) + ## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::Add(ns3::Ipv4InterfaceContainer other) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ipv4InterfaceContainer', 'other')]) + ## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::Add(ns3::Ptr ipv4, uint32_t interface) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4'), param('uint32_t', 'interface')]) + ## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::Add(std::pair,unsigned int> arg0) [member function] + cls.add_method('Add', + 'void', + [param('std::pair< ns3::Ptr< ns3::Ipv4 >, unsigned int >', 'arg0')]) + ## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::Add(std::string ipv4Name, uint32_t interface) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'ipv4Name'), param('uint32_t', 'interface')]) + ## ipv4-interface-container.h: std::pair,unsigned int> ns3::Ipv4InterfaceContainer::Get(uint32_t arg0) const [member function] + cls.add_method('Get', + 'std::pair< ns3::Ptr< ns3::Ipv4 >, unsigned int >', + [param('uint32_t', 'arg0')], + is_const=True) + ## ipv4-interface-container.h: ns3::Ipv4Address ns3::Ipv4InterfaceContainer::GetAddress(uint32_t i, uint32_t j=0) const [member function] + cls.add_method('GetAddress', + 'ns3::Ipv4Address', + [param('uint32_t', 'i'), param('uint32_t', 'j', default_value='0')], + is_const=True) + ## ipv4-interface-container.h: uint32_t ns3::Ipv4InterfaceContainer::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::SetMetric(uint32_t i, uint16_t metric) [member function] + cls.add_method('SetMetric', + 'void', + [param('uint32_t', 'i'), param('uint16_t', 'metric')]) + return + +def register_Ns3Ipv4RoutingHelper_methods(root_module, cls): + ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper::Ipv4RoutingHelper() [constructor] + cls.add_constructor([]) + ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper::Ipv4RoutingHelper(ns3::Ipv4RoutingHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4RoutingHelper const &', 'arg0')]) + ## ipv4-routing-helper.h: ns3::Ptr ns3::Ipv4RoutingHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3Ipv4StaticRoutingHelper_methods(root_module, cls): + ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper(ns3::Ipv4StaticRoutingHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4StaticRoutingHelper const &', 'arg0')]) + ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper() [constructor] + cls.add_constructor([]) + ## ipv4-static-routing-helper.h: void ns3::Ipv4StaticRoutingHelper::AddMulticastRoute(ns3::Ptr n, ns3::Ipv4Address source, ns3::Ipv4Address group, ns3::Ptr input, ns3::NetDeviceContainer output) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('ns3::Ptr< ns3::NetDevice >', 'input'), param('ns3::NetDeviceContainer', 'output')]) + ## ipv4-static-routing-helper.h: void ns3::Ipv4StaticRoutingHelper::AddMulticastRoute(std::string n, ns3::Ipv4Address source, ns3::Ipv4Address group, ns3::Ptr input, ns3::NetDeviceContainer output) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('std::string', 'n'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('ns3::Ptr< ns3::NetDevice >', 'input'), param('ns3::NetDeviceContainer', 'output')]) + ## ipv4-static-routing-helper.h: void ns3::Ipv4StaticRoutingHelper::AddMulticastRoute(ns3::Ptr n, ns3::Ipv4Address source, ns3::Ipv4Address group, std::string inputName, ns3::NetDeviceContainer output) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('std::string', 'inputName'), param('ns3::NetDeviceContainer', 'output')]) + ## ipv4-static-routing-helper.h: void ns3::Ipv4StaticRoutingHelper::AddMulticastRoute(std::string nName, ns3::Ipv4Address source, ns3::Ipv4Address group, std::string inputName, ns3::NetDeviceContainer output) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('std::string', 'nName'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('std::string', 'inputName'), param('ns3::NetDeviceContainer', 'output')]) + ## ipv4-static-routing-helper.h: ns3::Ptr ns3::Ipv4StaticRoutingHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True, is_virtual=True) + ## ipv4-static-routing-helper.h: ns3::Ptr ns3::Ipv4StaticRoutingHelper::GetStaticRouting(ns3::Ptr ipv4) const [member function] + cls.add_method('GetStaticRouting', + 'ns3::Ptr< ns3::Ipv4StaticRouting >', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], + is_const=True) + ## ipv4-static-routing-helper.h: void ns3::Ipv4StaticRoutingHelper::SetDefaultMulticastRoute(ns3::Ptr n, ns3::Ptr nd) [member function] + cls.add_method('SetDefaultMulticastRoute', + 'void', + [param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) + ## ipv4-static-routing-helper.h: void ns3::Ipv4StaticRoutingHelper::SetDefaultMulticastRoute(ns3::Ptr n, std::string ndName) [member function] + cls.add_method('SetDefaultMulticastRoute', + 'void', + [param('ns3::Ptr< ns3::Node >', 'n'), param('std::string', 'ndName')]) + ## ipv4-static-routing-helper.h: void ns3::Ipv4StaticRoutingHelper::SetDefaultMulticastRoute(std::string nName, ns3::Ptr nd) [member function] + cls.add_method('SetDefaultMulticastRoute', + 'void', + [param('std::string', 'nName'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) + ## ipv4-static-routing-helper.h: void ns3::Ipv4StaticRoutingHelper::SetDefaultMulticastRoute(std::string nName, std::string ndName) [member function] + cls.add_method('SetDefaultMulticastRoute', + 'void', + [param('std::string', 'nName'), param('std::string', 'ndName')]) + return + +def register_Ns3Ipv6AddressHelper_methods(root_module, cls): + ## ipv6-address-helper.h: ns3::Ipv6AddressHelper::Ipv6AddressHelper(ns3::Ipv6AddressHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6AddressHelper const &', 'arg0')]) + ## ipv6-address-helper.h: ns3::Ipv6AddressHelper::Ipv6AddressHelper() [constructor] + cls.add_constructor([]) + ## ipv6-address-helper.h: ns3::Ipv6InterfaceContainer ns3::Ipv6AddressHelper::Assign(ns3::NetDeviceContainer const & c) [member function] + cls.add_method('Assign', + 'ns3::Ipv6InterfaceContainer', + [param('ns3::NetDeviceContainer const &', 'c')]) + ## ipv6-address-helper.h: ns3::Ipv6InterfaceContainer ns3::Ipv6AddressHelper::Assign(ns3::NetDeviceContainer const & c, std::vector > withConfiguration) [member function] + cls.add_method('Assign', + 'ns3::Ipv6InterfaceContainer', + [param('ns3::NetDeviceContainer const &', 'c'), param('std::vector< bool >', 'withConfiguration')]) + ## ipv6-address-helper.h: ns3::Ipv6InterfaceContainer ns3::Ipv6AddressHelper::AssignWithoutAddress(ns3::NetDeviceContainer const & c) [member function] + cls.add_method('AssignWithoutAddress', + 'ns3::Ipv6InterfaceContainer', + [param('ns3::NetDeviceContainer const &', 'c')]) + ## ipv6-address-helper.h: ns3::Ipv6Address ns3::Ipv6AddressHelper::NewAddress(ns3::Address addr) [member function] + cls.add_method('NewAddress', + 'ns3::Ipv6Address', + [param('ns3::Address', 'addr')]) + ## ipv6-address-helper.h: void ns3::Ipv6AddressHelper::NewNetwork(ns3::Ipv6Address network, ns3::Ipv6Prefix prefix) [member function] + cls.add_method('NewNetwork', + 'void', + [param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'prefix')]) + return + +def register_Ns3Ipv6InterfaceContainer_methods(root_module, cls): + ## ipv6-interface-container.h: ns3::Ipv6InterfaceContainer::Ipv6InterfaceContainer(ns3::Ipv6InterfaceContainer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6InterfaceContainer const &', 'arg0')]) + ## ipv6-interface-container.h: ns3::Ipv6InterfaceContainer::Ipv6InterfaceContainer() [constructor] + cls.add_constructor([]) + ## ipv6-interface-container.h: void ns3::Ipv6InterfaceContainer::Add(ns3::Ptr ipv6, uint32_t interface) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::Ipv6 >', 'ipv6'), param('uint32_t', 'interface')]) + ## ipv6-interface-container.h: void ns3::Ipv6InterfaceContainer::Add(ns3::Ipv6InterfaceContainer & c) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ipv6InterfaceContainer &', 'c')]) + ## ipv6-interface-container.h: void ns3::Ipv6InterfaceContainer::Add(std::string ipv6Name, uint32_t interface) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'ipv6Name'), param('uint32_t', 'interface')]) + ## ipv6-interface-container.h: ns3::Ipv6Address ns3::Ipv6InterfaceContainer::GetAddress(uint32_t i, uint32_t j) const [member function] + cls.add_method('GetAddress', + 'ns3::Ipv6Address', + [param('uint32_t', 'i'), param('uint32_t', 'j')], + is_const=True) + ## ipv6-interface-container.h: uint32_t ns3::Ipv6InterfaceContainer::GetInterfaceIndex(uint32_t i) const [member function] + cls.add_method('GetInterfaceIndex', + 'uint32_t', + [param('uint32_t', 'i')], + is_const=True) + ## ipv6-interface-container.h: uint32_t ns3::Ipv6InterfaceContainer::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## ipv6-interface-container.h: void ns3::Ipv6InterfaceContainer::SetDefaultRoute(uint32_t i, uint32_t router) [member function] + cls.add_method('SetDefaultRoute', + 'void', + [param('uint32_t', 'i'), param('uint32_t', 'router')]) + ## ipv6-interface-container.h: void ns3::Ipv6InterfaceContainer::SetRouter(uint32_t i, bool router) [member function] + cls.add_method('SetRouter', + 'void', + [param('uint32_t', 'i'), param('bool', 'router')]) + return + +def register_Ns3Ipv6RoutingHelper_methods(root_module, cls): + ## ipv6-routing-helper.h: ns3::Ipv6RoutingHelper::Ipv6RoutingHelper() [constructor] + cls.add_constructor([]) + ## ipv6-routing-helper.h: ns3::Ipv6RoutingHelper::Ipv6RoutingHelper(ns3::Ipv6RoutingHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6RoutingHelper const &', 'arg0')]) + ## ipv6-routing-helper.h: ns3::Ptr ns3::Ipv6RoutingHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv6RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3Ipv6StaticRoutingHelper_methods(root_module, cls): + ## ipv6-static-routing-helper.h: ns3::Ipv6StaticRoutingHelper::Ipv6StaticRoutingHelper(ns3::Ipv6StaticRoutingHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6StaticRoutingHelper const &', 'arg0')]) + ## ipv6-static-routing-helper.h: ns3::Ipv6StaticRoutingHelper::Ipv6StaticRoutingHelper() [constructor] + cls.add_constructor([]) + ## ipv6-static-routing-helper.h: void ns3::Ipv6StaticRoutingHelper::AddMulticastRoute(ns3::Ptr n, ns3::Ipv6Address source, ns3::Ipv6Address group, ns3::Ptr input, ns3::NetDeviceContainer output) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ipv6Address', 'source'), param('ns3::Ipv6Address', 'group'), param('ns3::Ptr< ns3::NetDevice >', 'input'), param('ns3::NetDeviceContainer', 'output')]) + ## ipv6-static-routing-helper.h: void ns3::Ipv6StaticRoutingHelper::AddMulticastRoute(std::string n, ns3::Ipv6Address source, ns3::Ipv6Address group, ns3::Ptr input, ns3::NetDeviceContainer output) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('std::string', 'n'), param('ns3::Ipv6Address', 'source'), param('ns3::Ipv6Address', 'group'), param('ns3::Ptr< ns3::NetDevice >', 'input'), param('ns3::NetDeviceContainer', 'output')]) + ## ipv6-static-routing-helper.h: void ns3::Ipv6StaticRoutingHelper::AddMulticastRoute(ns3::Ptr n, ns3::Ipv6Address source, ns3::Ipv6Address group, std::string inputName, ns3::NetDeviceContainer output) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ipv6Address', 'source'), param('ns3::Ipv6Address', 'group'), param('std::string', 'inputName'), param('ns3::NetDeviceContainer', 'output')]) + ## ipv6-static-routing-helper.h: void ns3::Ipv6StaticRoutingHelper::AddMulticastRoute(std::string nName, ns3::Ipv6Address source, ns3::Ipv6Address group, std::string inputName, ns3::NetDeviceContainer output) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('std::string', 'nName'), param('ns3::Ipv6Address', 'source'), param('ns3::Ipv6Address', 'group'), param('std::string', 'inputName'), param('ns3::NetDeviceContainer', 'output')]) + ## ipv6-static-routing-helper.h: ns3::Ptr ns3::Ipv6StaticRoutingHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv6RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True, is_virtual=True) + ## ipv6-static-routing-helper.h: ns3::Ptr ns3::Ipv6StaticRoutingHelper::GetStaticRouting(ns3::Ptr ipv6) const [member function] + cls.add_method('GetStaticRouting', + 'ns3::Ptr< ns3::Ipv6StaticRouting >', + [param('ns3::Ptr< ns3::Ipv6 >', 'ipv6')], + is_const=True) + return + +def register_Ns3MeshHelper_methods(root_module, cls): + ## mesh-helper.h: ns3::MeshHelper::MeshHelper(ns3::MeshHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshHelper const &', 'arg0')]) + ## mesh-helper.h: ns3::MeshHelper::MeshHelper() [constructor] + cls.add_constructor([]) + ## mesh-helper.h: static ns3::MeshHelper ns3::MeshHelper::Default() [member function] + cls.add_method('Default', + 'ns3::MeshHelper', + [], + is_static=True) + ## mesh-helper.h: ns3::NetDeviceContainer ns3::MeshHelper::Install(ns3::WifiPhyHelper const & phyHelper, ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::WifiPhyHelper const &', 'phyHelper'), param('ns3::NodeContainer', 'c')], + is_const=True) + ## mesh-helper.h: void ns3::MeshHelper::Report(ns3::Ptr const & arg0, std::ostream & arg1) [member function] + cls.add_method('Report', + 'void', + [param('ns3::Ptr< ns3::NetDevice > const &', 'arg0'), param('std::ostream &', 'arg1')]) + ## mesh-helper.h: void ns3::MeshHelper::ResetStats(ns3::Ptr const & arg0) [member function] + cls.add_method('ResetStats', + 'void', + [param('ns3::Ptr< ns3::NetDevice > const &', 'arg0')]) + ## mesh-helper.h: void ns3::MeshHelper::SetMacType(std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetMacType', + 'void', + [param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## mesh-helper.h: void ns3::MeshHelper::SetNumberOfInterfaces(uint32_t nInterfaces) [member function] + cls.add_method('SetNumberOfInterfaces', + 'void', + [param('uint32_t', 'nInterfaces')]) + ## mesh-helper.h: void ns3::MeshHelper::SetRemoteStationManager(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetRemoteStationManager', + 'void', + [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## mesh-helper.h: void ns3::MeshHelper::SetSpreadInterfaceChannels(ns3::MeshHelper::ChannelPolicy arg0) [member function] + cls.add_method('SetSpreadInterfaceChannels', + 'void', + [param('ns3::MeshHelper::ChannelPolicy', 'arg0')]) + ## mesh-helper.h: void ns3::MeshHelper::SetStackInstaller(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetStackInstaller', + 'void', + [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## mesh-helper.h: void ns3::MeshHelper::SetStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('SetStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')]) + return + +def register_Ns3MobilityHelper_methods(root_module, cls): + ## mobility-helper.h: ns3::MobilityHelper::MobilityHelper(ns3::MobilityHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MobilityHelper const &', 'arg0')]) + ## mobility-helper.h: ns3::MobilityHelper::MobilityHelper() [constructor] + cls.add_constructor([]) + ## 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) + ## mobility-helper.h: std::string ns3::MobilityHelper::GetMobilityModelType() const [member function] + cls.add_method('GetMobilityModelType', + 'std::string', + [], + is_const=True) + ## mobility-helper.h: void ns3::MobilityHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## mobility-helper.h: void ns3::MobilityHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'void', + [param('std::string', 'nodeName')], + is_const=True) + ## mobility-helper.h: void ns3::MobilityHelper::Install(ns3::NodeContainer container) const [member function] + cls.add_method('Install', + 'void', + [param('ns3::NodeContainer', 'container')], + is_const=True) + ## mobility-helper.h: void ns3::MobilityHelper::InstallAll() [member function] + cls.add_method('InstallAll', + 'void', + []) + ## mobility-helper.h: void ns3::MobilityHelper::PopReferenceMobilityModel() [member function] + cls.add_method('PopReferenceMobilityModel', + 'void', + []) + ## mobility-helper.h: void ns3::MobilityHelper::PushReferenceMobilityModel(ns3::Ptr reference) [member function] + cls.add_method('PushReferenceMobilityModel', + 'void', + [param('ns3::Ptr< ns3::Object >', 'reference')]) + ## mobility-helper.h: void ns3::MobilityHelper::PushReferenceMobilityModel(std::string referenceName) [member function] + cls.add_method('PushReferenceMobilityModel', + 'void', + [param('std::string', 'referenceName')]) + ## mobility-helper.h: void ns3::MobilityHelper::SetMobilityModel(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue(), std::string n8="", ns3::AttributeValue const & v8=ns3::EmptyAttributeValue(), std::string n9="", ns3::AttributeValue const & v9=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetMobilityModel', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n8', default_value='""'), param('ns3::AttributeValue const &', 'v8', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n9', default_value='""'), param('ns3::AttributeValue const &', 'v9', default_value='ns3::EmptyAttributeValue()')]) + ## mobility-helper.h: void ns3::MobilityHelper::SetPositionAllocator(ns3::Ptr allocator) [member function] + cls.add_method('SetPositionAllocator', + 'void', + [param('ns3::Ptr< ns3::PositionAllocator >', 'allocator')]) + ## mobility-helper.h: void ns3::MobilityHelper::SetPositionAllocator(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue(), std::string n8="", ns3::AttributeValue const & v8=ns3::EmptyAttributeValue(), std::string n9="", ns3::AttributeValue const & v9=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetPositionAllocator', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n8', default_value='""'), param('ns3::AttributeValue const &', 'v8', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n9', default_value='""'), param('ns3::AttributeValue const &', 'v9', default_value='ns3::EmptyAttributeValue()')]) + return + +def register_Ns3NetDeviceContainer_methods(root_module, cls): + ## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NetDeviceContainer const &', 'arg0')]) + ## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer() [constructor] + cls.add_constructor([]) + ## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::Ptr dev) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::NetDevice >', 'dev')]) + ## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(std::string devName) [constructor] + cls.add_constructor([param('std::string', 'devName')]) + ## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & a, ns3::NetDeviceContainer const & b) [constructor] + cls.add_constructor([param('ns3::NetDeviceContainer const &', 'a'), param('ns3::NetDeviceContainer const &', 'b')]) + ## net-device-container.h: void ns3::NetDeviceContainer::Add(ns3::NetDeviceContainer other) [member function] + cls.add_method('Add', + 'void', + [param('ns3::NetDeviceContainer', 'other')]) + ## net-device-container.h: void ns3::NetDeviceContainer::Add(ns3::Ptr device) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device')]) + ## net-device-container.h: void ns3::NetDeviceContainer::Add(std::string deviceName) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'deviceName')]) + ## net-device-container.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::NetDeviceContainer::Begin() const [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::NetDevice > const, std::vector< ns3::Ptr< ns3::NetDevice > > >', + [], + is_const=True) + ## net-device-container.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::NetDeviceContainer::End() const [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::NetDevice > const, std::vector< ns3::Ptr< ns3::NetDevice > > >', + [], + is_const=True) + ## net-device-container.h: ns3::Ptr ns3::NetDeviceContainer::Get(uint32_t i) const [member function] + cls.add_method('Get', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_const=True) + ## net-device-container.h: uint32_t ns3::NetDeviceContainer::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + return + +def register_Ns3NodeContainer_methods(root_module, cls): + ## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NodeContainer const &', 'arg0')]) + ## node-container.h: ns3::NodeContainer::NodeContainer() [constructor] + cls.add_constructor([]) + ## node-container.h: ns3::NodeContainer::NodeContainer(ns3::Ptr node) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'node')]) + ## node-container.h: ns3::NodeContainer::NodeContainer(std::string nodeName) [constructor] + cls.add_constructor([param('std::string', 'nodeName')]) + ## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b) [constructor] + cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b')]) + ## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c) [constructor] + cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c')]) + ## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d) [constructor] + cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd')]) + ## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d, ns3::NodeContainer const & e) [constructor] + cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd'), param('ns3::NodeContainer const &', 'e')]) + ## node-container.h: void ns3::NodeContainer::Add(ns3::NodeContainer other) [member function] + cls.add_method('Add', + 'void', + [param('ns3::NodeContainer', 'other')]) + ## node-container.h: void ns3::NodeContainer::Add(ns3::Ptr node) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## node-container.h: void ns3::NodeContainer::Add(std::string nodeName) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'nodeName')]) + ## node-container.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::NodeContainer::Begin() const [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', + [], + is_const=True) + ## node-container.h: void ns3::NodeContainer::Create(uint32_t n) [member function] + cls.add_method('Create', + 'void', + [param('uint32_t', 'n')]) + ## node-container.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::NodeContainer::End() const [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', + [], + is_const=True) + ## node-container.h: ns3::Ptr ns3::NodeContainer::Get(uint32_t i) const [member function] + cls.add_method('Get', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'i')], + is_const=True) + ## node-container.h: static ns3::NodeContainer ns3::NodeContainer::GetGlobal() [member function] + cls.add_method('GetGlobal', + 'ns3::NodeContainer', + [], + is_static=True) + ## node-container.h: uint32_t ns3::NodeContainer::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + return + +def register_Ns3Ns2MobilityHelper_methods(root_module, cls): + ## ns2-mobility-helper.h: ns3::Ns2MobilityHelper::Ns2MobilityHelper(ns3::Ns2MobilityHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ns2MobilityHelper const &', 'arg0')]) + ## ns2-mobility-helper.h: ns3::Ns2MobilityHelper::Ns2MobilityHelper(std::string filename) [constructor] + cls.add_constructor([param('std::string', 'filename')]) + ## ns2-mobility-helper.h: void ns3::Ns2MobilityHelper::Install() const [member function] + cls.add_method('Install', + 'void', + [], + is_const=True) + return + +def register_Ns3OlsrHelper_methods(root_module, cls): + ## olsr-helper.h: ns3::OlsrHelper::OlsrHelper(ns3::OlsrHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::OlsrHelper const &', 'arg0')]) + ## olsr-helper.h: ns3::OlsrHelper::OlsrHelper() [constructor] + cls.add_constructor([]) + ## olsr-helper.h: ns3::Ptr ns3::OlsrHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True, is_virtual=True) + ## olsr-helper.h: void ns3::OlsrHelper::Set(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + return + +def register_Ns3OnOffHelper_methods(root_module, cls): + ## on-off-helper.h: ns3::OnOffHelper::OnOffHelper(ns3::OnOffHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::OnOffHelper const &', 'arg0')]) + ## on-off-helper.h: ns3::OnOffHelper::OnOffHelper(std::string protocol, ns3::Address address) [constructor] + cls.add_constructor([param('std::string', 'protocol'), param('ns3::Address', 'address')]) + ## on-off-helper.h: ns3::ApplicationContainer ns3::OnOffHelper::Install(ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::NodeContainer', 'c')], + is_const=True) + ## on-off-helper.h: ns3::ApplicationContainer ns3::OnOffHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## on-off-helper.h: ns3::ApplicationContainer ns3::OnOffHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('std::string', 'nodeName')], + is_const=True) + ## on-off-helper.h: void ns3::OnOffHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + return + +def register_Ns3PacketSinkHelper_methods(root_module, cls): + ## packet-sink-helper.h: ns3::PacketSinkHelper::PacketSinkHelper(ns3::PacketSinkHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSinkHelper const &', 'arg0')]) + ## packet-sink-helper.h: ns3::PacketSinkHelper::PacketSinkHelper(std::string protocol, ns3::Address address) [constructor] + cls.add_constructor([param('std::string', 'protocol'), param('ns3::Address', 'address')]) + ## packet-sink-helper.h: ns3::ApplicationContainer ns3::PacketSinkHelper::Install(ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::NodeContainer', 'c')], + is_const=True) + ## packet-sink-helper.h: ns3::ApplicationContainer ns3::PacketSinkHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## packet-sink-helper.h: ns3::ApplicationContainer ns3::PacketSinkHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('std::string', 'nodeName')], + is_const=True) + ## packet-sink-helper.h: void ns3::PacketSinkHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + return + +def register_Ns3PacketSocketHelper_methods(root_module, cls): + ## packet-socket-helper.h: ns3::PacketSocketHelper::PacketSocketHelper() [constructor] + cls.add_constructor([]) + ## packet-socket-helper.h: ns3::PacketSocketHelper::PacketSocketHelper(ns3::PacketSocketHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSocketHelper const &', 'arg0')]) + ## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'void', + [param('std::string', 'nodeName')], + is_const=True) + ## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'void', + [param('ns3::NodeContainer', 'c')], + is_const=True) + return + +def register_Ns3Ping6Helper_methods(root_module, cls): + ## ping6-helper.h: ns3::Ping6Helper::Ping6Helper(ns3::Ping6Helper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ping6Helper const &', 'arg0')]) + ## ping6-helper.h: ns3::Ping6Helper::Ping6Helper() [constructor] + cls.add_constructor([]) + ## ping6-helper.h: ns3::ApplicationContainer ns3::Ping6Helper::Install(ns3::NodeContainer c) [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::NodeContainer', 'c')]) + ## ping6-helper.h: void ns3::Ping6Helper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## ping6-helper.h: void ns3::Ping6Helper::SetIfIndex(uint32_t ifIndex) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t', 'ifIndex')]) + ## ping6-helper.h: void ns3::Ping6Helper::SetLocal(ns3::Ipv6Address ip) [member function] + cls.add_method('SetLocal', + 'void', + [param('ns3::Ipv6Address', 'ip')]) + ## ping6-helper.h: void ns3::Ping6Helper::SetRemote(ns3::Ipv6Address ip) [member function] + cls.add_method('SetRemote', + 'void', + [param('ns3::Ipv6Address', 'ip')]) + return + +def register_Ns3PointToPointHelper_methods(root_module, cls): + ## point-to-point-helper.h: ns3::PointToPointHelper::PointToPointHelper(ns3::PointToPointHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointHelper const &', 'arg0')]) + ## point-to-point-helper.h: ns3::PointToPointHelper::PointToPointHelper() [constructor] + cls.add_constructor([]) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::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) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=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', + [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::Ptr nd) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd')], + is_static=True) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, std::string ndName) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('std::string', 'ndName')], + is_static=True) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NodeContainer', 'n')], + is_static=True) + ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcapAll(std::string filename) [member function] + cls.add_method('EnablePcapAll', + 'void', + [param('std::string', 'filename')], + is_static=True) + ## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::NodeContainer c) [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer', 'c')]) + ## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::Ptr a, ns3::Ptr b) [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'a'), param('ns3::Ptr< ns3::Node >', 'b')]) + ## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::Ptr a, std::string bName) [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'a'), param('std::string', 'bName')]) + ## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(std::string aName, ns3::Ptr b) [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'aName'), param('ns3::Ptr< ns3::Node >', 'b')]) + ## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(std::string aNode, std::string bNode) [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'aNode'), param('std::string', 'bNode')]) + ## point-to-point-helper.h: void ns3::PointToPointHelper::InstallStar(ns3::Ptr hub, ns3::NodeContainer spokes, ns3::NetDeviceContainer & hubDevices, ns3::NetDeviceContainer & spokeDevices) [member function] + cls.add_method('InstallStar', + 'void', + [param('ns3::Ptr< ns3::Node >', 'hub'), param('ns3::NodeContainer', 'spokes'), param('ns3::NetDeviceContainer &', 'hubDevices'), param('ns3::NetDeviceContainer &', 'spokeDevices')]) + ## point-to-point-helper.h: void ns3::PointToPointHelper::InstallStar(std::string hubName, ns3::NodeContainer spokes, ns3::NetDeviceContainer & hubDevices, ns3::NetDeviceContainer & spokeDevices) [member function] + cls.add_method('InstallStar', + 'void', + [param('std::string', 'hubName'), param('ns3::NodeContainer', 'spokes'), param('ns3::NetDeviceContainer &', 'hubDevices'), param('ns3::NetDeviceContainer &', 'spokeDevices')]) + ## point-to-point-helper.h: void ns3::PointToPointHelper::SetChannelAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetChannelAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## point-to-point-helper.h: void ns3::PointToPointHelper::SetDeviceAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetDeviceAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## point-to-point-helper.h: void ns3::PointToPointHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')]) + return + +def register_Ns3TapBridgeHelper_methods(root_module, cls): + ## tap-bridge-helper.h: ns3::TapBridgeHelper::TapBridgeHelper(ns3::TapBridgeHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TapBridgeHelper const &', 'arg0')]) + ## tap-bridge-helper.h: ns3::TapBridgeHelper::TapBridgeHelper() [constructor] + cls.add_constructor([]) + ## tap-bridge-helper.h: ns3::TapBridgeHelper::TapBridgeHelper(ns3::Ipv4Address gateway) [constructor] + cls.add_constructor([param('ns3::Ipv4Address', 'gateway')]) + ## tap-bridge-helper.h: ns3::Ptr ns3::TapBridgeHelper::Install(ns3::Ptr node, ns3::Ptr nd) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::NetDevice >', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) + ## tap-bridge-helper.h: ns3::Ptr ns3::TapBridgeHelper::Install(std::string nodeName, ns3::Ptr nd) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::NetDevice >', + [param('std::string', 'nodeName'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) + ## tap-bridge-helper.h: ns3::Ptr ns3::TapBridgeHelper::Install(ns3::Ptr node, std::string ndName) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::NetDevice >', + [param('ns3::Ptr< ns3::Node >', 'node'), param('std::string', 'ndName')]) + ## tap-bridge-helper.h: ns3::Ptr ns3::TapBridgeHelper::Install(std::string nodeName, std::string ndName) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::NetDevice >', + [param('std::string', 'nodeName'), param('std::string', 'ndName')]) + ## tap-bridge-helper.h: ns3::Ptr ns3::TapBridgeHelper::Install(ns3::Ptr node, ns3::Ptr nd, ns3::AttributeValue const & v1) [member function] + cls.add_method('Install', + 'ns3::Ptr< ns3::NetDevice >', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('ns3::AttributeValue const &', 'v1')]) + ## tap-bridge-helper.h: void ns3::TapBridgeHelper::SetAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + return + +def register_Ns3UdpEchoClientHelper_methods(root_module, cls): + ## udp-echo-helper.h: ns3::UdpEchoClientHelper::UdpEchoClientHelper(ns3::UdpEchoClientHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UdpEchoClientHelper const &', 'arg0')]) + ## udp-echo-helper.h: ns3::UdpEchoClientHelper::UdpEchoClientHelper(ns3::Ipv4Address ip, uint16_t port) [constructor] + cls.add_constructor([param('ns3::Ipv4Address', 'ip'), param('uint16_t', 'port')]) + ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('std::string', 'nodeName')], + is_const=True) + ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::NodeContainer', 'c')], + is_const=True) + ## udp-echo-helper.h: void ns3::UdpEchoClientHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + ## udp-echo-helper.h: void ns3::UdpEchoClientHelper::SetFill(ns3::Ptr app, std::string fill) [member function] + cls.add_method('SetFill', + 'void', + [param('ns3::Ptr< ns3::Application >', 'app'), param('std::string', 'fill')]) + ## udp-echo-helper.h: void ns3::UdpEchoClientHelper::SetFill(ns3::Ptr app, uint8_t fill, uint32_t dataLength) [member function] + cls.add_method('SetFill', + 'void', + [param('ns3::Ptr< ns3::Application >', 'app'), param('uint8_t', 'fill'), param('uint32_t', 'dataLength')]) + ## udp-echo-helper.h: void ns3::UdpEchoClientHelper::SetFill(ns3::Ptr app, uint8_t * fill, uint32_t fillLength, uint32_t dataLength) [member function] + cls.add_method('SetFill', + 'void', + [param('ns3::Ptr< ns3::Application >', 'app'), param('uint8_t *', 'fill'), param('uint32_t', 'fillLength'), param('uint32_t', 'dataLength')]) + return + +def register_Ns3UdpEchoServerHelper_methods(root_module, cls): + ## udp-echo-helper.h: ns3::UdpEchoServerHelper::UdpEchoServerHelper(ns3::UdpEchoServerHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UdpEchoServerHelper const &', 'arg0')]) + ## udp-echo-helper.h: ns3::UdpEchoServerHelper::UdpEchoServerHelper(uint16_t port) [constructor] + cls.add_constructor([param('uint16_t', 'port')]) + ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('std::string', 'nodeName')], + is_const=True) + ## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::NodeContainer', 'c')], + is_const=True) + ## udp-echo-helper.h: void ns3::UdpEchoServerHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + return + +def register_Ns3V4PingHelper_methods(root_module, cls): + ## v4ping-helper.h: ns3::V4PingHelper::V4PingHelper(ns3::V4PingHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::V4PingHelper const &', 'arg0')]) + ## v4ping-helper.h: ns3::V4PingHelper::V4PingHelper(ns3::Ipv4Address remote) [constructor] + cls.add_constructor([param('ns3::Ipv4Address', 'remote')]) + ## v4ping-helper.h: ns3::ApplicationContainer ns3::V4PingHelper::Install(ns3::NodeContainer nodes) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::NodeContainer', 'nodes')], + is_const=True) + ## v4ping-helper.h: ns3::ApplicationContainer ns3::V4PingHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## v4ping-helper.h: ns3::ApplicationContainer ns3::V4PingHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::ApplicationContainer', + [param('std::string', 'nodeName')], + is_const=True) + ## v4ping-helper.h: void ns3::V4PingHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) + return + +def register_Ns3WifiHelper_methods(root_module, cls): + ## wifi-helper.h: ns3::WifiHelper::WifiHelper(ns3::WifiHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiHelper const &', 'arg0')]) + ## wifi-helper.h: ns3::WifiHelper::WifiHelper() [constructor] + cls.add_constructor([]) + ## wifi-helper.h: static ns3::WifiHelper ns3::WifiHelper::Default() [member function] + cls.add_method('Default', + 'ns3::WifiHelper', + [], + is_static=True) + ## wifi-helper.h: static void ns3::WifiHelper::EnableLogComponents() [member function] + cls.add_method('EnableLogComponents', + 'void', + [], + is_static=True) + ## wifi-helper.h: ns3::NetDeviceContainer ns3::WifiHelper::Install(ns3::WifiPhyHelper const & phy, ns3::WifiMacHelper const & mac, ns3::NodeContainer c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::WifiPhyHelper const &', 'phy'), param('ns3::WifiMacHelper const &', 'mac'), param('ns3::NodeContainer', 'c')], + is_const=True) + ## wifi-helper.h: ns3::NetDeviceContainer ns3::WifiHelper::Install(ns3::WifiPhyHelper const & phy, ns3::WifiMacHelper const & mac, ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::WifiPhyHelper const &', 'phy'), param('ns3::WifiMacHelper const &', 'mac'), param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## wifi-helper.h: ns3::NetDeviceContainer ns3::WifiHelper::Install(ns3::WifiPhyHelper const & phy, ns3::WifiMacHelper const & mac, std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::WifiPhyHelper const &', 'phy'), param('ns3::WifiMacHelper const &', 'mac'), param('std::string', 'nodeName')], + is_const=True) + ## wifi-helper.h: void ns3::WifiHelper::SetRemoteStationManager(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetRemoteStationManager', + 'void', + [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## wifi-helper.h: void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('SetStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')]) + return + +def register_Ns3WifiMacHelper_methods(root_module, cls): + ## wifi-helper.h: ns3::WifiMacHelper::WifiMacHelper() [constructor] + cls.add_constructor([]) + ## wifi-helper.h: ns3::WifiMacHelper::WifiMacHelper(ns3::WifiMacHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiMacHelper const &', 'arg0')]) + ## wifi-helper.h: ns3::Ptr ns3::WifiMacHelper::Create() const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::WifiMac >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3WifiPhyHelper_methods(root_module, cls): + ## wifi-helper.h: ns3::WifiPhyHelper::WifiPhyHelper() [constructor] + cls.add_constructor([]) + ## wifi-helper.h: ns3::WifiPhyHelper::WifiPhyHelper(ns3::WifiPhyHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiPhyHelper const &', 'arg0')]) + ## wifi-helper.h: ns3::Ptr ns3::WifiPhyHelper::Create(ns3::Ptr node, ns3::Ptr device) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::WifiPhy >', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::WifiNetDevice >', 'device')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3YansWifiChannelHelper_methods(root_module, cls): + ## yans-wifi-helper.h: ns3::YansWifiChannelHelper::YansWifiChannelHelper(ns3::YansWifiChannelHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::YansWifiChannelHelper const &', 'arg0')]) + ## yans-wifi-helper.h: ns3::YansWifiChannelHelper::YansWifiChannelHelper() [constructor] + cls.add_constructor([]) + ## yans-wifi-helper.h: void ns3::YansWifiChannelHelper::AddPropagationLoss(std::string name, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('AddPropagationLoss', + 'void', + [param('std::string', 'name'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## yans-wifi-helper.h: ns3::Ptr ns3::YansWifiChannelHelper::Create() const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::YansWifiChannel >', + [], + is_const=True) + ## yans-wifi-helper.h: static ns3::YansWifiChannelHelper ns3::YansWifiChannelHelper::Default() [member function] + cls.add_method('Default', + 'ns3::YansWifiChannelHelper', + [], + is_static=True) + ## yans-wifi-helper.h: void ns3::YansWifiChannelHelper::SetPropagationDelay(std::string name, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetPropagationDelay', + 'void', + [param('std::string', 'name'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + return + +def register_Ns3YansWifiPhyHelper_methods(root_module, cls): + ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::YansWifiPhyHelper(ns3::YansWifiPhyHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::YansWifiPhyHelper const &', 'arg0')]) + ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::YansWifiPhyHelper() [constructor] + cls.add_constructor([]) + ## yans-wifi-helper.h: static ns3::YansWifiPhyHelper ns3::YansWifiPhyHelper::Default() [member function] + cls.add_method('Default', + 'ns3::YansWifiPhyHelper', + [], + is_static=True) + ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::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) + ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=True) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::Ptr nd) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, std::string ndName) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('std::string', 'ndName')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NodeContainer', 'n')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcapAll(std::string filename) [member function] + cls.add_method('EnablePcapAll', + 'void', + [param('std::string', 'filename')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::Set(std::string name, ns3::AttributeValue const & v) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'v')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetChannel(ns3::Ptr channel) [member function] + cls.add_method('SetChannel', + 'void', + [param('ns3::Ptr< ns3::YansWifiChannel >', 'channel')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetChannel(std::string channelName) [member function] + cls.add_method('SetChannel', + 'void', + [param('std::string', 'channelName')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetErrorRateModel(std::string name, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetErrorRateModel', + 'void', + [param('std::string', 'name'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetPcapFormat(ns3::YansWifiPhyHelper::PcapFormat format) [member function] + cls.add_method('SetPcapFormat', + 'void', + [param('ns3::YansWifiPhyHelper::PcapFormat', 'format')]) + ## yans-wifi-helper.h: ns3::Ptr ns3::YansWifiPhyHelper::Create(ns3::Ptr node, ns3::Ptr device) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::WifiPhy >', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::WifiNetDevice >', 'device')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls): + ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper(ns3::Ipv4GlobalRoutingHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4GlobalRoutingHelper const &', 'arg0')]) + ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper() [constructor] + cls.add_constructor([]) + ## ipv4-global-routing-helper.h: ns3::Ptr ns3::Ipv4GlobalRoutingHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True, is_virtual=True) + ## ipv4-global-routing-helper.h: static void ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables() [member function] + cls.add_method('PopulateRoutingTables', + 'void', + [], + is_static=True) + ## ipv4-global-routing-helper.h: static void ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables() [member function] + cls.add_method('RecomputeRoutingTables', + 'void', + [], + is_static=True) + return + +def register_Ns3Ipv4ListRoutingHelper_methods(root_module, cls): + ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper::Ipv4ListRoutingHelper(ns3::Ipv4ListRoutingHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4ListRoutingHelper const &', 'arg0')]) + ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper::Ipv4ListRoutingHelper() [constructor] + cls.add_constructor([]) + ## ipv4-list-routing-helper.h: void ns3::Ipv4ListRoutingHelper::Add(ns3::Ipv4RoutingHelper const & routing, int16_t priority) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ipv4RoutingHelper const &', 'routing'), param('int16_t', 'priority')]) + ## ipv4-list-routing-helper.h: ns3::Ptr ns3::Ipv4ListRoutingHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True, is_virtual=True) + return + +def register_Ns3Ipv4NixVectorHelper_methods(root_module, cls): + ## ipv4-nix-vector-helper.h: ns3::Ipv4NixVectorHelper::Ipv4NixVectorHelper(ns3::Ipv4NixVectorHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4NixVectorHelper const &', 'arg0')]) + ## ipv4-nix-vector-helper.h: ns3::Ipv4NixVectorHelper::Ipv4NixVectorHelper() [constructor] + cls.add_constructor([]) + ## ipv4-nix-vector-helper.h: ns3::Ptr ns3::Ipv4NixVectorHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True, is_virtual=True) + return + +def register_Ns3Ipv6ListRoutingHelper_methods(root_module, cls): + ## ipv6-list-routing-helper.h: ns3::Ipv6ListRoutingHelper::Ipv6ListRoutingHelper(ns3::Ipv6ListRoutingHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6ListRoutingHelper const &', 'arg0')]) + ## ipv6-list-routing-helper.h: ns3::Ipv6ListRoutingHelper::Ipv6ListRoutingHelper() [constructor] + cls.add_constructor([]) + ## ipv6-list-routing-helper.h: void ns3::Ipv6ListRoutingHelper::Add(ns3::Ipv6RoutingHelper const & routing, int16_t priority) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ipv6RoutingHelper const &', 'routing'), param('int16_t', 'priority')]) + ## ipv6-list-routing-helper.h: ns3::Ptr ns3::Ipv6ListRoutingHelper::Create(ns3::Ptr node) const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::Ipv6RoutingProtocol >', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True, is_virtual=True) + return + +def register_Ns3NqosWifiMacHelper_methods(root_module, cls): + ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper::NqosWifiMacHelper(ns3::NqosWifiMacHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NqosWifiMacHelper const &', 'arg0')]) + ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper::NqosWifiMacHelper() [constructor] + cls.add_constructor([]) + ## nqos-wifi-mac-helper.h: static ns3::NqosWifiMacHelper ns3::NqosWifiMacHelper::Default() [member function] + cls.add_method('Default', + 'ns3::NqosWifiMacHelper', + [], + is_static=True) + ## nqos-wifi-mac-helper.h: void ns3::NqosWifiMacHelper::SetType(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetType', + 'void', + [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## nqos-wifi-mac-helper.h: ns3::Ptr ns3::NqosWifiMacHelper::Create() const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::WifiMac >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3QosWifiMacHelper_methods(root_module, cls): + ## qos-wifi-mac-helper.h: ns3::QosWifiMacHelper::QosWifiMacHelper(ns3::QosWifiMacHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::QosWifiMacHelper const &', 'arg0')]) + ## qos-wifi-mac-helper.h: ns3::QosWifiMacHelper::QosWifiMacHelper() [constructor] + cls.add_constructor([]) + ## qos-wifi-mac-helper.h: static ns3::QosWifiMacHelper ns3::QosWifiMacHelper::Default() [member function] + cls.add_method('Default', + 'ns3::QosWifiMacHelper', + [], + is_static=True) + ## qos-wifi-mac-helper.h: void ns3::QosWifiMacHelper::SetMsduAggregatorForAc(ns3::AccessClass accessClass, std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetMsduAggregatorForAc', + 'void', + [param('ns3::AccessClass', 'accessClass'), param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()')]) + ## qos-wifi-mac-helper.h: void ns3::QosWifiMacHelper::SetType(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetType', + 'void', + [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) + ## qos-wifi-mac-helper.h: ns3::Ptr ns3::QosWifiMacHelper::Create() const [member function] + cls.add_method('Create', + 'ns3::Ptr< ns3::WifiMac >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3AthstatsWifiTraceSink_methods(root_module, cls): + ## athstats-helper.h: ns3::AthstatsWifiTraceSink::AthstatsWifiTraceSink(ns3::AthstatsWifiTraceSink const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AthstatsWifiTraceSink const &', 'arg0')]) + ## athstats-helper.h: ns3::AthstatsWifiTraceSink::AthstatsWifiTraceSink() [constructor] + cls.add_constructor([]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::DevRxTrace(std::string context, ns3::Ptr p) [member function] + cls.add_method('DevRxTrace', + 'void', + [param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::DevTxTrace(std::string context, ns3::Ptr p) [member function] + cls.add_method('DevTxTrace', + 'void', + [param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')]) + ## athstats-helper.h: static ns3::TypeId ns3::AthstatsWifiTraceSink::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::Open(std::string const & name) [member function] + cls.add_method('Open', + 'void', + [param('std::string const &', 'name')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::PhyRxErrorTrace(std::string context, ns3::Ptr packet, double snr) [member function] + cls.add_method('PhyRxErrorTrace', + 'void', + [param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('double', 'snr')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::PhyRxOkTrace(std::string context, ns3::Ptr packet, double snr, ns3::WifiMode mode, ns3::WifiPreamble preamble) [member function] + cls.add_method('PhyRxOkTrace', + 'void', + [param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('double', 'snr'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::PhyStateTrace(std::string context, ns3::Time start, ns3::Time duration, ns3::WifiPhy::State state) [member function] + cls.add_method('PhyStateTrace', + 'void', + [param('std::string', 'context'), param('ns3::Time', 'start'), param('ns3::Time', 'duration'), param('ns3::WifiPhy::State', 'state')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::PhyTxTrace(std::string context, ns3::Ptr packet, ns3::WifiMode mode, ns3::WifiPreamble preamble, uint8_t txPower) [member function] + cls.add_method('PhyTxTrace', + 'void', + [param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble'), param('uint8_t', 'txPower')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::TxDataFailedTrace(std::string context, ns3::Mac48Address address) [member function] + cls.add_method('TxDataFailedTrace', + 'void', + [param('std::string', 'context'), param('ns3::Mac48Address', 'address')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::TxFinalDataFailedTrace(std::string context, ns3::Mac48Address address) [member function] + cls.add_method('TxFinalDataFailedTrace', + 'void', + [param('std::string', 'context'), param('ns3::Mac48Address', 'address')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::TxFinalRtsFailedTrace(std::string context, ns3::Mac48Address address) [member function] + cls.add_method('TxFinalRtsFailedTrace', + 'void', + [param('std::string', 'context'), param('ns3::Mac48Address', 'address')]) + ## athstats-helper.h: void ns3::AthstatsWifiTraceSink::TxRtsFailedTrace(std::string context, ns3::Mac48Address address) [member function] + cls.add_method('TxRtsFailedTrace', + 'void', + [param('std::string', 'context'), param('ns3::Mac48Address', 'address')]) + return + +def register_Ns3MeshStack_methods(root_module, cls): + ## mesh-stack-installer.h: ns3::MeshStack::MeshStack() [constructor] + cls.add_constructor([]) + ## mesh-stack-installer.h: ns3::MeshStack::MeshStack(ns3::MeshStack const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshStack const &', 'arg0')]) + ## mesh-stack-installer.h: bool ns3::MeshStack::InstallStack(ns3::Ptr mp) [member function] + cls.add_method('InstallStack', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'mp')], + is_pure_virtual=True, is_virtual=True) + ## mesh-stack-installer.h: void ns3::MeshStack::Report(ns3::Ptr const mp, std::ostream & arg1) [member function] + cls.add_method('Report', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp'), param('std::ostream &', 'arg1')], + is_pure_virtual=True, is_virtual=True) + ## mesh-stack-installer.h: void ns3::MeshStack::ResetStats(ns3::Ptr const mp) [member function] + cls.add_method('ResetStats', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3Dot11sStack_methods(root_module, cls): + ## dot11s-installer.h: ns3::Dot11sStack::Dot11sStack(ns3::Dot11sStack const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Dot11sStack const &', 'arg0')]) + ## dot11s-installer.h: ns3::Dot11sStack::Dot11sStack() [constructor] + cls.add_constructor([]) + ## dot11s-installer.h: void ns3::Dot11sStack::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## dot11s-installer.h: static ns3::TypeId ns3::Dot11sStack::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## dot11s-installer.h: bool ns3::Dot11sStack::InstallStack(ns3::Ptr mp) [member function] + cls.add_method('InstallStack', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'mp')], + is_virtual=True) + ## dot11s-installer.h: void ns3::Dot11sStack::Report(ns3::Ptr const mp, std::ostream & arg1) [member function] + cls.add_method('Report', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp'), param('std::ostream &', 'arg1')], + is_virtual=True) + ## dot11s-installer.h: void ns3::Dot11sStack::ResetStats(ns3::Ptr const mp) [member function] + cls.add_method('ResetStats', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp')], + is_virtual=True) + return + +def register_Ns3FlameStack_methods(root_module, cls): + ## flame-installer.h: ns3::FlameStack::FlameStack(ns3::FlameStack const & arg0) [copy constructor] + cls.add_constructor([param('ns3::FlameStack const &', 'arg0')]) + ## flame-installer.h: ns3::FlameStack::FlameStack() [constructor] + cls.add_constructor([]) + ## flame-installer.h: void ns3::FlameStack::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## flame-installer.h: static ns3::TypeId ns3::FlameStack::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## flame-installer.h: bool ns3::FlameStack::InstallStack(ns3::Ptr mp) [member function] + cls.add_method('InstallStack', + 'bool', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'mp')], + is_virtual=True) + ## flame-installer.h: void ns3::FlameStack::Report(ns3::Ptr const mp, std::ostream & arg1) [member function] + cls.add_method('Report', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp'), param('std::ostream &', 'arg1')], + is_virtual=True) + ## flame-installer.h: void ns3::FlameStack::ResetStats(ns3::Ptr const mp) [member function] + cls.add_method('ResetStats', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice > const', 'mp')], + is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_internet_stack.py b/bindings/python/apidefs/gcc-LP64/ns3_module_internet_stack.py new file mode 100644 index 000000000..c8eef2d76 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_internet_stack.py @@ -0,0 +1,2854 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## icmpv4.h: ns3::Icmpv4DestinationUnreachable [class] + module.add_class('Icmpv4DestinationUnreachable', parent=root_module['ns3::Header']) + ## icmpv4.h: ns3::Icmpv4DestinationUnreachable [enumeration] + module.add_enum('', ['NET_UNREACHABLE', 'HOST_UNREACHABLE', 'PROTOCOL_UNREACHABLE', 'PORT_UNREACHABLE', 'FRAG_NEEDED', 'SOURCE_ROUTE_FAILED'], outer_class=root_module['ns3::Icmpv4DestinationUnreachable']) + ## icmpv4.h: ns3::Icmpv4Echo [class] + module.add_class('Icmpv4Echo', parent=root_module['ns3::Header']) + ## icmpv4.h: ns3::Icmpv4Header [class] + module.add_class('Icmpv4Header', parent=root_module['ns3::Header']) + ## icmpv4.h: ns3::Icmpv4Header [enumeration] + module.add_enum('', ['ECHO_REPLY', 'DEST_UNREACH', 'ECHO', 'TIME_EXCEEDED'], outer_class=root_module['ns3::Icmpv4Header']) + ## icmpv4.h: ns3::Icmpv4TimeExceeded [class] + module.add_class('Icmpv4TimeExceeded', parent=root_module['ns3::Header']) + ## icmpv4.h: ns3::Icmpv4TimeExceeded [enumeration] + module.add_enum('', ['TIME_TO_LIVE', 'FRAGMENT_REASSEMBLY'], outer_class=root_module['ns3::Icmpv4TimeExceeded']) + ## icmpv6-header.h: ns3::Icmpv6Header [class] + module.add_class('Icmpv6Header', parent=root_module['ns3::Header']) + ## icmpv6-header.h: ns3::Icmpv6Header::Type_e [enumeration] + module.add_enum('Type_e', ['ICMPV6_ERROR_DESTINATION_UNREACHABLE', 'ICMPV6_ERROR_PACKET_TOO_BIG', 'ICMPV6_ERROR_TIME_EXCEEDED', 'ICMPV6_ERROR_PARAMETER_ERROR', 'ICMPV6_ECHO_REQUEST', 'ICMPV6_ECHO_REPLY', 'ICMPV6_SUBSCRIBE_REQUEST', 'ICMPV6_SUBSCRIBE_REPORT', 'ICMPV6_SUBSCRIVE_END', 'ICMPV6_ND_ROUTER_SOLICITATION', 'ICMPV6_ND_ROUTER_ADVERTISEMENT', 'ICMPV6_ND_NEIGHBOR_SOLICITATION', 'ICMPV6_ND_NEIGHBOR_ADVERTISEMENT', 'ICMPV6_ND_REDIRECTION', 'ICMPV6_ROUTER_RENUMBER', 'ICMPV6_INFORMATION_REQUEST', 'ICMPV6_INFORMATION_RESPONSE', 'ICMPV6_INVERSE_ND_SOLICITATION', 'ICMPV6_INVERSE_ND_ADVERSTISEMENT', 'ICMPV6_MLDV2_SUBSCRIBE_REPORT', 'ICMPV6_MOBILITY_HA_DISCOVER_REQUEST', 'ICMPV6_MOBILITY_HA_DISCOVER_RESPONSE', 'ICMPV6_MOBILITY_MOBILE_PREFIX_SOLICITATION', 'ICMPV6_SECURE_ND_CERTIFICATE_PATH_SOLICITATION', 'ICMPV6_SECURE_ND_CERTIFICATE_PATH_ADVERTISEMENT', 'ICMPV6_EXPERIMENTAL_MOBILITY'], outer_class=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6Header::OptionType_e [enumeration] + module.add_enum('OptionType_e', ['ICMPV6_OPT_LINK_LAYER_SOURCE', 'ICMPV6_OPT_LINK_LAYER_TARGET', 'ICMPV6_OPT_PREFIX', 'ICMPV6_OPT_REDIRECTED', 'ICMPV6_OPT_MTU'], outer_class=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6Header::ErrorDestinationUnreachable_e [enumeration] + module.add_enum('ErrorDestinationUnreachable_e', ['ICMPV6_NO_ROUTE', 'ICMPV6_ADM_PROHIBITED', 'ICMPV6_NOT_NEIGHBOUR', 'ICMPV6_ADDR_UNREACHABLE', 'ICMPV6_PORT_UNREACHABLE'], outer_class=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6Header::ErrorTimeExceeded_e [enumeration] + module.add_enum('ErrorTimeExceeded_e', ['ICMPV6_HOPLIMIT', 'ICMPV6_FRAGTIME'], outer_class=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6Header::ErrorParameterError_e [enumeration] + module.add_enum('ErrorParameterError_e', ['ICMPV6_MALFORMED_HEADER', 'ICMPV6_UNKNOWN_NEXT_HEADER', 'ICMPV6_UNKNOWN_OPTION'], outer_class=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6NA [class] + module.add_class('Icmpv6NA', parent=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6NS [class] + module.add_class('Icmpv6NS', parent=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6OptionHeader [class] + module.add_class('Icmpv6OptionHeader', parent=root_module['ns3::Header']) + ## icmpv6-header.h: ns3::Icmpv6OptionLinkLayerAddress [class] + module.add_class('Icmpv6OptionLinkLayerAddress', parent=root_module['ns3::Icmpv6OptionHeader']) + ## icmpv6-header.h: ns3::Icmpv6OptionMtu [class] + module.add_class('Icmpv6OptionMtu', parent=root_module['ns3::Icmpv6OptionHeader']) + ## icmpv6-header.h: ns3::Icmpv6OptionPrefixInformation [class] + module.add_class('Icmpv6OptionPrefixInformation', parent=root_module['ns3::Icmpv6OptionHeader']) + ## icmpv6-header.h: ns3::Icmpv6OptionRedirected [class] + module.add_class('Icmpv6OptionRedirected', parent=root_module['ns3::Icmpv6OptionHeader']) + ## icmpv6-header.h: ns3::Icmpv6ParameterError [class] + module.add_class('Icmpv6ParameterError', parent=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6RA [class] + module.add_class('Icmpv6RA', parent=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6RS [class] + module.add_class('Icmpv6RS', parent=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6Redirection [class] + module.add_class('Icmpv6Redirection', parent=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6TimeExceeded [class] + module.add_class('Icmpv6TimeExceeded', parent=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6TooBig [class] + module.add_class('Icmpv6TooBig', parent=root_module['ns3::Icmpv6Header']) + ## tcp-header.h: ns3::TcpHeader [class] + module.add_class('TcpHeader', parent=root_module['ns3::Header']) + ## tcp-header.h: ns3::TcpHeader::Flags_t [enumeration] + module.add_enum('Flags_t', ['NONE', 'FIN', 'SYN', 'RST', 'PSH', 'ACK', 'URG'], outer_class=root_module['ns3::TcpHeader']) + ## udp-header.h: ns3::UdpHeader [class] + module.add_class('UdpHeader', parent=root_module['ns3::Header']) + ## arp-cache.h: ns3::ArpCache [class] + module.add_class('ArpCache', parent=root_module['ns3::Object']) + ## arp-cache.h: ns3::ArpCache::Entry [class] + module.add_class('Entry', outer_class=root_module['ns3::ArpCache']) + ## arp-l3-protocol.h: ns3::ArpL3Protocol [class] + module.add_class('ArpL3Protocol', parent=root_module['ns3::Object']) + ## icmpv6-header.h: ns3::Icmpv6DestinationUnreachable [class] + module.add_class('Icmpv6DestinationUnreachable', parent=root_module['ns3::Icmpv6Header']) + ## icmpv6-header.h: ns3::Icmpv6Echo [class] + module.add_class('Icmpv6Echo', parent=root_module['ns3::Icmpv6Header']) + ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol [class] + module.add_class('Ipv4L3Protocol', parent=root_module['ns3::Ipv4']) + ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::DropReason [enumeration] + module.add_enum('DropReason', ['DROP_TTL_EXPIRED', 'DROP_NO_ROUTE', 'DROP_BAD_CHECKSUM', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR'], outer_class=root_module['ns3::Ipv4L3Protocol']) + ## ipv4-l4-protocol.h: ns3::Ipv4L4Protocol [class] + module.add_class('Ipv4L4Protocol', parent=root_module['ns3::Object']) + ## ipv4-l4-protocol.h: ns3::Ipv4L4Protocol::RxStatus [enumeration] + module.add_enum('RxStatus', ['RX_OK', 'RX_CSUM_FAILED', 'RX_ENDPOINT_UNREACH'], outer_class=root_module['ns3::Ipv4L4Protocol']) + ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol [class] + module.add_class('Ipv6L3Protocol', parent=root_module['ns3::Ipv6']) + ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol::DropReason [enumeration] + module.add_enum('DropReason', ['DROP_TTL_EXPIRED', 'DROP_NO_ROUTE', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR'], outer_class=root_module['ns3::Ipv6L3Protocol']) + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol [class] + module.add_class('Ipv6L4Protocol', parent=root_module['ns3::Object']) + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::RxStatus_e [enumeration] + module.add_enum('RxStatus_e', ['RX_OK', 'RX_CSUM_FAILED', 'RX_ENDPOINT_UNREACH'], outer_class=root_module['ns3::Ipv6L4Protocol']) + ## ndisc-cache.h: ns3::NdiscCache [class] + module.add_class('NdiscCache', parent=root_module['ns3::Object']) + ## ndisc-cache.h: ns3::NdiscCache::Entry [class] + module.add_class('Entry', outer_class=root_module['ns3::NdiscCache']) + ## tcp-l4-protocol.h: ns3::TcpL4Protocol [class] + module.add_class('TcpL4Protocol', parent=root_module['ns3::Ipv4L4Protocol']) + ## udp-l4-protocol.h: ns3::UdpL4Protocol [class] + module.add_class('UdpL4Protocol', parent=root_module['ns3::Ipv4L4Protocol']) + ## icmpv4-l4-protocol.h: ns3::Icmpv4L4Protocol [class] + module.add_class('Icmpv4L4Protocol', parent=root_module['ns3::Ipv4L4Protocol']) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol [class] + module.add_class('Icmpv6L4Protocol', parent=root_module['ns3::Ipv6L4Protocol']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Icmpv4DestinationUnreachable_methods(root_module, root_module['ns3::Icmpv4DestinationUnreachable']) + register_Ns3Icmpv4Echo_methods(root_module, root_module['ns3::Icmpv4Echo']) + register_Ns3Icmpv4Header_methods(root_module, root_module['ns3::Icmpv4Header']) + register_Ns3Icmpv4TimeExceeded_methods(root_module, root_module['ns3::Icmpv4TimeExceeded']) + register_Ns3Icmpv6Header_methods(root_module, root_module['ns3::Icmpv6Header']) + register_Ns3Icmpv6NA_methods(root_module, root_module['ns3::Icmpv6NA']) + register_Ns3Icmpv6NS_methods(root_module, root_module['ns3::Icmpv6NS']) + register_Ns3Icmpv6OptionHeader_methods(root_module, root_module['ns3::Icmpv6OptionHeader']) + register_Ns3Icmpv6OptionLinkLayerAddress_methods(root_module, root_module['ns3::Icmpv6OptionLinkLayerAddress']) + register_Ns3Icmpv6OptionMtu_methods(root_module, root_module['ns3::Icmpv6OptionMtu']) + register_Ns3Icmpv6OptionPrefixInformation_methods(root_module, root_module['ns3::Icmpv6OptionPrefixInformation']) + register_Ns3Icmpv6OptionRedirected_methods(root_module, root_module['ns3::Icmpv6OptionRedirected']) + register_Ns3Icmpv6ParameterError_methods(root_module, root_module['ns3::Icmpv6ParameterError']) + register_Ns3Icmpv6RA_methods(root_module, root_module['ns3::Icmpv6RA']) + register_Ns3Icmpv6RS_methods(root_module, root_module['ns3::Icmpv6RS']) + register_Ns3Icmpv6Redirection_methods(root_module, root_module['ns3::Icmpv6Redirection']) + register_Ns3Icmpv6TimeExceeded_methods(root_module, root_module['ns3::Icmpv6TimeExceeded']) + register_Ns3Icmpv6TooBig_methods(root_module, root_module['ns3::Icmpv6TooBig']) + register_Ns3TcpHeader_methods(root_module, root_module['ns3::TcpHeader']) + register_Ns3UdpHeader_methods(root_module, root_module['ns3::UdpHeader']) + register_Ns3ArpCache_methods(root_module, root_module['ns3::ArpCache']) + register_Ns3ArpCacheEntry_methods(root_module, root_module['ns3::ArpCache::Entry']) + register_Ns3ArpL3Protocol_methods(root_module, root_module['ns3::ArpL3Protocol']) + register_Ns3Icmpv6DestinationUnreachable_methods(root_module, root_module['ns3::Icmpv6DestinationUnreachable']) + register_Ns3Icmpv6Echo_methods(root_module, root_module['ns3::Icmpv6Echo']) + register_Ns3Ipv4L3Protocol_methods(root_module, root_module['ns3::Ipv4L3Protocol']) + register_Ns3Ipv4L4Protocol_methods(root_module, root_module['ns3::Ipv4L4Protocol']) + register_Ns3Ipv6L3Protocol_methods(root_module, root_module['ns3::Ipv6L3Protocol']) + register_Ns3Ipv6L4Protocol_methods(root_module, root_module['ns3::Ipv6L4Protocol']) + register_Ns3NdiscCache_methods(root_module, root_module['ns3::NdiscCache']) + register_Ns3NdiscCacheEntry_methods(root_module, root_module['ns3::NdiscCache::Entry']) + register_Ns3TcpL4Protocol_methods(root_module, root_module['ns3::TcpL4Protocol']) + register_Ns3UdpL4Protocol_methods(root_module, root_module['ns3::UdpL4Protocol']) + register_Ns3Icmpv4L4Protocol_methods(root_module, root_module['ns3::Icmpv4L4Protocol']) + register_Ns3Icmpv6L4Protocol_methods(root_module, root_module['ns3::Icmpv6L4Protocol']) + return + +def register_Ns3Icmpv4DestinationUnreachable_methods(root_module, cls): + ## icmpv4.h: ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable(ns3::Icmpv4DestinationUnreachable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv4DestinationUnreachable const &', 'arg0')]) + ## icmpv4.h: ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable() [constructor] + cls.add_constructor([]) + ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::GetData(uint8_t * payload) const [member function] + cls.add_method('GetData', + 'void', + [param('uint8_t *', 'payload')], + is_const=True) + ## icmpv4.h: ns3::Ipv4Header ns3::Icmpv4DestinationUnreachable::GetHeader() const [member function] + cls.add_method('GetHeader', + 'ns3::Ipv4Header', + [], + is_const=True) + ## icmpv4.h: uint16_t ns3::Icmpv4DestinationUnreachable::GetNextHopMtu() const [member function] + cls.add_method('GetNextHopMtu', + 'uint16_t', + [], + is_const=True) + ## icmpv4.h: static ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetData(ns3::Ptr data) [member function] + cls.add_method('SetData', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'data')]) + ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetHeader(ns3::Ipv4Header header) [member function] + cls.add_method('SetHeader', + 'void', + [param('ns3::Ipv4Header', 'header')]) + ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetNextHopMtu(uint16_t mtu) [member function] + cls.add_method('SetNextHopMtu', + 'void', + [param('uint16_t', 'mtu')]) + ## icmpv4.h: uint32_t ns3::Icmpv4DestinationUnreachable::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + visibility='private', is_virtual=True) + ## icmpv4.h: ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, visibility='private', is_virtual=True) + ## icmpv4.h: uint32_t ns3::Icmpv4DestinationUnreachable::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, visibility='private', is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, visibility='private', is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3Icmpv4Echo_methods(root_module, cls): + ## icmpv4.h: ns3::Icmpv4Echo::Icmpv4Echo(ns3::Icmpv4Echo const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv4Echo const &', 'arg0')]) + ## icmpv4.h: ns3::Icmpv4Echo::Icmpv4Echo() [constructor] + cls.add_constructor([]) + ## icmpv4.h: uint32_t ns3::Icmpv4Echo::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv4.h: uint32_t ns3::Icmpv4Echo::GetData(uint8_t * payload) const [member function] + cls.add_method('GetData', + 'uint32_t', + [param('uint8_t *', 'payload')], + is_const=True) + ## icmpv4.h: uint32_t ns3::Icmpv4Echo::GetDataSize() const [member function] + cls.add_method('GetDataSize', + 'uint32_t', + [], + is_const=True) + ## icmpv4.h: uint16_t ns3::Icmpv4Echo::GetIdentifier() const [member function] + cls.add_method('GetIdentifier', + 'uint16_t', + [], + is_const=True) + ## icmpv4.h: ns3::TypeId ns3::Icmpv4Echo::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv4.h: uint16_t ns3::Icmpv4Echo::GetSequenceNumber() const [member function] + cls.add_method('GetSequenceNumber', + 'uint16_t', + [], + is_const=True) + ## icmpv4.h: uint32_t ns3::Icmpv4Echo::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv4.h: static ns3::TypeId ns3::Icmpv4Echo::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv4.h: void ns3::Icmpv4Echo::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4Echo::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4Echo::SetData(ns3::Ptr data) [member function] + cls.add_method('SetData', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'data')]) + ## icmpv4.h: void ns3::Icmpv4Echo::SetIdentifier(uint16_t id) [member function] + cls.add_method('SetIdentifier', + 'void', + [param('uint16_t', 'id')]) + ## icmpv4.h: void ns3::Icmpv4Echo::SetSequenceNumber(uint16_t seq) [member function] + cls.add_method('SetSequenceNumber', + 'void', + [param('uint16_t', 'seq')]) + return + +def register_Ns3Icmpv4Header_methods(root_module, cls): + ## icmpv4.h: ns3::Icmpv4Header::Icmpv4Header(ns3::Icmpv4Header const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv4Header const &', 'arg0')]) + ## icmpv4.h: ns3::Icmpv4Header::Icmpv4Header() [constructor] + cls.add_constructor([]) + ## icmpv4.h: uint32_t ns3::Icmpv4Header::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4Header::EnableChecksum() [member function] + cls.add_method('EnableChecksum', + 'void', + []) + ## icmpv4.h: uint8_t ns3::Icmpv4Header::GetCode() const [member function] + cls.add_method('GetCode', + 'uint8_t', + [], + is_const=True) + ## icmpv4.h: ns3::TypeId ns3::Icmpv4Header::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv4.h: uint32_t ns3::Icmpv4Header::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv4.h: uint8_t ns3::Icmpv4Header::GetType() const [member function] + cls.add_method('GetType', + 'uint8_t', + [], + is_const=True) + ## icmpv4.h: static ns3::TypeId ns3::Icmpv4Header::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv4.h: void ns3::Icmpv4Header::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4Header::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4Header::SetCode(uint8_t code) [member function] + cls.add_method('SetCode', + 'void', + [param('uint8_t', 'code')]) + ## icmpv4.h: void ns3::Icmpv4Header::SetType(uint8_t type) [member function] + cls.add_method('SetType', + 'void', + [param('uint8_t', 'type')]) + return + +def register_Ns3Icmpv4TimeExceeded_methods(root_module, cls): + ## icmpv4.h: ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded(ns3::Icmpv4TimeExceeded const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv4TimeExceeded const &', 'arg0')]) + ## icmpv4.h: ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded() [constructor] + cls.add_constructor([]) + ## icmpv4.h: uint32_t ns3::Icmpv4TimeExceeded::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4TimeExceeded::GetData(uint8_t * payload) const [member function] + cls.add_method('GetData', + 'void', + [param('uint8_t *', 'payload')], + is_const=True) + ## icmpv4.h: ns3::Ipv4Header ns3::Icmpv4TimeExceeded::GetHeader() const [member function] + cls.add_method('GetHeader', + 'ns3::Ipv4Header', + [], + is_const=True) + ## icmpv4.h: ns3::TypeId ns3::Icmpv4TimeExceeded::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv4.h: uint32_t ns3::Icmpv4TimeExceeded::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv4.h: static ns3::TypeId ns3::Icmpv4TimeExceeded::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv4.h: void ns3::Icmpv4TimeExceeded::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4TimeExceeded::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv4.h: void ns3::Icmpv4TimeExceeded::SetData(ns3::Ptr data) [member function] + cls.add_method('SetData', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'data')]) + ## icmpv4.h: void ns3::Icmpv4TimeExceeded::SetHeader(ns3::Ipv4Header header) [member function] + cls.add_method('SetHeader', + 'void', + [param('ns3::Ipv4Header', 'header')]) + return + +def register_Ns3Icmpv6Header_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6Header::Icmpv6Header(ns3::Icmpv6Header const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6Header const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6Header::Icmpv6Header() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: void ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(ns3::Ipv6Address src, ns3::Ipv6Address dst, uint16_t length, uint8_t protocol) [member function] + cls.add_method('CalculatePseudoHeaderChecksum', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('uint16_t', 'length'), param('uint8_t', 'protocol')]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6Header::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: uint16_t ns3::Icmpv6Header::GetChecksum() const [member function] + cls.add_method('GetChecksum', + 'uint16_t', + [], + is_const=True) + ## icmpv6-header.h: uint8_t ns3::Icmpv6Header::GetCode() const [member function] + cls.add_method('GetCode', + 'uint8_t', + [], + is_const=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6Header::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6Header::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint8_t ns3::Icmpv6Header::GetType() const [member function] + cls.add_method('GetType', + 'uint8_t', + [], + is_const=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6Header::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6Header::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6Header::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6Header::SetChecksum(uint16_t checksum) [member function] + cls.add_method('SetChecksum', + 'void', + [param('uint16_t', 'checksum')]) + ## icmpv6-header.h: void ns3::Icmpv6Header::SetCode(uint8_t code) [member function] + cls.add_method('SetCode', + 'void', + [param('uint8_t', 'code')]) + ## icmpv6-header.h: void ns3::Icmpv6Header::SetType(uint8_t type) [member function] + cls.add_method('SetType', + 'void', + [param('uint8_t', 'type')]) + return + +def register_Ns3Icmpv6NA_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6NA::Icmpv6NA(ns3::Icmpv6NA const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6NA const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6NA::Icmpv6NA() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6NA::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: bool ns3::Icmpv6NA::GetFlagO() const [member function] + cls.add_method('GetFlagO', + 'bool', + [], + is_const=True) + ## icmpv6-header.h: bool ns3::Icmpv6NA::GetFlagR() const [member function] + cls.add_method('GetFlagR', + 'bool', + [], + is_const=True) + ## icmpv6-header.h: bool ns3::Icmpv6NA::GetFlagS() const [member function] + cls.add_method('GetFlagS', + 'bool', + [], + is_const=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6NA::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: ns3::Ipv6Address ns3::Icmpv6NA::GetIpv6Target() const [member function] + cls.add_method('GetIpv6Target', + 'ns3::Ipv6Address', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6NA::GetReserved() const [member function] + cls.add_method('GetReserved', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6NA::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6NA::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6NA::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6NA::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6NA::SetFlagO(bool o) [member function] + cls.add_method('SetFlagO', + 'void', + [param('bool', 'o')]) + ## icmpv6-header.h: void ns3::Icmpv6NA::SetFlagR(bool r) [member function] + cls.add_method('SetFlagR', + 'void', + [param('bool', 'r')]) + ## icmpv6-header.h: void ns3::Icmpv6NA::SetFlagS(bool s) [member function] + cls.add_method('SetFlagS', + 'void', + [param('bool', 's')]) + ## icmpv6-header.h: void ns3::Icmpv6NA::SetIpv6Target(ns3::Ipv6Address target) [member function] + cls.add_method('SetIpv6Target', + 'void', + [param('ns3::Ipv6Address', 'target')]) + ## icmpv6-header.h: void ns3::Icmpv6NA::SetReserved(uint32_t reserved) [member function] + cls.add_method('SetReserved', + 'void', + [param('uint32_t', 'reserved')]) + return + +def register_Ns3Icmpv6NS_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6NS::Icmpv6NS(ns3::Icmpv6NS const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6NS const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6NS::Icmpv6NS(ns3::Ipv6Address target) [constructor] + cls.add_constructor([param('ns3::Ipv6Address', 'target')]) + ## icmpv6-header.h: ns3::Icmpv6NS::Icmpv6NS() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6NS::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6NS::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: ns3::Ipv6Address ns3::Icmpv6NS::GetIpv6Target() const [member function] + cls.add_method('GetIpv6Target', + 'ns3::Ipv6Address', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6NS::GetReserved() const [member function] + cls.add_method('GetReserved', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6NS::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6NS::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6NS::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6NS::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6NS::SetIpv6Target(ns3::Ipv6Address target) [member function] + cls.add_method('SetIpv6Target', + 'void', + [param('ns3::Ipv6Address', 'target')]) + ## icmpv6-header.h: void ns3::Icmpv6NS::SetReserved(uint32_t reserved) [member function] + cls.add_method('SetReserved', + 'void', + [param('uint32_t', 'reserved')]) + return + +def register_Ns3Icmpv6OptionHeader_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6OptionHeader::Icmpv6OptionHeader(ns3::Icmpv6OptionHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6OptionHeader const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6OptionHeader::Icmpv6OptionHeader() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6OptionHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint8_t ns3::Icmpv6OptionHeader::GetLength() const [member function] + cls.add_method('GetLength', + 'uint8_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint8_t ns3::Icmpv6OptionHeader::GetType() const [member function] + cls.add_method('GetType', + 'uint8_t', + [], + is_const=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6OptionHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionHeader::SetLength(uint8_t len) [member function] + cls.add_method('SetLength', + 'void', + [param('uint8_t', 'len')]) + ## icmpv6-header.h: void ns3::Icmpv6OptionHeader::SetType(uint8_t type) [member function] + cls.add_method('SetType', + 'void', + [param('uint8_t', 'type')]) + return + +def register_Ns3Icmpv6OptionLinkLayerAddress_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6OptionLinkLayerAddress::Icmpv6OptionLinkLayerAddress(ns3::Icmpv6OptionLinkLayerAddress const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6OptionLinkLayerAddress const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6OptionLinkLayerAddress::Icmpv6OptionLinkLayerAddress(bool source) [constructor] + cls.add_constructor([param('bool', 'source')]) + ## icmpv6-header.h: ns3::Icmpv6OptionLinkLayerAddress::Icmpv6OptionLinkLayerAddress(bool source, ns3::Address addr) [constructor] + cls.add_constructor([param('bool', 'source'), param('ns3::Address', 'addr')]) + ## icmpv6-header.h: ns3::Icmpv6OptionLinkLayerAddress::Icmpv6OptionLinkLayerAddress() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionLinkLayerAddress::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::Address ns3::Icmpv6OptionLinkLayerAddress::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6OptionLinkLayerAddress::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionLinkLayerAddress::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6OptionLinkLayerAddress::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionLinkLayerAddress::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionLinkLayerAddress::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionLinkLayerAddress::SetAddress(ns3::Address addr) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'addr')]) + return + +def register_Ns3Icmpv6OptionMtu_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6OptionMtu::Icmpv6OptionMtu(ns3::Icmpv6OptionMtu const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6OptionMtu const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6OptionMtu::Icmpv6OptionMtu() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: ns3::Icmpv6OptionMtu::Icmpv6OptionMtu(uint32_t mtu) [constructor] + cls.add_constructor([param('uint32_t', 'mtu')]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionMtu::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6OptionMtu::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionMtu::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint16_t ns3::Icmpv6OptionMtu::GetReserved() const [member function] + cls.add_method('GetReserved', + 'uint16_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionMtu::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6OptionMtu::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionMtu::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionMtu::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionMtu::SetMtu(uint32_t mtu) [member function] + cls.add_method('SetMtu', + 'void', + [param('uint32_t', 'mtu')]) + ## icmpv6-header.h: void ns3::Icmpv6OptionMtu::SetReserved(uint16_t reserved) [member function] + cls.add_method('SetReserved', + 'void', + [param('uint16_t', 'reserved')]) + return + +def register_Ns3Icmpv6OptionPrefixInformation_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6OptionPrefixInformation::Icmpv6OptionPrefixInformation(ns3::Icmpv6OptionPrefixInformation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6OptionPrefixInformation const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6OptionPrefixInformation::Icmpv6OptionPrefixInformation() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: ns3::Icmpv6OptionPrefixInformation::Icmpv6OptionPrefixInformation(ns3::Ipv6Address network, uint8_t prefixlen) [constructor] + cls.add_constructor([param('ns3::Ipv6Address', 'network'), param('uint8_t', 'prefixlen')]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionPrefixInformation::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: uint8_t ns3::Icmpv6OptionPrefixInformation::GetFlags() const [member function] + cls.add_method('GetFlags', + 'uint8_t', + [], + is_const=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6OptionPrefixInformation::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionPrefixInformation::GetPreferredTime() const [member function] + cls.add_method('GetPreferredTime', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: ns3::Ipv6Address ns3::Icmpv6OptionPrefixInformation::GetPrefix() const [member function] + cls.add_method('GetPrefix', + 'ns3::Ipv6Address', + [], + is_const=True) + ## icmpv6-header.h: uint8_t ns3::Icmpv6OptionPrefixInformation::GetPrefixLength() const [member function] + cls.add_method('GetPrefixLength', + 'uint8_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionPrefixInformation::GetReserved() const [member function] + cls.add_method('GetReserved', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionPrefixInformation::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6OptionPrefixInformation::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionPrefixInformation::GetValidTime() const [member function] + cls.add_method('GetValidTime', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionPrefixInformation::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionPrefixInformation::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionPrefixInformation::SetFlags(uint8_t flags) [member function] + cls.add_method('SetFlags', + 'void', + [param('uint8_t', 'flags')]) + ## icmpv6-header.h: void ns3::Icmpv6OptionPrefixInformation::SetPreferredTime(uint32_t preferredTime) [member function] + cls.add_method('SetPreferredTime', + 'void', + [param('uint32_t', 'preferredTime')]) + ## icmpv6-header.h: void ns3::Icmpv6OptionPrefixInformation::SetPrefix(ns3::Ipv6Address prefix) [member function] + cls.add_method('SetPrefix', + 'void', + [param('ns3::Ipv6Address', 'prefix')]) + ## icmpv6-header.h: void ns3::Icmpv6OptionPrefixInformation::SetPrefixLength(uint8_t prefixLength) [member function] + cls.add_method('SetPrefixLength', + 'void', + [param('uint8_t', 'prefixLength')]) + ## icmpv6-header.h: void ns3::Icmpv6OptionPrefixInformation::SetReserved(uint32_t reserved) [member function] + cls.add_method('SetReserved', + 'void', + [param('uint32_t', 'reserved')]) + ## icmpv6-header.h: void ns3::Icmpv6OptionPrefixInformation::SetValidTime(uint32_t validTime) [member function] + cls.add_method('SetValidTime', + 'void', + [param('uint32_t', 'validTime')]) + return + +def register_Ns3Icmpv6OptionRedirected_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6OptionRedirected::Icmpv6OptionRedirected(ns3::Icmpv6OptionRedirected const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6OptionRedirected const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6OptionRedirected::Icmpv6OptionRedirected() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionRedirected::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6OptionRedirected::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: ns3::Ptr ns3::Icmpv6OptionRedirected::GetPacket() const [member function] + cls.add_method('GetPacket', + 'ns3::Ptr< ns3::Packet >', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6OptionRedirected::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6OptionRedirected::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionRedirected::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionRedirected::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6OptionRedirected::SetPacket(ns3::Ptr packet) [member function] + cls.add_method('SetPacket', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet')]) + return + +def register_Ns3Icmpv6ParameterError_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6ParameterError::Icmpv6ParameterError(ns3::Icmpv6ParameterError const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6ParameterError const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6ParameterError::Icmpv6ParameterError() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6ParameterError::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6ParameterError::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: ns3::Ptr ns3::Icmpv6ParameterError::GetPacket() const [member function] + cls.add_method('GetPacket', + 'ns3::Ptr< ns3::Packet >', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6ParameterError::GetPtr() const [member function] + cls.add_method('GetPtr', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6ParameterError::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6ParameterError::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6ParameterError::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6ParameterError::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6ParameterError::SetPacket(ns3::Ptr p) [member function] + cls.add_method('SetPacket', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## icmpv6-header.h: void ns3::Icmpv6ParameterError::SetPtr(uint32_t ptr) [member function] + cls.add_method('SetPtr', + 'void', + [param('uint32_t', 'ptr')]) + return + +def register_Ns3Icmpv6RA_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6RA::Icmpv6RA(ns3::Icmpv6RA const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6RA const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6RA::Icmpv6RA() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6RA::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: uint8_t ns3::Icmpv6RA::GetCurHopLimit() const [member function] + cls.add_method('GetCurHopLimit', + 'uint8_t', + [], + is_const=True) + ## icmpv6-header.h: bool ns3::Icmpv6RA::GetFlagH() const [member function] + cls.add_method('GetFlagH', + 'bool', + [], + is_const=True) + ## icmpv6-header.h: bool ns3::Icmpv6RA::GetFlagM() const [member function] + cls.add_method('GetFlagM', + 'bool', + [], + is_const=True) + ## icmpv6-header.h: bool ns3::Icmpv6RA::GetFlagO() const [member function] + cls.add_method('GetFlagO', + 'bool', + [], + is_const=True) + ## icmpv6-header.h: uint8_t ns3::Icmpv6RA::GetFlags() const [member function] + cls.add_method('GetFlags', + 'uint8_t', + [], + is_const=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6RA::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint16_t ns3::Icmpv6RA::GetLifeTime() const [member function] + cls.add_method('GetLifeTime', + 'uint16_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6RA::GetReachableTime() const [member function] + cls.add_method('GetReachableTime', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6RA::GetRetransmissionTime() const [member function] + cls.add_method('GetRetransmissionTime', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6RA::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6RA::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6RA::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6RA::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6RA::SetCurHopLimit(uint8_t m) [member function] + cls.add_method('SetCurHopLimit', + 'void', + [param('uint8_t', 'm')]) + ## icmpv6-header.h: void ns3::Icmpv6RA::SetFlagH(bool h) [member function] + cls.add_method('SetFlagH', + 'void', + [param('bool', 'h')]) + ## icmpv6-header.h: void ns3::Icmpv6RA::SetFlagM(bool m) [member function] + cls.add_method('SetFlagM', + 'void', + [param('bool', 'm')]) + ## icmpv6-header.h: void ns3::Icmpv6RA::SetFlagO(bool o) [member function] + cls.add_method('SetFlagO', + 'void', + [param('bool', 'o')]) + ## icmpv6-header.h: void ns3::Icmpv6RA::SetFlags(uint8_t f) [member function] + cls.add_method('SetFlags', + 'void', + [param('uint8_t', 'f')]) + ## icmpv6-header.h: void ns3::Icmpv6RA::SetLifeTime(uint16_t l) [member function] + cls.add_method('SetLifeTime', + 'void', + [param('uint16_t', 'l')]) + ## icmpv6-header.h: void ns3::Icmpv6RA::SetReachableTime(uint32_t r) [member function] + cls.add_method('SetReachableTime', + 'void', + [param('uint32_t', 'r')]) + ## icmpv6-header.h: void ns3::Icmpv6RA::SetRetransmissionTime(uint32_t r) [member function] + cls.add_method('SetRetransmissionTime', + 'void', + [param('uint32_t', 'r')]) + return + +def register_Ns3Icmpv6RS_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6RS::Icmpv6RS(ns3::Icmpv6RS const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6RS const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6RS::Icmpv6RS() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6RS::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6RS::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6RS::GetReserved() const [member function] + cls.add_method('GetReserved', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6RS::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6RS::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6RS::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6RS::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6RS::SetReserved(uint32_t reserved) [member function] + cls.add_method('SetReserved', + 'void', + [param('uint32_t', 'reserved')]) + return + +def register_Ns3Icmpv6Redirection_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6Redirection::Icmpv6Redirection(ns3::Icmpv6Redirection const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6Redirection const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6Redirection::Icmpv6Redirection() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6Redirection::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::Ipv6Address ns3::Icmpv6Redirection::GetDestination() const [member function] + cls.add_method('GetDestination', + 'ns3::Ipv6Address', + [], + is_const=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6Redirection::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6Redirection::GetReserved() const [member function] + cls.add_method('GetReserved', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6Redirection::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: ns3::Ipv6Address ns3::Icmpv6Redirection::GetTarget() const [member function] + cls.add_method('GetTarget', + 'ns3::Ipv6Address', + [], + is_const=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6Redirection::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6Redirection::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6Redirection::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6Redirection::SetDestination(ns3::Ipv6Address destination) [member function] + cls.add_method('SetDestination', + 'void', + [param('ns3::Ipv6Address', 'destination')]) + ## icmpv6-header.h: void ns3::Icmpv6Redirection::SetReserved(uint32_t reserved) [member function] + cls.add_method('SetReserved', + 'void', + [param('uint32_t', 'reserved')]) + ## icmpv6-header.h: void ns3::Icmpv6Redirection::SetTarget(ns3::Ipv6Address target) [member function] + cls.add_method('SetTarget', + 'void', + [param('ns3::Ipv6Address', 'target')]) + return + +def register_Ns3Icmpv6TimeExceeded_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6TimeExceeded::Icmpv6TimeExceeded(ns3::Icmpv6TimeExceeded const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6TimeExceeded const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6TimeExceeded::Icmpv6TimeExceeded() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6TimeExceeded::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6TimeExceeded::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: ns3::Ptr ns3::Icmpv6TimeExceeded::GetPacket() const [member function] + cls.add_method('GetPacket', + 'ns3::Ptr< ns3::Packet >', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6TimeExceeded::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6TimeExceeded::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6TimeExceeded::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6TimeExceeded::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6TimeExceeded::SetPacket(ns3::Ptr p) [member function] + cls.add_method('SetPacket', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + return + +def register_Ns3Icmpv6TooBig_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6TooBig::Icmpv6TooBig(ns3::Icmpv6TooBig const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6TooBig const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6TooBig::Icmpv6TooBig() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6TooBig::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6TooBig::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6TooBig::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint32_t', + [], + is_const=True) + ## icmpv6-header.h: ns3::Ptr ns3::Icmpv6TooBig::GetPacket() const [member function] + cls.add_method('GetPacket', + 'ns3::Ptr< ns3::Packet >', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6TooBig::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6TooBig::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6TooBig::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6TooBig::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6TooBig::SetMtu(uint32_t mtu) [member function] + cls.add_method('SetMtu', + 'void', + [param('uint32_t', 'mtu')]) + ## icmpv6-header.h: void ns3::Icmpv6TooBig::SetPacket(ns3::Ptr p) [member function] + cls.add_method('SetPacket', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + return + +def register_Ns3TcpHeader_methods(root_module, cls): + ## tcp-header.h: ns3::TcpHeader::TcpHeader(ns3::TcpHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TcpHeader const &', 'arg0')]) + ## tcp-header.h: ns3::TcpHeader::TcpHeader() [constructor] + cls.add_constructor([]) + ## tcp-header.h: uint32_t ns3::TcpHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## tcp-header.h: void ns3::TcpHeader::EnableChecksums() [member function] + cls.add_method('EnableChecksums', + 'void', + []) + ## tcp-header.h: SequenceNumber ns3::TcpHeader::GetAckNumber() const [member function] + cls.add_method('GetAckNumber', + 'SequenceNumber', + [], + is_const=True) + ## tcp-header.h: uint16_t ns3::TcpHeader::GetDestinationPort() const [member function] + cls.add_method('GetDestinationPort', + 'uint16_t', + [], + is_const=True) + ## tcp-header.h: uint8_t ns3::TcpHeader::GetFlags() const [member function] + cls.add_method('GetFlags', + 'uint8_t', + [], + is_const=True) + ## tcp-header.h: ns3::TypeId ns3::TcpHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## tcp-header.h: uint8_t ns3::TcpHeader::GetLength() const [member function] + cls.add_method('GetLength', + 'uint8_t', + [], + is_const=True) + ## tcp-header.h: SequenceNumber ns3::TcpHeader::GetSequenceNumber() const [member function] + cls.add_method('GetSequenceNumber', + 'SequenceNumber', + [], + is_const=True) + ## tcp-header.h: uint32_t ns3::TcpHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## tcp-header.h: uint16_t ns3::TcpHeader::GetSourcePort() const [member function] + cls.add_method('GetSourcePort', + 'uint16_t', + [], + is_const=True) + ## tcp-header.h: static ns3::TypeId ns3::TcpHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tcp-header.h: uint16_t ns3::TcpHeader::GetUrgentPointer() const [member function] + cls.add_method('GetUrgentPointer', + 'uint16_t', + [], + is_const=True) + ## tcp-header.h: uint16_t ns3::TcpHeader::GetWindowSize() const [member function] + cls.add_method('GetWindowSize', + 'uint16_t', + [], + is_const=True) + ## tcp-header.h: void ns3::TcpHeader::InitializeChecksum(ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function] + cls.add_method('InitializeChecksum', + 'void', + [param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')]) + ## tcp-header.h: bool ns3::TcpHeader::IsChecksumOk() const [member function] + cls.add_method('IsChecksumOk', + 'bool', + [], + is_const=True) + ## tcp-header.h: void ns3::TcpHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## tcp-header.h: void ns3::TcpHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## tcp-header.h: void ns3::TcpHeader::SetAckNumber(SequenceNumber ackNumber) [member function] + cls.add_method('SetAckNumber', + 'void', + [param('SequenceNumber', 'ackNumber')]) + ## tcp-header.h: void ns3::TcpHeader::SetDestinationPort(uint16_t port) [member function] + cls.add_method('SetDestinationPort', + 'void', + [param('uint16_t', 'port')]) + ## tcp-header.h: void ns3::TcpHeader::SetFlags(uint8_t flags) [member function] + cls.add_method('SetFlags', + 'void', + [param('uint8_t', 'flags')]) + ## tcp-header.h: void ns3::TcpHeader::SetLength(uint8_t length) [member function] + cls.add_method('SetLength', + 'void', + [param('uint8_t', 'length')]) + ## tcp-header.h: void ns3::TcpHeader::SetSequenceNumber(SequenceNumber sequenceNumber) [member function] + cls.add_method('SetSequenceNumber', + 'void', + [param('SequenceNumber', 'sequenceNumber')]) + ## tcp-header.h: void ns3::TcpHeader::SetSourcePort(uint16_t port) [member function] + cls.add_method('SetSourcePort', + 'void', + [param('uint16_t', 'port')]) + ## tcp-header.h: void ns3::TcpHeader::SetUrgentPointer(uint16_t urgentPointer) [member function] + cls.add_method('SetUrgentPointer', + 'void', + [param('uint16_t', 'urgentPointer')]) + ## tcp-header.h: void ns3::TcpHeader::SetWindowSize(uint16_t windowSize) [member function] + cls.add_method('SetWindowSize', + 'void', + [param('uint16_t', 'windowSize')]) + return + +def register_Ns3UdpHeader_methods(root_module, cls): + ## udp-header.h: ns3::UdpHeader::UdpHeader(ns3::UdpHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UdpHeader const &', 'arg0')]) + ## udp-header.h: ns3::UdpHeader::UdpHeader() [constructor] + cls.add_constructor([]) + ## udp-header.h: uint32_t ns3::UdpHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## udp-header.h: void ns3::UdpHeader::EnableChecksums() [member function] + cls.add_method('EnableChecksums', + 'void', + []) + ## udp-header.h: uint16_t ns3::UdpHeader::GetDestinationPort() const [member function] + cls.add_method('GetDestinationPort', + 'uint16_t', + [], + is_const=True) + ## udp-header.h: ns3::TypeId ns3::UdpHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## udp-header.h: uint32_t ns3::UdpHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## udp-header.h: uint16_t ns3::UdpHeader::GetSourcePort() const [member function] + cls.add_method('GetSourcePort', + 'uint16_t', + [], + is_const=True) + ## udp-header.h: static ns3::TypeId ns3::UdpHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## udp-header.h: void ns3::UdpHeader::InitializeChecksum(ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function] + cls.add_method('InitializeChecksum', + 'void', + [param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')]) + ## udp-header.h: bool ns3::UdpHeader::IsChecksumOk() const [member function] + cls.add_method('IsChecksumOk', + 'bool', + [], + is_const=True) + ## udp-header.h: void ns3::UdpHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## udp-header.h: void ns3::UdpHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## udp-header.h: void ns3::UdpHeader::SetDestinationPort(uint16_t port) [member function] + cls.add_method('SetDestinationPort', + 'void', + [param('uint16_t', 'port')]) + ## udp-header.h: void ns3::UdpHeader::SetSourcePort(uint16_t port) [member function] + cls.add_method('SetSourcePort', + 'void', + [param('uint16_t', 'port')]) + return + +def register_Ns3ArpCache_methods(root_module, cls): + ## arp-cache.h: ns3::ArpCache::ArpCache() [constructor] + cls.add_constructor([]) + ## arp-cache.h: ns3::ArpCache::Entry * ns3::ArpCache::Add(ns3::Ipv4Address to) [member function] + cls.add_method('Add', + 'ns3::ArpCache::Entry *', + [param('ns3::Ipv4Address', 'to')]) + ## arp-cache.h: void ns3::ArpCache::Flush() [member function] + cls.add_method('Flush', + 'void', + []) + ## arp-cache.h: ns3::Time ns3::ArpCache::GetAliveTimeout() const [member function] + cls.add_method('GetAliveTimeout', + 'ns3::Time', + [], + is_const=True) + ## arp-cache.h: ns3::Time ns3::ArpCache::GetDeadTimeout() const [member function] + cls.add_method('GetDeadTimeout', + 'ns3::Time', + [], + is_const=True) + ## arp-cache.h: ns3::Ptr ns3::ArpCache::GetDevice() const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [], + is_const=True) + ## arp-cache.h: ns3::Ptr ns3::ArpCache::GetInterface() const [member function] + cls.add_method('GetInterface', + 'ns3::Ptr< ns3::Ipv4Interface >', + [], + is_const=True) + ## arp-cache.h: static ns3::TypeId ns3::ArpCache::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## arp-cache.h: ns3::Time ns3::ArpCache::GetWaitReplyTimeout() const [member function] + cls.add_method('GetWaitReplyTimeout', + 'ns3::Time', + [], + is_const=True) + ## arp-cache.h: ns3::ArpCache::Entry * ns3::ArpCache::Lookup(ns3::Ipv4Address destination) [member function] + cls.add_method('Lookup', + 'ns3::ArpCache::Entry *', + [param('ns3::Ipv4Address', 'destination')]) + ## arp-cache.h: void ns3::ArpCache::SetAliveTimeout(ns3::Time aliveTimeout) [member function] + cls.add_method('SetAliveTimeout', + 'void', + [param('ns3::Time', 'aliveTimeout')]) + ## arp-cache.h: void ns3::ArpCache::SetArpRequestCallback(ns3::Callback, ns3::Ipv4Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> arpRequestCallback) [member function] + cls.add_method('SetArpRequestCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::ArpCache const >, ns3::Ipv4Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arpRequestCallback')]) + ## arp-cache.h: void ns3::ArpCache::SetDeadTimeout(ns3::Time deadTimeout) [member function] + cls.add_method('SetDeadTimeout', + 'void', + [param('ns3::Time', 'deadTimeout')]) + ## arp-cache.h: void ns3::ArpCache::SetDevice(ns3::Ptr device, ns3::Ptr interface) [member function] + cls.add_method('SetDevice', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Ipv4Interface >', 'interface')]) + ## arp-cache.h: void ns3::ArpCache::SetWaitReplyTimeout(ns3::Time waitReplyTimeout) [member function] + cls.add_method('SetWaitReplyTimeout', + 'void', + [param('ns3::Time', 'waitReplyTimeout')]) + ## arp-cache.h: void ns3::ArpCache::StartWaitReplyTimer() [member function] + cls.add_method('StartWaitReplyTimer', + 'void', + []) + ## arp-cache.h: void ns3::ArpCache::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3ArpCacheEntry_methods(root_module, cls): + ## arp-cache.h: ns3::ArpCache::Entry::Entry(ns3::ArpCache::Entry const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ArpCache::Entry const &', 'arg0')]) + ## arp-cache.h: ns3::ArpCache::Entry::Entry(ns3::ArpCache * arp) [constructor] + cls.add_constructor([param('ns3::ArpCache *', 'arp')]) + ## arp-cache.h: void ns3::ArpCache::Entry::ClearRetries() [member function] + cls.add_method('ClearRetries', + 'void', + []) + ## arp-cache.h: ns3::Ptr ns3::ArpCache::Entry::DequeuePending() [member function] + cls.add_method('DequeuePending', + 'ns3::Ptr< ns3::Packet >', + []) + ## arp-cache.h: ns3::Ipv4Address ns3::ArpCache::Entry::GetIpv4Address() const [member function] + cls.add_method('GetIpv4Address', + 'ns3::Ipv4Address', + [], + is_const=True) + ## arp-cache.h: ns3::Address ns3::ArpCache::Entry::GetMacAddress() const [member function] + cls.add_method('GetMacAddress', + 'ns3::Address', + [], + is_const=True) + ## arp-cache.h: uint32_t ns3::ArpCache::Entry::GetRetries() const [member function] + cls.add_method('GetRetries', + 'uint32_t', + [], + is_const=True) + ## arp-cache.h: void ns3::ArpCache::Entry::IncrementRetries() [member function] + cls.add_method('IncrementRetries', + 'void', + []) + ## arp-cache.h: bool ns3::ArpCache::Entry::IsAlive() [member function] + cls.add_method('IsAlive', + 'bool', + []) + ## arp-cache.h: bool ns3::ArpCache::Entry::IsDead() [member function] + cls.add_method('IsDead', + 'bool', + []) + ## arp-cache.h: bool ns3::ArpCache::Entry::IsExpired() const [member function] + cls.add_method('IsExpired', + 'bool', + [], + is_const=True) + ## arp-cache.h: bool ns3::ArpCache::Entry::IsWaitReply() [member function] + cls.add_method('IsWaitReply', + 'bool', + []) + ## arp-cache.h: void ns3::ArpCache::Entry::MarkAlive(ns3::Address macAddress) [member function] + cls.add_method('MarkAlive', + 'void', + [param('ns3::Address', 'macAddress')]) + ## arp-cache.h: void ns3::ArpCache::Entry::MarkDead() [member function] + cls.add_method('MarkDead', + 'void', + []) + ## arp-cache.h: void ns3::ArpCache::Entry::MarkWaitReply(ns3::Ptr waiting) [member function] + cls.add_method('MarkWaitReply', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'waiting')]) + ## arp-cache.h: void ns3::ArpCache::Entry::SetIpv4Address(ns3::Ipv4Address destination) [member function] + cls.add_method('SetIpv4Address', + 'void', + [param('ns3::Ipv4Address', 'destination')]) + ## arp-cache.h: bool ns3::ArpCache::Entry::UpdateWaitReply(ns3::Ptr waiting) [member function] + cls.add_method('UpdateWaitReply', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'waiting')]) + return + +def register_Ns3ArpL3Protocol_methods(root_module, cls): + ## arp-l3-protocol.h: ns3::ArpL3Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True) + ## arp-l3-protocol.h: static ns3::TypeId ns3::ArpL3Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## arp-l3-protocol.h: ns3::ArpL3Protocol::ArpL3Protocol() [constructor] + cls.add_constructor([]) + ## arp-l3-protocol.h: void ns3::ArpL3Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## arp-l3-protocol.h: ns3::Ptr ns3::ArpL3Protocol::CreateCache(ns3::Ptr device, ns3::Ptr interface) [member function] + cls.add_method('CreateCache', + 'ns3::Ptr< ns3::ArpCache >', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Ipv4Interface >', 'interface')]) + ## arp-l3-protocol.h: void ns3::ArpL3Protocol::Receive(ns3::Ptr device, ns3::Ptr p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function] + cls.add_method('Receive', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'from'), param('ns3::Address const &', 'to'), param('ns3::NetDevice::PacketType', 'packetType')]) + ## arp-l3-protocol.h: bool ns3::ArpL3Protocol::Lookup(ns3::Ptr p, ns3::Ipv4Address destination, ns3::Ptr device, ns3::Ptr cache, ns3::Address * hardwareDestination) [member function] + cls.add_method('Lookup', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::ArpCache >', 'cache'), param('ns3::Address *', 'hardwareDestination')]) + ## arp-l3-protocol.h: void ns3::ArpL3Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## arp-l3-protocol.h: void ns3::ArpL3Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3Icmpv6DestinationUnreachable_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6DestinationUnreachable::Icmpv6DestinationUnreachable(ns3::Icmpv6DestinationUnreachable const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6DestinationUnreachable const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6DestinationUnreachable::Icmpv6DestinationUnreachable() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6DestinationUnreachable::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6DestinationUnreachable::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: ns3::Ptr ns3::Icmpv6DestinationUnreachable::GetPacket() const [member function] + cls.add_method('GetPacket', + 'ns3::Ptr< ns3::Packet >', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6DestinationUnreachable::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6DestinationUnreachable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6DestinationUnreachable::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6DestinationUnreachable::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6DestinationUnreachable::SetPacket(ns3::Ptr p) [member function] + cls.add_method('SetPacket', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + return + +def register_Ns3Icmpv6Echo_methods(root_module, cls): + ## icmpv6-header.h: ns3::Icmpv6Echo::Icmpv6Echo(ns3::Icmpv6Echo const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6Echo const &', 'arg0')]) + ## icmpv6-header.h: ns3::Icmpv6Echo::Icmpv6Echo() [constructor] + cls.add_constructor([]) + ## icmpv6-header.h: ns3::Icmpv6Echo::Icmpv6Echo(bool request) [constructor] + cls.add_constructor([param('bool', 'request')]) + ## icmpv6-header.h: uint32_t ns3::Icmpv6Echo::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## icmpv6-header.h: uint16_t ns3::Icmpv6Echo::GetId() const [member function] + cls.add_method('GetId', + 'uint16_t', + [], + is_const=True) + ## icmpv6-header.h: ns3::TypeId ns3::Icmpv6Echo::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: uint16_t ns3::Icmpv6Echo::GetSeq() const [member function] + cls.add_method('GetSeq', + 'uint16_t', + [], + is_const=True) + ## icmpv6-header.h: uint32_t ns3::Icmpv6Echo::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## icmpv6-header.h: static ns3::TypeId ns3::Icmpv6Echo::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-header.h: void ns3::Icmpv6Echo::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6Echo::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## icmpv6-header.h: void ns3::Icmpv6Echo::SetId(uint16_t id) [member function] + cls.add_method('SetId', + 'void', + [param('uint16_t', 'id')]) + ## icmpv6-header.h: void ns3::Icmpv6Echo::SetSeq(uint16_t seq) [member function] + cls.add_method('SetSeq', + 'void', + [param('uint16_t', 'seq')]) + return + +def register_Ns3Ipv4L3Protocol_methods(root_module, cls): + ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True) + ## ipv4-l3-protocol.h: static ns3::TypeId ns3::Ipv4L3Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::Ipv4L3Protocol() [constructor] + cls.add_constructor([]) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetRoutingProtocol(ns3::Ptr routingProtocol) [member function] + cls.add_method('SetRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol')], + is_virtual=True) + ## ipv4-l3-protocol.h: ns3::Ptr ns3::Ipv4L3Protocol::GetRoutingProtocol() const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: ns3::Ptr ns3::Ipv4L3Protocol::CreateRawSocket() [member function] + cls.add_method('CreateRawSocket', + 'ns3::Ptr< ns3::Socket >', + []) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::DeleteRawSocket(ns3::Ptr socket) [member function] + cls.add_method('DeleteRawSocket', + 'void', + [param('ns3::Ptr< ns3::Socket >', 'socket')]) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Insert(ns3::Ptr protocol) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Ptr< ns3::Ipv4L4Protocol >', 'protocol')]) + ## ipv4-l3-protocol.h: ns3::Ptr ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber) const [member function] + cls.add_method('GetProtocol', + 'ns3::Ptr< ns3::Ipv4L4Protocol >', + [param('int', 'protocolNumber')], + is_const=True) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Remove(ns3::Ptr protocol) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Ptr< ns3::Ipv4L4Protocol >', 'protocol')]) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDefaultTtl(uint8_t ttl) [member function] + cls.add_method('SetDefaultTtl', + 'void', + [param('uint8_t', 'ttl')]) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Receive(ns3::Ptr device, ns3::Ptr p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function] + cls.add_method('Receive', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'from'), param('ns3::Address const &', 'to'), param('ns3::NetDevice::PacketType', 'packetType')]) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Send(ns3::Ptr packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol, ns3::Ptr route) [member function] + cls.add_method('Send', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) + ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::AddInterface(ns3::Ptr device) [member function] + cls.add_method('AddInterface', + 'uint32_t', + [param('ns3::Ptr< ns3::NetDevice >', 'device')], + is_virtual=True) + ## ipv4-l3-protocol.h: ns3::Ptr ns3::Ipv4L3Protocol::GetInterface(uint32_t i) const [member function] + cls.add_method('GetInterface', + 'ns3::Ptr< ns3::Ipv4Interface >', + [param('uint32_t', 'i')], + is_const=True) + ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNInterfaces() const [member function] + cls.add_method('GetNInterfaces', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: int32_t ns3::Ipv4L3Protocol::GetInterfaceForAddress(ns3::Ipv4Address addr) const [member function] + cls.add_method('GetInterfaceForAddress', + 'int32_t', + [param('ns3::Ipv4Address', 'addr')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: int32_t ns3::Ipv4L3Protocol::GetInterfaceForPrefix(ns3::Ipv4Address addr, ns3::Ipv4Mask mask) const [member function] + cls.add_method('GetInterfaceForPrefix', + 'int32_t', + [param('ns3::Ipv4Address', 'addr'), param('ns3::Ipv4Mask', 'mask')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: int32_t ns3::Ipv4L3Protocol::GetInterfaceForDevice(ns3::Ptr device) const [member function] + cls.add_method('GetInterfaceForDevice', + 'int32_t', + [param('ns3::Ptr< ns3::NetDevice const >', 'device')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::AddAddress(uint32_t i, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('AddAddress', + 'bool', + [param('uint32_t', 'i'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_virtual=True) + ## ipv4-l3-protocol.h: ns3::Ipv4InterfaceAddress ns3::Ipv4L3Protocol::GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const [member function] + cls.add_method('GetAddress', + 'ns3::Ipv4InterfaceAddress', + [param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNAddresses(uint32_t interface) const [member function] + cls.add_method('GetNAddresses', + 'uint32_t', + [param('uint32_t', 'interface')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex) [member function] + cls.add_method('RemoveAddress', + 'bool', + [param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')], + is_virtual=True) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetMetric(uint32_t i, uint16_t metric) [member function] + cls.add_method('SetMetric', + 'void', + [param('uint32_t', 'i'), param('uint16_t', 'metric')], + is_virtual=True) + ## ipv4-l3-protocol.h: uint16_t ns3::Ipv4L3Protocol::GetMetric(uint32_t i) const [member function] + cls.add_method('GetMetric', + 'uint16_t', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: uint16_t ns3::Ipv4L3Protocol::GetMtu(uint32_t i) const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function] + cls.add_method('IsUp', + 'bool', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetUp(uint32_t i) [member function] + cls.add_method('SetUp', + 'void', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDown(uint32_t i) [member function] + cls.add_method('SetDown', + 'void', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::IsForwarding(uint32_t i) const [member function] + cls.add_method('IsForwarding', + 'bool', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetForwarding(uint32_t i, bool val) [member function] + cls.add_method('SetForwarding', + 'void', + [param('uint32_t', 'i'), param('bool', 'val')], + is_virtual=True) + ## ipv4-l3-protocol.h: ns3::Ptr ns3::Ipv4L3Protocol::GetNetDevice(uint32_t i) [member function] + cls.add_method('GetNetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + visibility='protected', is_virtual=True) + ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetIpForward(bool forward) [member function] + cls.add_method('SetIpForward', + 'void', + [param('bool', 'forward')], + visibility='private', is_virtual=True) + ## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::GetIpForward() const [member function] + cls.add_method('GetIpForward', + 'bool', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3Ipv4L4Protocol_methods(root_module, cls): + ## ipv4-l4-protocol.h: ns3::Ipv4L4Protocol::Ipv4L4Protocol() [constructor] + cls.add_constructor([]) + ## ipv4-l4-protocol.h: ns3::Ipv4L4Protocol::Ipv4L4Protocol(ns3::Ipv4L4Protocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4L4Protocol const &', 'arg0')]) + ## ipv4-l4-protocol.h: int ns3::Ipv4L4Protocol::GetProtocolNumber() const [member function] + cls.add_method('GetProtocolNumber', + 'int', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4-l4-protocol.h: static ns3::TypeId ns3::Ipv4L4Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-l4-protocol.h: ns3::Ipv4L4Protocol::RxStatus ns3::Ipv4L4Protocol::Receive(ns3::Ptr p, ns3::Ipv4Address const & source, ns3::Ipv4Address const & destination, ns3::Ptr incomingInterface) [member function] + cls.add_method('Receive', + 'ns3::Ipv4L4Protocol::RxStatus', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address const &', 'source'), param('ns3::Ipv4Address const &', 'destination'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')], + is_pure_virtual=True, is_virtual=True) + ## ipv4-l4-protocol.h: void ns3::Ipv4L4Protocol::ReceiveIcmp(ns3::Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv4Address payloadSource, ns3::Ipv4Address payloadDestination, uint8_t const * payload) [member function] + cls.add_method('ReceiveIcmp', + 'void', + [param('ns3::Ipv4Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv4Address', 'payloadSource'), param('ns3::Ipv4Address', 'payloadDestination'), param('uint8_t const *', 'payload')], + is_virtual=True) + return + +def register_Ns3Ipv6L3Protocol_methods(root_module, cls): + ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True) + ## ipv6-l3-protocol.h: static ns3::TypeId ns3::Ipv6L3Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol::Ipv6L3Protocol() [constructor] + cls.add_constructor([]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::Insert(ns3::Ptr protocol) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Ptr< ns3::Ipv6L4Protocol >', 'protocol')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::Remove(ns3::Ptr protocol) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Ptr< ns3::Ipv6L4Protocol >', 'protocol')]) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetProtocol(int protocolNumber) const [member function] + cls.add_method('GetProtocol', + 'ns3::Ptr< ns3::Ipv6L4Protocol >', + [param('int', 'protocolNumber')], + is_const=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::CreateRawSocket() [member function] + cls.add_method('CreateRawSocket', + 'ns3::Ptr< ns3::Socket >', + []) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::DeleteRawSocket(ns3::Ptr socket) [member function] + cls.add_method('DeleteRawSocket', + 'void', + [param('ns3::Ptr< ns3::Socket >', 'socket')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetDefaultTtl(uint8_t ttl) [member function] + cls.add_method('SetDefaultTtl', + 'void', + [param('uint8_t', 'ttl')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::Receive(ns3::Ptr device, ns3::Ptr p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function] + cls.add_method('Receive', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'from'), param('ns3::Address const &', 'to'), param('ns3::NetDevice::PacketType', 'packetType')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::Send(ns3::Ptr packet, ns3::Ipv6Address source, ns3::Ipv6Address destination, uint8_t protocol, ns3::Ptr route) [member function] + cls.add_method('Send', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'source'), param('ns3::Ipv6Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv6Route >', 'route')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetRoutingProtocol(ns3::Ptr routingProtocol) [member function] + cls.add_method('SetRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::Ipv6RoutingProtocol >', 'routingProtocol')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetRoutingProtocol() const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::Ipv6RoutingProtocol >', + [], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: uint32_t ns3::Ipv6L3Protocol::AddInterface(ns3::Ptr device) [member function] + cls.add_method('AddInterface', + 'uint32_t', + [param('ns3::Ptr< ns3::NetDevice >', 'device')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetInterface(uint32_t i) const [member function] + cls.add_method('GetInterface', + 'ns3::Ptr< ns3::Ipv6Interface >', + [param('uint32_t', 'i')], + is_const=True) + ## ipv6-l3-protocol.h: uint32_t ns3::Ipv6L3Protocol::GetNInterfaces() const [member function] + cls.add_method('GetNInterfaces', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: int32_t ns3::Ipv6L3Protocol::GetInterfaceForAddress(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetInterfaceForAddress', + 'int32_t', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: int32_t ns3::Ipv6L3Protocol::GetInterfaceForPrefix(ns3::Ipv6Address addr, ns3::Ipv6Prefix mask) const [member function] + cls.add_method('GetInterfaceForPrefix', + 'int32_t', + [param('ns3::Ipv6Address', 'addr'), param('ns3::Ipv6Prefix', 'mask')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: int32_t ns3::Ipv6L3Protocol::GetInterfaceForDevice(ns3::Ptr device) const [member function] + cls.add_method('GetInterfaceForDevice', + 'int32_t', + [param('ns3::Ptr< ns3::NetDevice const >', 'device')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::AddAddress(uint32_t i, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('AddAddress', + 'bool', + [param('uint32_t', 'i'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ipv6InterfaceAddress ns3::Ipv6L3Protocol::GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const [member function] + cls.add_method('GetAddress', + 'ns3::Ipv6InterfaceAddress', + [param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: uint32_t ns3::Ipv6L3Protocol::GetNAddresses(uint32_t interface) const [member function] + cls.add_method('GetNAddresses', + 'uint32_t', + [param('uint32_t', 'interface')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex) [member function] + cls.add_method('RemoveAddress', + 'bool', + [param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')], + is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetMetric(uint32_t i, uint16_t metric) [member function] + cls.add_method('SetMetric', + 'void', + [param('uint32_t', 'i'), param('uint16_t', 'metric')], + is_virtual=True) + ## ipv6-l3-protocol.h: uint16_t ns3::Ipv6L3Protocol::GetMetric(uint32_t i) const [member function] + cls.add_method('GetMetric', + 'uint16_t', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: uint16_t ns3::Ipv6L3Protocol::GetMtu(uint32_t i) const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::IsUp(uint32_t i) const [member function] + cls.add_method('IsUp', + 'bool', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetUp(uint32_t i) [member function] + cls.add_method('SetUp', + 'void', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetDown(uint32_t i) [member function] + cls.add_method('SetDown', + 'void', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::IsForwarding(uint32_t i) const [member function] + cls.add_method('IsForwarding', + 'bool', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetForwarding(uint32_t i, bool val) [member function] + cls.add_method('SetForwarding', + 'void', + [param('uint32_t', 'i'), param('bool', 'val')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetNetDevice(uint32_t i) [member function] + cls.add_method('GetNetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_virtual=True) + ## ipv6-l3-protocol.h: ns3::Ptr ns3::Ipv6L3Protocol::GetIcmpv6() const [member function] + cls.add_method('GetIcmpv6', + 'ns3::Ptr< ns3::Icmpv6L4Protocol >', + [], + is_const=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::AddAutoconfiguredAddress(uint32_t interface, ns3::Ipv6Address network, ns3::Ipv6Prefix mask, uint8_t flags, uint32_t validTime, uint32_t preferredTime, ns3::Ipv6Address defaultRouter=ns3::Ipv6Address::GetZero( )) [member function] + cls.add_method('AddAutoconfiguredAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'mask'), param('uint8_t', 'flags'), param('uint32_t', 'validTime'), param('uint32_t', 'preferredTime'), param('ns3::Ipv6Address', 'defaultRouter', default_value='ns3::Ipv6Address::GetZero( )')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress(uint32_t interface, ns3::Ipv6Address network, ns3::Ipv6Prefix mask, ns3::Ipv6Address defaultRouter) [member function] + cls.add_method('RemoveAutoconfiguredAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'mask'), param('ns3::Ipv6Address', 'defaultRouter')]) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + visibility='protected', is_virtual=True) + ## ipv6-l3-protocol.h: void ns3::Ipv6L3Protocol::SetIpForward(bool forward) [member function] + cls.add_method('SetIpForward', + 'void', + [param('bool', 'forward')], + visibility='private', is_virtual=True) + ## ipv6-l3-protocol.h: bool ns3::Ipv6L3Protocol::GetIpForward() const [member function] + cls.add_method('GetIpForward', + 'bool', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3Ipv6L4Protocol_methods(root_module, cls): + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::Ipv6L4Protocol() [constructor] + cls.add_constructor([]) + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::Ipv6L4Protocol(ns3::Ipv6L4Protocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6L4Protocol const &', 'arg0')]) + ## ipv6-l4-protocol.h: int ns3::Ipv6L4Protocol::GetProtocolNumber() const [member function] + cls.add_method('GetProtocolNumber', + 'int', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6-l4-protocol.h: static ns3::TypeId ns3::Ipv6L4Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::RxStatus_e ns3::Ipv6L4Protocol::Receive(ns3::Ptr p, ns3::Ipv6Address const & src, ns3::Ipv6Address const & dst, ns3::Ptr incomingInterface) [member function] + cls.add_method('Receive', + 'ns3::Ipv6L4Protocol::RxStatus_e', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Address const &', 'src'), param('ns3::Ipv6Address const &', 'dst'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-l4-protocol.h: void ns3::Ipv6L4Protocol::ReceiveIcmp(ns3::Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv6Address payloadSource, ns3::Ipv6Address payloadDestination, uint8_t const * payload) [member function] + cls.add_method('ReceiveIcmp', + 'void', + [param('ns3::Ipv6Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv6Address', 'payloadSource'), param('ns3::Ipv6Address', 'payloadDestination'), param('uint8_t const *', 'payload')], + is_virtual=True) + return + +def register_Ns3NdiscCache_methods(root_module, cls): + ## ndisc-cache.h: ns3::NdiscCache::NdiscCache() [constructor] + cls.add_constructor([]) + ## ndisc-cache.h: ns3::NdiscCache::Entry * ns3::NdiscCache::Add(ns3::Ipv6Address to) [member function] + cls.add_method('Add', + 'ns3::NdiscCache::Entry *', + [param('ns3::Ipv6Address', 'to')]) + ## ndisc-cache.h: void ns3::NdiscCache::Flush() [member function] + cls.add_method('Flush', + 'void', + []) + ## ndisc-cache.h: ns3::Ptr ns3::NdiscCache::GetDevice() const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [], + is_const=True) + ## ndisc-cache.h: ns3::Ptr ns3::NdiscCache::GetInterface() const [member function] + cls.add_method('GetInterface', + 'ns3::Ptr< ns3::Ipv6Interface >', + [], + is_const=True) + ## ndisc-cache.h: static ns3::TypeId ns3::NdiscCache::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ndisc-cache.h: uint32_t ns3::NdiscCache::GetUnresQlen() [member function] + cls.add_method('GetUnresQlen', + 'uint32_t', + []) + ## ndisc-cache.h: ns3::NdiscCache::Entry * ns3::NdiscCache::Lookup(ns3::Ipv6Address dst) [member function] + cls.add_method('Lookup', + 'ns3::NdiscCache::Entry *', + [param('ns3::Ipv6Address', 'dst')]) + ## ndisc-cache.h: void ns3::NdiscCache::Remove(ns3::NdiscCache::Entry * entry) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::NdiscCache::Entry *', 'entry')]) + ## ndisc-cache.h: void ns3::NdiscCache::SetDevice(ns3::Ptr device, ns3::Ptr interface) [member function] + cls.add_method('SetDevice', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')]) + ## ndisc-cache.h: void ns3::NdiscCache::SetUnresQlen(uint32_t unresQlen) [member function] + cls.add_method('SetUnresQlen', + 'void', + [param('uint32_t', 'unresQlen')]) + ## ndisc-cache.h: ns3::NdiscCache::DEFAULT_UNRES_QLEN [variable] + cls.add_static_attribute('DEFAULT_UNRES_QLEN', 'uint32_t const', is_const=True) + ## ndisc-cache.h: void ns3::NdiscCache::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3NdiscCacheEntry_methods(root_module, cls): + ## ndisc-cache.h: ns3::NdiscCache::Entry::Entry(ns3::NdiscCache::Entry const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NdiscCache::Entry const &', 'arg0')]) + ## ndisc-cache.h: ns3::NdiscCache::Entry::Entry(ns3::NdiscCache * nd) [constructor] + cls.add_constructor([param('ns3::NdiscCache *', 'nd')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::AddWaitingPacket(ns3::Ptr p) [member function] + cls.add_method('AddWaitingPacket', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::ClearWaitingPacket() [member function] + cls.add_method('ClearWaitingPacket', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::FunctionDelayTimeout() [member function] + cls.add_method('FunctionDelayTimeout', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::FunctionProbeTimeout() [member function] + cls.add_method('FunctionProbeTimeout', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::FunctionReachableTimeout() [member function] + cls.add_method('FunctionReachableTimeout', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::FunctionRetransmitTimeout() [member function] + cls.add_method('FunctionRetransmitTimeout', + 'void', + []) + ## ndisc-cache.h: ns3::Time ns3::NdiscCache::Entry::GetLastReachabilityConfirmation() const [member function] + cls.add_method('GetLastReachabilityConfirmation', + 'ns3::Time', + [], + is_const=True) + ## ndisc-cache.h: ns3::Address ns3::NdiscCache::Entry::GetMacAddress() const [member function] + cls.add_method('GetMacAddress', + 'ns3::Address', + [], + is_const=True) + ## ndisc-cache.h: uint8_t ns3::NdiscCache::Entry::GetNSRetransmit() const [member function] + cls.add_method('GetNSRetransmit', + 'uint8_t', + [], + is_const=True) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::IncNSRetransmit() [member function] + cls.add_method('IncNSRetransmit', + 'void', + []) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsDelay() const [member function] + cls.add_method('IsDelay', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsIncomplete() const [member function] + cls.add_method('IsIncomplete', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsProbe() const [member function] + cls.add_method('IsProbe', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsReachable() const [member function] + cls.add_method('IsReachable', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsRouter() const [member function] + cls.add_method('IsRouter', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: bool ns3::NdiscCache::Entry::IsStale() const [member function] + cls.add_method('IsStale', + 'bool', + [], + is_const=True) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkDelay() [member function] + cls.add_method('MarkDelay', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkIncomplete(ns3::Ptr p) [member function] + cls.add_method('MarkIncomplete', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkProbe() [member function] + cls.add_method('MarkProbe', + 'void', + []) + ## ndisc-cache.h: std::list, std::allocator > > ns3::NdiscCache::Entry::MarkReachable(ns3::Address mac) [member function] + cls.add_method('MarkReachable', + 'std::list< ns3::Ptr< ns3::Packet > >', + [param('ns3::Address', 'mac')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkReachable() [member function] + cls.add_method('MarkReachable', + 'void', + []) + ## ndisc-cache.h: std::list, std::allocator > > ns3::NdiscCache::Entry::MarkStale(ns3::Address mac) [member function] + cls.add_method('MarkStale', + 'std::list< ns3::Ptr< ns3::Packet > >', + [param('ns3::Address', 'mac')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::MarkStale() [member function] + cls.add_method('MarkStale', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::ResetNSRetransmit() [member function] + cls.add_method('ResetNSRetransmit', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::SetIpv6Address(ns3::Ipv6Address ipv6Address) [member function] + cls.add_method('SetIpv6Address', + 'void', + [param('ns3::Ipv6Address', 'ipv6Address')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::SetMacAddress(ns3::Address mac) [member function] + cls.add_method('SetMacAddress', + 'void', + [param('ns3::Address', 'mac')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::SetRouter(bool router) [member function] + cls.add_method('SetRouter', + 'void', + [param('bool', 'router')]) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StartDelayTimer() [member function] + cls.add_method('StartDelayTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StartProbeTimer() [member function] + cls.add_method('StartProbeTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StartReachableTimer() [member function] + cls.add_method('StartReachableTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StartRetransmitTimer() [member function] + cls.add_method('StartRetransmitTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StopDelayTimer() [member function] + cls.add_method('StopDelayTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StopProbeTimer() [member function] + cls.add_method('StopProbeTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StopReachableTimer() [member function] + cls.add_method('StopReachableTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::StopRetransmitTimer() [member function] + cls.add_method('StopRetransmitTimer', + 'void', + []) + ## ndisc-cache.h: void ns3::NdiscCache::Entry::UpdateLastReachabilityconfirmation() [member function] + cls.add_method('UpdateLastReachabilityconfirmation', + 'void', + []) + return + +def register_Ns3TcpL4Protocol_methods(root_module, cls): + ## tcp-l4-protocol.h: ns3::TcpL4Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) + ## tcp-l4-protocol.h: static ns3::TypeId ns3::TcpL4Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tcp-l4-protocol.h: ns3::TcpL4Protocol::TcpL4Protocol() [constructor] + cls.add_constructor([]) + ## tcp-l4-protocol.h: void ns3::TcpL4Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## tcp-l4-protocol.h: int ns3::TcpL4Protocol::GetProtocolNumber() const [member function] + cls.add_method('GetProtocolNumber', + 'int', + [], + is_const=True, is_virtual=True) + ## tcp-l4-protocol.h: ns3::Ptr ns3::TcpL4Protocol::CreateSocket() [member function] + cls.add_method('CreateSocket', + 'ns3::Ptr< ns3::Socket >', + []) + ## tcp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate() [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + []) + ## tcp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ipv4Address address) [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + [param('ns3::Ipv4Address', 'address')]) + ## tcp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(uint16_t port) [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + [param('uint16_t', 'port')]) + ## tcp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ipv4Address address, uint16_t port) [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + [param('ns3::Ipv4Address', 'address'), param('uint16_t', 'port')]) + ## tcp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ipv4Address localAddress, uint16_t localPort, ns3::Ipv4Address peerAddress, uint16_t peerPort) [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + [param('ns3::Ipv4Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv4Address', 'peerAddress'), param('uint16_t', 'peerPort')]) + ## tcp-l4-protocol.h: void ns3::TcpL4Protocol::DeAllocate(ns3::Ipv4EndPoint * endPoint) [member function] + cls.add_method('DeAllocate', + 'void', + [param('ns3::Ipv4EndPoint *', 'endPoint')]) + ## tcp-l4-protocol.h: void ns3::TcpL4Protocol::Send(ns3::Ptr packet, ns3::Ipv4Address saddr, ns3::Ipv4Address daddr, uint16_t sport, uint16_t dport) [member function] + cls.add_method('Send', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'saddr'), param('ns3::Ipv4Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport')]) + ## tcp-l4-protocol.h: ns3::Ipv4L4Protocol::RxStatus ns3::TcpL4Protocol::Receive(ns3::Ptr p, ns3::Ipv4Address const & source, ns3::Ipv4Address const & destination, ns3::Ptr incomingInterface) [member function] + cls.add_method('Receive', + 'ns3::Ipv4L4Protocol::RxStatus', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address const &', 'source'), param('ns3::Ipv4Address const &', 'destination'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')], + is_virtual=True) + ## tcp-l4-protocol.h: void ns3::TcpL4Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## tcp-l4-protocol.h: void ns3::TcpL4Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3UdpL4Protocol_methods(root_module, cls): + ## udp-l4-protocol.h: ns3::UdpL4Protocol::UdpL4Protocol(ns3::UdpL4Protocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UdpL4Protocol const &', 'arg0')]) + ## udp-l4-protocol.h: ns3::UdpL4Protocol::UdpL4Protocol() [constructor] + cls.add_constructor([]) + ## udp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate() [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + []) + ## udp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ipv4Address address) [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + [param('ns3::Ipv4Address', 'address')]) + ## udp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(uint16_t port) [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + [param('uint16_t', 'port')]) + ## udp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ipv4Address address, uint16_t port) [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + [param('ns3::Ipv4Address', 'address'), param('uint16_t', 'port')]) + ## udp-l4-protocol.h: ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ipv4Address localAddress, uint16_t localPort, ns3::Ipv4Address peerAddress, uint16_t peerPort) [member function] + cls.add_method('Allocate', + 'ns3::Ipv4EndPoint *', + [param('ns3::Ipv4Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv4Address', 'peerAddress'), param('uint16_t', 'peerPort')]) + ## udp-l4-protocol.h: ns3::Ptr ns3::UdpL4Protocol::CreateSocket() [member function] + cls.add_method('CreateSocket', + 'ns3::Ptr< ns3::Socket >', + []) + ## udp-l4-protocol.h: void ns3::UdpL4Protocol::DeAllocate(ns3::Ipv4EndPoint * endPoint) [member function] + cls.add_method('DeAllocate', + 'void', + [param('ns3::Ipv4EndPoint *', 'endPoint')]) + ## udp-l4-protocol.h: int ns3::UdpL4Protocol::GetProtocolNumber() const [member function] + cls.add_method('GetProtocolNumber', + 'int', + [], + is_const=True, is_virtual=True) + ## udp-l4-protocol.h: static ns3::TypeId ns3::UdpL4Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## udp-l4-protocol.h: ns3::Ipv4L4Protocol::RxStatus ns3::UdpL4Protocol::Receive(ns3::Ptr p, ns3::Ipv4Address const & source, ns3::Ipv4Address const & destination, ns3::Ptr interface) [member function] + cls.add_method('Receive', + 'ns3::Ipv4L4Protocol::RxStatus', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address const &', 'source'), param('ns3::Ipv4Address const &', 'destination'), param('ns3::Ptr< ns3::Ipv4Interface >', 'interface')], + is_virtual=True) + ## udp-l4-protocol.h: void ns3::UdpL4Protocol::ReceiveIcmp(ns3::Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv4Address payloadSource, ns3::Ipv4Address payloadDestination, uint8_t const * payload) [member function] + cls.add_method('ReceiveIcmp', + 'void', + [param('ns3::Ipv4Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv4Address', 'payloadSource'), param('ns3::Ipv4Address', 'payloadDestination'), param('uint8_t const *', 'payload')], + is_virtual=True) + ## udp-l4-protocol.h: void ns3::UdpL4Protocol::Send(ns3::Ptr packet, ns3::Ipv4Address saddr, ns3::Ipv4Address daddr, uint16_t sport, uint16_t dport) [member function] + cls.add_method('Send', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'saddr'), param('ns3::Ipv4Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport')]) + ## udp-l4-protocol.h: void ns3::UdpL4Protocol::Send(ns3::Ptr packet, ns3::Ipv4Address saddr, ns3::Ipv4Address daddr, uint16_t sport, uint16_t dport, ns3::Ptr route) [member function] + cls.add_method('Send', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'saddr'), param('ns3::Ipv4Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) + ## udp-l4-protocol.h: void ns3::UdpL4Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## udp-l4-protocol.h: ns3::UdpL4Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) + ## udp-l4-protocol.h: void ns3::UdpL4Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## udp-l4-protocol.h: void ns3::UdpL4Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3Icmpv4L4Protocol_methods(root_module, cls): + ## icmpv4-l4-protocol.h: ns3::Icmpv4L4Protocol::Icmpv4L4Protocol(ns3::Icmpv4L4Protocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv4L4Protocol const &', 'arg0')]) + ## icmpv4-l4-protocol.h: ns3::Icmpv4L4Protocol::Icmpv4L4Protocol() [constructor] + cls.add_constructor([]) + ## icmpv4-l4-protocol.h: int ns3::Icmpv4L4Protocol::GetProtocolNumber() const [member function] + cls.add_method('GetProtocolNumber', + 'int', + [], + is_const=True, is_virtual=True) + ## icmpv4-l4-protocol.h: static uint16_t ns3::Icmpv4L4Protocol::GetStaticProtocolNumber() [member function] + cls.add_method('GetStaticProtocolNumber', + 'uint16_t', + [], + is_static=True) + ## icmpv4-l4-protocol.h: static ns3::TypeId ns3::Icmpv4L4Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv4-l4-protocol.h: ns3::Ipv4L4Protocol::RxStatus ns3::Icmpv4L4Protocol::Receive(ns3::Ptr p, ns3::Ipv4Address const & source, ns3::Ipv4Address const & destination, ns3::Ptr incomingInterface) [member function] + cls.add_method('Receive', + 'ns3::Ipv4L4Protocol::RxStatus', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address const &', 'source'), param('ns3::Ipv4Address const &', 'destination'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')], + is_virtual=True) + ## icmpv4-l4-protocol.h: void ns3::Icmpv4L4Protocol::SendDestUnreachFragNeeded(ns3::Ipv4Header header, ns3::Ptr orgData, uint16_t nextHopMtu) [member function] + cls.add_method('SendDestUnreachFragNeeded', + 'void', + [param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData'), param('uint16_t', 'nextHopMtu')]) + ## icmpv4-l4-protocol.h: void ns3::Icmpv4L4Protocol::SendDestUnreachPort(ns3::Ipv4Header header, ns3::Ptr orgData) [member function] + cls.add_method('SendDestUnreachPort', + 'void', + [param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData')]) + ## icmpv4-l4-protocol.h: void ns3::Icmpv4L4Protocol::SendTimeExceededTtl(ns3::Ipv4Header header, ns3::Ptr orgData) [member function] + cls.add_method('SendTimeExceededTtl', + 'void', + [param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData')]) + ## icmpv4-l4-protocol.h: void ns3::Icmpv4L4Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## icmpv4-l4-protocol.h: ns3::Icmpv4L4Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) + ## icmpv4-l4-protocol.h: void ns3::Icmpv4L4Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + visibility='protected', is_virtual=True) + ## icmpv4-l4-protocol.h: void ns3::Icmpv4L4Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3Icmpv6L4Protocol_methods(root_module, cls): + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::Icmpv6L4Protocol(ns3::Icmpv6L4Protocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Icmpv6L4Protocol const &', 'arg0')]) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::Icmpv6L4Protocol() [constructor] + cls.add_constructor([]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::CreateCache(ns3::Ptr device, ns3::Ptr interface) [member function] + cls.add_method('CreateCache', + 'ns3::Ptr< ns3::NdiscCache >', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::DoDAD(ns3::Ipv6Address target, ns3::Ptr interface) [member function] + cls.add_method('DoDAD', + 'void', + [param('ns3::Ipv6Address', 'target'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::DoDad(ns3::Ipv6Address addr, ns3::Ptr interface) [member function] + cls.add_method('DoDad', + 'void', + [param('ns3::Ipv6Address', 'addr'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::ForgeEchoRequest(ns3::Ipv6Address src, ns3::Ipv6Address dst, uint16_t id, uint16_t seq, ns3::Ptr data) [member function] + cls.add_method('ForgeEchoRequest', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('uint16_t', 'id'), param('uint16_t', 'seq'), param('ns3::Ptr< ns3::Packet >', 'data')]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::ForgeNA(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Address * hardwareAddress, uint8_t flags) [member function] + cls.add_method('ForgeNA', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Address *', 'hardwareAddress'), param('uint8_t', 'flags')]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::ForgeNS(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Ipv6Address target, ns3::Address hardwareAddress) [member function] + cls.add_method('ForgeNS', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Address', 'target'), param('ns3::Address', 'hardwareAddress')]) + ## icmpv6-l4-protocol.h: ns3::Ptr ns3::Icmpv6L4Protocol::ForgeRS(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Address hardwareAddress) [member function] + cls.add_method('ForgeRS', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Address', 'hardwareAddress')]) + ## icmpv6-l4-protocol.h: static void ns3::Icmpv6L4Protocol::FunctionDadTimeout(ns3::Ptr icmpv6, ns3::Ipv6Interface * interface, ns3::Ipv6Address addr) [member function] + cls.add_method('FunctionDadTimeout', + 'void', + [param('ns3::Ptr< ns3::Icmpv6L4Protocol >', 'icmpv6'), param('ns3::Ipv6Interface *', 'interface'), param('ns3::Ipv6Address', 'addr')], + is_static=True) + ## icmpv6-l4-protocol.h: int ns3::Icmpv6L4Protocol::GetProtocolNumber() const [member function] + cls.add_method('GetProtocolNumber', + 'int', + [], + is_const=True, is_virtual=True) + ## icmpv6-l4-protocol.h: static uint16_t ns3::Icmpv6L4Protocol::GetStaticProtocolNumber() [member function] + cls.add_method('GetStaticProtocolNumber', + 'uint16_t', + [], + is_static=True) + ## icmpv6-l4-protocol.h: static ns3::TypeId ns3::Icmpv6L4Protocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## icmpv6-l4-protocol.h: int ns3::Icmpv6L4Protocol::GetVersion() const [member function] + cls.add_method('GetVersion', + 'int', + [], + is_const=True, is_virtual=True) + ## icmpv6-l4-protocol.h: bool ns3::Icmpv6L4Protocol::IsAlwaysDad() const [member function] + cls.add_method('IsAlwaysDad', + 'bool', + [], + is_const=True) + ## icmpv6-l4-protocol.h: bool ns3::Icmpv6L4Protocol::Lookup(ns3::Ipv6Address dst, ns3::Ptr device, ns3::Ptr cache, ns3::Address * hardwareDestination) [member function] + cls.add_method('Lookup', + 'bool', + [param('ns3::Ipv6Address', 'dst'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::NdiscCache >', 'cache'), param('ns3::Address *', 'hardwareDestination')]) + ## icmpv6-l4-protocol.h: bool ns3::Icmpv6L4Protocol::Lookup(ns3::Ptr p, ns3::Ipv6Address dst, ns3::Ptr device, ns3::Ptr cache, ns3::Address * hardwareDestination) [member function] + cls.add_method('Lookup', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Address', 'dst'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::NdiscCache >', 'cache'), param('ns3::Address *', 'hardwareDestination')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::NotifyNewAggregate() [member function] + cls.add_method('NotifyNewAggregate', + 'void', + [], + is_virtual=True) + ## icmpv6-l4-protocol.h: ns3::Ipv6L4Protocol::RxStatus_e ns3::Icmpv6L4Protocol::Receive(ns3::Ptr p, ns3::Ipv6Address const & src, ns3::Ipv6Address const & dst, ns3::Ptr interface) [member function] + cls.add_method('Receive', + 'ns3::Ipv6L4Protocol::RxStatus_e', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Address const &', 'src'), param('ns3::Ipv6Address const &', 'dst'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')], + is_virtual=True) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendEchoReply(ns3::Ipv6Address src, ns3::Ipv6Address dst, uint16_t id, uint16_t seq, ns3::Ptr data) [member function] + cls.add_method('SendEchoReply', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('uint16_t', 'id'), param('uint16_t', 'seq'), param('ns3::Ptr< ns3::Packet >', 'data')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendErrorDestinationUnreachable(ns3::Ptr malformedPacket, ns3::Ipv6Address dst, uint8_t code) [member function] + cls.add_method('SendErrorDestinationUnreachable', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'malformedPacket'), param('ns3::Ipv6Address', 'dst'), param('uint8_t', 'code')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendErrorParameterError(ns3::Ptr malformedPacket, ns3::Ipv6Address dst, uint8_t code, uint32_t ptr) [member function] + cls.add_method('SendErrorParameterError', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'malformedPacket'), param('ns3::Ipv6Address', 'dst'), param('uint8_t', 'code'), param('uint32_t', 'ptr')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendErrorTimeExceeded(ns3::Ptr malformedPacket, ns3::Ipv6Address dst, uint8_t code) [member function] + cls.add_method('SendErrorTimeExceeded', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'malformedPacket'), param('ns3::Ipv6Address', 'dst'), param('uint8_t', 'code')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendErrorTooBig(ns3::Ptr malformedPacket, ns3::Ipv6Address dst, uint32_t mtu) [member function] + cls.add_method('SendErrorTooBig', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'malformedPacket'), param('ns3::Ipv6Address', 'dst'), param('uint32_t', 'mtu')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendMessage(ns3::Ptr packet, ns3::Ipv6Address src, ns3::Ipv6Address dst, uint8_t ttl) [member function] + cls.add_method('SendMessage', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('uint8_t', 'ttl')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendMessage(ns3::Ptr packet, ns3::Ipv6Address dst, ns3::Icmpv6Header & icmpv6Hdr, uint8_t ttl) [member function] + cls.add_method('SendMessage', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'dst'), param('ns3::Icmpv6Header &', 'icmpv6Hdr'), param('uint8_t', 'ttl')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendNA(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Address * hardwareAddress, uint8_t flags) [member function] + cls.add_method('SendNA', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Address *', 'hardwareAddress'), param('uint8_t', 'flags')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendNS(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Ipv6Address target, ns3::Address hardwareAddress) [member function] + cls.add_method('SendNS', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Address', 'target'), param('ns3::Address', 'hardwareAddress')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendRS(ns3::Ipv6Address src, ns3::Ipv6Address dst, ns3::Address hardwareAddress) [member function] + cls.add_method('SendRS', + 'void', + [param('ns3::Ipv6Address', 'src'), param('ns3::Ipv6Address', 'dst'), param('ns3::Address', 'hardwareAddress')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SendRedirection(ns3::Ptr redirectedPacket, ns3::Ipv6Address dst, ns3::Ipv6Address redirTarget, ns3::Ipv6Address redirDestination, ns3::Address redirHardwareTarget) [member function] + cls.add_method('SendRedirection', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'redirectedPacket'), param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Address', 'redirTarget'), param('ns3::Ipv6Address', 'redirDestination'), param('ns3::Address', 'redirHardwareTarget')]) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::DELAY_FIRST_PROBE_TIME [variable] + cls.add_static_attribute('DELAY_FIRST_PROBE_TIME', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_ANYCAST_DELAY_TIME [variable] + cls.add_static_attribute('MAX_ANYCAST_DELAY_TIME', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_FINAL_RTR_ADVERTISEMENTS [variable] + cls.add_static_attribute('MAX_FINAL_RTR_ADVERTISEMENTS', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_INITIAL_RTR_ADVERTISEMENTS [variable] + cls.add_static_attribute('MAX_INITIAL_RTR_ADVERTISEMENTS', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_INITIAL_RTR_ADVERT_INTERVAL [variable] + cls.add_static_attribute('MAX_INITIAL_RTR_ADVERT_INTERVAL', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_MULTICAST_SOLICIT [variable] + cls.add_static_attribute('MAX_MULTICAST_SOLICIT', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_NEIGHBOR_ADVERTISEMENT [variable] + cls.add_static_attribute('MAX_NEIGHBOR_ADVERTISEMENT', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_RANDOM_FACTOR [variable] + cls.add_static_attribute('MAX_RANDOM_FACTOR', 'double const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_RA_DELAY_TIME [variable] + cls.add_static_attribute('MAX_RA_DELAY_TIME', 'uint32_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_RTR_SOLICITATIONS [variable] + cls.add_static_attribute('MAX_RTR_SOLICITATIONS', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_RTR_SOLICITATION_DELAY [variable] + cls.add_static_attribute('MAX_RTR_SOLICITATION_DELAY', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MAX_UNICAST_SOLICIT [variable] + cls.add_static_attribute('MAX_UNICAST_SOLICIT', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MIN_DELAY_BETWEEN_RAS [variable] + cls.add_static_attribute('MIN_DELAY_BETWEEN_RAS', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::MIN_RANDOM_FACTOR [variable] + cls.add_static_attribute('MIN_RANDOM_FACTOR', 'double const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::PROT_NUMBER [variable] + cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::REACHABLE_TIME [variable] + cls.add_static_attribute('REACHABLE_TIME', 'uint32_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::RETRANS_TIMER [variable] + cls.add_static_attribute('RETRANS_TIMER', 'uint32_t const', is_const=True) + ## icmpv6-l4-protocol.h: ns3::Icmpv6L4Protocol::RTR_SOLICITATION_INTERVAL [variable] + cls.add_static_attribute('RTR_SOLICITATION_INTERVAL', 'uint8_t const', is_const=True) + ## icmpv6-l4-protocol.h: void ns3::Icmpv6L4Protocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_list_routing.py b/bindings/python/apidefs/gcc-LP64/ns3_module_list_routing.py new file mode 100644 index 000000000..36415514e --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_list_routing.py @@ -0,0 +1,261 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## ipv4-list-routing.h: ns3::Ipv4ListRouting [class] + module.add_class('Ipv4ListRouting', parent=root_module['ns3::Ipv4RoutingProtocol']) + ## ipv6-list-routing.h: ns3::Ipv6ListRouting [class] + module.add_class('Ipv6ListRouting', parent=root_module['ns3::Ipv6RoutingProtocol']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Ipv4ListRouting_methods(root_module, root_module['ns3::Ipv4ListRouting']) + register_Ns3Ipv6ListRouting_methods(root_module, root_module['ns3::Ipv6ListRouting']) + return + +def register_Ns3Ipv4ListRouting_methods(root_module, cls): + ## ipv4-list-routing.h: ns3::Ipv4ListRouting::Ipv4ListRouting(ns3::Ipv4ListRouting const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4ListRouting const &', 'arg0')]) + ## ipv4-list-routing.h: ns3::Ipv4ListRouting::Ipv4ListRouting() [constructor] + cls.add_constructor([]) + ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::AddRoutingProtocol(ns3::Ptr routingProtocol, int16_t priority) [member function] + cls.add_method('AddRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol'), param('int16_t', 'priority')], + is_virtual=True) + ## ipv4-list-routing.h: uint32_t ns3::Ipv4ListRouting::GetNRoutingProtocols() const [member function] + cls.add_method('GetNRoutingProtocols', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ipv4-list-routing.h: ns3::Ptr ns3::Ipv4ListRouting::GetRoutingProtocol(uint32_t index, int16_t & priority) const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [param('uint32_t', 'index'), param('int16_t &', 'priority')], + is_const=True, is_virtual=True) + ## ipv4-list-routing.h: static ns3::TypeId ns3::Ipv4ListRouting::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_virtual=True) + ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_virtual=True) + ## ipv4-list-routing.h: bool ns3::Ipv4ListRouting::RouteInput(ns3::Ptr p, ns3::Ipv4Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + is_virtual=True) + ## ipv4-list-routing.h: ns3::Ptr ns3::Ipv4ListRouting::RouteOutput(ns3::Ptr p, ns3::Ipv4Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv4Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + is_virtual=True) + ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::SetIpv4(ns3::Ptr ipv4) [member function] + cls.add_method('SetIpv4', + 'void', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], + is_virtual=True) + ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3Ipv6ListRouting_methods(root_module, cls): + ## ipv6-list-routing.h: ns3::Ipv6ListRouting::Ipv6ListRouting(ns3::Ipv6ListRouting const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6ListRouting const &', 'arg0')]) + ## ipv6-list-routing.h: ns3::Ipv6ListRouting::Ipv6ListRouting() [constructor] + cls.add_constructor([]) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::AddRoutingProtocol(ns3::Ptr routingProtocol, int16_t priority) [member function] + cls.add_method('AddRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::Ipv6RoutingProtocol >', 'routingProtocol'), param('int16_t', 'priority')], + is_virtual=True) + ## ipv6-list-routing.h: uint32_t ns3::Ipv6ListRouting::GetNRoutingProtocols() const [member function] + cls.add_method('GetNRoutingProtocols', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ipv6-list-routing.h: ns3::Ptr ns3::Ipv6ListRouting::GetRoutingProtocol(uint32_t index, int16_t & priority) const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::Ipv6RoutingProtocol >', + [param('uint32_t', 'index'), param('int16_t &', 'priority')], + is_const=True, is_virtual=True) + ## ipv6-list-routing.h: static ns3::TypeId ns3::Ipv6ListRouting::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_virtual=True) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::NotifyAddRoute(ns3::Ipv6Address dst, ns3::Ipv6Prefix mask, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address::GetZero( )) [member function] + cls.add_method('NotifyAddRoute', + 'void', + [param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Prefix', 'mask'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address::GetZero( )')], + is_virtual=True) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_virtual=True) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::NotifyRemoveRoute(ns3::Ipv6Address dst, ns3::Ipv6Prefix mask, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address::GetZero( )) [member function] + cls.add_method('NotifyRemoveRoute', + 'void', + [param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Prefix', 'mask'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address::GetZero( )')], + is_virtual=True) + ## ipv6-list-routing.h: bool ns3::Ipv6ListRouting::RouteInput(ns3::Ptr p, ns3::Ipv6Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv6Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv6Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv6Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv6Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv6Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv6MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + is_virtual=True) + ## ipv6-list-routing.h: ns3::Ptr ns3::Ipv6ListRouting::RouteOutput(ns3::Ptr p, ns3::Ipv6Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv6Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + is_virtual=True) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::SetIpv6(ns3::Ptr ipv6) [member function] + cls.add_method('SetIpv6', + 'void', + [param('ns3::Ptr< ns3::Ipv6 >', 'ipv6')], + is_virtual=True) + ## ipv6-list-routing.h: void ns3::Ipv6ListRouting::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_mesh.py b/bindings/python/apidefs/gcc-LP64/ns3_module_mesh.py new file mode 100644 index 000000000..e4e3ce76d --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_mesh.py @@ -0,0 +1,727 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## wifi-information-element-vector.h: ns3::WifiElementId [enumeration] + module.add_enum('WifiElementId', ['IE11S_MESH_CONFIGURATION', 'IE11S_MESH_ID', 'IE11S_LINK_METRIC_REPORT', 'IE11S_CONGESTION_NOTIFICATION', 'IE11S_PEERING_MANAGEMENT', 'IE11S_SUPP_MBSS_REG_CLASSES_CHANNELS', 'IE11S_MESH_CHANNEL_SWITCH_ANNOUNCEMENT', 'IE11S_MESH_TIM', 'IE11S_AWAKE_WINDOW', 'IE11S_BEACON_TIMING', 'IE11S_MCCAOP_SETUP_REQUEST', 'IE11S_MCCAOP_SETUP_REPLY', 'IE11S_MCCAOP_ADVERTISEMENT', 'IE11S_MCCAOP_RESERVATION_TEARDOWN', 'IE11S_PORTAL_ANNOUNCEMENT', 'IE11S_RANN', 'IE11S_PREQ', 'IE11S_PREP', 'IE11S_PERR', 'IE11S_PROXY_UPDATE', 'IE11S_PROXY_UPDATE_CONFIRMATION', 'IE11S_ABBREVIATED_HANDSHAKE', 'IE11S_MESH_PEERING_PROTOCOL_VERSION']) + ## mesh-wifi-beacon.h: ns3::MeshWifiBeacon [class] + module.add_class('MeshWifiBeacon') + ## wifi-information-element-vector.h: ns3::WifiInformationElement [class] + module.add_class('WifiInformationElement', parent=root_module['ns3::RefCountBase']) + ## mesh-wifi-interface-mac-plugin.h: ns3::MeshWifiInterfaceMacPlugin [class] + module.add_class('MeshWifiInterfaceMacPlugin', parent=root_module['ns3::RefCountBase']) + ## wifi-information-element-vector.h: ns3::WifiInformationElementVector [class] + module.add_class('WifiInformationElementVector', parent=root_module['ns3::Header']) + ## mesh-l2-routing-protocol.h: ns3::MeshL2RoutingProtocol [class] + module.add_class('MeshL2RoutingProtocol', parent=root_module['ns3::Object']) + ## mesh-wifi-interface-mac.h: ns3::MeshWifiInterfaceMac [class] + module.add_class('MeshWifiInterfaceMac', parent=root_module['ns3::WifiMac']) + ## mesh-point-device.h: ns3::MeshPointDevice [class] + module.add_class('MeshPointDevice', parent=root_module['ns3::NetDevice']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3MeshWifiBeacon_methods(root_module, root_module['ns3::MeshWifiBeacon']) + register_Ns3WifiInformationElement_methods(root_module, root_module['ns3::WifiInformationElement']) + register_Ns3MeshWifiInterfaceMacPlugin_methods(root_module, root_module['ns3::MeshWifiInterfaceMacPlugin']) + register_Ns3WifiInformationElementVector_methods(root_module, root_module['ns3::WifiInformationElementVector']) + register_Ns3MeshL2RoutingProtocol_methods(root_module, root_module['ns3::MeshL2RoutingProtocol']) + register_Ns3MeshWifiInterfaceMac_methods(root_module, root_module['ns3::MeshWifiInterfaceMac']) + register_Ns3MeshPointDevice_methods(root_module, root_module['ns3::MeshPointDevice']) + return + +def register_Ns3MeshWifiBeacon_methods(root_module, cls): + ## mesh-wifi-beacon.h: ns3::MeshWifiBeacon::MeshWifiBeacon(ns3::MeshWifiBeacon const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshWifiBeacon const &', 'arg0')]) + ## mesh-wifi-beacon.h: ns3::MeshWifiBeacon::MeshWifiBeacon(ns3::Ssid ssid, ns3::SupportedRates rates, uint64_t us) [constructor] + cls.add_constructor([param('ns3::Ssid', 'ssid'), param('ns3::SupportedRates', 'rates'), param('uint64_t', 'us')]) + ## mesh-wifi-beacon.h: void ns3::MeshWifiBeacon::AddInformationElement(ns3::Ptr ie) [member function] + cls.add_method('AddInformationElement', + 'void', + [param('ns3::Ptr< ns3::WifiInformationElement >', 'ie')]) + ## mesh-wifi-beacon.h: ns3::MgtBeaconHeader ns3::MeshWifiBeacon::BeaconHeader() const [member function] + cls.add_method('BeaconHeader', + 'ns3::MgtBeaconHeader', + [], + is_const=True) + ## mesh-wifi-beacon.h: ns3::WifiMacHeader ns3::MeshWifiBeacon::CreateHeader(ns3::Mac48Address address, ns3::Mac48Address mpAddress) [member function] + cls.add_method('CreateHeader', + 'ns3::WifiMacHeader', + [param('ns3::Mac48Address', 'address'), param('ns3::Mac48Address', 'mpAddress')]) + ## mesh-wifi-beacon.h: ns3::Ptr ns3::MeshWifiBeacon::CreatePacket() [member function] + cls.add_method('CreatePacket', + 'ns3::Ptr< ns3::Packet >', + []) + return + +def register_Ns3WifiInformationElement_methods(root_module, cls): + cls.add_binary_comparison_operator('<') + cls.add_binary_comparison_operator('==') + ## wifi-information-element-vector.h: ns3::WifiInformationElement::WifiInformationElement() [constructor] + cls.add_constructor([]) + ## wifi-information-element-vector.h: ns3::WifiInformationElement::WifiInformationElement(ns3::WifiInformationElement const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiInformationElement const &', 'arg0')]) + ## wifi-information-element-vector.h: uint8_t ns3::WifiInformationElement::DeserializeInformation(ns3::Buffer::Iterator start, uint8_t length) [member function] + cls.add_method('DeserializeInformation', + 'uint8_t', + [param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')], + is_pure_virtual=True, is_virtual=True) + ## wifi-information-element-vector.h: ns3::WifiElementId ns3::WifiInformationElement::ElementId() const [member function] + cls.add_method('ElementId', + 'ns3::WifiElementId', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: uint8_t ns3::WifiInformationElement::GetInformationSize() const [member function] + cls.add_method('GetInformationSize', + 'uint8_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElement::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElement::SerializeInformation(ns3::Buffer::Iterator start) const [member function] + cls.add_method('SerializeInformation', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3MeshWifiInterfaceMacPlugin_methods(root_module, cls): + ## mesh-wifi-interface-mac-plugin.h: ns3::MeshWifiInterfaceMacPlugin::MeshWifiInterfaceMacPlugin() [constructor] + cls.add_constructor([]) + ## mesh-wifi-interface-mac-plugin.h: ns3::MeshWifiInterfaceMacPlugin::MeshWifiInterfaceMacPlugin(ns3::MeshWifiInterfaceMacPlugin const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshWifiInterfaceMacPlugin const &', 'arg0')]) + ## mesh-wifi-interface-mac-plugin.h: bool ns3::MeshWifiInterfaceMacPlugin::Receive(ns3::Ptr packet, ns3::WifiMacHeader const & header) [member function] + cls.add_method('Receive', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::WifiMacHeader const &', 'header')], + is_pure_virtual=True, is_virtual=True) + ## mesh-wifi-interface-mac-plugin.h: void ns3::MeshWifiInterfaceMacPlugin::SetParent(ns3::Ptr parent) [member function] + cls.add_method('SetParent', + 'void', + [param('ns3::Ptr< ns3::MeshWifiInterfaceMac >', 'parent')], + is_pure_virtual=True, is_virtual=True) + ## mesh-wifi-interface-mac-plugin.h: void ns3::MeshWifiInterfaceMacPlugin::UpdateBeacon(ns3::MeshWifiBeacon & beacon) const [member function] + cls.add_method('UpdateBeacon', + 'void', + [param('ns3::MeshWifiBeacon &', 'beacon')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac-plugin.h: bool ns3::MeshWifiInterfaceMacPlugin::UpdateOutcomingFrame(ns3::Ptr packet, ns3::WifiMacHeader & header, ns3::Mac48Address from, ns3::Mac48Address to) [member function] + cls.add_method('UpdateOutcomingFrame', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::WifiMacHeader &', 'header'), param('ns3::Mac48Address', 'from'), param('ns3::Mac48Address', 'to')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3WifiInformationElementVector_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + ## wifi-information-element-vector.h: ns3::WifiInformationElementVector::WifiInformationElementVector(ns3::WifiInformationElementVector const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiInformationElementVector const &', 'arg0')]) + ## wifi-information-element-vector.h: ns3::WifiInformationElementVector::WifiInformationElementVector() [constructor] + cls.add_constructor([]) + ## wifi-information-element-vector.h: bool ns3::WifiInformationElementVector::AddInformationElement(ns3::Ptr element) [member function] + cls.add_method('AddInformationElement', + 'bool', + [param('ns3::Ptr< ns3::WifiInformationElement >', 'element')]) + ## wifi-information-element-vector.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::WifiInformationElementVector::Begin() [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::WifiInformationElement >, std::vector< ns3::Ptr< ns3::WifiInformationElement > > >', + []) + ## wifi-information-element-vector.h: uint32_t ns3::WifiInformationElementVector::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## wifi-information-element-vector.h: uint32_t ns3::WifiInformationElementVector::DeserializeSingleIe(ns3::Buffer::Iterator start) [member function] + cls.add_method('DeserializeSingleIe', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## wifi-information-element-vector.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::WifiInformationElementVector::End() [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::WifiInformationElement >, std::vector< ns3::Ptr< ns3::WifiInformationElement > > >', + []) + ## wifi-information-element-vector.h: ns3::Ptr ns3::WifiInformationElementVector::FindFirst(ns3::WifiElementId id) const [member function] + cls.add_method('FindFirst', + 'ns3::Ptr< ns3::WifiInformationElement >', + [param('ns3::WifiElementId', 'id')], + is_const=True) + ## wifi-information-element-vector.h: ns3::TypeId ns3::WifiInformationElementVector::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: uint32_t ns3::WifiInformationElementVector::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: static ns3::TypeId ns3::WifiInformationElementVector::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElementVector::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElementVector::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## wifi-information-element-vector.h: void ns3::WifiInformationElementVector::SetMaxSize(uint16_t size) [member function] + cls.add_method('SetMaxSize', + 'void', + [param('uint16_t', 'size')]) + return + +def register_Ns3MeshL2RoutingProtocol_methods(root_module, cls): + ## mesh-l2-routing-protocol.h: ns3::MeshL2RoutingProtocol::MeshL2RoutingProtocol() [constructor] + cls.add_constructor([]) + ## mesh-l2-routing-protocol.h: ns3::MeshL2RoutingProtocol::MeshL2RoutingProtocol(ns3::MeshL2RoutingProtocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshL2RoutingProtocol const &', 'arg0')]) + ## mesh-l2-routing-protocol.h: ns3::Ptr ns3::MeshL2RoutingProtocol::GetMeshPoint() const [member function] + cls.add_method('GetMeshPoint', + 'ns3::Ptr< ns3::MeshPointDevice >', + [], + is_const=True) + ## mesh-l2-routing-protocol.h: static ns3::TypeId ns3::MeshL2RoutingProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mesh-l2-routing-protocol.h: bool ns3::MeshL2RoutingProtocol::RemoveRoutingStuff(uint32_t fromIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t & protocolType) [member function] + cls.add_method('RemoveRoutingStuff', + 'bool', + [param('uint32_t', 'fromIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t &', 'protocolType')], + is_pure_virtual=True, is_virtual=True) + ## mesh-l2-routing-protocol.h: bool ns3::MeshL2RoutingProtocol::RequestRoute(uint32_t sourceIface, ns3::Mac48Address const source, ns3::Mac48Address const destination, ns3::Ptr packet, uint16_t protocolType, ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty> routeReply) [member function] + cls.add_method('RequestRoute', + 'bool', + [param('uint32_t', 'sourceIface'), param('ns3::Mac48Address const', 'source'), param('ns3::Mac48Address const', 'destination'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocolType'), param('ns3::Callback< void, bool, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, unsigned short, unsigned int, ns3::empty, ns3::empty, ns3::empty >', 'routeReply')], + is_pure_virtual=True, is_virtual=True) + ## mesh-l2-routing-protocol.h: void ns3::MeshL2RoutingProtocol::SetMeshPoint(ns3::Ptr mp) [member function] + cls.add_method('SetMeshPoint', + 'void', + [param('ns3::Ptr< ns3::MeshPointDevice >', 'mp')]) + return + +def register_Ns3MeshWifiInterfaceMac_methods(root_module, cls): + ## mesh-wifi-interface-mac.h: ns3::MeshWifiInterfaceMac::MeshWifiInterfaceMac(ns3::MeshWifiInterfaceMac const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshWifiInterfaceMac const &', 'arg0')]) + ## mesh-wifi-interface-mac.h: ns3::MeshWifiInterfaceMac::MeshWifiInterfaceMac() [constructor] + cls.add_constructor([]) + ## mesh-wifi-interface-mac.h: bool ns3::MeshWifiInterfaceMac::CheckSupportedRates(ns3::SupportedRates rates) const [member function] + cls.add_method('CheckSupportedRates', + 'bool', + [param('ns3::SupportedRates', 'rates')], + is_const=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Mac48Address ns3::MeshWifiInterfaceMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetBeaconInterval() const [member function] + cls.add_method('GetBeaconInterval', + 'ns3::Time', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: ns3::Mac48Address ns3::MeshWifiInterfaceMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: uint16_t ns3::MeshWifiInterfaceMac::GetFrequencyChannel() const [member function] + cls.add_method('GetFrequencyChannel', + 'uint16_t', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: uint32_t ns3::MeshWifiInterfaceMac::GetLinkMetric(ns3::Mac48Address peerAddress) [member function] + cls.add_method('GetLinkMetric', + 'uint32_t', + [param('ns3::Mac48Address', 'peerAddress')]) + ## mesh-wifi-interface-mac.h: ns3::Mac48Address ns3::MeshWifiInterfaceMac::GetMeshPointAddress() const [member function] + cls.add_method('GetMeshPointAddress', + 'ns3::Mac48Address', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Ssid ns3::MeshWifiInterfaceMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: ns3::Ptr ns3::MeshWifiInterfaceMac::GetStationManager() [member function] + cls.add_method('GetStationManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + []) + ## mesh-wifi-interface-mac.h: ns3::SupportedRates ns3::MeshWifiInterfaceMac::GetSupportedRates() const [member function] + cls.add_method('GetSupportedRates', + 'ns3::SupportedRates', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: ns3::Time ns3::MeshWifiInterfaceMac::GetTbtt() const [member function] + cls.add_method('GetTbtt', + 'ns3::Time', + [], + is_const=True) + ## mesh-wifi-interface-mac.h: static ns3::TypeId ns3::MeshWifiInterfaceMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::InstallPlugin(ns3::Ptr plugin) [member function] + cls.add_method('InstallPlugin', + 'void', + [param('ns3::Ptr< ns3::MeshWifiInterfaceMacPlugin >', 'plugin')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::Report(std::ostream & arg0) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'arg0')], + is_const=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SendManagementFrame(ns3::Ptr frame, ns3::WifiMacHeader const & hdr) [member function] + cls.add_method('SendManagementFrame', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'frame'), param('ns3::WifiMacHeader const &', 'hdr')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetBeaconGeneration(bool enable) [member function] + cls.add_method('SetBeaconGeneration', + 'void', + [param('bool', 'enable')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetBeaconInterval(ns3::Time interval) [member function] + cls.add_method('SetBeaconInterval', + 'void', + [param('ns3::Time', 'interval')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetLinkMetricCallback(ns3::Callback, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetLinkMetricCallback', + 'void', + [param('ns3::Callback< unsigned int, ns3::Mac48Address, ns3::Ptr< ns3::MeshWifiInterfaceMac >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetMeshPointAddress(ns3::Mac48Address arg0) [member function] + cls.add_method('SetMeshPointAddress', + 'void', + [param('ns3::Mac48Address', 'arg0')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetQueue(ns3::AccessClass ac) [member function] + cls.add_method('SetQueue', + 'void', + [param('ns3::AccessClass', 'ac')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetRandomStartDelay(ns3::Time interval) [member function] + cls.add_method('SetRandomStartDelay', + 'void', + [param('ns3::Time', 'interval')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::ShiftTbtt(ns3::Time shift) [member function] + cls.add_method('ShiftTbtt', + 'void', + [param('ns3::Time', 'shift')]) + ## mesh-wifi-interface-mac.h: bool ns3::MeshWifiInterfaceMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::SwitchFrequencyChannel(uint16_t new_id) [member function] + cls.add_method('SwitchFrequencyChannel', + 'void', + [param('uint16_t', 'new_id')]) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## mesh-wifi-interface-mac.h: void ns3::MeshWifiInterfaceMac::ForwardUp(ns3::Ptr packet, ns3::Mac48Address src, ns3::Mac48Address dst) [member function] + cls.add_method('ForwardUp', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], + visibility='private', is_virtual=True) + return + +def register_Ns3MeshPointDevice_methods(root_module, cls): + ## mesh-point-device.h: ns3::MeshPointDevice::MeshPointDevice(ns3::MeshPointDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MeshPointDevice const &', 'arg0')]) + ## mesh-point-device.h: ns3::MeshPointDevice::MeshPointDevice() [constructor] + cls.add_constructor([]) + ## mesh-point-device.h: void ns3::MeshPointDevice::AddInterface(ns3::Ptr port) [member function] + cls.add_method('AddInterface', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'port')]) + ## mesh-point-device.h: void ns3::MeshPointDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## mesh-point-device.h: ns3::Address ns3::MeshPointDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Address ns3::MeshPointDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Ptr ns3::MeshPointDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: uint32_t ns3::MeshPointDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Ptr ns3::MeshPointDevice::GetInterface(uint32_t id) const [member function] + cls.add_method('GetInterface', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'id')], + is_const=True) + ## mesh-point-device.h: std::vector, std::allocator > > ns3::MeshPointDevice::GetInterfaces() const [member function] + cls.add_method('GetInterfaces', + 'std::vector< ns3::Ptr< ns3::NetDevice > >', + [], + is_const=True) + ## mesh-point-device.h: uint16_t ns3::MeshPointDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Address ns3::MeshPointDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Address ns3::MeshPointDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## mesh-point-device.h: uint32_t ns3::MeshPointDevice::GetNInterfaces() const [member function] + cls.add_method('GetNInterfaces', + 'uint32_t', + [], + is_const=True) + ## mesh-point-device.h: ns3::Ptr ns3::MeshPointDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: ns3::Ptr ns3::MeshPointDevice::GetRoutingProtocol() const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::MeshL2RoutingProtocol >', + [], + is_const=True) + ## mesh-point-device.h: static ns3::TypeId ns3::MeshPointDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::Report(std::ostream & os) const [member function] + cls.add_method('Report', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::ResetStats() [member function] + cls.add_method('ResetStats', + 'void', + []) + ## mesh-point-device.h: bool ns3::MeshPointDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetAddress(ns3::Address a) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'a')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## mesh-point-device.h: bool ns3::MeshPointDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## mesh-point-device.h: void ns3::MeshPointDevice::SetRoutingProtocol(ns3::Ptr protocol) [member function] + cls.add_method('SetRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::MeshL2RoutingProtocol >', 'protocol')]) + ## mesh-point-device.h: bool ns3::MeshPointDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_mobility.py b/bindings/python/apidefs/gcc-LP64/ns3_module_mobility.py new file mode 100644 index 000000000..b7556135d --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_mobility.py @@ -0,0 +1,735 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## constant-velocity-helper.h: ns3::ConstantVelocityHelper [class] + module.add_class('ConstantVelocityHelper', allow_subclassing=False) + ## rectangle.h: ns3::Rectangle [class] + module.add_class('Rectangle') + ## rectangle.h: ns3::Rectangle::Side [enumeration] + module.add_enum('Side', ['RIGHT', 'LEFT', 'TOP', 'BOTTOM'], outer_class=root_module['ns3::Rectangle']) + ## position-allocator.h: ns3::PositionAllocator [class] + module.add_class('PositionAllocator', parent=root_module['ns3::Object']) + ## position-allocator.h: ns3::RandomDiscPositionAllocator [class] + module.add_class('RandomDiscPositionAllocator', parent=root_module['ns3::PositionAllocator']) + ## position-allocator.h: ns3::RandomRectanglePositionAllocator [class] + module.add_class('RandomRectanglePositionAllocator', parent=root_module['ns3::PositionAllocator']) + ## rectangle.h: ns3::RectangleChecker [class] + module.add_class('RectangleChecker', parent=root_module['ns3::AttributeChecker']) + ## rectangle.h: ns3::RectangleValue [class] + module.add_class('RectangleValue', parent=root_module['ns3::AttributeValue']) + ## position-allocator.h: ns3::GridPositionAllocator [class] + module.add_class('GridPositionAllocator', parent=root_module['ns3::PositionAllocator']) + ## position-allocator.h: ns3::GridPositionAllocator::LayoutType [enumeration] + module.add_enum('LayoutType', ['ROW_FIRST', 'COLUMN_FIRST'], outer_class=root_module['ns3::GridPositionAllocator']) + ## position-allocator.h: ns3::ListPositionAllocator [class] + module.add_class('ListPositionAllocator', parent=root_module['ns3::PositionAllocator']) + ## mobility-model.h: ns3::MobilityModel [class] + module.add_class('MobilityModel', parent=root_module['ns3::Object']) + ## random-direction-2d-mobility-model.h: ns3::RandomDirection2dMobilityModel [class] + module.add_class('RandomDirection2dMobilityModel', parent=root_module['ns3::MobilityModel']) + ## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel [class] + module.add_class('RandomWalk2dMobilityModel', parent=root_module['ns3::MobilityModel']) + ## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel::Mode [enumeration] + module.add_enum('Mode', ['MODE_DISTANCE', 'MODE_TIME'], outer_class=root_module['ns3::RandomWalk2dMobilityModel']) + ## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel [class] + module.add_class('RandomWaypointMobilityModel', parent=root_module['ns3::MobilityModel']) + ## constant-acceleration-mobility-model.h: ns3::ConstantAccelerationMobilityModel [class] + module.add_class('ConstantAccelerationMobilityModel', parent=root_module['ns3::MobilityModel']) + ## constant-position-mobility-model.h: ns3::ConstantPositionMobilityModel [class] + module.add_class('ConstantPositionMobilityModel', parent=root_module['ns3::MobilityModel']) + ## constant-velocity-mobility-model.h: ns3::ConstantVelocityMobilityModel [class] + module.add_class('ConstantVelocityMobilityModel', parent=root_module['ns3::MobilityModel']) + ## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel [class] + module.add_class('HierarchicalMobilityModel', parent=root_module['ns3::MobilityModel']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3ConstantVelocityHelper_methods(root_module, root_module['ns3::ConstantVelocityHelper']) + register_Ns3Rectangle_methods(root_module, root_module['ns3::Rectangle']) + register_Ns3PositionAllocator_methods(root_module, root_module['ns3::PositionAllocator']) + register_Ns3RandomDiscPositionAllocator_methods(root_module, root_module['ns3::RandomDiscPositionAllocator']) + register_Ns3RandomRectanglePositionAllocator_methods(root_module, root_module['ns3::RandomRectanglePositionAllocator']) + register_Ns3RectangleChecker_methods(root_module, root_module['ns3::RectangleChecker']) + register_Ns3RectangleValue_methods(root_module, root_module['ns3::RectangleValue']) + register_Ns3GridPositionAllocator_methods(root_module, root_module['ns3::GridPositionAllocator']) + register_Ns3ListPositionAllocator_methods(root_module, root_module['ns3::ListPositionAllocator']) + register_Ns3MobilityModel_methods(root_module, root_module['ns3::MobilityModel']) + register_Ns3RandomDirection2dMobilityModel_methods(root_module, root_module['ns3::RandomDirection2dMobilityModel']) + register_Ns3RandomWalk2dMobilityModel_methods(root_module, root_module['ns3::RandomWalk2dMobilityModel']) + register_Ns3RandomWaypointMobilityModel_methods(root_module, root_module['ns3::RandomWaypointMobilityModel']) + register_Ns3ConstantAccelerationMobilityModel_methods(root_module, root_module['ns3::ConstantAccelerationMobilityModel']) + register_Ns3ConstantPositionMobilityModel_methods(root_module, root_module['ns3::ConstantPositionMobilityModel']) + register_Ns3ConstantVelocityMobilityModel_methods(root_module, root_module['ns3::ConstantVelocityMobilityModel']) + register_Ns3HierarchicalMobilityModel_methods(root_module, root_module['ns3::HierarchicalMobilityModel']) + return + +def register_Ns3ConstantVelocityHelper_methods(root_module, cls): + ## constant-velocity-helper.h: ns3::ConstantVelocityHelper::ConstantVelocityHelper(ns3::ConstantVelocityHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConstantVelocityHelper const &', 'arg0')]) + ## constant-velocity-helper.h: ns3::ConstantVelocityHelper::ConstantVelocityHelper() [constructor] + cls.add_constructor([]) + ## constant-velocity-helper.h: ns3::ConstantVelocityHelper::ConstantVelocityHelper(ns3::Vector const & position) [constructor] + cls.add_constructor([param('ns3::Vector const &', 'position')]) + ## constant-velocity-helper.h: ns3::ConstantVelocityHelper::ConstantVelocityHelper(ns3::Vector const & position, ns3::Vector const & vel) [constructor] + cls.add_constructor([param('ns3::Vector const &', 'position'), param('ns3::Vector const &', 'vel')]) + ## constant-velocity-helper.h: ns3::Vector ns3::ConstantVelocityHelper::GetCurrentPosition() const [member function] + cls.add_method('GetCurrentPosition', + 'ns3::Vector', + [], + is_const=True) + ## constant-velocity-helper.h: ns3::Vector ns3::ConstantVelocityHelper::GetVelocity() const [member function] + cls.add_method('GetVelocity', + 'ns3::Vector', + [], + is_const=True) + ## constant-velocity-helper.h: void ns3::ConstantVelocityHelper::Pause() [member function] + cls.add_method('Pause', + 'void', + []) + ## constant-velocity-helper.h: void ns3::ConstantVelocityHelper::SetPosition(ns3::Vector const & position) [member function] + cls.add_method('SetPosition', + 'void', + [param('ns3::Vector const &', 'position')]) + ## constant-velocity-helper.h: void ns3::ConstantVelocityHelper::SetVelocity(ns3::Vector const & vel) [member function] + cls.add_method('SetVelocity', + 'void', + [param('ns3::Vector const &', 'vel')]) + ## constant-velocity-helper.h: void ns3::ConstantVelocityHelper::Unpause() [member function] + cls.add_method('Unpause', + 'void', + []) + ## constant-velocity-helper.h: void ns3::ConstantVelocityHelper::Update() const [member function] + cls.add_method('Update', + 'void', + [], + is_const=True) + ## constant-velocity-helper.h: void ns3::ConstantVelocityHelper::UpdateWithBounds(ns3::Rectangle const & rectangle) const [member function] + cls.add_method('UpdateWithBounds', + 'void', + [param('ns3::Rectangle const &', 'rectangle')], + is_const=True) + return + +def register_Ns3Rectangle_methods(root_module, cls): + cls.add_output_stream_operator() + ## rectangle.h: ns3::Rectangle::Rectangle(ns3::Rectangle const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Rectangle const &', 'arg0')]) + ## rectangle.h: ns3::Rectangle::Rectangle(double _xMin, double _xMax, double _yMin, double _yMax) [constructor] + cls.add_constructor([param('double', '_xMin'), param('double', '_xMax'), param('double', '_yMin'), param('double', '_yMax')]) + ## rectangle.h: ns3::Rectangle::Rectangle() [constructor] + cls.add_constructor([]) + ## rectangle.h: ns3::Vector ns3::Rectangle::CalculateIntersection(ns3::Vector const & current, ns3::Vector const & speed) const [member function] + cls.add_method('CalculateIntersection', + 'ns3::Vector', + [param('ns3::Vector const &', 'current'), param('ns3::Vector const &', 'speed')], + is_const=True) + ## rectangle.h: ns3::Rectangle::Side ns3::Rectangle::GetClosestSide(ns3::Vector const & position) const [member function] + cls.add_method('GetClosestSide', + 'ns3::Rectangle::Side', + [param('ns3::Vector const &', 'position')], + is_const=True) + ## rectangle.h: bool ns3::Rectangle::IsInside(ns3::Vector const & position) const [member function] + cls.add_method('IsInside', + 'bool', + [param('ns3::Vector const &', 'position')], + is_const=True) + ## rectangle.h: ns3::Rectangle::xMax [variable] + cls.add_instance_attribute('xMax', 'double', is_const=False) + ## rectangle.h: ns3::Rectangle::xMin [variable] + cls.add_instance_attribute('xMin', 'double', is_const=False) + ## rectangle.h: ns3::Rectangle::yMax [variable] + cls.add_instance_attribute('yMax', 'double', is_const=False) + ## rectangle.h: ns3::Rectangle::yMin [variable] + cls.add_instance_attribute('yMin', 'double', is_const=False) + return + +def register_Ns3PositionAllocator_methods(root_module, cls): + ## position-allocator.h: ns3::PositionAllocator::PositionAllocator(ns3::PositionAllocator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PositionAllocator const &', 'arg0')]) + ## position-allocator.h: ns3::PositionAllocator::PositionAllocator() [constructor] + cls.add_constructor([]) + ## position-allocator.h: ns3::Vector ns3::PositionAllocator::GetNext() const [member function] + cls.add_method('GetNext', + 'ns3::Vector', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## position-allocator.h: static ns3::TypeId ns3::PositionAllocator::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3RandomDiscPositionAllocator_methods(root_module, cls): + ## position-allocator.h: ns3::RandomDiscPositionAllocator::RandomDiscPositionAllocator(ns3::RandomDiscPositionAllocator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RandomDiscPositionAllocator const &', 'arg0')]) + ## position-allocator.h: ns3::RandomDiscPositionAllocator::RandomDiscPositionAllocator() [constructor] + cls.add_constructor([]) + ## position-allocator.h: ns3::Vector ns3::RandomDiscPositionAllocator::GetNext() const [member function] + cls.add_method('GetNext', + 'ns3::Vector', + [], + is_const=True, is_virtual=True) + ## position-allocator.h: static ns3::TypeId ns3::RandomDiscPositionAllocator::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## position-allocator.h: void ns3::RandomDiscPositionAllocator::SetRho(ns3::RandomVariable rho) [member function] + cls.add_method('SetRho', + 'void', + [param('ns3::RandomVariable', 'rho')]) + ## position-allocator.h: void ns3::RandomDiscPositionAllocator::SetTheta(ns3::RandomVariable theta) [member function] + cls.add_method('SetTheta', + 'void', + [param('ns3::RandomVariable', 'theta')]) + ## position-allocator.h: void ns3::RandomDiscPositionAllocator::SetX(double x) [member function] + cls.add_method('SetX', + 'void', + [param('double', 'x')]) + ## position-allocator.h: void ns3::RandomDiscPositionAllocator::SetY(double y) [member function] + cls.add_method('SetY', + 'void', + [param('double', 'y')]) + return + +def register_Ns3RandomRectanglePositionAllocator_methods(root_module, cls): + ## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator(ns3::RandomRectanglePositionAllocator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RandomRectanglePositionAllocator const &', 'arg0')]) + ## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator() [constructor] + cls.add_constructor([]) + ## position-allocator.h: ns3::Vector ns3::RandomRectanglePositionAllocator::GetNext() const [member function] + cls.add_method('GetNext', + 'ns3::Vector', + [], + is_const=True, is_virtual=True) + ## position-allocator.h: static ns3::TypeId ns3::RandomRectanglePositionAllocator::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetX(ns3::RandomVariable x) [member function] + cls.add_method('SetX', + 'void', + [param('ns3::RandomVariable', 'x')]) + ## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetY(ns3::RandomVariable y) [member function] + cls.add_method('SetY', + 'void', + [param('ns3::RandomVariable', 'y')]) + return + +def register_Ns3RectangleChecker_methods(root_module, cls): + ## rectangle.h: ns3::RectangleChecker::RectangleChecker() [constructor] + cls.add_constructor([]) + ## rectangle.h: ns3::RectangleChecker::RectangleChecker(ns3::RectangleChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RectangleChecker const &', 'arg0')]) + return + +def register_Ns3RectangleValue_methods(root_module, cls): + ## rectangle.h: ns3::RectangleValue::RectangleValue() [constructor] + cls.add_constructor([]) + ## rectangle.h: ns3::RectangleValue::RectangleValue(ns3::RectangleValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RectangleValue const &', 'arg0')]) + ## rectangle.h: ns3::RectangleValue::RectangleValue(ns3::Rectangle const & value) [constructor] + cls.add_constructor([param('ns3::Rectangle const &', 'value')]) + ## rectangle.h: ns3::Ptr ns3::RectangleValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## rectangle.h: bool ns3::RectangleValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## rectangle.h: ns3::Rectangle ns3::RectangleValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Rectangle', + [], + is_const=True) + ## rectangle.h: std::string ns3::RectangleValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## rectangle.h: void ns3::RectangleValue::Set(ns3::Rectangle const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Rectangle const &', 'value')]) + return + +def register_Ns3GridPositionAllocator_methods(root_module, cls): + ## position-allocator.h: ns3::GridPositionAllocator::GridPositionAllocator(ns3::GridPositionAllocator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::GridPositionAllocator const &', 'arg0')]) + ## position-allocator.h: ns3::GridPositionAllocator::GridPositionAllocator() [constructor] + cls.add_constructor([]) + ## position-allocator.h: double ns3::GridPositionAllocator::GetDeltaX() const [member function] + cls.add_method('GetDeltaX', + 'double', + [], + is_const=True) + ## position-allocator.h: double ns3::GridPositionAllocator::GetDeltaY() const [member function] + cls.add_method('GetDeltaY', + 'double', + [], + is_const=True) + ## position-allocator.h: ns3::GridPositionAllocator::LayoutType ns3::GridPositionAllocator::GetLayoutType() const [member function] + cls.add_method('GetLayoutType', + 'ns3::GridPositionAllocator::LayoutType', + [], + is_const=True) + ## position-allocator.h: double ns3::GridPositionAllocator::GetMinX() const [member function] + cls.add_method('GetMinX', + 'double', + [], + is_const=True) + ## position-allocator.h: double ns3::GridPositionAllocator::GetMinY() const [member function] + cls.add_method('GetMinY', + 'double', + [], + is_const=True) + ## position-allocator.h: uint32_t ns3::GridPositionAllocator::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## position-allocator.h: ns3::Vector ns3::GridPositionAllocator::GetNext() const [member function] + cls.add_method('GetNext', + 'ns3::Vector', + [], + is_const=True, is_virtual=True) + ## position-allocator.h: static ns3::TypeId ns3::GridPositionAllocator::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## position-allocator.h: void ns3::GridPositionAllocator::SetDeltaX(double deltaX) [member function] + cls.add_method('SetDeltaX', + 'void', + [param('double', 'deltaX')]) + ## position-allocator.h: void ns3::GridPositionAllocator::SetDeltaY(double deltaY) [member function] + cls.add_method('SetDeltaY', + 'void', + [param('double', 'deltaY')]) + ## position-allocator.h: void ns3::GridPositionAllocator::SetLayoutType(ns3::GridPositionAllocator::LayoutType layoutType) [member function] + cls.add_method('SetLayoutType', + 'void', + [param('ns3::GridPositionAllocator::LayoutType', 'layoutType')]) + ## position-allocator.h: void ns3::GridPositionAllocator::SetMinX(double xMin) [member function] + cls.add_method('SetMinX', + 'void', + [param('double', 'xMin')]) + ## position-allocator.h: void ns3::GridPositionAllocator::SetMinY(double yMin) [member function] + cls.add_method('SetMinY', + 'void', + [param('double', 'yMin')]) + ## position-allocator.h: void ns3::GridPositionAllocator::SetN(uint32_t n) [member function] + cls.add_method('SetN', + 'void', + [param('uint32_t', 'n')]) + return + +def register_Ns3ListPositionAllocator_methods(root_module, cls): + ## position-allocator.h: ns3::ListPositionAllocator::ListPositionAllocator(ns3::ListPositionAllocator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ListPositionAllocator const &', 'arg0')]) + ## position-allocator.h: ns3::ListPositionAllocator::ListPositionAllocator() [constructor] + cls.add_constructor([]) + ## position-allocator.h: void ns3::ListPositionAllocator::Add(ns3::Vector v) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Vector', 'v')]) + ## position-allocator.h: ns3::Vector ns3::ListPositionAllocator::GetNext() const [member function] + cls.add_method('GetNext', + 'ns3::Vector', + [], + is_const=True, is_virtual=True) + ## position-allocator.h: static ns3::TypeId ns3::ListPositionAllocator::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3MobilityModel_methods(root_module, cls): + ## mobility-model.h: ns3::MobilityModel::MobilityModel(ns3::MobilityModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MobilityModel const &', 'arg0')]) + ## mobility-model.h: ns3::MobilityModel::MobilityModel() [constructor] + cls.add_constructor([]) + ## mobility-model.h: double ns3::MobilityModel::GetDistanceFrom(ns3::Ptr position) const [member function] + cls.add_method('GetDistanceFrom', + 'double', + [param('ns3::Ptr< ns3::MobilityModel const >', 'position')], + is_const=True) + ## mobility-model.h: ns3::Vector ns3::MobilityModel::GetPosition() const [member function] + cls.add_method('GetPosition', + 'ns3::Vector', + [], + is_const=True) + ## mobility-model.h: static ns3::TypeId ns3::MobilityModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mobility-model.h: ns3::Vector ns3::MobilityModel::GetVelocity() const [member function] + cls.add_method('GetVelocity', + 'ns3::Vector', + [], + is_const=True) + ## mobility-model.h: void ns3::MobilityModel::SetPosition(ns3::Vector const & position) [member function] + cls.add_method('SetPosition', + 'void', + [param('ns3::Vector const &', 'position')]) + ## mobility-model.h: void ns3::MobilityModel::NotifyCourseChange() const [member function] + cls.add_method('NotifyCourseChange', + 'void', + [], + is_const=True, visibility='protected') + ## mobility-model.h: ns3::Vector ns3::MobilityModel::DoGetPosition() const [member function] + cls.add_method('DoGetPosition', + 'ns3::Vector', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## mobility-model.h: ns3::Vector ns3::MobilityModel::DoGetVelocity() const [member function] + cls.add_method('DoGetVelocity', + 'ns3::Vector', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## mobility-model.h: void ns3::MobilityModel::DoSetPosition(ns3::Vector const & position) [member function] + cls.add_method('DoSetPosition', + 'void', + [param('ns3::Vector const &', 'position')], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3RandomDirection2dMobilityModel_methods(root_module, cls): + ## random-direction-2d-mobility-model.h: ns3::RandomDirection2dMobilityModel::RandomDirection2dMobilityModel(ns3::RandomDirection2dMobilityModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RandomDirection2dMobilityModel const &', 'arg0')]) + ## random-direction-2d-mobility-model.h: ns3::RandomDirection2dMobilityModel::RandomDirection2dMobilityModel() [constructor] + cls.add_constructor([]) + ## random-direction-2d-mobility-model.h: static ns3::TypeId ns3::RandomDirection2dMobilityModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-direction-2d-mobility-model.h: void ns3::RandomDirection2dMobilityModel::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## random-direction-2d-mobility-model.h: ns3::Vector ns3::RandomDirection2dMobilityModel::DoGetPosition() const [member function] + cls.add_method('DoGetPosition', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## random-direction-2d-mobility-model.h: ns3::Vector ns3::RandomDirection2dMobilityModel::DoGetVelocity() const [member function] + cls.add_method('DoGetVelocity', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## random-direction-2d-mobility-model.h: void ns3::RandomDirection2dMobilityModel::DoSetPosition(ns3::Vector const & position) [member function] + cls.add_method('DoSetPosition', + 'void', + [param('ns3::Vector const &', 'position')], + visibility='private', is_virtual=True) + return + +def register_Ns3RandomWalk2dMobilityModel_methods(root_module, cls): + ## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel::RandomWalk2dMobilityModel(ns3::RandomWalk2dMobilityModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RandomWalk2dMobilityModel const &', 'arg0')]) + ## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel::RandomWalk2dMobilityModel() [constructor] + cls.add_constructor([]) + ## random-walk-2d-mobility-model.h: static ns3::TypeId ns3::RandomWalk2dMobilityModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-walk-2d-mobility-model.h: void ns3::RandomWalk2dMobilityModel::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## random-walk-2d-mobility-model.h: ns3::Vector ns3::RandomWalk2dMobilityModel::DoGetPosition() const [member function] + cls.add_method('DoGetPosition', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## random-walk-2d-mobility-model.h: ns3::Vector ns3::RandomWalk2dMobilityModel::DoGetVelocity() const [member function] + cls.add_method('DoGetVelocity', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## random-walk-2d-mobility-model.h: void ns3::RandomWalk2dMobilityModel::DoSetPosition(ns3::Vector const & position) [member function] + cls.add_method('DoSetPosition', + 'void', + [param('ns3::Vector const &', 'position')], + visibility='private', is_virtual=True) + return + +def register_Ns3RandomWaypointMobilityModel_methods(root_module, cls): + ## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel::RandomWaypointMobilityModel(ns3::RandomWaypointMobilityModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RandomWaypointMobilityModel const &', 'arg0')]) + ## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel::RandomWaypointMobilityModel() [constructor] + cls.add_constructor([]) + ## random-waypoint-mobility-model.h: static ns3::TypeId ns3::RandomWaypointMobilityModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-waypoint-mobility-model.h: ns3::Vector ns3::RandomWaypointMobilityModel::DoGetPosition() const [member function] + cls.add_method('DoGetPosition', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## random-waypoint-mobility-model.h: ns3::Vector ns3::RandomWaypointMobilityModel::DoGetVelocity() const [member function] + cls.add_method('DoGetVelocity', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## random-waypoint-mobility-model.h: void ns3::RandomWaypointMobilityModel::DoSetPosition(ns3::Vector const & position) [member function] + cls.add_method('DoSetPosition', + 'void', + [param('ns3::Vector const &', 'position')], + visibility='private', is_virtual=True) + return + +def register_Ns3ConstantAccelerationMobilityModel_methods(root_module, cls): + ## constant-acceleration-mobility-model.h: ns3::ConstantAccelerationMobilityModel::ConstantAccelerationMobilityModel(ns3::ConstantAccelerationMobilityModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConstantAccelerationMobilityModel const &', 'arg0')]) + ## constant-acceleration-mobility-model.h: ns3::ConstantAccelerationMobilityModel::ConstantAccelerationMobilityModel() [constructor] + cls.add_constructor([]) + ## constant-acceleration-mobility-model.h: static ns3::TypeId ns3::ConstantAccelerationMobilityModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## constant-acceleration-mobility-model.h: void ns3::ConstantAccelerationMobilityModel::SetVelocityAndAcceleration(ns3::Vector const & velocity, ns3::Vector const & acceleration) [member function] + cls.add_method('SetVelocityAndAcceleration', + 'void', + [param('ns3::Vector const &', 'velocity'), param('ns3::Vector const &', 'acceleration')]) + ## constant-acceleration-mobility-model.h: ns3::Vector ns3::ConstantAccelerationMobilityModel::DoGetPosition() const [member function] + cls.add_method('DoGetPosition', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## constant-acceleration-mobility-model.h: ns3::Vector ns3::ConstantAccelerationMobilityModel::DoGetVelocity() const [member function] + cls.add_method('DoGetVelocity', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## constant-acceleration-mobility-model.h: void ns3::ConstantAccelerationMobilityModel::DoSetPosition(ns3::Vector const & position) [member function] + cls.add_method('DoSetPosition', + 'void', + [param('ns3::Vector const &', 'position')], + visibility='private', is_virtual=True) + return + +def register_Ns3ConstantPositionMobilityModel_methods(root_module, cls): + ## constant-position-mobility-model.h: ns3::ConstantPositionMobilityModel::ConstantPositionMobilityModel(ns3::ConstantPositionMobilityModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConstantPositionMobilityModel const &', 'arg0')]) + ## constant-position-mobility-model.h: ns3::ConstantPositionMobilityModel::ConstantPositionMobilityModel() [constructor] + cls.add_constructor([]) + ## constant-position-mobility-model.h: static ns3::TypeId ns3::ConstantPositionMobilityModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## constant-position-mobility-model.h: ns3::Vector ns3::ConstantPositionMobilityModel::DoGetPosition() const [member function] + cls.add_method('DoGetPosition', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## constant-position-mobility-model.h: ns3::Vector ns3::ConstantPositionMobilityModel::DoGetVelocity() const [member function] + cls.add_method('DoGetVelocity', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## constant-position-mobility-model.h: void ns3::ConstantPositionMobilityModel::DoSetPosition(ns3::Vector const & position) [member function] + cls.add_method('DoSetPosition', + 'void', + [param('ns3::Vector const &', 'position')], + visibility='private', is_virtual=True) + return + +def register_Ns3ConstantVelocityMobilityModel_methods(root_module, cls): + ## constant-velocity-mobility-model.h: ns3::ConstantVelocityMobilityModel::ConstantVelocityMobilityModel(ns3::ConstantVelocityMobilityModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConstantVelocityMobilityModel const &', 'arg0')]) + ## constant-velocity-mobility-model.h: ns3::ConstantVelocityMobilityModel::ConstantVelocityMobilityModel() [constructor] + cls.add_constructor([]) + ## constant-velocity-mobility-model.h: static ns3::TypeId ns3::ConstantVelocityMobilityModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## constant-velocity-mobility-model.h: void ns3::ConstantVelocityMobilityModel::SetVelocity(ns3::Vector const & speed) [member function] + cls.add_method('SetVelocity', + 'void', + [param('ns3::Vector const &', 'speed')]) + ## constant-velocity-mobility-model.h: ns3::Vector ns3::ConstantVelocityMobilityModel::DoGetPosition() const [member function] + cls.add_method('DoGetPosition', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## constant-velocity-mobility-model.h: ns3::Vector ns3::ConstantVelocityMobilityModel::DoGetVelocity() const [member function] + cls.add_method('DoGetVelocity', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## constant-velocity-mobility-model.h: void ns3::ConstantVelocityMobilityModel::DoSetPosition(ns3::Vector const & position) [member function] + cls.add_method('DoSetPosition', + 'void', + [param('ns3::Vector const &', 'position')], + visibility='private', is_virtual=True) + return + +def register_Ns3HierarchicalMobilityModel_methods(root_module, cls): + ## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel::HierarchicalMobilityModel(ns3::HierarchicalMobilityModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::HierarchicalMobilityModel const &', 'arg0')]) + ## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel::HierarchicalMobilityModel() [constructor] + cls.add_constructor([]) + ## hierarchical-mobility-model.h: ns3::Ptr ns3::HierarchicalMobilityModel::GetChild() const [member function] + cls.add_method('GetChild', + 'ns3::Ptr< ns3::MobilityModel >', + [], + is_const=True) + ## hierarchical-mobility-model.h: ns3::Ptr ns3::HierarchicalMobilityModel::GetParent() const [member function] + cls.add_method('GetParent', + 'ns3::Ptr< ns3::MobilityModel >', + [], + is_const=True) + ## hierarchical-mobility-model.h: static ns3::TypeId ns3::HierarchicalMobilityModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## hierarchical-mobility-model.h: void ns3::HierarchicalMobilityModel::SetChild(ns3::Ptr model) [member function] + cls.add_method('SetChild', + 'void', + [param('ns3::Ptr< ns3::MobilityModel >', 'model')]) + ## hierarchical-mobility-model.h: void ns3::HierarchicalMobilityModel::SetParent(ns3::Ptr model) [member function] + cls.add_method('SetParent', + 'void', + [param('ns3::Ptr< ns3::MobilityModel >', 'model')]) + ## hierarchical-mobility-model.h: ns3::Vector ns3::HierarchicalMobilityModel::DoGetPosition() const [member function] + cls.add_method('DoGetPosition', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## hierarchical-mobility-model.h: ns3::Vector ns3::HierarchicalMobilityModel::DoGetVelocity() const [member function] + cls.add_method('DoGetVelocity', + 'ns3::Vector', + [], + is_const=True, visibility='private', is_virtual=True) + ## hierarchical-mobility-model.h: void ns3::HierarchicalMobilityModel::DoSetPosition(ns3::Vector const & position) [member function] + cls.add_method('DoSetPosition', + 'void', + [param('ns3::Vector const &', 'position')], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + ## rectangle.h: extern ns3::Ptr ns3::MakeRectangleChecker() [free function] + module.add_function('MakeRectangleChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_nix_vector_routing.py b/bindings/python/apidefs/gcc-LP64/ns3_module_nix_vector_routing.py new file mode 100644 index 000000000..f027a698f --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_nix_vector_routing.py @@ -0,0 +1,180 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting [class] + module.add_class('Ipv4NixVectorRouting', parent=root_module['ns3::Ipv4RoutingProtocol']) + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >', 'ns3::NixMap_t') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >*', 'ns3::NixMap_t*') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >&', 'ns3::NixMap_t&') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >', 'ns3::Ipv4RouteMap_t') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >*', 'ns3::Ipv4RouteMap_t*') + typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >&', 'ns3::Ipv4RouteMap_t&') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Ipv4NixVectorRouting_methods(root_module, root_module['ns3::Ipv4NixVectorRouting']) + return + +def register_Ns3Ipv4NixVectorRouting_methods(root_module, cls): + ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting::Ipv4NixVectorRouting(ns3::Ipv4NixVectorRouting const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4NixVectorRouting const &', 'arg0')]) + ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting::Ipv4NixVectorRouting() [constructor] + cls.add_constructor([]) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::FlushGlobalNixRoutingCache() [member function] + cls.add_method('FlushGlobalNixRoutingCache', + 'void', + []) + ## ipv4-nix-vector-routing.h: static ns3::TypeId ns3::Ipv4NixVectorRouting::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::SetNode(ns3::Ptr arg0) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'arg0')]) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: bool ns3::Ipv4NixVectorRouting::RouteInput(ns3::Ptr p, ns3::Ipv4Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: ns3::Ptr ns3::Ipv4NixVectorRouting::RouteOutput(ns3::Ptr p, ns3::Ipv4Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv4Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + visibility='private', is_virtual=True) + ## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::SetIpv4(ns3::Ptr ipv4) [member function] + cls.add_method('SetIpv4', + 'void', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_node.py b/bindings/python/apidefs/gcc-LP64/ns3_module_node.py new file mode 100644 index 000000000..9c9c6855d --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_node.py @@ -0,0 +1,4973 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## packetbb.h: ns3::PbbAddressLength [enumeration] + module.add_enum('PbbAddressLength', ['IPV4', 'IPV6']) + ## ethernet-header.h: ns3::ethernet_header_t [enumeration] + module.add_enum('ethernet_header_t', ['LENGTH', 'VLAN', 'QINQ']) + ## address.h: ns3::Address [class] + module.add_class('Address') + ## address.h: ns3::Address::MaxSize_e [enumeration] + module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address']) + ## inet6-socket-address.h: ns3::Inet6SocketAddress [class] + module.add_class('Inet6SocketAddress') + ## inet6-socket-address.h: ns3::Inet6SocketAddress [class] + root_module['ns3::Inet6SocketAddress'].implicitly_converts_to(root_module['ns3::Address']) + ## inet-socket-address.h: ns3::InetSocketAddress [class] + module.add_class('InetSocketAddress') + ## inet-socket-address.h: ns3::InetSocketAddress [class] + root_module['ns3::InetSocketAddress'].implicitly_converts_to(root_module['ns3::Address']) + ## ipv4-address.h: ns3::Ipv4Address [class] + module.add_class('Ipv4Address') + ## ipv4-address.h: ns3::Ipv4Address [class] + root_module['ns3::Ipv4Address'].implicitly_converts_to(root_module['ns3::Address']) + ## ipv4-address-generator.h: ns3::Ipv4AddressGenerator [class] + module.add_class('Ipv4AddressGenerator') + ## ipv4-interface-address.h: ns3::Ipv4InterfaceAddress [class] + module.add_class('Ipv4InterfaceAddress') + ## ipv4-interface-address.h: ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e [enumeration] + module.add_enum('InterfaceAddressScope_e', ['HOST', 'LINK', 'GLOBAL'], outer_class=root_module['ns3::Ipv4InterfaceAddress']) + ## ipv4-address.h: ns3::Ipv4Mask [class] + module.add_class('Ipv4Mask') + ## ipv6-address.h: ns3::Ipv6Address [class] + module.add_class('Ipv6Address') + ## ipv6-address.h: ns3::Ipv6Address [class] + root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address']) + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress [class] + module.add_class('Ipv6InterfaceAddress') + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress::State_e [enumeration] + module.add_enum('State_e', ['TENTATIVE', 'DEPRECATED', 'PREFERRED', 'PERMANENT', 'HOMEADDRESS', 'TENTATIVE_OPTIMISTIC', 'INVALID'], outer_class=root_module['ns3::Ipv6InterfaceAddress']) + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress::Scope_e [enumeration] + module.add_enum('Scope_e', ['HOST', 'LINKLOCAL', 'GLOBAL'], outer_class=root_module['ns3::Ipv6InterfaceAddress']) + ## ipv6-address.h: ns3::Ipv6Prefix [class] + module.add_class('Ipv6Prefix') + ## mac48-address.h: ns3::Mac48Address [class] + module.add_class('Mac48Address') + ## mac48-address.h: ns3::Mac48Address [class] + root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address']) + ## mac64-address.h: ns3::Mac64Address [class] + module.add_class('Mac64Address') + ## mac64-address.h: ns3::Mac64Address [class] + root_module['ns3::Mac64Address'].implicitly_converts_to(root_module['ns3::Address']) + ## node-list.h: ns3::NodeList [class] + module.add_class('NodeList') + ## packet-socket-address.h: ns3::PacketSocketAddress [class] + module.add_class('PacketSocketAddress') + ## packet-socket-address.h: ns3::PacketSocketAddress [class] + root_module['ns3::PacketSocketAddress'].implicitly_converts_to(root_module['ns3::Address']) + ## packetbb.h: ns3::PbbAddressBlock [class] + module.add_class('PbbAddressBlock', allow_subclassing=True) + ## packetbb.h: ns3::PbbAddressBlockIpv4 [class] + module.add_class('PbbAddressBlockIpv4', parent=root_module['ns3::PbbAddressBlock']) + ## packetbb.h: ns3::PbbAddressBlockIpv6 [class] + module.add_class('PbbAddressBlockIpv6', parent=root_module['ns3::PbbAddressBlock']) + ## packetbb.h: ns3::PbbAddressTlvBlock [class] + module.add_class('PbbAddressTlvBlock') + ## packetbb.h: ns3::PbbMessage [class] + module.add_class('PbbMessage', allow_subclassing=True) + ## packetbb.h: ns3::PbbMessageIpv4 [class] + module.add_class('PbbMessageIpv4', parent=root_module['ns3::PbbMessage']) + ## packetbb.h: ns3::PbbMessageIpv6 [class] + module.add_class('PbbMessageIpv6', parent=root_module['ns3::PbbMessage']) + ## packetbb.h: ns3::PbbTlv [class] + module.add_class('PbbTlv') + ## packetbb.h: ns3::PbbTlvBlock [class] + module.add_class('PbbTlvBlock') + ## ipv4-address.h: ns3::Ipv4AddressChecker [class] + module.add_class('Ipv4AddressChecker', parent=root_module['ns3::AttributeChecker']) + ## ipv4-address.h: ns3::Ipv4AddressValue [class] + module.add_class('Ipv4AddressValue', parent=root_module['ns3::AttributeValue']) + ## ipv4-header.h: ns3::Ipv4Header [class] + module.add_class('Ipv4Header', parent=root_module['ns3::Header']) + ## ipv4-address.h: ns3::Ipv4MaskChecker [class] + module.add_class('Ipv4MaskChecker', parent=root_module['ns3::AttributeChecker']) + ## ipv4-address.h: ns3::Ipv4MaskValue [class] + module.add_class('Ipv4MaskValue', parent=root_module['ns3::AttributeValue']) + ## ipv4-route.h: ns3::Ipv4MulticastRoute [class] + module.add_class('Ipv4MulticastRoute', parent=root_module['ns3::RefCountBase']) + ## ipv4-route.h: ns3::Ipv4Route [class] + module.add_class('Ipv4Route', parent=root_module['ns3::RefCountBase']) + ## ipv6-address.h: ns3::Ipv6AddressChecker [class] + module.add_class('Ipv6AddressChecker', parent=root_module['ns3::AttributeChecker']) + ## ipv6-address.h: ns3::Ipv6AddressValue [class] + module.add_class('Ipv6AddressValue', parent=root_module['ns3::AttributeValue']) + ## ipv6-header.h: ns3::Ipv6Header [class] + module.add_class('Ipv6Header', parent=root_module['ns3::Header']) + ## ipv6-header.h: ns3::Ipv6Header::NextHeader_e [enumeration] + module.add_enum('NextHeader_e', ['IPV6_EXT_HOP_BY_HOP', 'IPV6_IPV4', 'IPV6_TCP', 'IPV6_UDP', 'IPV6_IPV6', 'IPV6_EXT_ROUTING', 'IPV6_EXT_FRAGMENTATION', 'IPV6_EXT_CONFIDENTIALITY', 'IPV6_EXT_AUTHENTIFICATION', 'IPV6_ICMPV6', 'IPV6_EXT_END', 'IPV6_EXT_DESTINATION', 'IPV6_SCTP', 'IPV6_EXT_MOBILITY', 'IPV6_UDP_LITE'], outer_class=root_module['ns3::Ipv6Header']) + ## ipv6-route.h: ns3::Ipv6MulticastRoute [class] + module.add_class('Ipv6MulticastRoute', parent=root_module['ns3::RefCountBase']) + ## ipv6-address.h: ns3::Ipv6PrefixChecker [class] + module.add_class('Ipv6PrefixChecker', parent=root_module['ns3::AttributeChecker']) + ## ipv6-address.h: ns3::Ipv6PrefixValue [class] + module.add_class('Ipv6PrefixValue', parent=root_module['ns3::AttributeValue']) + ## ipv6-route.h: ns3::Ipv6Route [class] + module.add_class('Ipv6Route', parent=root_module['ns3::RefCountBase']) + ## llc-snap-header.h: ns3::LlcSnapHeader [class] + module.add_class('LlcSnapHeader', parent=root_module['ns3::Header']) + ## mac48-address.h: ns3::Mac48AddressChecker [class] + module.add_class('Mac48AddressChecker', parent=root_module['ns3::AttributeChecker']) + ## mac48-address.h: ns3::Mac48AddressValue [class] + module.add_class('Mac48AddressValue', parent=root_module['ns3::AttributeValue']) + ## packetbb.h: ns3::PbbAddressTlv [class] + module.add_class('PbbAddressTlv', parent=root_module['ns3::PbbTlv']) + ## packetbb.h: ns3::PbbPacket [class] + module.add_class('PbbPacket', parent=root_module['ns3::Header']) + ## queue.h: ns3::Queue [class] + module.add_class('Queue', parent=root_module['ns3::Object']) + ## socket.h: ns3::Socket [class] + module.add_class('Socket', parent=root_module['ns3::Object']) + ## socket.h: ns3::Socket::SocketErrno [enumeration] + module.add_enum('SocketErrno', ['ERROR_NOTERROR', 'ERROR_ISCONN', 'ERROR_NOTCONN', 'ERROR_MSGSIZE', 'ERROR_AGAIN', 'ERROR_SHUTDOWN', 'ERROR_OPNOTSUPP', 'ERROR_AFNOSUPPORT', 'ERROR_INVAL', 'ERROR_BADF', 'ERROR_NOROUTETOHOST', 'SOCKET_ERRNO_LAST'], outer_class=root_module['ns3::Socket']) + ## socket.h: ns3::SocketAddressTag [class] + module.add_class('SocketAddressTag', parent=root_module['ns3::Tag']) + ## socket-factory.h: ns3::SocketFactory [class] + module.add_class('SocketFactory', parent=root_module['ns3::Object']) + ## socket.h: ns3::SocketIpTtlTag [class] + module.add_class('SocketIpTtlTag', parent=root_module['ns3::Tag']) + ## socket.h: ns3::SocketSetDontFragmentTag [class] + module.add_class('SocketSetDontFragmentTag', parent=root_module['ns3::Tag']) + ## tcp-socket.h: ns3::TcpSocket [class] + module.add_class('TcpSocket', parent=root_module['ns3::Socket']) + ## tcp-socket-factory.h: ns3::TcpSocketFactory [class] + module.add_class('TcpSocketFactory', parent=root_module['ns3::SocketFactory']) + ## udp-socket.h: ns3::UdpSocket [class] + module.add_class('UdpSocket', parent=root_module['ns3::Socket']) + ## udp-socket-factory.h: ns3::UdpSocketFactory [class] + module.add_class('UdpSocketFactory', parent=root_module['ns3::SocketFactory']) + ## address.h: ns3::AddressChecker [class] + module.add_class('AddressChecker', parent=root_module['ns3::AttributeChecker']) + ## address.h: ns3::AddressValue [class] + module.add_class('AddressValue', parent=root_module['ns3::AttributeValue']) + ## application.h: ns3::Application [class] + module.add_class('Application', parent=root_module['ns3::Object']) + ## channel.h: ns3::Channel [class] + module.add_class('Channel', parent=root_module['ns3::Object']) + ## drop-tail-queue.h: ns3::DropTailQueue [class] + module.add_class('DropTailQueue', parent=root_module['ns3::Queue']) + ## drop-tail-queue.h: ns3::DropTailQueue::Mode [enumeration] + module.add_enum('Mode', ['ILLEGAL', 'PACKETS', 'BYTES'], outer_class=root_module['ns3::DropTailQueue']) + ## ethernet-header.h: ns3::EthernetHeader [class] + module.add_class('EthernetHeader', parent=root_module['ns3::Header']) + ## ethernet-trailer.h: ns3::EthernetTrailer [class] + module.add_class('EthernetTrailer', parent=root_module['ns3::Trailer']) + ## ipv4.h: ns3::Ipv4 [class] + module.add_class('Ipv4', parent=root_module['ns3::Object']) + ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory [class] + module.add_class('Ipv4RawSocketFactory', parent=root_module['ns3::SocketFactory']) + ## ipv4-routing-protocol.h: ns3::Ipv4RoutingProtocol [class] + module.add_class('Ipv4RoutingProtocol', parent=root_module['ns3::Object']) + ## ipv6.h: ns3::Ipv6 [class] + module.add_class('Ipv6', parent=root_module['ns3::Object']) + ## ipv6-raw-socket-factory.h: ns3::Ipv6RawSocketFactory [class] + module.add_class('Ipv6RawSocketFactory', parent=root_module['ns3::SocketFactory']) + ## ipv6-routing-protocol.h: ns3::Ipv6RoutingProtocol [class] + module.add_class('Ipv6RoutingProtocol', parent=root_module['ns3::Object']) + ## net-device.h: ns3::NetDevice [class] + module.add_class('NetDevice', parent=root_module['ns3::Object']) + ## net-device.h: ns3::NetDevice::PacketType [enumeration] + module.add_enum('PacketType', ['PACKET_HOST', 'NS3_PACKET_HOST', 'PACKET_BROADCAST', 'NS3_PACKET_BROADCAST', 'PACKET_MULTICAST', 'NS3_PACKET_MULTICAST', 'PACKET_OTHERHOST', 'NS3_PACKET_OTHERHOST'], outer_class=root_module['ns3::NetDevice']) + ## node.h: ns3::Node [class] + module.add_class('Node', parent=root_module['ns3::Object']) + ## packet-socket-factory.h: ns3::PacketSocketFactory [class] + module.add_class('PacketSocketFactory', parent=root_module['ns3::SocketFactory']) + ## simple-channel.h: ns3::SimpleChannel [class] + module.add_class('SimpleChannel', parent=root_module['ns3::Channel']) + ## simple-net-device.h: ns3::SimpleNetDevice [class] + module.add_class('SimpleNetDevice', parent=root_module['ns3::NetDevice']) + module.add_container('ns3::olsr::MprSet', 'ns3::Ipv4Address', container_type='set') + module.add_container('std::vector< ns3::Ipv4Address >', 'ns3::Ipv4Address', container_type='vector') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + module.add_container('std::vector< ns3::Mac48Address >', 'ns3::Mac48Address', container_type='vector') + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Address_methods(root_module, root_module['ns3::Address']) + register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress']) + register_Ns3InetSocketAddress_methods(root_module, root_module['ns3::InetSocketAddress']) + register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address']) + register_Ns3Ipv4AddressGenerator_methods(root_module, root_module['ns3::Ipv4AddressGenerator']) + register_Ns3Ipv4InterfaceAddress_methods(root_module, root_module['ns3::Ipv4InterfaceAddress']) + register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask']) + register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address']) + register_Ns3Ipv6InterfaceAddress_methods(root_module, root_module['ns3::Ipv6InterfaceAddress']) + register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix']) + register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address']) + register_Ns3Mac64Address_methods(root_module, root_module['ns3::Mac64Address']) + register_Ns3NodeList_methods(root_module, root_module['ns3::NodeList']) + register_Ns3PacketSocketAddress_methods(root_module, root_module['ns3::PacketSocketAddress']) + register_Ns3PbbAddressBlock_methods(root_module, root_module['ns3::PbbAddressBlock']) + register_Ns3PbbAddressBlockIpv4_methods(root_module, root_module['ns3::PbbAddressBlockIpv4']) + register_Ns3PbbAddressBlockIpv6_methods(root_module, root_module['ns3::PbbAddressBlockIpv6']) + register_Ns3PbbAddressTlvBlock_methods(root_module, root_module['ns3::PbbAddressTlvBlock']) + register_Ns3PbbMessage_methods(root_module, root_module['ns3::PbbMessage']) + register_Ns3PbbMessageIpv4_methods(root_module, root_module['ns3::PbbMessageIpv4']) + register_Ns3PbbMessageIpv6_methods(root_module, root_module['ns3::PbbMessageIpv6']) + register_Ns3PbbTlv_methods(root_module, root_module['ns3::PbbTlv']) + register_Ns3PbbTlvBlock_methods(root_module, root_module['ns3::PbbTlvBlock']) + register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker']) + register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue']) + register_Ns3Ipv4Header_methods(root_module, root_module['ns3::Ipv4Header']) + register_Ns3Ipv4MaskChecker_methods(root_module, root_module['ns3::Ipv4MaskChecker']) + register_Ns3Ipv4MaskValue_methods(root_module, root_module['ns3::Ipv4MaskValue']) + register_Ns3Ipv4MulticastRoute_methods(root_module, root_module['ns3::Ipv4MulticastRoute']) + register_Ns3Ipv4Route_methods(root_module, root_module['ns3::Ipv4Route']) + register_Ns3Ipv6AddressChecker_methods(root_module, root_module['ns3::Ipv6AddressChecker']) + register_Ns3Ipv6AddressValue_methods(root_module, root_module['ns3::Ipv6AddressValue']) + register_Ns3Ipv6Header_methods(root_module, root_module['ns3::Ipv6Header']) + register_Ns3Ipv6MulticastRoute_methods(root_module, root_module['ns3::Ipv6MulticastRoute']) + register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker']) + register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue']) + register_Ns3Ipv6Route_methods(root_module, root_module['ns3::Ipv6Route']) + register_Ns3LlcSnapHeader_methods(root_module, root_module['ns3::LlcSnapHeader']) + register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker']) + register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue']) + register_Ns3PbbAddressTlv_methods(root_module, root_module['ns3::PbbAddressTlv']) + register_Ns3PbbPacket_methods(root_module, root_module['ns3::PbbPacket']) + register_Ns3Queue_methods(root_module, root_module['ns3::Queue']) + register_Ns3Socket_methods(root_module, root_module['ns3::Socket']) + register_Ns3SocketAddressTag_methods(root_module, root_module['ns3::SocketAddressTag']) + register_Ns3SocketFactory_methods(root_module, root_module['ns3::SocketFactory']) + register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag']) + register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag']) + register_Ns3TcpSocket_methods(root_module, root_module['ns3::TcpSocket']) + register_Ns3TcpSocketFactory_methods(root_module, root_module['ns3::TcpSocketFactory']) + register_Ns3UdpSocket_methods(root_module, root_module['ns3::UdpSocket']) + register_Ns3UdpSocketFactory_methods(root_module, root_module['ns3::UdpSocketFactory']) + register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker']) + register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue']) + register_Ns3Application_methods(root_module, root_module['ns3::Application']) + register_Ns3Channel_methods(root_module, root_module['ns3::Channel']) + register_Ns3DropTailQueue_methods(root_module, root_module['ns3::DropTailQueue']) + register_Ns3EthernetHeader_methods(root_module, root_module['ns3::EthernetHeader']) + register_Ns3EthernetTrailer_methods(root_module, root_module['ns3::EthernetTrailer']) + register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4']) + register_Ns3Ipv4RawSocketFactory_methods(root_module, root_module['ns3::Ipv4RawSocketFactory']) + register_Ns3Ipv4RoutingProtocol_methods(root_module, root_module['ns3::Ipv4RoutingProtocol']) + register_Ns3Ipv6_methods(root_module, root_module['ns3::Ipv6']) + register_Ns3Ipv6RawSocketFactory_methods(root_module, root_module['ns3::Ipv6RawSocketFactory']) + register_Ns3Ipv6RoutingProtocol_methods(root_module, root_module['ns3::Ipv6RoutingProtocol']) + register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice']) + register_Ns3Node_methods(root_module, root_module['ns3::Node']) + register_Ns3PacketSocketFactory_methods(root_module, root_module['ns3::PacketSocketFactory']) + register_Ns3SimpleChannel_methods(root_module, root_module['ns3::SimpleChannel']) + register_Ns3SimpleNetDevice_methods(root_module, root_module['ns3::SimpleNetDevice']) + return + +def register_Ns3Address_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_binary_comparison_operator('<') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## address.h: ns3::Address::Address() [constructor] + cls.add_constructor([]) + ## address.h: ns3::Address::Address(uint8_t type, uint8_t const * buffer, uint8_t len) [constructor] + cls.add_constructor([param('uint8_t', 'type'), param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) + ## address.h: ns3::Address::Address(ns3::Address const & address) [copy constructor] + cls.add_constructor([param('ns3::Address const &', 'address')]) + ## address.h: bool ns3::Address::CheckCompatible(uint8_t type, uint8_t len) const [member function] + cls.add_method('CheckCompatible', + 'bool', + [param('uint8_t', 'type'), param('uint8_t', 'len')], + is_const=True) + ## address.h: uint32_t ns3::Address::CopyAllFrom(uint8_t const * buffer, uint8_t len) [member function] + cls.add_method('CopyAllFrom', + 'uint32_t', + [param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) + ## address.h: uint32_t ns3::Address::CopyAllTo(uint8_t * buffer, uint8_t len) const [member function] + cls.add_method('CopyAllTo', + 'uint32_t', + [param('uint8_t *', 'buffer'), param('uint8_t', 'len')], + is_const=True) + ## address.h: uint32_t ns3::Address::CopyFrom(uint8_t const * buffer, uint8_t len) [member function] + cls.add_method('CopyFrom', + 'uint32_t', + [param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) + ## address.h: uint32_t ns3::Address::CopyTo(uint8_t * buffer) const [member function] + cls.add_method('CopyTo', + 'uint32_t', + [param('uint8_t *', 'buffer')], + is_const=True) + ## address.h: void ns3::Address::Deserialize(ns3::TagBuffer buffer) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'buffer')]) + ## address.h: uint8_t ns3::Address::GetLength() const [member function] + cls.add_method('GetLength', + 'uint8_t', + [], + is_const=True) + ## address.h: uint32_t ns3::Address::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## address.h: bool ns3::Address::IsInvalid() const [member function] + cls.add_method('IsInvalid', + 'bool', + [], + is_const=True) + ## address.h: bool ns3::Address::IsMatchingType(uint8_t type) const [member function] + cls.add_method('IsMatchingType', + 'bool', + [param('uint8_t', 'type')], + is_const=True) + ## address.h: static uint8_t ns3::Address::Register() [member function] + cls.add_method('Register', + 'uint8_t', + [], + is_static=True) + ## address.h: void ns3::Address::Serialize(ns3::TagBuffer buffer) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'buffer')], + is_const=True) + return + +def register_Ns3Inet6SocketAddress_methods(root_module, cls): + ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Inet6SocketAddress const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Inet6SocketAddress const &', 'arg0')]) + ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6, uint16_t port) [constructor] + cls.add_constructor([param('ns3::Ipv6Address', 'ipv6'), param('uint16_t', 'port')]) + ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6) [constructor] + cls.add_constructor([param('ns3::Ipv6Address', 'ipv6')]) + ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(uint16_t port) [constructor] + cls.add_constructor([param('uint16_t', 'port')]) + ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6, uint16_t port) [constructor] + cls.add_constructor([param('char const *', 'ipv6'), param('uint16_t', 'port')]) + ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6) [constructor] + cls.add_constructor([param('char const *', 'ipv6')]) + ## inet6-socket-address.h: static ns3::Inet6SocketAddress ns3::Inet6SocketAddress::ConvertFrom(ns3::Address const & addr) [member function] + cls.add_method('ConvertFrom', + 'ns3::Inet6SocketAddress', + [param('ns3::Address const &', 'addr')], + is_static=True) + ## inet6-socket-address.h: ns3::Ipv6Address ns3::Inet6SocketAddress::GetIpv6() const [member function] + cls.add_method('GetIpv6', + 'ns3::Ipv6Address', + [], + is_const=True) + ## inet6-socket-address.h: uint16_t ns3::Inet6SocketAddress::GetPort() const [member function] + cls.add_method('GetPort', + 'uint16_t', + [], + is_const=True) + ## inet6-socket-address.h: static bool ns3::Inet6SocketAddress::IsMatchingType(ns3::Address const & addr) [member function] + cls.add_method('IsMatchingType', + 'bool', + [param('ns3::Address const &', 'addr')], + is_static=True) + ## inet6-socket-address.h: void ns3::Inet6SocketAddress::SetIpv6(ns3::Ipv6Address ipv6) [member function] + cls.add_method('SetIpv6', + 'void', + [param('ns3::Ipv6Address', 'ipv6')]) + ## inet6-socket-address.h: void ns3::Inet6SocketAddress::SetPort(uint16_t port) [member function] + cls.add_method('SetPort', + 'void', + [param('uint16_t', 'port')]) + return + +def register_Ns3InetSocketAddress_methods(root_module, cls): + ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(ns3::InetSocketAddress const & arg0) [copy constructor] + cls.add_constructor([param('ns3::InetSocketAddress const &', 'arg0')]) + ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4, uint16_t port) [constructor] + cls.add_constructor([param('ns3::Ipv4Address', 'ipv4'), param('uint16_t', 'port')]) + ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4) [constructor] + cls.add_constructor([param('ns3::Ipv4Address', 'ipv4')]) + ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(uint16_t port) [constructor] + cls.add_constructor([param('uint16_t', 'port')]) + ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(char const * ipv4, uint16_t port) [constructor] + cls.add_constructor([param('char const *', 'ipv4'), param('uint16_t', 'port')]) + ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(char const * ipv4) [constructor] + cls.add_constructor([param('char const *', 'ipv4')]) + ## inet-socket-address.h: static ns3::InetSocketAddress ns3::InetSocketAddress::ConvertFrom(ns3::Address const & address) [member function] + cls.add_method('ConvertFrom', + 'ns3::InetSocketAddress', + [param('ns3::Address const &', 'address')], + is_static=True) + ## inet-socket-address.h: ns3::Ipv4Address ns3::InetSocketAddress::GetIpv4() const [member function] + cls.add_method('GetIpv4', + 'ns3::Ipv4Address', + [], + is_const=True) + ## inet-socket-address.h: uint16_t ns3::InetSocketAddress::GetPort() const [member function] + cls.add_method('GetPort', + 'uint16_t', + [], + is_const=True) + ## inet-socket-address.h: static bool ns3::InetSocketAddress::IsMatchingType(ns3::Address const & address) [member function] + cls.add_method('IsMatchingType', + 'bool', + [param('ns3::Address const &', 'address')], + is_static=True) + ## inet-socket-address.h: void ns3::InetSocketAddress::SetIpv4(ns3::Ipv4Address address) [member function] + cls.add_method('SetIpv4', + 'void', + [param('ns3::Ipv4Address', 'address')]) + ## inet-socket-address.h: void ns3::InetSocketAddress::SetPort(uint16_t port) [member function] + cls.add_method('SetPort', + 'void', + [param('uint16_t', 'port')]) + return + +def register_Ns3Ipv4Address_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_binary_comparison_operator('<') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ipv4-address.h: ns3::Ipv4Address::Ipv4Address(ns3::Ipv4Address const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4Address const &', 'arg0')]) + ## ipv4-address.h: ns3::Ipv4Address::Ipv4Address() [constructor] + cls.add_constructor([]) + ## ipv4-address.h: ns3::Ipv4Address::Ipv4Address(uint32_t address) [constructor] + cls.add_constructor([param('uint32_t', 'address')]) + ## ipv4-address.h: ns3::Ipv4Address::Ipv4Address(char const * address) [constructor] + cls.add_constructor([param('char const *', 'address')]) + ## ipv4-address.h: ns3::Ipv4Address ns3::Ipv4Address::CombineMask(ns3::Ipv4Mask const & mask) const [member function] + cls.add_method('CombineMask', + 'ns3::Ipv4Address', + [param('ns3::Ipv4Mask const &', 'mask')], + is_const=True) + ## ipv4-address.h: static ns3::Ipv4Address ns3::Ipv4Address::ConvertFrom(ns3::Address const & address) [member function] + cls.add_method('ConvertFrom', + 'ns3::Ipv4Address', + [param('ns3::Address const &', 'address')], + is_static=True) + ## ipv4-address.h: static ns3::Ipv4Address ns3::Ipv4Address::Deserialize(uint8_t const * buf) [member function] + cls.add_method('Deserialize', + 'ns3::Ipv4Address', + [param('uint8_t const *', 'buf')], + is_static=True) + ## ipv4-address.h: uint32_t ns3::Ipv4Address::Get() const [member function] + cls.add_method('Get', + 'uint32_t', + [], + is_const=True) + ## ipv4-address.h: static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function] + cls.add_method('GetAny', + 'ns3::Ipv4Address', + [], + is_static=True) + ## ipv4-address.h: static ns3::Ipv4Address ns3::Ipv4Address::GetBroadcast() [member function] + cls.add_method('GetBroadcast', + 'ns3::Ipv4Address', + [], + is_static=True) + ## ipv4-address.h: static ns3::Ipv4Address ns3::Ipv4Address::GetLoopback() [member function] + cls.add_method('GetLoopback', + 'ns3::Ipv4Address', + [], + is_static=True) + ## ipv4-address.h: ns3::Ipv4Address ns3::Ipv4Address::GetSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function] + cls.add_method('GetSubnetDirectedBroadcast', + 'ns3::Ipv4Address', + [param('ns3::Ipv4Mask const &', 'mask')], + is_const=True) + ## ipv4-address.h: static ns3::Ipv4Address ns3::Ipv4Address::GetZero() [member function] + cls.add_method('GetZero', + 'ns3::Ipv4Address', + [], + is_static=True) + ## ipv4-address.h: bool ns3::Ipv4Address::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True) + ## ipv4-address.h: bool ns3::Ipv4Address::IsEqual(ns3::Ipv4Address const & other) const [member function] + cls.add_method('IsEqual', + 'bool', + [param('ns3::Ipv4Address const &', 'other')], + is_const=True) + ## ipv4-address.h: static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function] + cls.add_method('IsMatchingType', + 'bool', + [param('ns3::Address const &', 'address')], + is_static=True) + ## ipv4-address.h: bool ns3::Ipv4Address::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True) + ## ipv4-address.h: bool ns3::Ipv4Address::IsSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function] + cls.add_method('IsSubnetDirectedBroadcast', + 'bool', + [param('ns3::Ipv4Mask const &', 'mask')], + is_const=True) + ## ipv4-address.h: void ns3::Ipv4Address::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## ipv4-address.h: void ns3::Ipv4Address::Serialize(uint8_t * buf) const [member function] + cls.add_method('Serialize', + 'void', + [param('uint8_t *', 'buf')], + is_const=True) + ## ipv4-address.h: void ns3::Ipv4Address::Set(uint32_t address) [member function] + cls.add_method('Set', + 'void', + [param('uint32_t', 'address')]) + ## ipv4-address.h: void ns3::Ipv4Address::Set(char const * address) [member function] + cls.add_method('Set', + 'void', + [param('char const *', 'address')]) + return + +def register_Ns3Ipv4AddressGenerator_methods(root_module, cls): + ## ipv4-address-generator.h: ns3::Ipv4AddressGenerator::Ipv4AddressGenerator() [constructor] + cls.add_constructor([]) + ## ipv4-address-generator.h: ns3::Ipv4AddressGenerator::Ipv4AddressGenerator(ns3::Ipv4AddressGenerator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4AddressGenerator const &', 'arg0')]) + ## ipv4-address-generator.h: static bool ns3::Ipv4AddressGenerator::AddAllocated(ns3::Ipv4Address const addr) [member function] + cls.add_method('AddAllocated', + 'bool', + [param('ns3::Ipv4Address const', 'addr')], + is_static=True) + ## ipv4-address-generator.h: static ns3::Ipv4Address ns3::Ipv4AddressGenerator::GetAddress(ns3::Ipv4Mask const mask) [member function] + cls.add_method('GetAddress', + 'ns3::Ipv4Address', + [param('ns3::Ipv4Mask const', 'mask')], + is_static=True) + ## ipv4-address-generator.h: static ns3::Ipv4Address ns3::Ipv4AddressGenerator::GetNetwork(ns3::Ipv4Mask const mask) [member function] + cls.add_method('GetNetwork', + 'ns3::Ipv4Address', + [param('ns3::Ipv4Mask const', 'mask')], + is_static=True) + ## ipv4-address-generator.h: static void ns3::Ipv4AddressGenerator::Init(ns3::Ipv4Address const net, ns3::Ipv4Mask const mask, ns3::Ipv4Address const addr="0.0.0.1") [member function] + cls.add_method('Init', + 'void', + [param('ns3::Ipv4Address const', 'net'), param('ns3::Ipv4Mask const', 'mask'), param('ns3::Ipv4Address const', 'addr', default_value='"0.0.0.1"')], + is_static=True) + ## ipv4-address-generator.h: static void ns3::Ipv4AddressGenerator::InitAddress(ns3::Ipv4Address const addr, ns3::Ipv4Mask const mask) [member function] + cls.add_method('InitAddress', + 'void', + [param('ns3::Ipv4Address const', 'addr'), param('ns3::Ipv4Mask const', 'mask')], + is_static=True) + ## ipv4-address-generator.h: static ns3::Ipv4Address ns3::Ipv4AddressGenerator::NextAddress(ns3::Ipv4Mask const mask) [member function] + cls.add_method('NextAddress', + 'ns3::Ipv4Address', + [param('ns3::Ipv4Mask const', 'mask')], + is_static=True) + ## ipv4-address-generator.h: static ns3::Ipv4Address ns3::Ipv4AddressGenerator::NextNetwork(ns3::Ipv4Mask const mask) [member function] + cls.add_method('NextNetwork', + 'ns3::Ipv4Address', + [param('ns3::Ipv4Mask const', 'mask')], + is_static=True) + ## ipv4-address-generator.h: static void ns3::Ipv4AddressGenerator::Reset() [member function] + cls.add_method('Reset', + 'void', + [], + is_static=True) + ## ipv4-address-generator.h: static void ns3::Ipv4AddressGenerator::TestMode() [member function] + cls.add_method('TestMode', + 'void', + [], + is_static=True) + return + +def register_Ns3Ipv4InterfaceAddress_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ipv4-interface-address.h: ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress() [constructor] + cls.add_constructor([]) + ## ipv4-interface-address.h: ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress(ns3::Ipv4Address local, ns3::Ipv4Mask mask) [constructor] + cls.add_constructor([param('ns3::Ipv4Address', 'local'), param('ns3::Ipv4Mask', 'mask')]) + ## ipv4-interface-address.h: ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress(ns3::Ipv4InterfaceAddress const & o) [copy constructor] + cls.add_constructor([param('ns3::Ipv4InterfaceAddress const &', 'o')]) + ## ipv4-interface-address.h: ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-interface-address.h: ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetLocal() const [member function] + cls.add_method('GetLocal', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-interface-address.h: ns3::Ipv4Mask ns3::Ipv4InterfaceAddress::GetMask() const [member function] + cls.add_method('GetMask', + 'ns3::Ipv4Mask', + [], + is_const=True) + ## ipv4-interface-address.h: ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e ns3::Ipv4InterfaceAddress::GetScope() const [member function] + cls.add_method('GetScope', + 'ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', + [], + is_const=True) + ## ipv4-interface-address.h: bool ns3::Ipv4InterfaceAddress::IsSecondary() const [member function] + cls.add_method('IsSecondary', + 'bool', + [], + is_const=True) + ## ipv4-interface-address.h: void ns3::Ipv4InterfaceAddress::SetBroadcast(ns3::Ipv4Address broadcast) [member function] + cls.add_method('SetBroadcast', + 'void', + [param('ns3::Ipv4Address', 'broadcast')]) + ## ipv4-interface-address.h: void ns3::Ipv4InterfaceAddress::SetLocal(ns3::Ipv4Address local) [member function] + cls.add_method('SetLocal', + 'void', + [param('ns3::Ipv4Address', 'local')]) + ## ipv4-interface-address.h: void ns3::Ipv4InterfaceAddress::SetMask(ns3::Ipv4Mask mask) [member function] + cls.add_method('SetMask', + 'void', + [param('ns3::Ipv4Mask', 'mask')]) + ## ipv4-interface-address.h: void ns3::Ipv4InterfaceAddress::SetPrimary() [member function] + cls.add_method('SetPrimary', + 'void', + []) + ## ipv4-interface-address.h: void ns3::Ipv4InterfaceAddress::SetScope(ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function] + cls.add_method('SetScope', + 'void', + [param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')]) + ## ipv4-interface-address.h: void ns3::Ipv4InterfaceAddress::SetSecondary() [member function] + cls.add_method('SetSecondary', + 'void', + []) + return + +def register_Ns3Ipv4Mask_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ipv4-address.h: ns3::Ipv4Mask::Ipv4Mask(ns3::Ipv4Mask const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4Mask const &', 'arg0')]) + ## ipv4-address.h: ns3::Ipv4Mask::Ipv4Mask() [constructor] + cls.add_constructor([]) + ## ipv4-address.h: ns3::Ipv4Mask::Ipv4Mask(uint32_t mask) [constructor] + cls.add_constructor([param('uint32_t', 'mask')]) + ## ipv4-address.h: ns3::Ipv4Mask::Ipv4Mask(char const * mask) [constructor] + cls.add_constructor([param('char const *', 'mask')]) + ## ipv4-address.h: uint32_t ns3::Ipv4Mask::Get() const [member function] + cls.add_method('Get', + 'uint32_t', + [], + is_const=True) + ## ipv4-address.h: uint32_t ns3::Ipv4Mask::GetInverse() const [member function] + cls.add_method('GetInverse', + 'uint32_t', + [], + is_const=True) + ## ipv4-address.h: static ns3::Ipv4Mask ns3::Ipv4Mask::GetLoopback() [member function] + cls.add_method('GetLoopback', + 'ns3::Ipv4Mask', + [], + is_static=True) + ## ipv4-address.h: static ns3::Ipv4Mask ns3::Ipv4Mask::GetOnes() [member function] + cls.add_method('GetOnes', + 'ns3::Ipv4Mask', + [], + is_static=True) + ## ipv4-address.h: uint16_t ns3::Ipv4Mask::GetPrefixLength() const [member function] + cls.add_method('GetPrefixLength', + 'uint16_t', + [], + is_const=True) + ## ipv4-address.h: static ns3::Ipv4Mask ns3::Ipv4Mask::GetZero() [member function] + cls.add_method('GetZero', + 'ns3::Ipv4Mask', + [], + is_static=True) + ## ipv4-address.h: bool ns3::Ipv4Mask::IsEqual(ns3::Ipv4Mask other) const [member function] + cls.add_method('IsEqual', + 'bool', + [param('ns3::Ipv4Mask', 'other')], + is_const=True) + ## ipv4-address.h: bool ns3::Ipv4Mask::IsMatch(ns3::Ipv4Address a, ns3::Ipv4Address b) const [member function] + cls.add_method('IsMatch', + 'bool', + [param('ns3::Ipv4Address', 'a'), param('ns3::Ipv4Address', 'b')], + is_const=True) + ## ipv4-address.h: void ns3::Ipv4Mask::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## ipv4-address.h: void ns3::Ipv4Mask::Set(uint32_t mask) [member function] + cls.add_method('Set', + 'void', + [param('uint32_t', 'mask')]) + return + +def register_Ns3Ipv6Address_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_binary_comparison_operator('<') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address() [constructor] + cls.add_constructor([]) + ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address(char const * address) [constructor] + cls.add_constructor([param('char const *', 'address')]) + ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address(uint8_t * address) [constructor] + cls.add_constructor([param('uint8_t *', 'address')]) + ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const & addr) [copy constructor] + cls.add_constructor([param('ns3::Ipv6Address const &', 'addr')]) + ## ipv6-address.h: ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const * addr) [constructor] + cls.add_constructor([param('ns3::Ipv6Address const *', 'addr')]) + ## ipv6-address.h: ns3::Ipv6Address ns3::Ipv6Address::CombinePrefix(ns3::Ipv6Prefix const & prefix) [member function] + cls.add_method('CombinePrefix', + 'ns3::Ipv6Address', + [param('ns3::Ipv6Prefix const &', 'prefix')]) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::ConvertFrom(ns3::Address const & address) [member function] + cls.add_method('ConvertFrom', + 'ns3::Ipv6Address', + [param('ns3::Address const &', 'address')], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::Deserialize(uint8_t const * buf) [member function] + cls.add_method('Deserialize', + 'ns3::Ipv6Address', + [param('uint8_t const *', 'buf')], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetAllHostsMulticast() [member function] + cls.add_method('GetAllHostsMulticast', + 'ns3::Ipv6Address', + [], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetAllNodesMulticast() [member function] + cls.add_method('GetAllNodesMulticast', + 'ns3::Ipv6Address', + [], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetAllRoutersMulticast() [member function] + cls.add_method('GetAllRoutersMulticast', + 'ns3::Ipv6Address', + [], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetAny() [member function] + cls.add_method('GetAny', + 'ns3::Ipv6Address', + [], + is_static=True) + ## ipv6-address.h: void ns3::Ipv6Address::GetBytes(uint8_t * buf) const [member function] + cls.add_method('GetBytes', + 'void', + [param('uint8_t *', 'buf')], + is_const=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetLoopback() [member function] + cls.add_method('GetLoopback', + 'ns3::Ipv6Address', + [], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetOnes() [member function] + cls.add_method('GetOnes', + 'ns3::Ipv6Address', + [], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::GetZero() [member function] + cls.add_method('GetZero', + 'ns3::Ipv6Address', + [], + is_static=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsAllHostsMulticast() const [member function] + cls.add_method('IsAllHostsMulticast', + 'bool', + [], + is_const=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsAllNodesMulticast() const [member function] + cls.add_method('IsAllNodesMulticast', + 'bool', + [], + is_const=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsAllRoutersMulticast() const [member function] + cls.add_method('IsAllRoutersMulticast', + 'bool', + [], + is_const=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsAny() const [member function] + cls.add_method('IsAny', + 'bool', + [], + is_const=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsEqual(ns3::Ipv6Address const & other) const [member function] + cls.add_method('IsEqual', + 'bool', + [param('ns3::Ipv6Address const &', 'other')], + is_const=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsLinkLocal() const [member function] + cls.add_method('IsLinkLocal', + 'bool', + [], + is_const=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsLocalhost() const [member function] + cls.add_method('IsLocalhost', + 'bool', + [], + is_const=True) + ## ipv6-address.h: static bool ns3::Ipv6Address::IsMatchingType(ns3::Address const & address) [member function] + cls.add_method('IsMatchingType', + 'bool', + [param('ns3::Address const &', 'address')], + is_static=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True) + ## ipv6-address.h: bool ns3::Ipv6Address::IsSolicitedMulticast() const [member function] + cls.add_method('IsSolicitedMulticast', + 'bool', + [], + is_const=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac48Address addr, ns3::Ipv6Address prefix) [member function] + cls.add_method('MakeAutoconfiguredAddress', + 'ns3::Ipv6Address', + [param('ns3::Mac48Address', 'addr'), param('ns3::Ipv6Address', 'prefix')], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac48Address mac) [member function] + cls.add_method('MakeAutoconfiguredLinkLocalAddress', + 'ns3::Ipv6Address', + [param('ns3::Mac48Address', 'mac')], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Address ns3::Ipv6Address::MakeSolicitedAddress(ns3::Ipv6Address addr) [member function] + cls.add_method('MakeSolicitedAddress', + 'ns3::Ipv6Address', + [param('ns3::Ipv6Address', 'addr')], + is_static=True) + ## ipv6-address.h: void ns3::Ipv6Address::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## ipv6-address.h: void ns3::Ipv6Address::Serialize(uint8_t * buf) const [member function] + cls.add_method('Serialize', + 'void', + [param('uint8_t *', 'buf')], + is_const=True) + ## ipv6-address.h: void ns3::Ipv6Address::Set(char const * address) [member function] + cls.add_method('Set', + 'void', + [param('char const *', 'address')]) + ## ipv6-address.h: void ns3::Ipv6Address::Set(uint8_t * address) [member function] + cls.add_method('Set', + 'void', + [param('uint8_t *', 'address')]) + return + +def register_Ns3Ipv6InterfaceAddress_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress() [constructor] + cls.add_constructor([]) + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress(ns3::Ipv6Address address) [constructor] + cls.add_constructor([param('ns3::Ipv6Address', 'address')]) + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress(ns3::Ipv6Address address, ns3::Ipv6Prefix prefix) [constructor] + cls.add_constructor([param('ns3::Ipv6Address', 'address'), param('ns3::Ipv6Prefix', 'prefix')]) + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress(ns3::Ipv6InterfaceAddress const & o) [copy constructor] + cls.add_constructor([param('ns3::Ipv6InterfaceAddress const &', 'o')]) + ## ipv6-interface-address.h: ns3::Ipv6Address ns3::Ipv6InterfaceAddress::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-interface-address.h: uint32_t ns3::Ipv6InterfaceAddress::GetNsDadUid() const [member function] + cls.add_method('GetNsDadUid', + 'uint32_t', + [], + is_const=True) + ## ipv6-interface-address.h: ns3::Ipv6Prefix ns3::Ipv6InterfaceAddress::GetPrefix() const [member function] + cls.add_method('GetPrefix', + 'ns3::Ipv6Prefix', + [], + is_const=True) + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress::Scope_e ns3::Ipv6InterfaceAddress::GetScope() const [member function] + cls.add_method('GetScope', + 'ns3::Ipv6InterfaceAddress::Scope_e', + [], + is_const=True) + ## ipv6-interface-address.h: ns3::Ipv6InterfaceAddress::State_e ns3::Ipv6InterfaceAddress::GetState() const [member function] + cls.add_method('GetState', + 'ns3::Ipv6InterfaceAddress::State_e', + [], + is_const=True) + ## ipv6-interface-address.h: void ns3::Ipv6InterfaceAddress::SetAddress(ns3::Ipv6Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Ipv6Address', 'address')]) + ## ipv6-interface-address.h: void ns3::Ipv6InterfaceAddress::SetNsDadUid(uint32_t uid) [member function] + cls.add_method('SetNsDadUid', + 'void', + [param('uint32_t', 'uid')]) + ## ipv6-interface-address.h: void ns3::Ipv6InterfaceAddress::SetScope(ns3::Ipv6InterfaceAddress::Scope_e scope) [member function] + cls.add_method('SetScope', + 'void', + [param('ns3::Ipv6InterfaceAddress::Scope_e', 'scope')]) + ## ipv6-interface-address.h: void ns3::Ipv6InterfaceAddress::SetState(ns3::Ipv6InterfaceAddress::State_e state) [member function] + cls.add_method('SetState', + 'void', + [param('ns3::Ipv6InterfaceAddress::State_e', 'state')]) + return + +def register_Ns3Ipv6Prefix_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix() [constructor] + cls.add_constructor([]) + ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(uint8_t * prefix) [constructor] + cls.add_constructor([param('uint8_t *', 'prefix')]) + ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(char const * prefix) [constructor] + cls.add_constructor([param('char const *', 'prefix')]) + ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(uint8_t prefix) [constructor] + cls.add_constructor([param('uint8_t', 'prefix')]) + ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const & prefix) [copy constructor] + cls.add_constructor([param('ns3::Ipv6Prefix const &', 'prefix')]) + ## ipv6-address.h: ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const * prefix) [constructor] + cls.add_constructor([param('ns3::Ipv6Prefix const *', 'prefix')]) + ## ipv6-address.h: void ns3::Ipv6Prefix::GetBytes(uint8_t * buf) const [member function] + cls.add_method('GetBytes', + 'void', + [param('uint8_t *', 'buf')], + is_const=True) + ## ipv6-address.h: static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetLoopback() [member function] + cls.add_method('GetLoopback', + 'ns3::Ipv6Prefix', + [], + is_static=True) + ## ipv6-address.h: static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetOnes() [member function] + cls.add_method('GetOnes', + 'ns3::Ipv6Prefix', + [], + is_static=True) + ## ipv6-address.h: uint8_t ns3::Ipv6Prefix::GetPrefixLength() const [member function] + cls.add_method('GetPrefixLength', + 'uint8_t', + [], + is_const=True) + ## ipv6-address.h: static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetZero() [member function] + cls.add_method('GetZero', + 'ns3::Ipv6Prefix', + [], + is_static=True) + ## ipv6-address.h: bool ns3::Ipv6Prefix::IsEqual(ns3::Ipv6Prefix const & other) const [member function] + cls.add_method('IsEqual', + 'bool', + [param('ns3::Ipv6Prefix const &', 'other')], + is_const=True) + ## ipv6-address.h: bool ns3::Ipv6Prefix::IsMatch(ns3::Ipv6Address a, ns3::Ipv6Address b) const [member function] + cls.add_method('IsMatch', + 'bool', + [param('ns3::Ipv6Address', 'a'), param('ns3::Ipv6Address', 'b')], + is_const=True) + ## ipv6-address.h: void ns3::Ipv6Prefix::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + return + +def register_Ns3Mac48Address_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_binary_comparison_operator('<') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## mac48-address.h: ns3::Mac48Address::Mac48Address(ns3::Mac48Address const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Mac48Address const &', 'arg0')]) + ## mac48-address.h: ns3::Mac48Address::Mac48Address() [constructor] + cls.add_constructor([]) + ## mac48-address.h: ns3::Mac48Address::Mac48Address(char const * str) [constructor] + cls.add_constructor([param('char const *', 'str')]) + ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::Allocate() [member function] + cls.add_method('Allocate', + 'ns3::Mac48Address', + [], + is_static=True) + ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::ConvertFrom(ns3::Address const & address) [member function] + cls.add_method('ConvertFrom', + 'ns3::Mac48Address', + [param('ns3::Address const &', 'address')], + is_static=True) + ## mac48-address.h: void ns3::Mac48Address::CopyFrom(uint8_t const * buffer) [member function] + cls.add_method('CopyFrom', + 'void', + [param('uint8_t const *', 'buffer')]) + ## mac48-address.h: void ns3::Mac48Address::CopyTo(uint8_t * buffer) const [member function] + cls.add_method('CopyTo', + 'void', + [param('uint8_t *', 'buffer')], + is_const=True) + ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::GetBroadcast() [member function] + cls.add_method('GetBroadcast', + 'ns3::Mac48Address', + [], + is_static=True) + ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv4Address address) [member function] + cls.add_method('GetMulticast', + 'ns3::Mac48Address', + [param('ns3::Ipv4Address', 'address')], + is_static=True) + ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv6Address address) [member function] + cls.add_method('GetMulticast', + 'ns3::Mac48Address', + [param('ns3::Ipv6Address', 'address')], + is_static=True) + ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::GetMulticast6Prefix() [member function] + cls.add_method('GetMulticast6Prefix', + 'ns3::Mac48Address', + [], + is_static=True) + ## mac48-address.h: static ns3::Mac48Address ns3::Mac48Address::GetMulticastPrefix() [member function] + cls.add_method('GetMulticastPrefix', + 'ns3::Mac48Address', + [], + is_static=True) + ## mac48-address.h: bool ns3::Mac48Address::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True) + ## mac48-address.h: bool ns3::Mac48Address::IsGroup() const [member function] + cls.add_method('IsGroup', + 'bool', + [], + is_const=True) + ## mac48-address.h: static bool ns3::Mac48Address::IsMatchingType(ns3::Address const & address) [member function] + cls.add_method('IsMatchingType', + 'bool', + [param('ns3::Address const &', 'address')], + is_static=True) + return + +def register_Ns3Mac64Address_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## mac64-address.h: ns3::Mac64Address::Mac64Address(ns3::Mac64Address const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Mac64Address const &', 'arg0')]) + ## mac64-address.h: ns3::Mac64Address::Mac64Address() [constructor] + cls.add_constructor([]) + ## mac64-address.h: ns3::Mac64Address::Mac64Address(char const * str) [constructor] + cls.add_constructor([param('char const *', 'str')]) + ## mac64-address.h: static ns3::Mac64Address ns3::Mac64Address::Allocate() [member function] + cls.add_method('Allocate', + 'ns3::Mac64Address', + [], + is_static=True) + ## mac64-address.h: static ns3::Mac64Address ns3::Mac64Address::ConvertFrom(ns3::Address const & address) [member function] + cls.add_method('ConvertFrom', + 'ns3::Mac64Address', + [param('ns3::Address const &', 'address')], + is_static=True) + ## mac64-address.h: void ns3::Mac64Address::CopyFrom(uint8_t const * buffer) [member function] + cls.add_method('CopyFrom', + 'void', + [param('uint8_t const *', 'buffer')]) + ## mac64-address.h: void ns3::Mac64Address::CopyTo(uint8_t * buffer) const [member function] + cls.add_method('CopyTo', + 'void', + [param('uint8_t *', 'buffer')], + is_const=True) + ## mac64-address.h: static bool ns3::Mac64Address::IsMatchingType(ns3::Address const & address) [member function] + cls.add_method('IsMatchingType', + 'bool', + [param('ns3::Address const &', 'address')], + is_static=True) + return + +def register_Ns3NodeList_methods(root_module, cls): + ## node-list.h: ns3::NodeList::NodeList() [constructor] + cls.add_constructor([]) + ## node-list.h: ns3::NodeList::NodeList(ns3::NodeList const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NodeList const &', 'arg0')]) + ## node-list.h: static uint32_t ns3::NodeList::Add(ns3::Ptr node) [member function] + cls.add_method('Add', + 'uint32_t', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_static=True) + ## node-list.h: static __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::NodeList::Begin() [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', + [], + is_static=True) + ## node-list.h: static __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::NodeList::End() [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', + [], + is_static=True) + ## node-list.h: static uint32_t ns3::NodeList::GetNNodes() [member function] + cls.add_method('GetNNodes', + 'uint32_t', + [], + is_static=True) + ## node-list.h: static ns3::Ptr ns3::NodeList::GetNode(uint32_t n) [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'n')], + is_static=True) + return + +def register_Ns3PacketSocketAddress_methods(root_module, cls): + ## packet-socket-address.h: ns3::PacketSocketAddress::PacketSocketAddress(ns3::PacketSocketAddress const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSocketAddress const &', 'arg0')]) + ## packet-socket-address.h: ns3::PacketSocketAddress::PacketSocketAddress() [constructor] + cls.add_constructor([]) + ## packet-socket-address.h: static ns3::PacketSocketAddress ns3::PacketSocketAddress::ConvertFrom(ns3::Address const & address) [member function] + cls.add_method('ConvertFrom', + 'ns3::PacketSocketAddress', + [param('ns3::Address const &', 'address')], + is_static=True) + ## packet-socket-address.h: ns3::Address ns3::PacketSocketAddress::GetPhysicalAddress() const [member function] + cls.add_method('GetPhysicalAddress', + 'ns3::Address', + [], + is_const=True) + ## packet-socket-address.h: uint16_t ns3::PacketSocketAddress::GetProtocol() const [member function] + cls.add_method('GetProtocol', + 'uint16_t', + [], + is_const=True) + ## packet-socket-address.h: uint32_t ns3::PacketSocketAddress::GetSingleDevice() const [member function] + cls.add_method('GetSingleDevice', + 'uint32_t', + [], + is_const=True) + ## packet-socket-address.h: static bool ns3::PacketSocketAddress::IsMatchingType(ns3::Address const & address) [member function] + cls.add_method('IsMatchingType', + 'bool', + [param('ns3::Address const &', 'address')], + is_static=True) + ## packet-socket-address.h: bool ns3::PacketSocketAddress::IsSingleDevice() const [member function] + cls.add_method('IsSingleDevice', + 'bool', + [], + is_const=True) + ## packet-socket-address.h: void ns3::PacketSocketAddress::SetAllDevices() [member function] + cls.add_method('SetAllDevices', + 'void', + []) + ## packet-socket-address.h: void ns3::PacketSocketAddress::SetPhysicalAddress(ns3::Address const address) [member function] + cls.add_method('SetPhysicalAddress', + 'void', + [param('ns3::Address const', 'address')]) + ## packet-socket-address.h: void ns3::PacketSocketAddress::SetProtocol(uint16_t protocol) [member function] + cls.add_method('SetProtocol', + 'void', + [param('uint16_t', 'protocol')]) + ## packet-socket-address.h: void ns3::PacketSocketAddress::SetSingleDevice(uint32_t device) [member function] + cls.add_method('SetSingleDevice', + 'void', + [param('uint32_t', 'device')]) + return + +def register_Ns3PbbAddressBlock_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbAddressBlock::PbbAddressBlock(ns3::PbbAddressBlock const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressBlock const &', 'arg0')]) + ## packetbb.h: ns3::PbbAddressBlock::PbbAddressBlock() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Address ns3::PbbAddressBlock::AddressBack() const [member function] + cls.add_method('AddressBack', + 'ns3::Address', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressBegin() [member function] + cls.add_method('AddressBegin', + 'std::_List_iterator< ns3::Address >', + []) + ## packetbb.h: std::_List_const_iterator ns3::PbbAddressBlock::AddressBegin() const [member function] + cls.add_method('AddressBegin', + 'std::_List_const_iterator< ns3::Address >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::AddressClear() [member function] + cls.add_method('AddressClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbAddressBlock::AddressEmpty() const [member function] + cls.add_method('AddressEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressEnd() [member function] + cls.add_method('AddressEnd', + 'std::_List_iterator< ns3::Address >', + []) + ## packetbb.h: std::_List_const_iterator ns3::PbbAddressBlock::AddressEnd() const [member function] + cls.add_method('AddressEnd', + 'std::_List_const_iterator< ns3::Address >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressErase(std::_List_iterator position) [member function] + cls.add_method('AddressErase', + 'std::_List_iterator< ns3::Address >', + [param('std::_List_iterator< ns3::Address >', 'position')]) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressErase(std::_List_iterator first, std::_List_iterator last) [member function] + cls.add_method('AddressErase', + 'std::_List_iterator< ns3::Address >', + [param('std::_List_iterator< ns3::Address >', 'first'), param('std::_List_iterator< ns3::Address >', 'last')]) + ## packetbb.h: ns3::Address ns3::PbbAddressBlock::AddressFront() const [member function] + cls.add_method('AddressFront', + 'ns3::Address', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::AddressInsert(std::_List_iterator position, ns3::Address const value) [member function] + cls.add_method('AddressInsert', + 'std::_List_iterator< ns3::Address >', + [param('std::_List_iterator< ns3::Address >', 'position'), param('ns3::Address const', 'value')]) + ## packetbb.h: void ns3::PbbAddressBlock::AddressPopBack() [member function] + cls.add_method('AddressPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::AddressPopFront() [member function] + cls.add_method('AddressPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::AddressPushBack(ns3::Address address) [member function] + cls.add_method('AddressPushBack', + 'void', + [param('ns3::Address', 'address')]) + ## packetbb.h: void ns3::PbbAddressBlock::AddressPushFront(ns3::Address address) [member function] + cls.add_method('AddressPushFront', + 'void', + [param('ns3::Address', 'address')]) + ## packetbb.h: int ns3::PbbAddressBlock::AddressSize() const [member function] + cls.add_method('AddressSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: uint32_t ns3::PbbAddressBlock::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbAddressBlock::PrefixBack() const [member function] + cls.add_method('PrefixBack', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixBegin() [member function] + cls.add_method('PrefixBegin', + 'std::_List_iterator< unsigned char >', + []) + ## packetbb.h: std::_List_const_iterator ns3::PbbAddressBlock::PrefixBegin() const [member function] + cls.add_method('PrefixBegin', + 'std::_List_const_iterator< unsigned char >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixClear() [member function] + cls.add_method('PrefixClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbAddressBlock::PrefixEmpty() const [member function] + cls.add_method('PrefixEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixEnd() [member function] + cls.add_method('PrefixEnd', + 'std::_List_iterator< unsigned char >', + []) + ## packetbb.h: std::_List_const_iterator ns3::PbbAddressBlock::PrefixEnd() const [member function] + cls.add_method('PrefixEnd', + 'std::_List_const_iterator< unsigned char >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixErase(std::_List_iterator position) [member function] + cls.add_method('PrefixErase', + 'std::_List_iterator< unsigned char >', + [param('std::_List_iterator< unsigned char >', 'position')]) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixErase(std::_List_iterator first, std::_List_iterator last) [member function] + cls.add_method('PrefixErase', + 'std::_List_iterator< unsigned char >', + [param('std::_List_iterator< unsigned char >', 'first'), param('std::_List_iterator< unsigned char >', 'last')]) + ## packetbb.h: uint8_t ns3::PbbAddressBlock::PrefixFront() const [member function] + cls.add_method('PrefixFront', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: std::_List_iterator ns3::PbbAddressBlock::PrefixInsert(std::_List_iterator position, uint8_t const value) [member function] + cls.add_method('PrefixInsert', + 'std::_List_iterator< unsigned char >', + [param('std::_List_iterator< unsigned char >', 'position'), param('uint8_t const', 'value')]) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixPopBack() [member function] + cls.add_method('PrefixPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixPopFront() [member function] + cls.add_method('PrefixPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixPushBack(uint8_t prefix) [member function] + cls.add_method('PrefixPushBack', + 'void', + [param('uint8_t', 'prefix')]) + ## packetbb.h: void ns3::PbbAddressBlock::PrefixPushFront(uint8_t prefix) [member function] + cls.add_method('PrefixPushFront', + 'void', + [param('uint8_t', 'prefix')]) + ## packetbb.h: int ns3::PbbAddressBlock::PrefixSize() const [member function] + cls.add_method('PrefixSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbAddressBlock::TlvBack() [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbAddressTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbAddressBlock::TlvBack() const [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbAddressTlv > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvBegin() [member function] + cls.add_method('TlvBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbAddressBlock::TlvBegin() const [member function] + cls.add_method('TlvBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::TlvClear() [member function] + cls.add_method('TlvClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbAddressBlock::TlvEmpty() const [member function] + cls.add_method('TlvEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvEnd() [member function] + cls.add_method('TlvEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbAddressBlock::TlvEnd() const [member function] + cls.add_method('TlvEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvErase(std::_List_iterator > position) [member function] + cls.add_method('TlvErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvErase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('TlvErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbAddressBlock::TlvFront() [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbAddressTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbAddressBlock::TlvFront() const [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbAddressTlv > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressBlock::TlvInsert(std::_List_iterator > position, ns3::Ptr const value) [member function] + cls.add_method('TlvInsert', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position'), param('ns3::Ptr< ns3::PbbTlv > const', 'value')]) + ## packetbb.h: void ns3::PbbAddressBlock::TlvPopBack() [member function] + cls.add_method('TlvPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::TlvPopFront() [member function] + cls.add_method('TlvPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressBlock::TlvPushBack(ns3::Ptr address) [member function] + cls.add_method('TlvPushBack', + 'void', + [param('ns3::Ptr< ns3::PbbAddressTlv >', 'address')]) + ## packetbb.h: void ns3::PbbAddressBlock::TlvPushFront(ns3::Ptr address) [member function] + cls.add_method('TlvPushFront', + 'void', + [param('ns3::Ptr< ns3::PbbAddressTlv >', 'address')]) + ## packetbb.h: int ns3::PbbAddressBlock::TlvSize() const [member function] + cls.add_method('TlvSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressBlock::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## packetbb.h: ns3::Address ns3::PbbAddressBlock::DeserializeAddress(uint8_t * buffer) const [member function] + cls.add_method('DeserializeAddress', + 'ns3::Address', + [param('uint8_t *', 'buffer')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: uint8_t ns3::PbbAddressBlock::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'uint8_t', + [], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlock::PrintAddress(std::ostream & os, std::_List_const_iterator iter) const [member function] + cls.add_method('PrintAddress', + 'void', + [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlock::SerializeAddress(uint8_t * buffer, std::_List_const_iterator iter) const [member function] + cls.add_method('SerializeAddress', + 'void', + [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbAddressBlockIpv4_methods(root_module, cls): + ## packetbb.h: ns3::PbbAddressBlockIpv4::PbbAddressBlockIpv4(ns3::PbbAddressBlockIpv4 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressBlockIpv4 const &', 'arg0')]) + ## packetbb.h: ns3::PbbAddressBlockIpv4::PbbAddressBlockIpv4() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Address ns3::PbbAddressBlockIpv4::DeserializeAddress(uint8_t * buffer) const [member function] + cls.add_method('DeserializeAddress', + 'ns3::Address', + [param('uint8_t *', 'buffer')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: uint8_t ns3::PbbAddressBlockIpv4::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'uint8_t', + [], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlockIpv4::PrintAddress(std::ostream & os, std::_List_const_iterator iter) const [member function] + cls.add_method('PrintAddress', + 'void', + [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlockIpv4::SerializeAddress(uint8_t * buffer, std::_List_const_iterator iter) const [member function] + cls.add_method('SerializeAddress', + 'void', + [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbAddressBlockIpv6_methods(root_module, cls): + ## packetbb.h: ns3::PbbAddressBlockIpv6::PbbAddressBlockIpv6(ns3::PbbAddressBlockIpv6 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressBlockIpv6 const &', 'arg0')]) + ## packetbb.h: ns3::PbbAddressBlockIpv6::PbbAddressBlockIpv6() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Address ns3::PbbAddressBlockIpv6::DeserializeAddress(uint8_t * buffer) const [member function] + cls.add_method('DeserializeAddress', + 'ns3::Address', + [param('uint8_t *', 'buffer')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: uint8_t ns3::PbbAddressBlockIpv6::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'uint8_t', + [], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlockIpv6::PrintAddress(std::ostream & os, std::_List_const_iterator iter) const [member function] + cls.add_method('PrintAddress', + 'void', + [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbAddressBlockIpv6::SerializeAddress(uint8_t * buffer, std::_List_const_iterator iter) const [member function] + cls.add_method('SerializeAddress', + 'void', + [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], + is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbAddressTlvBlock_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbAddressTlvBlock::PbbAddressTlvBlock() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::PbbAddressTlvBlock::PbbAddressTlvBlock(ns3::PbbAddressTlvBlock const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressTlvBlock const &', 'arg0')]) + ## packetbb.h: ns3::Ptr ns3::PbbAddressTlvBlock::Back() const [member function] + cls.add_method('Back', + 'ns3::Ptr< ns3::PbbAddressTlv >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::Begin() [member function] + cls.add_method('Begin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbAddressTlvBlock::Begin() const [member function] + cls.add_method('Begin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Clear() [member function] + cls.add_method('Clear', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: bool ns3::PbbAddressTlvBlock::Empty() const [member function] + cls.add_method('Empty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::End() [member function] + cls.add_method('End', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbAddressTlvBlock::End() const [member function] + cls.add_method('End', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::Erase(std::_List_iterator > position) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::Erase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbAddressTlvBlock::Front() const [member function] + cls.add_method('Front', + 'ns3::Ptr< ns3::PbbAddressTlv >', + [], + is_const=True) + ## packetbb.h: uint32_t ns3::PbbAddressTlvBlock::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbAddressTlvBlock::Insert(std::_List_iterator > position, ns3::Ptr const tlv) [member function] + cls.add_method('Insert', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position'), param('ns3::Ptr< ns3::PbbAddressTlv > const', 'tlv')]) + ## packetbb.h: void ns3::PbbAddressTlvBlock::PopBack() [member function] + cls.add_method('PopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressTlvBlock::PopFront() [member function] + cls.add_method('PopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbAddressTlvBlock::PushBack(ns3::Ptr tlv) [member function] + cls.add_method('PushBack', + 'void', + [param('ns3::Ptr< ns3::PbbAddressTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbAddressTlvBlock::PushFront(ns3::Ptr tlv) [member function] + cls.add_method('PushFront', + 'void', + [param('ns3::Ptr< ns3::PbbAddressTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbAddressTlvBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: int ns3::PbbAddressTlvBlock::Size() const [member function] + cls.add_method('Size', + 'int', + [], + is_const=True) + return + +def register_Ns3PbbMessage_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbMessage::PbbMessage(ns3::PbbMessage const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbMessage const &', 'arg0')]) + ## packetbb.h: ns3::PbbMessage::PbbMessage() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::AddressBlockBack() [member function] + cls.add_method('AddressBlockBack', + 'ns3::Ptr< ns3::PbbAddressBlock >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbMessage::AddressBlockBack() const [member function] + cls.add_method('AddressBlockBack', + 'ns3::Ptr< ns3::PbbAddressBlock > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::AddressBlockBegin() [member function] + cls.add_method('AddressBlockBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbMessage::AddressBlockBegin() const [member function] + cls.add_method('AddressBlockBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::AddressBlockClear() [member function] + cls.add_method('AddressBlockClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbMessage::AddressBlockEmpty() const [member function] + cls.add_method('AddressBlockEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::AddressBlockEnd() [member function] + cls.add_method('AddressBlockEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbMessage::AddressBlockEnd() const [member function] + cls.add_method('AddressBlockEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::AddressBlockErase(std::_List_iterator > position) [member function] + cls.add_method('AddressBlockErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::AddressBlockErase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('AddressBlockErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::AddressBlockFront() [member function] + cls.add_method('AddressBlockFront', + 'ns3::Ptr< ns3::PbbAddressBlock >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbMessage::AddressBlockFront() const [member function] + cls.add_method('AddressBlockFront', + 'ns3::Ptr< ns3::PbbAddressBlock > const', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::AddressBlockPopBack() [member function] + cls.add_method('AddressBlockPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbMessage::AddressBlockPopFront() [member function] + cls.add_method('AddressBlockPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbMessage::AddressBlockPushBack(ns3::Ptr block) [member function] + cls.add_method('AddressBlockPushBack', + 'void', + [param('ns3::Ptr< ns3::PbbAddressBlock >', 'block')]) + ## packetbb.h: void ns3::PbbMessage::AddressBlockPushFront(ns3::Ptr block) [member function] + cls.add_method('AddressBlockPushFront', + 'void', + [param('ns3::Ptr< ns3::PbbAddressBlock >', 'block')]) + ## packetbb.h: int ns3::PbbMessage::AddressBlockSize() const [member function] + cls.add_method('AddressBlockSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: static ns3::Ptr ns3::PbbMessage::DeserializeMessage(ns3::Buffer::Iterator & start) [member function] + cls.add_method('DeserializeMessage', + 'ns3::Ptr< ns3::PbbMessage >', + [param('ns3::Buffer::Iterator &', 'start')], + is_static=True) + ## packetbb.h: uint8_t ns3::PbbMessage::GetHopCount() const [member function] + cls.add_method('GetHopCount', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbMessage::GetHopLimit() const [member function] + cls.add_method('GetHopLimit', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: ns3::Address ns3::PbbMessage::GetOriginatorAddress() const [member function] + cls.add_method('GetOriginatorAddress', + 'ns3::Address', + [], + is_const=True) + ## packetbb.h: uint16_t ns3::PbbMessage::GetSequenceNumber() const [member function] + cls.add_method('GetSequenceNumber', + 'uint16_t', + [], + is_const=True) + ## packetbb.h: uint32_t ns3::PbbMessage::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbMessage::GetType() const [member function] + cls.add_method('GetType', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbMessage::HasHopCount() const [member function] + cls.add_method('HasHopCount', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbMessage::HasHopLimit() const [member function] + cls.add_method('HasHopLimit', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbMessage::HasOriginatorAddress() const [member function] + cls.add_method('HasOriginatorAddress', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbMessage::HasSequenceNumber() const [member function] + cls.add_method('HasSequenceNumber', + 'bool', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::SetHopCount(uint8_t hopcount) [member function] + cls.add_method('SetHopCount', + 'void', + [param('uint8_t', 'hopcount')]) + ## packetbb.h: void ns3::PbbMessage::SetHopLimit(uint8_t hoplimit) [member function] + cls.add_method('SetHopLimit', + 'void', + [param('uint8_t', 'hoplimit')]) + ## packetbb.h: void ns3::PbbMessage::SetOriginatorAddress(ns3::Address address) [member function] + cls.add_method('SetOriginatorAddress', + 'void', + [param('ns3::Address', 'address')]) + ## packetbb.h: void ns3::PbbMessage::SetSequenceNumber(uint16_t seqnum) [member function] + cls.add_method('SetSequenceNumber', + 'void', + [param('uint16_t', 'seqnum')]) + ## packetbb.h: void ns3::PbbMessage::SetType(uint8_t type) [member function] + cls.add_method('SetType', + 'void', + [param('uint8_t', 'type')]) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::TlvBack() [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbMessage::TlvBack() const [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbTlv > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::TlvBegin() [member function] + cls.add_method('TlvBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbMessage::TlvBegin() const [member function] + cls.add_method('TlvBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::TlvClear() [member function] + cls.add_method('TlvClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbMessage::TlvEmpty() const [member function] + cls.add_method('TlvEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::TlvEnd() [member function] + cls.add_method('TlvEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbMessage::TlvEnd() const [member function] + cls.add_method('TlvEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::TlvErase(std::_List_iterator > position) [member function] + cls.add_method('TlvErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbMessage::TlvErase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('TlvErase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::TlvFront() [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbMessage::TlvFront() const [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbTlv > const', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::TlvPopBack() [member function] + cls.add_method('TlvPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbMessage::TlvPopFront() [member function] + cls.add_method('TlvPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbMessage::TlvPushBack(ns3::Ptr tlv) [member function] + cls.add_method('TlvPushBack', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbMessage::TlvPushFront(ns3::Ptr tlv) [member function] + cls.add_method('TlvPushFront', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: int ns3::PbbMessage::TlvSize() const [member function] + cls.add_method('TlvSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbMessage::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbMessage::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('AddressBlockDeserialize', + 'ns3::Ptr< ns3::PbbAddressBlock >', + [param('ns3::Buffer::Iterator &', 'start')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::Address ns3::PbbMessage::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('DeserializeOriginatorAddress', + 'ns3::Address', + [param('ns3::Buffer::Iterator &', 'start')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::PbbAddressLength ns3::PbbMessage::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'ns3::PbbAddressLength', + [], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessage::PrintOriginatorAddress(std::ostream & os) const [member function] + cls.add_method('PrintOriginatorAddress', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessage::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('SerializeOriginatorAddress', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbMessageIpv4_methods(root_module, cls): + ## packetbb.h: ns3::PbbMessageIpv4::PbbMessageIpv4(ns3::PbbMessageIpv4 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbMessageIpv4 const &', 'arg0')]) + ## packetbb.h: ns3::PbbMessageIpv4::PbbMessageIpv4() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Ptr ns3::PbbMessageIpv4::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('AddressBlockDeserialize', + 'ns3::Ptr< ns3::PbbAddressBlock >', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::Address ns3::PbbMessageIpv4::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('DeserializeOriginatorAddress', + 'ns3::Address', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::PbbAddressLength ns3::PbbMessageIpv4::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'ns3::PbbAddressLength', + [], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessageIpv4::PrintOriginatorAddress(std::ostream & os) const [member function] + cls.add_method('PrintOriginatorAddress', + 'void', + [param('std::ostream &', 'os')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessageIpv4::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('SerializeOriginatorAddress', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbMessageIpv6_methods(root_module, cls): + ## packetbb.h: ns3::PbbMessageIpv6::PbbMessageIpv6(ns3::PbbMessageIpv6 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbMessageIpv6 const &', 'arg0')]) + ## packetbb.h: ns3::PbbMessageIpv6::PbbMessageIpv6() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::Ptr ns3::PbbMessageIpv6::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('AddressBlockDeserialize', + 'ns3::Ptr< ns3::PbbAddressBlock >', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::Address ns3::PbbMessageIpv6::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('DeserializeOriginatorAddress', + 'ns3::Address', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: ns3::PbbAddressLength ns3::PbbMessageIpv6::GetAddressLength() const [member function] + cls.add_method('GetAddressLength', + 'ns3::PbbAddressLength', + [], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessageIpv6::PrintOriginatorAddress(std::ostream & os) const [member function] + cls.add_method('PrintOriginatorAddress', + 'void', + [param('std::ostream &', 'os')], + is_const=True, visibility='protected', is_virtual=True) + ## packetbb.h: void ns3::PbbMessageIpv6::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('SerializeOriginatorAddress', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected', is_virtual=True) + return + +def register_Ns3PbbTlv_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbTlv::PbbTlv(ns3::PbbTlv const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbTlv const &', 'arg0')]) + ## packetbb.h: ns3::PbbTlv::PbbTlv() [constructor] + cls.add_constructor([]) + ## packetbb.h: void ns3::PbbTlv::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: uint32_t ns3::PbbTlv::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbTlv::GetType() const [member function] + cls.add_method('GetType', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbTlv::GetTypeExt() const [member function] + cls.add_method('GetTypeExt', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: ns3::Buffer ns3::PbbTlv::GetValue() const [member function] + cls.add_method('GetValue', + 'ns3::Buffer', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbTlv::HasTypeExt() const [member function] + cls.add_method('HasTypeExt', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbTlv::HasValue() const [member function] + cls.add_method('HasValue', + 'bool', + [], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: void ns3::PbbTlv::SetType(uint8_t type) [member function] + cls.add_method('SetType', + 'void', + [param('uint8_t', 'type')]) + ## packetbb.h: void ns3::PbbTlv::SetTypeExt(uint8_t type) [member function] + cls.add_method('SetTypeExt', + 'void', + [param('uint8_t', 'type')]) + ## packetbb.h: void ns3::PbbTlv::SetValue(ns3::Buffer start) [member function] + cls.add_method('SetValue', + 'void', + [param('ns3::Buffer', 'start')]) + ## packetbb.h: void ns3::PbbTlv::SetValue(uint8_t const * buffer, uint32_t size) [member function] + cls.add_method('SetValue', + 'void', + [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) + ## packetbb.h: void ns3::PbbTlv::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbTlv::GetIndexStart() const [member function] + cls.add_method('GetIndexStart', + 'uint8_t', + [], + is_const=True, visibility='protected') + ## packetbb.h: uint8_t ns3::PbbTlv::GetIndexStop() const [member function] + cls.add_method('GetIndexStop', + 'uint8_t', + [], + is_const=True, visibility='protected') + ## packetbb.h: bool ns3::PbbTlv::HasIndexStart() const [member function] + cls.add_method('HasIndexStart', + 'bool', + [], + is_const=True, visibility='protected') + ## packetbb.h: bool ns3::PbbTlv::HasIndexStop() const [member function] + cls.add_method('HasIndexStop', + 'bool', + [], + is_const=True, visibility='protected') + ## packetbb.h: bool ns3::PbbTlv::IsMultivalue() const [member function] + cls.add_method('IsMultivalue', + 'bool', + [], + is_const=True, visibility='protected') + ## packetbb.h: void ns3::PbbTlv::SetIndexStart(uint8_t index) [member function] + cls.add_method('SetIndexStart', + 'void', + [param('uint8_t', 'index')], + visibility='protected') + ## packetbb.h: void ns3::PbbTlv::SetIndexStop(uint8_t index) [member function] + cls.add_method('SetIndexStop', + 'void', + [param('uint8_t', 'index')], + visibility='protected') + ## packetbb.h: void ns3::PbbTlv::SetMultivalue(bool isMultivalue) [member function] + cls.add_method('SetMultivalue', + 'void', + [param('bool', 'isMultivalue')], + visibility='protected') + return + +def register_Ns3PbbTlvBlock_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbTlvBlock::PbbTlvBlock() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::PbbTlvBlock::PbbTlvBlock(ns3::PbbTlvBlock const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbTlvBlock const &', 'arg0')]) + ## packetbb.h: ns3::Ptr ns3::PbbTlvBlock::Back() const [member function] + cls.add_method('Back', + 'ns3::Ptr< ns3::PbbTlv >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::Begin() [member function] + cls.add_method('Begin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbTlvBlock::Begin() const [member function] + cls.add_method('Begin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbTlvBlock::Clear() [member function] + cls.add_method('Clear', + 'void', + []) + ## packetbb.h: void ns3::PbbTlvBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')]) + ## packetbb.h: bool ns3::PbbTlvBlock::Empty() const [member function] + cls.add_method('Empty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::End() [member function] + cls.add_method('End', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbTlvBlock::End() const [member function] + cls.add_method('End', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::Erase(std::_List_iterator > position) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::Erase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) + ## packetbb.h: ns3::Ptr ns3::PbbTlvBlock::Front() const [member function] + cls.add_method('Front', + 'ns3::Ptr< ns3::PbbTlv >', + [], + is_const=True) + ## packetbb.h: uint32_t ns3::PbbTlvBlock::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbTlvBlock::Insert(std::_List_iterator > position, ns3::Ptr const tlv) [member function] + cls.add_method('Insert', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position'), param('ns3::Ptr< ns3::PbbTlv > const', 'tlv')]) + ## packetbb.h: void ns3::PbbTlvBlock::PopBack() [member function] + cls.add_method('PopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbTlvBlock::PopFront() [member function] + cls.add_method('PopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbTlvBlock::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## packetbb.h: void ns3::PbbTlvBlock::Print(std::ostream & os, int level) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os'), param('int', 'level')], + is_const=True) + ## packetbb.h: void ns3::PbbTlvBlock::PushBack(ns3::Ptr tlv) [member function] + cls.add_method('PushBack', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbTlvBlock::PushFront(ns3::Ptr tlv) [member function] + cls.add_method('PushFront', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbTlvBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True) + ## packetbb.h: int ns3::PbbTlvBlock::Size() const [member function] + cls.add_method('Size', + 'int', + [], + is_const=True) + return + +def register_Ns3Ipv4AddressChecker_methods(root_module, cls): + ## ipv4-address.h: ns3::Ipv4AddressChecker::Ipv4AddressChecker() [constructor] + cls.add_constructor([]) + ## ipv4-address.h: ns3::Ipv4AddressChecker::Ipv4AddressChecker(ns3::Ipv4AddressChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4AddressChecker const &', 'arg0')]) + return + +def register_Ns3Ipv4AddressValue_methods(root_module, cls): + ## ipv4-address.h: ns3::Ipv4AddressValue::Ipv4AddressValue() [constructor] + cls.add_constructor([]) + ## ipv4-address.h: ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4AddressValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4AddressValue const &', 'arg0')]) + ## ipv4-address.h: ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4Address const & value) [constructor] + cls.add_constructor([param('ns3::Ipv4Address const &', 'value')]) + ## ipv4-address.h: ns3::Ptr ns3::Ipv4AddressValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## ipv4-address.h: bool ns3::Ipv4AddressValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## ipv4-address.h: ns3::Ipv4Address ns3::Ipv4AddressValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-address.h: std::string ns3::Ipv4AddressValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## ipv4-address.h: void ns3::Ipv4AddressValue::Set(ns3::Ipv4Address const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Ipv4Address const &', 'value')]) + return + +def register_Ns3Ipv4Header_methods(root_module, cls): + ## ipv4-header.h: ns3::Ipv4Header::Ipv4Header(ns3::Ipv4Header const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4Header const &', 'arg0')]) + ## ipv4-header.h: ns3::Ipv4Header::Ipv4Header() [constructor] + cls.add_constructor([]) + ## ipv4-header.h: uint32_t ns3::Ipv4Header::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## ipv4-header.h: void ns3::Ipv4Header::EnableChecksum() [member function] + cls.add_method('EnableChecksum', + 'void', + []) + ## ipv4-header.h: ns3::Ipv4Address ns3::Ipv4Header::GetDestination() const [member function] + cls.add_method('GetDestination', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-header.h: uint16_t ns3::Ipv4Header::GetFragmentOffset() const [member function] + cls.add_method('GetFragmentOffset', + 'uint16_t', + [], + is_const=True) + ## ipv4-header.h: uint16_t ns3::Ipv4Header::GetIdentification() const [member function] + cls.add_method('GetIdentification', + 'uint16_t', + [], + is_const=True) + ## ipv4-header.h: ns3::TypeId ns3::Ipv4Header::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## ipv4-header.h: uint16_t ns3::Ipv4Header::GetPayloadSize() const [member function] + cls.add_method('GetPayloadSize', + 'uint16_t', + [], + is_const=True) + ## ipv4-header.h: uint8_t ns3::Ipv4Header::GetProtocol() const [member function] + cls.add_method('GetProtocol', + 'uint8_t', + [], + is_const=True) + ## ipv4-header.h: uint32_t ns3::Ipv4Header::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ipv4-header.h: ns3::Ipv4Address ns3::Ipv4Header::GetSource() const [member function] + cls.add_method('GetSource', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-header.h: uint8_t ns3::Ipv4Header::GetTos() const [member function] + cls.add_method('GetTos', + 'uint8_t', + [], + is_const=True) + ## ipv4-header.h: uint8_t ns3::Ipv4Header::GetTtl() const [member function] + cls.add_method('GetTtl', + 'uint8_t', + [], + is_const=True) + ## ipv4-header.h: static ns3::TypeId ns3::Ipv4Header::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-header.h: bool ns3::Ipv4Header::IsChecksumOk() const [member function] + cls.add_method('IsChecksumOk', + 'bool', + [], + is_const=True) + ## ipv4-header.h: bool ns3::Ipv4Header::IsDontFragment() const [member function] + cls.add_method('IsDontFragment', + 'bool', + [], + is_const=True) + ## ipv4-header.h: bool ns3::Ipv4Header::IsLastFragment() const [member function] + cls.add_method('IsLastFragment', + 'bool', + [], + is_const=True) + ## ipv4-header.h: void ns3::Ipv4Header::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ipv4-header.h: void ns3::Ipv4Header::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## ipv4-header.h: void ns3::Ipv4Header::SetDestination(ns3::Ipv4Address destination) [member function] + cls.add_method('SetDestination', + 'void', + [param('ns3::Ipv4Address', 'destination')]) + ## ipv4-header.h: void ns3::Ipv4Header::SetDontFragment() [member function] + cls.add_method('SetDontFragment', + 'void', + []) + ## ipv4-header.h: void ns3::Ipv4Header::SetFragmentOffset(uint16_t offset) [member function] + cls.add_method('SetFragmentOffset', + 'void', + [param('uint16_t', 'offset')]) + ## ipv4-header.h: void ns3::Ipv4Header::SetIdentification(uint16_t identification) [member function] + cls.add_method('SetIdentification', + 'void', + [param('uint16_t', 'identification')]) + ## ipv4-header.h: void ns3::Ipv4Header::SetLastFragment() [member function] + cls.add_method('SetLastFragment', + 'void', + []) + ## ipv4-header.h: void ns3::Ipv4Header::SetMayFragment() [member function] + cls.add_method('SetMayFragment', + 'void', + []) + ## ipv4-header.h: void ns3::Ipv4Header::SetMoreFragments() [member function] + cls.add_method('SetMoreFragments', + 'void', + []) + ## ipv4-header.h: void ns3::Ipv4Header::SetPayloadSize(uint16_t size) [member function] + cls.add_method('SetPayloadSize', + 'void', + [param('uint16_t', 'size')]) + ## ipv4-header.h: void ns3::Ipv4Header::SetProtocol(uint8_t num) [member function] + cls.add_method('SetProtocol', + 'void', + [param('uint8_t', 'num')]) + ## ipv4-header.h: void ns3::Ipv4Header::SetSource(ns3::Ipv4Address source) [member function] + cls.add_method('SetSource', + 'void', + [param('ns3::Ipv4Address', 'source')]) + ## ipv4-header.h: void ns3::Ipv4Header::SetTos(uint8_t tos) [member function] + cls.add_method('SetTos', + 'void', + [param('uint8_t', 'tos')]) + ## ipv4-header.h: void ns3::Ipv4Header::SetTtl(uint8_t ttl) [member function] + cls.add_method('SetTtl', + 'void', + [param('uint8_t', 'ttl')]) + return + +def register_Ns3Ipv4MaskChecker_methods(root_module, cls): + ## ipv4-address.h: ns3::Ipv4MaskChecker::Ipv4MaskChecker() [constructor] + cls.add_constructor([]) + ## ipv4-address.h: ns3::Ipv4MaskChecker::Ipv4MaskChecker(ns3::Ipv4MaskChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4MaskChecker const &', 'arg0')]) + return + +def register_Ns3Ipv4MaskValue_methods(root_module, cls): + ## ipv4-address.h: ns3::Ipv4MaskValue::Ipv4MaskValue() [constructor] + cls.add_constructor([]) + ## ipv4-address.h: ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4MaskValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4MaskValue const &', 'arg0')]) + ## ipv4-address.h: ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4Mask const & value) [constructor] + cls.add_constructor([param('ns3::Ipv4Mask const &', 'value')]) + ## ipv4-address.h: ns3::Ptr ns3::Ipv4MaskValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## ipv4-address.h: bool ns3::Ipv4MaskValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## ipv4-address.h: ns3::Ipv4Mask ns3::Ipv4MaskValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Ipv4Mask', + [], + is_const=True) + ## ipv4-address.h: std::string ns3::Ipv4MaskValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## ipv4-address.h: void ns3::Ipv4MaskValue::Set(ns3::Ipv4Mask const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Ipv4Mask const &', 'value')]) + return + +def register_Ns3Ipv4MulticastRoute_methods(root_module, cls): + ## ipv4-route.h: ns3::Ipv4MulticastRoute::Ipv4MulticastRoute(ns3::Ipv4MulticastRoute const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4MulticastRoute const &', 'arg0')]) + ## ipv4-route.h: ns3::Ipv4MulticastRoute::Ipv4MulticastRoute() [constructor] + cls.add_constructor([]) + ## ipv4-route.h: ns3::Ipv4Address ns3::Ipv4MulticastRoute::GetGroup() const [member function] + cls.add_method('GetGroup', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-route.h: ns3::Ipv4Address ns3::Ipv4MulticastRoute::GetOrigin() const [member function] + cls.add_method('GetOrigin', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-route.h: uint32_t ns3::Ipv4MulticastRoute::GetOutputTtl(uint32_t oif) const [member function] + cls.add_method('GetOutputTtl', + 'uint32_t', + [param('uint32_t', 'oif')], + is_const=True) + ## ipv4-route.h: uint32_t ns3::Ipv4MulticastRoute::GetParent() const [member function] + cls.add_method('GetParent', + 'uint32_t', + [], + is_const=True) + ## ipv4-route.h: void ns3::Ipv4MulticastRoute::SetGroup(ns3::Ipv4Address const group) [member function] + cls.add_method('SetGroup', + 'void', + [param('ns3::Ipv4Address const', 'group')]) + ## ipv4-route.h: void ns3::Ipv4MulticastRoute::SetOrigin(ns3::Ipv4Address const origin) [member function] + cls.add_method('SetOrigin', + 'void', + [param('ns3::Ipv4Address const', 'origin')]) + ## ipv4-route.h: void ns3::Ipv4MulticastRoute::SetOutputTtl(uint32_t oif, uint32_t ttl) [member function] + cls.add_method('SetOutputTtl', + 'void', + [param('uint32_t', 'oif'), param('uint32_t', 'ttl')]) + ## ipv4-route.h: void ns3::Ipv4MulticastRoute::SetParent(uint32_t iif) [member function] + cls.add_method('SetParent', + 'void', + [param('uint32_t', 'iif')]) + ## ipv4-route.h: ns3::Ipv4MulticastRoute::MAX_INTERFACES [variable] + cls.add_static_attribute('MAX_INTERFACES', 'uint32_t const', is_const=True) + ## ipv4-route.h: ns3::Ipv4MulticastRoute::MAX_TTL [variable] + cls.add_static_attribute('MAX_TTL', 'uint32_t const', is_const=True) + return + +def register_Ns3Ipv4Route_methods(root_module, cls): + cls.add_output_stream_operator() + ## ipv4-route.h: ns3::Ipv4Route::Ipv4Route(ns3::Ipv4Route const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4Route const &', 'arg0')]) + ## ipv4-route.h: ns3::Ipv4Route::Ipv4Route() [constructor] + cls.add_constructor([]) + ## ipv4-route.h: ns3::Ipv4Address ns3::Ipv4Route::GetDestination() const [member function] + cls.add_method('GetDestination', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-route.h: ns3::Ipv4Address ns3::Ipv4Route::GetGateway() const [member function] + cls.add_method('GetGateway', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-route.h: ns3::Ptr ns3::Ipv4Route::GetOutputDevice() const [member function] + cls.add_method('GetOutputDevice', + 'ns3::Ptr< ns3::NetDevice >', + [], + is_const=True) + ## ipv4-route.h: ns3::Ipv4Address ns3::Ipv4Route::GetSource() const [member function] + cls.add_method('GetSource', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-route.h: void ns3::Ipv4Route::SetDestination(ns3::Ipv4Address dest) [member function] + cls.add_method('SetDestination', + 'void', + [param('ns3::Ipv4Address', 'dest')]) + ## ipv4-route.h: void ns3::Ipv4Route::SetGateway(ns3::Ipv4Address gw) [member function] + cls.add_method('SetGateway', + 'void', + [param('ns3::Ipv4Address', 'gw')]) + ## ipv4-route.h: void ns3::Ipv4Route::SetOutputDevice(ns3::Ptr outputDevice) [member function] + cls.add_method('SetOutputDevice', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'outputDevice')]) + ## ipv4-route.h: void ns3::Ipv4Route::SetSource(ns3::Ipv4Address src) [member function] + cls.add_method('SetSource', + 'void', + [param('ns3::Ipv4Address', 'src')]) + return + +def register_Ns3Ipv6AddressChecker_methods(root_module, cls): + ## ipv6-address.h: ns3::Ipv6AddressChecker::Ipv6AddressChecker() [constructor] + cls.add_constructor([]) + ## ipv6-address.h: ns3::Ipv6AddressChecker::Ipv6AddressChecker(ns3::Ipv6AddressChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6AddressChecker const &', 'arg0')]) + return + +def register_Ns3Ipv6AddressValue_methods(root_module, cls): + ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue() [constructor] + cls.add_constructor([]) + ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6AddressValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6AddressValue const &', 'arg0')]) + ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6Address const & value) [constructor] + cls.add_constructor([param('ns3::Ipv6Address const &', 'value')]) + ## ipv6-address.h: ns3::Ptr ns3::Ipv6AddressValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## ipv6-address.h: bool ns3::Ipv6AddressValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## ipv6-address.h: ns3::Ipv6Address ns3::Ipv6AddressValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-address.h: std::string ns3::Ipv6AddressValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## ipv6-address.h: void ns3::Ipv6AddressValue::Set(ns3::Ipv6Address const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Ipv6Address const &', 'value')]) + return + +def register_Ns3Ipv6Header_methods(root_module, cls): + ## ipv6-header.h: ns3::Ipv6Header::Ipv6Header(ns3::Ipv6Header const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6Header const &', 'arg0')]) + ## ipv6-header.h: ns3::Ipv6Header::Ipv6Header() [constructor] + cls.add_constructor([]) + ## ipv6-header.h: uint32_t ns3::Ipv6Header::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## ipv6-header.h: ns3::Ipv6Address ns3::Ipv6Header::GetDestinationAddress() const [member function] + cls.add_method('GetDestinationAddress', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-header.h: uint32_t ns3::Ipv6Header::GetFlowLabel() const [member function] + cls.add_method('GetFlowLabel', + 'uint32_t', + [], + is_const=True) + ## ipv6-header.h: uint8_t ns3::Ipv6Header::GetHopLimit() const [member function] + cls.add_method('GetHopLimit', + 'uint8_t', + [], + is_const=True) + ## ipv6-header.h: ns3::TypeId ns3::Ipv6Header::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## ipv6-header.h: uint8_t ns3::Ipv6Header::GetNextHeader() const [member function] + cls.add_method('GetNextHeader', + 'uint8_t', + [], + is_const=True) + ## ipv6-header.h: uint16_t ns3::Ipv6Header::GetPayloadLength() const [member function] + cls.add_method('GetPayloadLength', + 'uint16_t', + [], + is_const=True) + ## ipv6-header.h: uint32_t ns3::Ipv6Header::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ipv6-header.h: ns3::Ipv6Address ns3::Ipv6Header::GetSourceAddress() const [member function] + cls.add_method('GetSourceAddress', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-header.h: uint8_t ns3::Ipv6Header::GetTrafficClass() const [member function] + cls.add_method('GetTrafficClass', + 'uint8_t', + [], + is_const=True) + ## ipv6-header.h: static ns3::TypeId ns3::Ipv6Header::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6-header.h: void ns3::Ipv6Header::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ipv6-header.h: void ns3::Ipv6Header::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## ipv6-header.h: void ns3::Ipv6Header::SetDestinationAddress(ns3::Ipv6Address dst) [member function] + cls.add_method('SetDestinationAddress', + 'void', + [param('ns3::Ipv6Address', 'dst')]) + ## ipv6-header.h: void ns3::Ipv6Header::SetFlowLabel(uint32_t flow) [member function] + cls.add_method('SetFlowLabel', + 'void', + [param('uint32_t', 'flow')]) + ## ipv6-header.h: void ns3::Ipv6Header::SetHopLimit(uint8_t limit) [member function] + cls.add_method('SetHopLimit', + 'void', + [param('uint8_t', 'limit')]) + ## ipv6-header.h: void ns3::Ipv6Header::SetNextHeader(uint8_t next) [member function] + cls.add_method('SetNextHeader', + 'void', + [param('uint8_t', 'next')]) + ## ipv6-header.h: void ns3::Ipv6Header::SetPayloadLength(uint16_t len) [member function] + cls.add_method('SetPayloadLength', + 'void', + [param('uint16_t', 'len')]) + ## ipv6-header.h: void ns3::Ipv6Header::SetSourceAddress(ns3::Ipv6Address src) [member function] + cls.add_method('SetSourceAddress', + 'void', + [param('ns3::Ipv6Address', 'src')]) + ## ipv6-header.h: void ns3::Ipv6Header::SetTrafficClass(uint8_t traffic) [member function] + cls.add_method('SetTrafficClass', + 'void', + [param('uint8_t', 'traffic')]) + return + +def register_Ns3Ipv6MulticastRoute_methods(root_module, cls): + cls.add_output_stream_operator() + ## ipv6-route.h: ns3::Ipv6MulticastRoute::Ipv6MulticastRoute(ns3::Ipv6MulticastRoute const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6MulticastRoute const &', 'arg0')]) + ## ipv6-route.h: ns3::Ipv6MulticastRoute::Ipv6MulticastRoute() [constructor] + cls.add_constructor([]) + ## ipv6-route.h: ns3::Ipv6Address ns3::Ipv6MulticastRoute::GetGroup() const [member function] + cls.add_method('GetGroup', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-route.h: ns3::Ipv6Address ns3::Ipv6MulticastRoute::GetOrigin() const [member function] + cls.add_method('GetOrigin', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-route.h: uint32_t ns3::Ipv6MulticastRoute::GetOutputTtl(uint32_t oif) const [member function] + cls.add_method('GetOutputTtl', + 'uint32_t', + [param('uint32_t', 'oif')], + is_const=True) + ## ipv6-route.h: uint32_t ns3::Ipv6MulticastRoute::GetParent() const [member function] + cls.add_method('GetParent', + 'uint32_t', + [], + is_const=True) + ## ipv6-route.h: void ns3::Ipv6MulticastRoute::SetGroup(ns3::Ipv6Address const group) [member function] + cls.add_method('SetGroup', + 'void', + [param('ns3::Ipv6Address const', 'group')]) + ## ipv6-route.h: void ns3::Ipv6MulticastRoute::SetOrigin(ns3::Ipv6Address const origin) [member function] + cls.add_method('SetOrigin', + 'void', + [param('ns3::Ipv6Address const', 'origin')]) + ## ipv6-route.h: void ns3::Ipv6MulticastRoute::SetOutputTtl(uint32_t oif, uint32_t ttl) [member function] + cls.add_method('SetOutputTtl', + 'void', + [param('uint32_t', 'oif'), param('uint32_t', 'ttl')]) + ## ipv6-route.h: void ns3::Ipv6MulticastRoute::SetParent(uint32_t iif) [member function] + cls.add_method('SetParent', + 'void', + [param('uint32_t', 'iif')]) + ## ipv6-route.h: ns3::Ipv6MulticastRoute::MAX_INTERFACES [variable] + cls.add_static_attribute('MAX_INTERFACES', 'uint32_t const', is_const=True) + ## ipv6-route.h: ns3::Ipv6MulticastRoute::MAX_TTL [variable] + cls.add_static_attribute('MAX_TTL', 'uint32_t const', is_const=True) + return + +def register_Ns3Ipv6PrefixChecker_methods(root_module, cls): + ## ipv6-address.h: ns3::Ipv6PrefixChecker::Ipv6PrefixChecker() [constructor] + cls.add_constructor([]) + ## ipv6-address.h: ns3::Ipv6PrefixChecker::Ipv6PrefixChecker(ns3::Ipv6PrefixChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6PrefixChecker const &', 'arg0')]) + return + +def register_Ns3Ipv6PrefixValue_methods(root_module, cls): + ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue() [constructor] + cls.add_constructor([]) + ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6PrefixValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6PrefixValue const &', 'arg0')]) + ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6Prefix const & value) [constructor] + cls.add_constructor([param('ns3::Ipv6Prefix const &', 'value')]) + ## ipv6-address.h: ns3::Ptr ns3::Ipv6PrefixValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## ipv6-address.h: bool ns3::Ipv6PrefixValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## ipv6-address.h: ns3::Ipv6Prefix ns3::Ipv6PrefixValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Ipv6Prefix', + [], + is_const=True) + ## ipv6-address.h: std::string ns3::Ipv6PrefixValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## ipv6-address.h: void ns3::Ipv6PrefixValue::Set(ns3::Ipv6Prefix const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Ipv6Prefix const &', 'value')]) + return + +def register_Ns3Ipv6Route_methods(root_module, cls): + cls.add_output_stream_operator() + ## ipv6-route.h: ns3::Ipv6Route::Ipv6Route(ns3::Ipv6Route const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6Route const &', 'arg0')]) + ## ipv6-route.h: ns3::Ipv6Route::Ipv6Route() [constructor] + cls.add_constructor([]) + ## ipv6-route.h: ns3::Ipv6Address ns3::Ipv6Route::GetDestination() const [member function] + cls.add_method('GetDestination', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-route.h: ns3::Ipv6Address ns3::Ipv6Route::GetGateway() const [member function] + cls.add_method('GetGateway', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-route.h: ns3::Ptr ns3::Ipv6Route::GetOutputDevice() const [member function] + cls.add_method('GetOutputDevice', + 'ns3::Ptr< ns3::NetDevice >', + [], + is_const=True) + ## ipv6-route.h: ns3::Ipv6Address ns3::Ipv6Route::GetSource() const [member function] + cls.add_method('GetSource', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-route.h: void ns3::Ipv6Route::SetDestination(ns3::Ipv6Address dest) [member function] + cls.add_method('SetDestination', + 'void', + [param('ns3::Ipv6Address', 'dest')]) + ## ipv6-route.h: void ns3::Ipv6Route::SetGateway(ns3::Ipv6Address gw) [member function] + cls.add_method('SetGateway', + 'void', + [param('ns3::Ipv6Address', 'gw')]) + ## ipv6-route.h: void ns3::Ipv6Route::SetOutputDevice(ns3::Ptr outputDevice) [member function] + cls.add_method('SetOutputDevice', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'outputDevice')]) + ## ipv6-route.h: void ns3::Ipv6Route::SetSource(ns3::Ipv6Address src) [member function] + cls.add_method('SetSource', + 'void', + [param('ns3::Ipv6Address', 'src')]) + return + +def register_Ns3LlcSnapHeader_methods(root_module, cls): + ## llc-snap-header.h: ns3::LlcSnapHeader::LlcSnapHeader(ns3::LlcSnapHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::LlcSnapHeader const &', 'arg0')]) + ## llc-snap-header.h: ns3::LlcSnapHeader::LlcSnapHeader() [constructor] + cls.add_constructor([]) + ## llc-snap-header.h: uint32_t ns3::LlcSnapHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## llc-snap-header.h: ns3::TypeId ns3::LlcSnapHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## llc-snap-header.h: uint32_t ns3::LlcSnapHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## llc-snap-header.h: uint16_t ns3::LlcSnapHeader::GetType() [member function] + cls.add_method('GetType', + 'uint16_t', + []) + ## llc-snap-header.h: static ns3::TypeId ns3::LlcSnapHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## llc-snap-header.h: void ns3::LlcSnapHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## llc-snap-header.h: void ns3::LlcSnapHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## llc-snap-header.h: void ns3::LlcSnapHeader::SetType(uint16_t type) [member function] + cls.add_method('SetType', + 'void', + [param('uint16_t', 'type')]) + return + +def register_Ns3Mac48AddressChecker_methods(root_module, cls): + ## mac48-address.h: ns3::Mac48AddressChecker::Mac48AddressChecker() [constructor] + cls.add_constructor([]) + ## mac48-address.h: ns3::Mac48AddressChecker::Mac48AddressChecker(ns3::Mac48AddressChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Mac48AddressChecker const &', 'arg0')]) + return + +def register_Ns3Mac48AddressValue_methods(root_module, cls): + ## mac48-address.h: ns3::Mac48AddressValue::Mac48AddressValue() [constructor] + cls.add_constructor([]) + ## mac48-address.h: ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48AddressValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Mac48AddressValue const &', 'arg0')]) + ## mac48-address.h: ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48Address const & value) [constructor] + cls.add_constructor([param('ns3::Mac48Address const &', 'value')]) + ## mac48-address.h: ns3::Ptr ns3::Mac48AddressValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## mac48-address.h: bool ns3::Mac48AddressValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## mac48-address.h: ns3::Mac48Address ns3::Mac48AddressValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Mac48Address', + [], + is_const=True) + ## mac48-address.h: std::string ns3::Mac48AddressValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## mac48-address.h: void ns3::Mac48AddressValue::Set(ns3::Mac48Address const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Mac48Address const &', 'value')]) + return + +def register_Ns3PbbAddressTlv_methods(root_module, cls): + ## packetbb.h: ns3::PbbAddressTlv::PbbAddressTlv() [constructor] + cls.add_constructor([]) + ## packetbb.h: ns3::PbbAddressTlv::PbbAddressTlv(ns3::PbbAddressTlv const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbAddressTlv const &', 'arg0')]) + ## packetbb.h: uint8_t ns3::PbbAddressTlv::GetIndexStart() const [member function] + cls.add_method('GetIndexStart', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: uint8_t ns3::PbbAddressTlv::GetIndexStop() const [member function] + cls.add_method('GetIndexStop', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbAddressTlv::HasIndexStart() const [member function] + cls.add_method('HasIndexStart', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbAddressTlv::HasIndexStop() const [member function] + cls.add_method('HasIndexStop', + 'bool', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbAddressTlv::IsMultivalue() const [member function] + cls.add_method('IsMultivalue', + 'bool', + [], + is_const=True) + ## packetbb.h: void ns3::PbbAddressTlv::SetIndexStart(uint8_t index) [member function] + cls.add_method('SetIndexStart', + 'void', + [param('uint8_t', 'index')]) + ## packetbb.h: void ns3::PbbAddressTlv::SetIndexStop(uint8_t index) [member function] + cls.add_method('SetIndexStop', + 'void', + [param('uint8_t', 'index')]) + ## packetbb.h: void ns3::PbbAddressTlv::SetMultivalue(bool isMultivalue) [member function] + cls.add_method('SetMultivalue', + 'void', + [param('bool', 'isMultivalue')]) + return + +def register_Ns3PbbPacket_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('!=') + ## packetbb.h: ns3::PbbPacket::PbbPacket(ns3::PbbPacket const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PbbPacket const &', 'arg0')]) + ## packetbb.h: ns3::PbbPacket::PbbPacket() [constructor] + cls.add_constructor([]) + ## packetbb.h: uint32_t ns3::PbbPacket::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::Erase(std::_List_iterator > position) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::Erase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::Erase(std::_List_iterator > position) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'position')]) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::Erase(std::_List_iterator > first, std::_List_iterator > last) [member function] + cls.add_method('Erase', + 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', + [param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'last')]) + ## packetbb.h: ns3::TypeId ns3::PbbPacket::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## packetbb.h: uint16_t ns3::PbbPacket::GetSequenceNumber() const [member function] + cls.add_method('GetSequenceNumber', + 'uint16_t', + [], + is_const=True) + ## packetbb.h: uint32_t ns3::PbbPacket::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## packetbb.h: static ns3::TypeId ns3::PbbPacket::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## packetbb.h: uint8_t ns3::PbbPacket::GetVersion() const [member function] + cls.add_method('GetVersion', + 'uint8_t', + [], + is_const=True) + ## packetbb.h: bool ns3::PbbPacket::HasSequenceNumber() const [member function] + cls.add_method('HasSequenceNumber', + 'bool', + [], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbPacket::MessageBack() [member function] + cls.add_method('MessageBack', + 'ns3::Ptr< ns3::PbbMessage >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbPacket::MessageBack() const [member function] + cls.add_method('MessageBack', + 'ns3::Ptr< ns3::PbbMessage > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::MessageBegin() [member function] + cls.add_method('MessageBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbPacket::MessageBegin() const [member function] + cls.add_method('MessageBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbMessage > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::MessageClear() [member function] + cls.add_method('MessageClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbPacket::MessageEmpty() const [member function] + cls.add_method('MessageEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::MessageEnd() [member function] + cls.add_method('MessageEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbPacket::MessageEnd() const [member function] + cls.add_method('MessageEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbMessage > >', + [], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbPacket::MessageFront() [member function] + cls.add_method('MessageFront', + 'ns3::Ptr< ns3::PbbMessage >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbPacket::MessageFront() const [member function] + cls.add_method('MessageFront', + 'ns3::Ptr< ns3::PbbMessage > const', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::MessagePopBack() [member function] + cls.add_method('MessagePopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbPacket::MessagePopFront() [member function] + cls.add_method('MessagePopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbPacket::MessagePushBack(ns3::Ptr message) [member function] + cls.add_method('MessagePushBack', + 'void', + [param('ns3::Ptr< ns3::PbbMessage >', 'message')]) + ## packetbb.h: void ns3::PbbPacket::MessagePushFront(ns3::Ptr message) [member function] + cls.add_method('MessagePushFront', + 'void', + [param('ns3::Ptr< ns3::PbbMessage >', 'message')]) + ## packetbb.h: int ns3::PbbPacket::MessageSize() const [member function] + cls.add_method('MessageSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## packetbb.h: void ns3::PbbPacket::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## packetbb.h: void ns3::PbbPacket::SetSequenceNumber(uint16_t number) [member function] + cls.add_method('SetSequenceNumber', + 'void', + [param('uint16_t', 'number')]) + ## packetbb.h: ns3::Ptr ns3::PbbPacket::TlvBack() [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbPacket::TlvBack() const [member function] + cls.add_method('TlvBack', + 'ns3::Ptr< ns3::PbbTlv > const', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::TlvBegin() [member function] + cls.add_method('TlvBegin', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbPacket::TlvBegin() const [member function] + cls.add_method('TlvBegin', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::TlvClear() [member function] + cls.add_method('TlvClear', + 'void', + []) + ## packetbb.h: bool ns3::PbbPacket::TlvEmpty() const [member function] + cls.add_method('TlvEmpty', + 'bool', + [], + is_const=True) + ## packetbb.h: std::_List_iterator > ns3::PbbPacket::TlvEnd() [member function] + cls.add_method('TlvEnd', + 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', + []) + ## packetbb.h: std::_List_const_iterator > ns3::PbbPacket::TlvEnd() const [member function] + cls.add_method('TlvEnd', + 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', + [], + is_const=True) + ## packetbb.h: ns3::Ptr ns3::PbbPacket::TlvFront() [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbTlv >', + []) + ## packetbb.h: ns3::Ptr const ns3::PbbPacket::TlvFront() const [member function] + cls.add_method('TlvFront', + 'ns3::Ptr< ns3::PbbTlv > const', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::TlvPopBack() [member function] + cls.add_method('TlvPopBack', + 'void', + []) + ## packetbb.h: void ns3::PbbPacket::TlvPopFront() [member function] + cls.add_method('TlvPopFront', + 'void', + []) + ## packetbb.h: void ns3::PbbPacket::TlvPushBack(ns3::Ptr tlv) [member function] + cls.add_method('TlvPushBack', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: void ns3::PbbPacket::TlvPushFront(ns3::Ptr tlv) [member function] + cls.add_method('TlvPushFront', + 'void', + [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) + ## packetbb.h: int ns3::PbbPacket::TlvSize() const [member function] + cls.add_method('TlvSize', + 'int', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## packetbb.h: void ns3::PbbPacket::SerializePacketTlv(ns3::Buffer::Iterator & start) const [member function] + cls.add_method('SerializePacketTlv', + 'void', + [param('ns3::Buffer::Iterator &', 'start')], + is_const=True, visibility='protected') + return + +def register_Ns3Queue_methods(root_module, cls): + ## queue.h: ns3::Queue::Queue(ns3::Queue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Queue const &', 'arg0')]) + ## queue.h: ns3::Queue::Queue() [constructor] + cls.add_constructor([]) + ## queue.h: ns3::Ptr ns3::Queue::Dequeue() [member function] + cls.add_method('Dequeue', + 'ns3::Ptr< ns3::Packet >', + []) + ## queue.h: void ns3::Queue::DequeueAll() [member function] + cls.add_method('DequeueAll', + 'void', + []) + ## queue.h: bool ns3::Queue::Enqueue(ns3::Ptr p) [member function] + cls.add_method('Enqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## queue.h: uint32_t ns3::Queue::GetNBytes() const [member function] + cls.add_method('GetNBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h: uint32_t ns3::Queue::GetNPackets() const [member function] + cls.add_method('GetNPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h: uint32_t ns3::Queue::GetTotalDroppedBytes() const [member function] + cls.add_method('GetTotalDroppedBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h: uint32_t ns3::Queue::GetTotalDroppedPackets() const [member function] + cls.add_method('GetTotalDroppedPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h: uint32_t ns3::Queue::GetTotalReceivedBytes() const [member function] + cls.add_method('GetTotalReceivedBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h: uint32_t ns3::Queue::GetTotalReceivedPackets() const [member function] + cls.add_method('GetTotalReceivedPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h: static ns3::TypeId ns3::Queue::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## queue.h: bool ns3::Queue::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True) + ## queue.h: ns3::Ptr ns3::Queue::Peek() const [member function] + cls.add_method('Peek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_const=True) + ## queue.h: void ns3::Queue::ResetStatistics() [member function] + cls.add_method('ResetStatistics', + 'void', + []) + ## queue.h: void ns3::Queue::Drop(ns3::Ptr packet) [member function] + cls.add_method('Drop', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet')], + visibility='protected') + ## queue.h: ns3::Ptr ns3::Queue::DoDequeue() [member function] + cls.add_method('DoDequeue', + 'ns3::Ptr< ns3::Packet >', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## queue.h: bool ns3::Queue::DoEnqueue(ns3::Ptr p) [member function] + cls.add_method('DoEnqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## queue.h: ns3::Ptr ns3::Queue::DoPeek() const [member function] + cls.add_method('DoPeek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3Socket_methods(root_module, cls): + ## socket.h: ns3::Socket::Socket(ns3::Socket const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Socket const &', 'arg0')]) + ## socket.h: ns3::Socket::Socket() [constructor] + cls.add_constructor([]) + ## socket.h: int ns3::Socket::Bind(ns3::Address const & address) [member function] + cls.add_method('Bind', + 'int', + [param('ns3::Address const &', 'address')], + is_pure_virtual=True, is_virtual=True) + ## socket.h: int ns3::Socket::Bind() [member function] + cls.add_method('Bind', + 'int', + [], + is_pure_virtual=True, is_virtual=True) + ## socket.h: int ns3::Socket::Close() [member function] + cls.add_method('Close', + 'int', + [], + is_pure_virtual=True, is_virtual=True) + ## socket.h: int ns3::Socket::Connect(ns3::Address const & address) [member function] + cls.add_method('Connect', + 'int', + [param('ns3::Address const &', 'address')], + is_pure_virtual=True, is_virtual=True) + ## socket.h: static ns3::Ptr ns3::Socket::CreateSocket(ns3::Ptr node, ns3::TypeId tid) [member function] + cls.add_method('CreateSocket', + 'ns3::Ptr< ns3::Socket >', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::TypeId', 'tid')], + is_static=True) + ## socket.h: ns3::Socket::SocketErrno ns3::Socket::GetErrno() const [member function] + cls.add_method('GetErrno', + 'ns3::Socket::SocketErrno', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## socket.h: ns3::Ptr ns3::Socket::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## socket.h: uint32_t ns3::Socket::GetRxAvailable() const [member function] + cls.add_method('GetRxAvailable', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## socket.h: int ns3::Socket::GetSockName(ns3::Address & address) const [member function] + cls.add_method('GetSockName', + 'int', + [param('ns3::Address &', 'address')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## socket.h: uint32_t ns3::Socket::GetTxAvailable() const [member function] + cls.add_method('GetTxAvailable', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## socket.h: int ns3::Socket::Listen() [member function] + cls.add_method('Listen', + 'int', + [], + is_pure_virtual=True, is_virtual=True) + ## socket.h: ns3::Ptr ns3::Socket::Recv(uint32_t maxSize, uint32_t flags) [member function] + cls.add_method('Recv', + 'ns3::Ptr< ns3::Packet >', + [param('uint32_t', 'maxSize'), param('uint32_t', 'flags')], + is_pure_virtual=True, is_virtual=True) + ## socket.h: ns3::Ptr ns3::Socket::Recv() [member function] + cls.add_method('Recv', + 'ns3::Ptr< ns3::Packet >', + []) + ## socket.h: int ns3::Socket::Recv(uint8_t * buf, uint32_t size, uint32_t flags) [member function] + cls.add_method('Recv', + 'int', + [param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')]) + ## socket.h: ns3::Ptr ns3::Socket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function] + cls.add_method('RecvFrom', + 'ns3::Ptr< ns3::Packet >', + [param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')], + is_pure_virtual=True, is_virtual=True) + ## socket.h: ns3::Ptr ns3::Socket::RecvFrom(ns3::Address & fromAddress) [member function] + cls.add_method('RecvFrom', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::Address &', 'fromAddress')]) + ## socket.h: int ns3::Socket::RecvFrom(uint8_t * buf, uint32_t size, uint32_t flags, ns3::Address & fromAddress) [member function] + cls.add_method('RecvFrom', + 'int', + [param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')]) + ## socket.h: int ns3::Socket::Send(ns3::Ptr p, uint32_t flags) [member function] + cls.add_method('Send', + 'int', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')], + is_pure_virtual=True, is_virtual=True) + ## socket.h: int ns3::Socket::Send(ns3::Ptr p) [member function] + cls.add_method('Send', + 'int', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## socket.h: int ns3::Socket::Send(uint8_t const * buf, uint32_t size, uint32_t flags) [member function] + cls.add_method('Send', + 'int', + [param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')]) + ## socket.h: int ns3::Socket::SendTo(ns3::Ptr p, uint32_t flags, ns3::Address const & toAddress) [member function] + cls.add_method('SendTo', + 'int', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'toAddress')], + is_pure_virtual=True, is_virtual=True) + ## socket.h: int ns3::Socket::SendTo(uint8_t const * buf, uint32_t size, uint32_t flags, ns3::Address const & address) [member function] + cls.add_method('SendTo', + 'int', + [param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address const &', 'address')]) + ## socket.h: void ns3::Socket::SetAcceptCallback(ns3::Callback, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionRequest, ns3::Callback, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> newConnectionCreated) [member function] + cls.add_method('SetAcceptCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionRequest'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'newConnectionCreated')]) + ## socket.h: void ns3::Socket::SetConnectCallback(ns3::Callback, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionSucceeded, ns3::Callback, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionFailed) [member function] + cls.add_method('SetConnectCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionSucceeded'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionFailed')]) + ## socket.h: void ns3::Socket::SetDataSentCallback(ns3::Callback, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> dataSent) [member function] + cls.add_method('SetDataSentCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataSent')]) + ## socket.h: void ns3::Socket::SetRecvCallback(ns3::Callback, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> arg0) [member function] + cls.add_method('SetRecvCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arg0')]) + ## socket.h: void ns3::Socket::SetSendCallback(ns3::Callback, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> sendCb) [member function] + cls.add_method('SetSendCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'sendCb')]) + ## socket.h: int ns3::Socket::ShutdownRecv() [member function] + cls.add_method('ShutdownRecv', + 'int', + [], + is_pure_virtual=True, is_virtual=True) + ## socket.h: int ns3::Socket::ShutdownSend() [member function] + cls.add_method('ShutdownSend', + 'int', + [], + is_pure_virtual=True, is_virtual=True) + ## socket.h: void ns3::Socket::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## socket.h: void ns3::Socket::NotifyConnectionFailed() [member function] + cls.add_method('NotifyConnectionFailed', + 'void', + [], + visibility='protected') + ## socket.h: bool ns3::Socket::NotifyConnectionRequest(ns3::Address const & from) [member function] + cls.add_method('NotifyConnectionRequest', + 'bool', + [param('ns3::Address const &', 'from')], + visibility='protected') + ## socket.h: void ns3::Socket::NotifyConnectionSucceeded() [member function] + cls.add_method('NotifyConnectionSucceeded', + 'void', + [], + visibility='protected') + ## socket.h: void ns3::Socket::NotifyDataRecv() [member function] + cls.add_method('NotifyDataRecv', + 'void', + [], + visibility='protected') + ## socket.h: void ns3::Socket::NotifyDataSent(uint32_t size) [member function] + cls.add_method('NotifyDataSent', + 'void', + [param('uint32_t', 'size')], + visibility='protected') + ## socket.h: void ns3::Socket::NotifyNewConnectionCreated(ns3::Ptr socket, ns3::Address const & from) [member function] + cls.add_method('NotifyNewConnectionCreated', + 'void', + [param('ns3::Ptr< ns3::Socket >', 'socket'), param('ns3::Address const &', 'from')], + visibility='protected') + ## socket.h: void ns3::Socket::NotifySend(uint32_t spaceAvailable) [member function] + cls.add_method('NotifySend', + 'void', + [param('uint32_t', 'spaceAvailable')], + visibility='protected') + return + +def register_Ns3SocketAddressTag_methods(root_module, cls): + ## socket.h: ns3::SocketAddressTag::SocketAddressTag(ns3::SocketAddressTag const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SocketAddressTag const &', 'arg0')]) + ## socket.h: ns3::SocketAddressTag::SocketAddressTag() [constructor] + cls.add_constructor([]) + ## socket.h: void ns3::SocketAddressTag::Deserialize(ns3::TagBuffer i) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_virtual=True) + ## socket.h: ns3::Address ns3::SocketAddressTag::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True) + ## socket.h: ns3::TypeId ns3::SocketAddressTag::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## socket.h: uint32_t ns3::SocketAddressTag::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## socket.h: static ns3::TypeId ns3::SocketAddressTag::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## socket.h: void ns3::SocketAddressTag::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## socket.h: void ns3::SocketAddressTag::Serialize(ns3::TagBuffer i) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_const=True, is_virtual=True) + ## socket.h: void ns3::SocketAddressTag::SetAddress(ns3::Address addr) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'addr')]) + return + +def register_Ns3SocketFactory_methods(root_module, cls): + ## socket-factory.h: ns3::SocketFactory::SocketFactory(ns3::SocketFactory const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SocketFactory const &', 'arg0')]) + ## socket-factory.h: ns3::SocketFactory::SocketFactory() [constructor] + cls.add_constructor([]) + ## socket-factory.h: ns3::Ptr ns3::SocketFactory::CreateSocket() [member function] + cls.add_method('CreateSocket', + 'ns3::Ptr< ns3::Socket >', + [], + is_pure_virtual=True, is_virtual=True) + ## socket-factory.h: static ns3::TypeId ns3::SocketFactory::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3SocketIpTtlTag_methods(root_module, cls): + ## socket.h: ns3::SocketIpTtlTag::SocketIpTtlTag(ns3::SocketIpTtlTag const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SocketIpTtlTag const &', 'arg0')]) + ## socket.h: ns3::SocketIpTtlTag::SocketIpTtlTag() [constructor] + cls.add_constructor([]) + ## socket.h: void ns3::SocketIpTtlTag::Deserialize(ns3::TagBuffer i) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_virtual=True) + ## socket.h: ns3::TypeId ns3::SocketIpTtlTag::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## socket.h: uint32_t ns3::SocketIpTtlTag::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## socket.h: uint8_t ns3::SocketIpTtlTag::GetTtl() const [member function] + cls.add_method('GetTtl', + 'uint8_t', + [], + is_const=True) + ## socket.h: static ns3::TypeId ns3::SocketIpTtlTag::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## socket.h: void ns3::SocketIpTtlTag::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## socket.h: void ns3::SocketIpTtlTag::Serialize(ns3::TagBuffer i) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_const=True, is_virtual=True) + ## socket.h: void ns3::SocketIpTtlTag::SetTtl(uint8_t ttl) [member function] + cls.add_method('SetTtl', + 'void', + [param('uint8_t', 'ttl')]) + return + +def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls): + ## socket.h: ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag(ns3::SocketSetDontFragmentTag const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SocketSetDontFragmentTag const &', 'arg0')]) + ## socket.h: ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag() [constructor] + cls.add_constructor([]) + ## socket.h: void ns3::SocketSetDontFragmentTag::Deserialize(ns3::TagBuffer i) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_virtual=True) + ## socket.h: void ns3::SocketSetDontFragmentTag::Disable() [member function] + cls.add_method('Disable', + 'void', + []) + ## socket.h: void ns3::SocketSetDontFragmentTag::Enable() [member function] + cls.add_method('Enable', + 'void', + []) + ## socket.h: ns3::TypeId ns3::SocketSetDontFragmentTag::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## socket.h: uint32_t ns3::SocketSetDontFragmentTag::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## socket.h: static ns3::TypeId ns3::SocketSetDontFragmentTag::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## socket.h: bool ns3::SocketSetDontFragmentTag::IsEnabled() const [member function] + cls.add_method('IsEnabled', + 'bool', + [], + is_const=True) + ## socket.h: void ns3::SocketSetDontFragmentTag::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## socket.h: void ns3::SocketSetDontFragmentTag::Serialize(ns3::TagBuffer i) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_const=True, is_virtual=True) + return + +def register_Ns3TcpSocket_methods(root_module, cls): + ## tcp-socket.h: ns3::TcpSocket::TcpSocket(ns3::TcpSocket const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TcpSocket const &', 'arg0')]) + ## tcp-socket.h: ns3::TcpSocket::TcpSocket() [constructor] + cls.add_constructor([]) + ## tcp-socket.h: static ns3::TypeId ns3::TcpSocket::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tcp-socket.h: uint32_t ns3::TcpSocket::GetConnCount() const [member function] + cls.add_method('GetConnCount', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: ns3::Time ns3::TcpSocket::GetConnTimeout() const [member function] + cls.add_method('GetConnTimeout', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: uint32_t ns3::TcpSocket::GetDelAckMaxCount() const [member function] + cls.add_method('GetDelAckMaxCount', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: ns3::Time ns3::TcpSocket::GetDelAckTimeout() const [member function] + cls.add_method('GetDelAckTimeout', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: uint32_t ns3::TcpSocket::GetInitialCwnd() const [member function] + cls.add_method('GetInitialCwnd', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: uint32_t ns3::TcpSocket::GetRcvBufSize() const [member function] + cls.add_method('GetRcvBufSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: uint32_t ns3::TcpSocket::GetSSThresh() const [member function] + cls.add_method('GetSSThresh', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: uint32_t ns3::TcpSocket::GetSegSize() const [member function] + cls.add_method('GetSegSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: uint32_t ns3::TcpSocket::GetSndBufSize() const [member function] + cls.add_method('GetSndBufSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetConnCount(uint32_t count) [member function] + cls.add_method('SetConnCount', + 'void', + [param('uint32_t', 'count')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetConnTimeout(ns3::Time timeout) [member function] + cls.add_method('SetConnTimeout', + 'void', + [param('ns3::Time', 'timeout')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetDelAckMaxCount(uint32_t count) [member function] + cls.add_method('SetDelAckMaxCount', + 'void', + [param('uint32_t', 'count')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetDelAckTimeout(ns3::Time timeout) [member function] + cls.add_method('SetDelAckTimeout', + 'void', + [param('ns3::Time', 'timeout')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetInitialCwnd(uint32_t count) [member function] + cls.add_method('SetInitialCwnd', + 'void', + [param('uint32_t', 'count')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetRcvBufSize(uint32_t size) [member function] + cls.add_method('SetRcvBufSize', + 'void', + [param('uint32_t', 'size')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetSSThresh(uint32_t threshold) [member function] + cls.add_method('SetSSThresh', + 'void', + [param('uint32_t', 'threshold')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetSegSize(uint32_t size) [member function] + cls.add_method('SetSegSize', + 'void', + [param('uint32_t', 'size')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h: void ns3::TcpSocket::SetSndBufSize(uint32_t size) [member function] + cls.add_method('SetSndBufSize', + 'void', + [param('uint32_t', 'size')], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3TcpSocketFactory_methods(root_module, cls): + ## tcp-socket-factory.h: ns3::TcpSocketFactory::TcpSocketFactory() [constructor] + cls.add_constructor([]) + ## tcp-socket-factory.h: ns3::TcpSocketFactory::TcpSocketFactory(ns3::TcpSocketFactory const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TcpSocketFactory const &', 'arg0')]) + ## tcp-socket-factory.h: static ns3::TypeId ns3::TcpSocketFactory::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3UdpSocket_methods(root_module, cls): + ## udp-socket.h: ns3::UdpSocket::UdpSocket(ns3::UdpSocket const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UdpSocket const &', 'arg0')]) + ## udp-socket.h: ns3::UdpSocket::UdpSocket() [constructor] + cls.add_constructor([]) + ## udp-socket.h: static ns3::TypeId ns3::UdpSocket::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## udp-socket.h: int ns3::UdpSocket::MulticastJoinGroup(uint32_t interface, ns3::Address const & groupAddress) [member function] + cls.add_method('MulticastJoinGroup', + 'int', + [param('uint32_t', 'interface'), param('ns3::Address const &', 'groupAddress')], + is_pure_virtual=True, is_virtual=True) + ## udp-socket.h: int ns3::UdpSocket::MulticastLeaveGroup(uint32_t interface, ns3::Address const & groupAddress) [member function] + cls.add_method('MulticastLeaveGroup', + 'int', + [param('uint32_t', 'interface'), param('ns3::Address const &', 'groupAddress')], + is_pure_virtual=True, is_virtual=True) + ## udp-socket.h: int32_t ns3::UdpSocket::GetIpMulticastIf() const [member function] + cls.add_method('GetIpMulticastIf', + 'int32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## udp-socket.h: bool ns3::UdpSocket::GetIpMulticastLoop() const [member function] + cls.add_method('GetIpMulticastLoop', + 'bool', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## udp-socket.h: uint8_t ns3::UdpSocket::GetIpMulticastTtl() const [member function] + cls.add_method('GetIpMulticastTtl', + 'uint8_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## udp-socket.h: uint8_t ns3::UdpSocket::GetIpTtl() const [member function] + cls.add_method('GetIpTtl', + 'uint8_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## udp-socket.h: bool ns3::UdpSocket::GetMtuDiscover() const [member function] + cls.add_method('GetMtuDiscover', + 'bool', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## udp-socket.h: uint32_t ns3::UdpSocket::GetRcvBufSize() const [member function] + cls.add_method('GetRcvBufSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## udp-socket.h: void ns3::UdpSocket::SetIpMulticastIf(int32_t ipIf) [member function] + cls.add_method('SetIpMulticastIf', + 'void', + [param('int32_t', 'ipIf')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## udp-socket.h: void ns3::UdpSocket::SetIpMulticastLoop(bool loop) [member function] + cls.add_method('SetIpMulticastLoop', + 'void', + [param('bool', 'loop')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## udp-socket.h: void ns3::UdpSocket::SetIpMulticastTtl(uint8_t ipTtl) [member function] + cls.add_method('SetIpMulticastTtl', + 'void', + [param('uint8_t', 'ipTtl')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## udp-socket.h: void ns3::UdpSocket::SetIpTtl(uint8_t ipTtl) [member function] + cls.add_method('SetIpTtl', + 'void', + [param('uint8_t', 'ipTtl')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## udp-socket.h: void ns3::UdpSocket::SetMtuDiscover(bool discover) [member function] + cls.add_method('SetMtuDiscover', + 'void', + [param('bool', 'discover')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## udp-socket.h: void ns3::UdpSocket::SetRcvBufSize(uint32_t size) [member function] + cls.add_method('SetRcvBufSize', + 'void', + [param('uint32_t', 'size')], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3UdpSocketFactory_methods(root_module, cls): + ## udp-socket-factory.h: ns3::UdpSocketFactory::UdpSocketFactory() [constructor] + cls.add_constructor([]) + ## udp-socket-factory.h: ns3::UdpSocketFactory::UdpSocketFactory(ns3::UdpSocketFactory const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UdpSocketFactory const &', 'arg0')]) + ## udp-socket-factory.h: static ns3::TypeId ns3::UdpSocketFactory::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3AddressChecker_methods(root_module, cls): + ## address.h: ns3::AddressChecker::AddressChecker() [constructor] + cls.add_constructor([]) + ## address.h: ns3::AddressChecker::AddressChecker(ns3::AddressChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AddressChecker const &', 'arg0')]) + return + +def register_Ns3AddressValue_methods(root_module, cls): + ## address.h: ns3::AddressValue::AddressValue() [constructor] + cls.add_constructor([]) + ## address.h: ns3::AddressValue::AddressValue(ns3::AddressValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AddressValue const &', 'arg0')]) + ## address.h: ns3::AddressValue::AddressValue(ns3::Address const & value) [constructor] + cls.add_constructor([param('ns3::Address const &', 'value')]) + ## address.h: ns3::Ptr ns3::AddressValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## address.h: bool ns3::AddressValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## address.h: ns3::Address ns3::AddressValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Address', + [], + is_const=True) + ## address.h: std::string ns3::AddressValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## address.h: void ns3::AddressValue::Set(ns3::Address const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Address const &', 'value')]) + return + +def register_Ns3Application_methods(root_module, cls): + ## application.h: ns3::Application::Application(ns3::Application const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Application const &', 'arg0')]) + ## application.h: ns3::Application::Application() [constructor] + cls.add_constructor([]) + ## application.h: ns3::Ptr ns3::Application::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## application.h: static ns3::TypeId ns3::Application::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## application.h: void ns3::Application::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## application.h: void ns3::Application::Start(ns3::Time const & startTime) [member function] + cls.add_method('Start', + 'void', + [param('ns3::Time const &', 'startTime')]) + ## application.h: void ns3::Application::Start(ns3::RandomVariable const & startVariable) [member function] + cls.add_method('Start', + 'void', + [param('ns3::RandomVariable const &', 'startVariable')]) + ## application.h: void ns3::Application::Stop(ns3::Time const & stopTime) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::Time const &', 'stopTime')]) + ## application.h: void ns3::Application::Stop(ns3::RandomVariable const & stopVariable) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::RandomVariable const &', 'stopVariable')]) + ## application.h: void ns3::Application::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## application.h: void ns3::Application::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## application.h: void ns3::Application::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3Channel_methods(root_module, cls): + ## channel.h: ns3::Channel::Channel(ns3::Channel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Channel const &', 'arg0')]) + ## channel.h: ns3::Channel::Channel() [constructor] + cls.add_constructor([]) + ## channel.h: ns3::Ptr ns3::Channel::GetDevice(uint32_t i) const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## channel.h: uint32_t ns3::Channel::GetNDevices() const [member function] + cls.add_method('GetNDevices', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## channel.h: static ns3::TypeId ns3::Channel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3DropTailQueue_methods(root_module, cls): + ## drop-tail-queue.h: ns3::DropTailQueue::DropTailQueue(ns3::DropTailQueue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DropTailQueue const &', 'arg0')]) + ## drop-tail-queue.h: ns3::DropTailQueue::DropTailQueue() [constructor] + cls.add_constructor([]) + ## drop-tail-queue.h: ns3::DropTailQueue::Mode ns3::DropTailQueue::GetMode() [member function] + cls.add_method('GetMode', + 'ns3::DropTailQueue::Mode', + []) + ## drop-tail-queue.h: static ns3::TypeId ns3::DropTailQueue::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## drop-tail-queue.h: void ns3::DropTailQueue::SetMode(ns3::DropTailQueue::Mode mode) [member function] + cls.add_method('SetMode', + 'void', + [param('ns3::DropTailQueue::Mode', 'mode')]) + ## drop-tail-queue.h: ns3::Ptr ns3::DropTailQueue::DoDequeue() [member function] + cls.add_method('DoDequeue', + 'ns3::Ptr< ns3::Packet >', + [], + visibility='private', is_virtual=True) + ## drop-tail-queue.h: bool ns3::DropTailQueue::DoEnqueue(ns3::Ptr p) [member function] + cls.add_method('DoEnqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + visibility='private', is_virtual=True) + ## drop-tail-queue.h: ns3::Ptr ns3::DropTailQueue::DoPeek() const [member function] + cls.add_method('DoPeek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3EthernetHeader_methods(root_module, cls): + ## ethernet-header.h: ns3::EthernetHeader::EthernetHeader(ns3::EthernetHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EthernetHeader const &', 'arg0')]) + ## ethernet-header.h: ns3::EthernetHeader::EthernetHeader(bool hasPreamble) [constructor] + cls.add_constructor([param('bool', 'hasPreamble')]) + ## ethernet-header.h: ns3::EthernetHeader::EthernetHeader() [constructor] + cls.add_constructor([]) + ## ethernet-header.h: uint32_t ns3::EthernetHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## ethernet-header.h: ns3::Mac48Address ns3::EthernetHeader::GetDestination() const [member function] + cls.add_method('GetDestination', + 'ns3::Mac48Address', + [], + is_const=True) + ## ethernet-header.h: uint32_t ns3::EthernetHeader::GetHeaderSize() const [member function] + cls.add_method('GetHeaderSize', + 'uint32_t', + [], + is_const=True) + ## ethernet-header.h: ns3::TypeId ns3::EthernetHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## ethernet-header.h: uint16_t ns3::EthernetHeader::GetLengthType() const [member function] + cls.add_method('GetLengthType', + 'uint16_t', + [], + is_const=True) + ## ethernet-header.h: ns3::ethernet_header_t ns3::EthernetHeader::GetPacketType() const [member function] + cls.add_method('GetPacketType', + 'ns3::ethernet_header_t', + [], + is_const=True) + ## ethernet-header.h: uint64_t ns3::EthernetHeader::GetPreambleSfd() const [member function] + cls.add_method('GetPreambleSfd', + 'uint64_t', + [], + is_const=True) + ## ethernet-header.h: uint32_t ns3::EthernetHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ethernet-header.h: ns3::Mac48Address ns3::EthernetHeader::GetSource() const [member function] + cls.add_method('GetSource', + 'ns3::Mac48Address', + [], + is_const=True) + ## ethernet-header.h: static ns3::TypeId ns3::EthernetHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ethernet-header.h: void ns3::EthernetHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ethernet-header.h: void ns3::EthernetHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## ethernet-header.h: void ns3::EthernetHeader::SetDestination(ns3::Mac48Address destination) [member function] + cls.add_method('SetDestination', + 'void', + [param('ns3::Mac48Address', 'destination')]) + ## ethernet-header.h: void ns3::EthernetHeader::SetLengthType(uint16_t size) [member function] + cls.add_method('SetLengthType', + 'void', + [param('uint16_t', 'size')]) + ## ethernet-header.h: void ns3::EthernetHeader::SetPreambleSfd(uint64_t preambleSfd) [member function] + cls.add_method('SetPreambleSfd', + 'void', + [param('uint64_t', 'preambleSfd')]) + ## ethernet-header.h: void ns3::EthernetHeader::SetSource(ns3::Mac48Address source) [member function] + cls.add_method('SetSource', + 'void', + [param('ns3::Mac48Address', 'source')]) + return + +def register_Ns3EthernetTrailer_methods(root_module, cls): + ## ethernet-trailer.h: ns3::EthernetTrailer::EthernetTrailer(ns3::EthernetTrailer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EthernetTrailer const &', 'arg0')]) + ## ethernet-trailer.h: ns3::EthernetTrailer::EthernetTrailer() [constructor] + cls.add_constructor([]) + ## ethernet-trailer.h: void ns3::EthernetTrailer::CalcFcs(ns3::Ptr p) [member function] + cls.add_method('CalcFcs', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## ethernet-trailer.h: bool ns3::EthernetTrailer::CheckFcs(ns3::Ptr p) const [member function] + cls.add_method('CheckFcs', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + is_const=True) + ## ethernet-trailer.h: uint32_t ns3::EthernetTrailer::Deserialize(ns3::Buffer::Iterator end) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'end')], + is_virtual=True) + ## ethernet-trailer.h: static void ns3::EthernetTrailer::EnableFcs(bool enable) [member function] + cls.add_method('EnableFcs', + 'void', + [param('bool', 'enable')], + is_static=True) + ## ethernet-trailer.h: uint32_t ns3::EthernetTrailer::GetFcs() [member function] + cls.add_method('GetFcs', + 'uint32_t', + []) + ## ethernet-trailer.h: ns3::TypeId ns3::EthernetTrailer::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## ethernet-trailer.h: uint32_t ns3::EthernetTrailer::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ethernet-trailer.h: uint32_t ns3::EthernetTrailer::GetTrailerSize() const [member function] + cls.add_method('GetTrailerSize', + 'uint32_t', + [], + is_const=True) + ## ethernet-trailer.h: static ns3::TypeId ns3::EthernetTrailer::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ethernet-trailer.h: void ns3::EthernetTrailer::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ethernet-trailer.h: void ns3::EthernetTrailer::Serialize(ns3::Buffer::Iterator end) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'end')], + is_const=True, is_virtual=True) + ## ethernet-trailer.h: void ns3::EthernetTrailer::SetFcs(uint32_t fcs) [member function] + cls.add_method('SetFcs', + 'void', + [param('uint32_t', 'fcs')]) + return + +def register_Ns3Ipv4_methods(root_module, cls): + ## ipv4.h: ns3::Ipv4::Ipv4(ns3::Ipv4 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4 const &', 'arg0')]) + ## ipv4.h: ns3::Ipv4::Ipv4() [constructor] + cls.add_constructor([]) + ## ipv4.h: bool ns3::Ipv4::AddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('AddAddress', + 'bool', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: uint32_t ns3::Ipv4::AddInterface(ns3::Ptr device) [member function] + cls.add_method('AddInterface', + 'uint32_t', + [param('ns3::Ptr< ns3::NetDevice >', 'device')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: ns3::Ipv4InterfaceAddress ns3::Ipv4::GetAddress(uint32_t interface, uint32_t addressIndex) const [member function] + cls.add_method('GetAddress', + 'ns3::Ipv4InterfaceAddress', + [param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: int32_t ns3::Ipv4::GetInterfaceForAddress(ns3::Ipv4Address address) const [member function] + cls.add_method('GetInterfaceForAddress', + 'int32_t', + [param('ns3::Ipv4Address', 'address')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: int32_t ns3::Ipv4::GetInterfaceForDevice(ns3::Ptr device) const [member function] + cls.add_method('GetInterfaceForDevice', + 'int32_t', + [param('ns3::Ptr< ns3::NetDevice const >', 'device')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: int32_t ns3::Ipv4::GetInterfaceForPrefix(ns3::Ipv4Address address, ns3::Ipv4Mask mask) const [member function] + cls.add_method('GetInterfaceForPrefix', + 'int32_t', + [param('ns3::Ipv4Address', 'address'), param('ns3::Ipv4Mask', 'mask')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: uint16_t ns3::Ipv4::GetMetric(uint32_t interface) const [member function] + cls.add_method('GetMetric', + 'uint16_t', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: uint16_t ns3::Ipv4::GetMtu(uint32_t interface) const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: uint32_t ns3::Ipv4::GetNAddresses(uint32_t interface) const [member function] + cls.add_method('GetNAddresses', + 'uint32_t', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: uint32_t ns3::Ipv4::GetNInterfaces() const [member function] + cls.add_method('GetNInterfaces', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: ns3::Ptr ns3::Ipv4::GetNetDevice(uint32_t interface) [member function] + cls.add_method('GetNetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: ns3::Ptr ns3::Ipv4::GetRoutingProtocol() const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: static ns3::TypeId ns3::Ipv4::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4.h: bool ns3::Ipv4::IsForwarding(uint32_t interface) const [member function] + cls.add_method('IsForwarding', + 'bool', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: bool ns3::Ipv4::IsUp(uint32_t interface) const [member function] + cls.add_method('IsUp', + 'bool', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h: bool ns3::Ipv4::RemoveAddress(uint32_t interface, uint32_t addressIndex) [member function] + cls.add_method('RemoveAddress', + 'bool', + [param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: void ns3::Ipv4::SetDown(uint32_t interface) [member function] + cls.add_method('SetDown', + 'void', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: void ns3::Ipv4::SetForwarding(uint32_t interface, bool val) [member function] + cls.add_method('SetForwarding', + 'void', + [param('uint32_t', 'interface'), param('bool', 'val')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: void ns3::Ipv4::SetMetric(uint32_t interface, uint16_t metric) [member function] + cls.add_method('SetMetric', + 'void', + [param('uint32_t', 'interface'), param('uint16_t', 'metric')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: void ns3::Ipv4::SetRoutingProtocol(ns3::Ptr routingProtocol) [member function] + cls.add_method('SetRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: void ns3::Ipv4::SetUp(uint32_t interface) [member function] + cls.add_method('SetUp', + 'void', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv4.h: ns3::Ipv4::IF_ANY [variable] + cls.add_static_attribute('IF_ANY', 'uint32_t const', is_const=True) + ## ipv4.h: bool ns3::Ipv4::GetIpForward() const [member function] + cls.add_method('GetIpForward', + 'bool', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## ipv4.h: void ns3::Ipv4::SetIpForward(bool forward) [member function] + cls.add_method('SetIpForward', + 'void', + [param('bool', 'forward')], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3Ipv4RawSocketFactory_methods(root_module, cls): + ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory::Ipv4RawSocketFactory() [constructor] + cls.add_constructor([]) + ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory::Ipv4RawSocketFactory(ns3::Ipv4RawSocketFactory const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4RawSocketFactory const &', 'arg0')]) + ## ipv4-raw-socket-factory.h: static ns3::TypeId ns3::Ipv4RawSocketFactory::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3Ipv4RoutingProtocol_methods(root_module, cls): + ## ipv4-routing-protocol.h: ns3::Ipv4RoutingProtocol::Ipv4RoutingProtocol() [constructor] + cls.add_constructor([]) + ## ipv4-routing-protocol.h: ns3::Ipv4RoutingProtocol::Ipv4RoutingProtocol(ns3::Ipv4RoutingProtocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4RoutingProtocol const &', 'arg0')]) + ## ipv4-routing-protocol.h: static ns3::TypeId ns3::Ipv4RoutingProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-routing-protocol.h: void ns3::Ipv4RoutingProtocol::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_pure_virtual=True, is_virtual=True) + ## ipv4-routing-protocol.h: void ns3::Ipv4RoutingProtocol::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv4-routing-protocol.h: void ns3::Ipv4RoutingProtocol::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv4-routing-protocol.h: void ns3::Ipv4RoutingProtocol::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_pure_virtual=True, is_virtual=True) + ## ipv4-routing-protocol.h: bool ns3::Ipv4RoutingProtocol::RouteInput(ns3::Ptr p, ns3::Ipv4Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + is_pure_virtual=True, is_virtual=True) + ## ipv4-routing-protocol.h: ns3::Ptr ns3::Ipv4RoutingProtocol::RouteOutput(ns3::Ptr p, ns3::Ipv4Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv4Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + is_pure_virtual=True, is_virtual=True) + ## ipv4-routing-protocol.h: void ns3::Ipv4RoutingProtocol::SetIpv4(ns3::Ptr ipv4) [member function] + cls.add_method('SetIpv4', + 'void', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3Ipv6_methods(root_module, cls): + ## ipv6.h: ns3::Ipv6::Ipv6(ns3::Ipv6 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6 const &', 'arg0')]) + ## ipv6.h: ns3::Ipv6::Ipv6() [constructor] + cls.add_constructor([]) + ## ipv6.h: bool ns3::Ipv6::AddAddress(uint32_t interface, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('AddAddress', + 'bool', + [param('uint32_t', 'interface'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: uint32_t ns3::Ipv6::AddInterface(ns3::Ptr device) [member function] + cls.add_method('AddInterface', + 'uint32_t', + [param('ns3::Ptr< ns3::NetDevice >', 'device')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: ns3::Ipv6InterfaceAddress ns3::Ipv6::GetAddress(uint32_t interface, uint32_t addressIndex) const [member function] + cls.add_method('GetAddress', + 'ns3::Ipv6InterfaceAddress', + [param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: int32_t ns3::Ipv6::GetInterfaceForAddress(ns3::Ipv6Address address) const [member function] + cls.add_method('GetInterfaceForAddress', + 'int32_t', + [param('ns3::Ipv6Address', 'address')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: int32_t ns3::Ipv6::GetInterfaceForDevice(ns3::Ptr device) const [member function] + cls.add_method('GetInterfaceForDevice', + 'int32_t', + [param('ns3::Ptr< ns3::NetDevice const >', 'device')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: int32_t ns3::Ipv6::GetInterfaceForPrefix(ns3::Ipv6Address address, ns3::Ipv6Prefix mask) const [member function] + cls.add_method('GetInterfaceForPrefix', + 'int32_t', + [param('ns3::Ipv6Address', 'address'), param('ns3::Ipv6Prefix', 'mask')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: uint16_t ns3::Ipv6::GetMetric(uint32_t interface) const [member function] + cls.add_method('GetMetric', + 'uint16_t', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: uint16_t ns3::Ipv6::GetMtu(uint32_t interface) const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: uint32_t ns3::Ipv6::GetNAddresses(uint32_t interface) const [member function] + cls.add_method('GetNAddresses', + 'uint32_t', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: uint32_t ns3::Ipv6::GetNInterfaces() const [member function] + cls.add_method('GetNInterfaces', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: ns3::Ptr ns3::Ipv6::GetNetDevice(uint32_t interface) [member function] + cls.add_method('GetNetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: ns3::Ptr ns3::Ipv6::GetRoutingProtocol() const [member function] + cls.add_method('GetRoutingProtocol', + 'ns3::Ptr< ns3::Ipv6RoutingProtocol >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: static ns3::TypeId ns3::Ipv6::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6.h: bool ns3::Ipv6::IsForwarding(uint32_t interface) const [member function] + cls.add_method('IsForwarding', + 'bool', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: bool ns3::Ipv6::IsUp(uint32_t interface) const [member function] + cls.add_method('IsUp', + 'bool', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv6.h: bool ns3::Ipv6::RemoveAddress(uint32_t interface, uint32_t addressIndex) [member function] + cls.add_method('RemoveAddress', + 'bool', + [param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: void ns3::Ipv6::SetDown(uint32_t interface) [member function] + cls.add_method('SetDown', + 'void', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: void ns3::Ipv6::SetForwarding(uint32_t interface, bool val) [member function] + cls.add_method('SetForwarding', + 'void', + [param('uint32_t', 'interface'), param('bool', 'val')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: void ns3::Ipv6::SetMetric(uint32_t interface, uint16_t metric) [member function] + cls.add_method('SetMetric', + 'void', + [param('uint32_t', 'interface'), param('uint16_t', 'metric')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: void ns3::Ipv6::SetRoutingProtocol(ns3::Ptr routingProtocol) [member function] + cls.add_method('SetRoutingProtocol', + 'void', + [param('ns3::Ptr< ns3::Ipv6RoutingProtocol >', 'routingProtocol')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: void ns3::Ipv6::SetUp(uint32_t interface) [member function] + cls.add_method('SetUp', + 'void', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv6.h: ns3::Ipv6::IF_ANY [variable] + cls.add_static_attribute('IF_ANY', 'uint32_t const', is_const=True) + ## ipv6.h: bool ns3::Ipv6::GetIpForward() const [member function] + cls.add_method('GetIpForward', + 'bool', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## ipv6.h: void ns3::Ipv6::SetIpForward(bool forward) [member function] + cls.add_method('SetIpForward', + 'void', + [param('bool', 'forward')], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3Ipv6RawSocketFactory_methods(root_module, cls): + ## ipv6-raw-socket-factory.h: ns3::Ipv6RawSocketFactory::Ipv6RawSocketFactory() [constructor] + cls.add_constructor([]) + ## ipv6-raw-socket-factory.h: ns3::Ipv6RawSocketFactory::Ipv6RawSocketFactory(ns3::Ipv6RawSocketFactory const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6RawSocketFactory const &', 'arg0')]) + ## ipv6-raw-socket-factory.h: static ns3::TypeId ns3::Ipv6RawSocketFactory::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3Ipv6RoutingProtocol_methods(root_module, cls): + ## ipv6-routing-protocol.h: ns3::Ipv6RoutingProtocol::Ipv6RoutingProtocol() [constructor] + cls.add_constructor([]) + ## ipv6-routing-protocol.h: ns3::Ipv6RoutingProtocol::Ipv6RoutingProtocol(ns3::Ipv6RoutingProtocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6RoutingProtocol const &', 'arg0')]) + ## ipv6-routing-protocol.h: static ns3::TypeId ns3::Ipv6RoutingProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6-routing-protocol.h: void ns3::Ipv6RoutingProtocol::NotifyAddAddress(uint32_t interface, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-routing-protocol.h: void ns3::Ipv6RoutingProtocol::NotifyAddRoute(ns3::Ipv6Address dst, ns3::Ipv6Prefix mask, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address::GetZero( )) [member function] + cls.add_method('NotifyAddRoute', + 'void', + [param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Prefix', 'mask'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address::GetZero( )')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-routing-protocol.h: void ns3::Ipv6RoutingProtocol::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-routing-protocol.h: void ns3::Ipv6RoutingProtocol::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-routing-protocol.h: void ns3::Ipv6RoutingProtocol::NotifyRemoveAddress(uint32_t interface, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-routing-protocol.h: void ns3::Ipv6RoutingProtocol::NotifyRemoveRoute(ns3::Ipv6Address dst, ns3::Ipv6Prefix mask, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address::GetZero( )) [member function] + cls.add_method('NotifyRemoveRoute', + 'void', + [param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Prefix', 'mask'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address::GetZero( )')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-routing-protocol.h: bool ns3::Ipv6RoutingProtocol::RouteInput(ns3::Ptr p, ns3::Ipv6Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv6Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv6Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv6Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv6Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv6Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv6MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-routing-protocol.h: ns3::Ptr ns3::Ipv6RoutingProtocol::RouteOutput(ns3::Ptr p, ns3::Ipv6Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv6Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + is_pure_virtual=True, is_virtual=True) + ## ipv6-routing-protocol.h: void ns3::Ipv6RoutingProtocol::SetIpv6(ns3::Ptr ipv6) [member function] + cls.add_method('SetIpv6', + 'void', + [param('ns3::Ptr< ns3::Ipv6 >', 'ipv6')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3NetDevice_methods(root_module, cls): + ## net-device.h: ns3::NetDevice::NetDevice() [constructor] + cls.add_constructor([]) + ## net-device.h: ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NetDevice const &', 'arg0')]) + ## net-device.h: void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: ns3::Address ns3::NetDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: ns3::Address ns3::NetDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: ns3::Ptr ns3::NetDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: uint32_t ns3::NetDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: uint16_t ns3::NetDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: ns3::Ptr ns3::NetDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: static ns3::TypeId ns3::NetDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## net-device.h: bool ns3::NetDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: void ns3::NetDevice::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: void ns3::NetDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: void ns3::NetDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: void ns3::NetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: void ns3::NetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_pure_virtual=True, is_virtual=True) + ## net-device.h: bool ns3::NetDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3Node_methods(root_module, cls): + ## node.h: ns3::Node::Node(ns3::Node const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Node const &', 'arg0')]) + ## node.h: ns3::Node::Node() [constructor] + cls.add_constructor([]) + ## node.h: ns3::Node::Node(uint32_t systemId) [constructor] + cls.add_constructor([param('uint32_t', 'systemId')]) + ## node.h: uint32_t ns3::Node::AddApplication(ns3::Ptr application) [member function] + cls.add_method('AddApplication', + 'uint32_t', + [param('ns3::Ptr< ns3::Application >', 'application')]) + ## node.h: uint32_t ns3::Node::AddDevice(ns3::Ptr device) [member function] + cls.add_method('AddDevice', + 'uint32_t', + [param('ns3::Ptr< ns3::NetDevice >', 'device')]) + ## node.h: static bool ns3::Node::ChecksumEnabled() [member function] + cls.add_method('ChecksumEnabled', + 'bool', + [], + is_static=True) + ## node.h: ns3::Ptr ns3::Node::GetApplication(uint32_t index) const [member function] + cls.add_method('GetApplication', + 'ns3::Ptr< ns3::Application >', + [param('uint32_t', 'index')], + is_const=True) + ## node.h: ns3::Ptr ns3::Node::GetDevice(uint32_t index) const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'index')], + is_const=True) + ## node.h: uint32_t ns3::Node::GetId() const [member function] + cls.add_method('GetId', + 'uint32_t', + [], + is_const=True) + ## node.h: uint32_t ns3::Node::GetNApplications() const [member function] + cls.add_method('GetNApplications', + 'uint32_t', + [], + is_const=True) + ## node.h: uint32_t ns3::Node::GetNDevices() const [member function] + cls.add_method('GetNDevices', + 'uint32_t', + [], + is_const=True) + ## node.h: uint32_t ns3::Node::GetSystemId() const [member function] + cls.add_method('GetSystemId', + 'uint32_t', + [], + is_const=True) + ## node.h: static ns3::TypeId ns3::Node::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## node.h: void ns3::Node::RegisterProtocolHandler(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> handler, uint16_t protocolType, ns3::Ptr device, bool promiscuous=false) [member function] + cls.add_method('RegisterProtocolHandler', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'promiscuous', default_value='false')]) + ## node.h: void ns3::Node::UnregisterProtocolHandler(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> handler) [member function] + cls.add_method('UnregisterProtocolHandler', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler')]) + ## node.h: void ns3::Node::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## node.h: void ns3::Node::NotifyDeviceAdded(ns3::Ptr device) [member function] + cls.add_method('NotifyDeviceAdded', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'device')], + visibility='private', is_virtual=True) + return + +def register_Ns3PacketSocketFactory_methods(root_module, cls): + ## packet-socket-factory.h: ns3::PacketSocketFactory::PacketSocketFactory(ns3::PacketSocketFactory const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSocketFactory const &', 'arg0')]) + ## packet-socket-factory.h: ns3::PacketSocketFactory::PacketSocketFactory() [constructor] + cls.add_constructor([]) + ## packet-socket-factory.h: ns3::Ptr ns3::PacketSocketFactory::CreateSocket() [member function] + cls.add_method('CreateSocket', + 'ns3::Ptr< ns3::Socket >', + [], + is_virtual=True) + ## packet-socket-factory.h: static ns3::TypeId ns3::PacketSocketFactory::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3SimpleChannel_methods(root_module, cls): + ## simple-channel.h: ns3::SimpleChannel::SimpleChannel(ns3::SimpleChannel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SimpleChannel const &', 'arg0')]) + ## simple-channel.h: ns3::SimpleChannel::SimpleChannel() [constructor] + cls.add_constructor([]) + ## simple-channel.h: void ns3::SimpleChannel::Add(ns3::Ptr device) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::SimpleNetDevice >', 'device')]) + ## simple-channel.h: ns3::Ptr ns3::SimpleChannel::GetDevice(uint32_t i) const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## simple-channel.h: uint32_t ns3::SimpleChannel::GetNDevices() const [member function] + cls.add_method('GetNDevices', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## simple-channel.h: static ns3::TypeId ns3::SimpleChannel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## simple-channel.h: void ns3::SimpleChannel::Send(ns3::Ptr p, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from, ns3::Ptr sender) [member function] + cls.add_method('Send', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from'), param('ns3::Ptr< ns3::SimpleNetDevice >', 'sender')]) + return + +def register_Ns3SimpleNetDevice_methods(root_module, cls): + ## simple-net-device.h: ns3::SimpleNetDevice::SimpleNetDevice(ns3::SimpleNetDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SimpleNetDevice const &', 'arg0')]) + ## simple-net-device.h: ns3::SimpleNetDevice::SimpleNetDevice() [constructor] + cls.add_constructor([]) + ## simple-net-device.h: void ns3::SimpleNetDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## simple-net-device.h: ns3::Address ns3::SimpleNetDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: ns3::Address ns3::SimpleNetDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: ns3::Ptr ns3::SimpleNetDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: uint32_t ns3::SimpleNetDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: uint16_t ns3::SimpleNetDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: ns3::Address ns3::SimpleNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## simple-net-device.h: ns3::Address ns3::SimpleNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## simple-net-device.h: ns3::Ptr ns3::SimpleNetDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: static ns3::TypeId ns3::SimpleNetDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: void ns3::SimpleNetDevice::Receive(ns3::Ptr packet, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Receive', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')]) + ## simple-net-device.h: bool ns3::SimpleNetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## simple-net-device.h: void ns3::SimpleNetDevice::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + is_virtual=True) + ## simple-net-device.h: void ns3::SimpleNetDevice::SetChannel(ns3::Ptr channel) [member function] + cls.add_method('SetChannel', + 'void', + [param('ns3::Ptr< ns3::SimpleChannel >', 'channel')]) + ## simple-net-device.h: void ns3::SimpleNetDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## simple-net-device.h: void ns3::SimpleNetDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## simple-net-device.h: void ns3::SimpleNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## simple-net-device.h: void ns3::SimpleNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## simple-net-device.h: bool ns3::SimpleNetDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## simple-net-device.h: void ns3::SimpleNetDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + ## address.h: extern ns3::Ptr ns3::MakeAddressChecker() [free function] + module.add_function('MakeAddressChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## ipv4-address.h: extern ns3::Ptr ns3::MakeIpv4AddressChecker() [free function] + module.add_function('MakeIpv4AddressChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## ipv4-address.h: extern ns3::Ptr ns3::MakeIpv4MaskChecker() [free function] + module.add_function('MakeIpv4MaskChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## ipv6-address.h: extern ns3::Ptr ns3::MakeIpv6AddressChecker() [free function] + module.add_function('MakeIpv6AddressChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## ipv6-address.h: extern ns3::Ptr ns3::MakeIpv6PrefixChecker() [free function] + module.add_function('MakeIpv6PrefixChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## mac48-address.h: extern ns3::Ptr ns3::MakeMac48AddressChecker() [free function] + module.add_function('MakeMac48AddressChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Address & ad, uint32_t len) [free function] + module.add_function('ReadFrom', + 'void', + [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Address &', 'ad'), param('uint32_t', 'len')]) + ## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv4Address & ad) [free function] + module.add_function('ReadFrom', + 'void', + [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address &', 'ad')]) + ## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv6Address & ad) [free function] + module.add_function('ReadFrom', + 'void', + [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv6Address &', 'ad')]) + ## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac48Address & ad) [free function] + module.add_function('ReadFrom', + 'void', + [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address &', 'ad')]) + ## address-utils.h: extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Address const & ad) [free function] + module.add_function('WriteTo', + 'void', + [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Address const &', 'ad')]) + ## address-utils.h: extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Ipv4Address ad) [free function] + module.add_function('WriteTo', + 'void', + [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address', 'ad')]) + ## address-utils.h: extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Ipv6Address ad) [free function] + module.add_function('WriteTo', + 'void', + [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv6Address', 'ad')]) + ## address-utils.h: extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Mac48Address ad) [free function] + module.add_function('WriteTo', + 'void', + [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address', 'ad')]) + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + ## address-utils.h: extern bool ns3::addressUtils::IsMulticast(ns3::Address const & ad) [free function] + module.add_function('IsMulticast', + 'bool', + [param('ns3::Address const &', 'ad')]) + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_olsr.py b/bindings/python/apidefs/gcc-LP64/ns3_module_olsr.py new file mode 100644 index 000000000..c90959202 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_olsr.py @@ -0,0 +1,920 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## olsr-state.h: ns3::OlsrState [class] + module.add_class('OlsrState') + module.add_container('std::vector< ns3::olsr::MprSelectorTuple >', 'ns3::olsr::MprSelectorTuple', container_type='vector') + module.add_container('std::vector< ns3::olsr::NeighborTuple >', 'ns3::olsr::NeighborTuple', container_type='vector') + module.add_container('std::vector< ns3::olsr::TwoHopNeighborTuple >', 'ns3::olsr::TwoHopNeighborTuple', container_type='vector') + module.add_container('std::vector< ns3::olsr::LinkTuple >', 'ns3::olsr::LinkTuple', container_type='vector') + module.add_container('std::vector< ns3::olsr::TopologyTuple >', 'ns3::olsr::TopologyTuple', container_type='vector') + module.add_container('std::vector< ns3::olsr::IfaceAssocTuple >', 'ns3::olsr::IfaceAssocTuple', container_type='vector') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + ## olsr-repositories.h: ns3::olsr::DuplicateTuple [struct] + module.add_class('DuplicateTuple') + ## olsr-repositories.h: ns3::olsr::IfaceAssocTuple [struct] + module.add_class('IfaceAssocTuple') + ## olsr-repositories.h: ns3::olsr::LinkTuple [struct] + module.add_class('LinkTuple') + ## olsr-header.h: ns3::olsr::MessageHeader [class] + module.add_class('MessageHeader', parent=root_module['ns3::Header']) + ## olsr-header.h: ns3::olsr::MessageHeader::MessageType [enumeration] + module.add_enum('MessageType', ['HELLO_MESSAGE', 'TC_MESSAGE', 'MID_MESSAGE', 'HNA_MESSAGE'], outer_class=root_module['ns3::olsr::MessageHeader']) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello [struct] + module.add_class('Hello', outer_class=root_module['ns3::olsr::MessageHeader']) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage [struct] + module.add_class('LinkMessage', outer_class=root_module['ns3::olsr::MessageHeader::Hello']) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna [struct] + module.add_class('Hna', outer_class=root_module['ns3::olsr::MessageHeader']) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association [struct] + module.add_class('Association', outer_class=root_module['ns3::olsr::MessageHeader::Hna']) + ## olsr-header.h: ns3::olsr::MessageHeader::Mid [struct] + module.add_class('Mid', outer_class=root_module['ns3::olsr::MessageHeader']) + ## olsr-header.h: ns3::olsr::MessageHeader::Tc [struct] + module.add_class('Tc', outer_class=root_module['ns3::olsr::MessageHeader']) + ## olsr-repositories.h: ns3::olsr::MprSelectorTuple [struct] + module.add_class('MprSelectorTuple') + ## olsr-repositories.h: ns3::olsr::NeighborTuple [struct] + module.add_class('NeighborTuple') + ## olsr-repositories.h: ns3::olsr::NeighborTuple::Status [enumeration] + module.add_enum('Status', ['STATUS_NOT_SYM', 'STATUS_SYM'], outer_class=root_module['ns3::olsr::NeighborTuple']) + ## olsr-header.h: ns3::olsr::PacketHeader [class] + module.add_class('PacketHeader', parent=root_module['ns3::Header']) + ## olsr-routing-protocol.h: ns3::olsr::RoutingProtocol [class] + module.add_class('RoutingProtocol', parent=root_module['ns3::Ipv4RoutingProtocol']) + ## olsr-routing-protocol.h: ns3::olsr::RoutingTableEntry [struct] + module.add_class('RoutingTableEntry') + ## olsr-repositories.h: ns3::olsr::TopologyTuple [struct] + module.add_class('TopologyTuple') + ## olsr-repositories.h: ns3::olsr::TwoHopNeighborTuple [struct] + 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::vector< ns3::olsr::DuplicateTuple, std::allocator< ns3::olsr::DuplicateTuple > >*', 'ns3::olsr::DuplicateSet*') + typehandlers.add_type_alias('std::vector< ns3::olsr::DuplicateTuple, std::allocator< ns3::olsr::DuplicateTuple > >&', 'ns3::olsr::DuplicateSet&') + 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::NeighborTuple, std::allocator< ns3::olsr::NeighborTuple > >*', 'ns3::olsr::NeighborSet*') + typehandlers.add_type_alias('std::vector< ns3::olsr::NeighborTuple, std::allocator< ns3::olsr::NeighborTuple > >&', 'ns3::olsr::NeighborSet&') + typehandlers.add_type_alias('std::set< ns3::Ipv4Address, std::less< ns3::Ipv4Address >, std::allocator< ns3::Ipv4Address > >', 'ns3::olsr::MprSet') + typehandlers.add_type_alias('std::set< ns3::Ipv4Address, std::less< ns3::Ipv4Address >, std::allocator< ns3::Ipv4Address > >*', 'ns3::olsr::MprSet*') + 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::MprSelectorTuple, std::allocator< ns3::olsr::MprSelectorTuple > >*', 'ns3::olsr::MprSelectorSet*') + 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::TopologyTuple, std::allocator< ns3::olsr::TopologyTuple > >', 'ns3::olsr::TopologySet') + 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::TopologyTuple, std::allocator< ns3::olsr::TopologyTuple > >&', 'ns3::olsr::TopologySet&') + 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::MessageHeader, std::allocator< ns3::olsr::MessageHeader > >*', 'ns3::olsr::MessageList*') + 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::IfaceAssocTuple, std::allocator< ns3::olsr::IfaceAssocTuple > >*', 'ns3::olsr::IfaceAssocSet*') + 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::TwoHopNeighborTuple, std::allocator< ns3::olsr::TwoHopNeighborTuple > >', 'ns3::olsr::TwoHopNeighborSet') + 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::TwoHopNeighborTuple, std::allocator< ns3::olsr::TwoHopNeighborTuple > >&', 'ns3::olsr::TwoHopNeighborSet&') + typehandlers.add_type_alias('std::vector< ns3::olsr::LinkTuple, std::allocator< ns3::olsr::LinkTuple > >', 'ns3::olsr::LinkSet') + typehandlers.add_type_alias('std::vector< ns3::olsr::LinkTuple, std::allocator< ns3::olsr::LinkTuple > >*', 'ns3::olsr::LinkSet*') + 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']) + register_Ns3OlsrDuplicateTuple_methods(root_module, root_module['ns3::olsr::DuplicateTuple']) + register_Ns3OlsrIfaceAssocTuple_methods(root_module, root_module['ns3::olsr::IfaceAssocTuple']) + register_Ns3OlsrLinkTuple_methods(root_module, root_module['ns3::olsr::LinkTuple']) + register_Ns3OlsrMessageHeader_methods(root_module, root_module['ns3::olsr::MessageHeader']) + register_Ns3OlsrMessageHeaderHello_methods(root_module, root_module['ns3::olsr::MessageHeader::Hello']) + register_Ns3OlsrMessageHeaderHelloLinkMessage_methods(root_module, root_module['ns3::olsr::MessageHeader::Hello::LinkMessage']) + register_Ns3OlsrMessageHeaderHna_methods(root_module, root_module['ns3::olsr::MessageHeader::Hna']) + register_Ns3OlsrMessageHeaderHnaAssociation_methods(root_module, root_module['ns3::olsr::MessageHeader::Hna::Association']) + register_Ns3OlsrMessageHeaderMid_methods(root_module, root_module['ns3::olsr::MessageHeader::Mid']) + register_Ns3OlsrMessageHeaderTc_methods(root_module, root_module['ns3::olsr::MessageHeader::Tc']) + register_Ns3OlsrMprSelectorTuple_methods(root_module, root_module['ns3::olsr::MprSelectorTuple']) + register_Ns3OlsrNeighborTuple_methods(root_module, root_module['ns3::olsr::NeighborTuple']) + register_Ns3OlsrPacketHeader_methods(root_module, root_module['ns3::olsr::PacketHeader']) + register_Ns3OlsrRoutingProtocol_methods(root_module, root_module['ns3::olsr::RoutingProtocol']) + register_Ns3OlsrRoutingTableEntry_methods(root_module, root_module['ns3::olsr::RoutingTableEntry']) + register_Ns3OlsrTopologyTuple_methods(root_module, root_module['ns3::olsr::TopologyTuple']) + register_Ns3OlsrTwoHopNeighborTuple_methods(root_module, root_module['ns3::olsr::TwoHopNeighborTuple']) + return + +def register_Ns3OlsrState_methods(root_module, cls): + ## olsr-state.h: ns3::OlsrState::OlsrState(ns3::OlsrState const & arg0) [copy constructor] + cls.add_constructor([param('ns3::OlsrState const &', 'arg0')]) + ## olsr-state.h: ns3::OlsrState::OlsrState() [constructor] + cls.add_constructor([]) + ## olsr-state.h: void ns3::OlsrState::EraseDuplicateTuple(ns3::olsr::DuplicateTuple const & tuple) [member function] + cls.add_method('EraseDuplicateTuple', + 'void', + [param('ns3::olsr::DuplicateTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::EraseIfaceAssocTuple(ns3::olsr::IfaceAssocTuple const & tuple) [member function] + cls.add_method('EraseIfaceAssocTuple', + 'void', + [param('ns3::olsr::IfaceAssocTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::EraseLinkTuple(ns3::olsr::LinkTuple const & tuple) [member function] + cls.add_method('EraseLinkTuple', + 'void', + [param('ns3::olsr::LinkTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::EraseMprSelectorTuple(ns3::olsr::MprSelectorTuple const & tuple) [member function] + cls.add_method('EraseMprSelectorTuple', + 'void', + [param('ns3::olsr::MprSelectorTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::EraseMprSelectorTuples(ns3::Ipv4Address const & mainAddr) [member function] + cls.add_method('EraseMprSelectorTuples', + 'void', + [param('ns3::Ipv4Address const &', 'mainAddr')]) + ## olsr-state.h: void ns3::OlsrState::EraseNeighborTuple(ns3::olsr::NeighborTuple const & neighborTuple) [member function] + cls.add_method('EraseNeighborTuple', + 'void', + [param('ns3::olsr::NeighborTuple const &', 'neighborTuple')]) + ## olsr-state.h: void ns3::OlsrState::EraseNeighborTuple(ns3::Ipv4Address const & mainAddr) [member function] + cls.add_method('EraseNeighborTuple', + 'void', + [param('ns3::Ipv4Address const &', 'mainAddr')]) + ## olsr-state.h: void ns3::OlsrState::EraseOlderTopologyTuples(ns3::Ipv4Address const & lastAddr, uint16_t ansn) [member function] + cls.add_method('EraseOlderTopologyTuples', + 'void', + [param('ns3::Ipv4Address const &', 'lastAddr'), param('uint16_t', 'ansn')]) + ## olsr-state.h: void ns3::OlsrState::EraseTopologyTuple(ns3::olsr::TopologyTuple const & tuple) [member function] + cls.add_method('EraseTopologyTuple', + 'void', + [param('ns3::olsr::TopologyTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::EraseTwoHopNeighborTuple(ns3::olsr::TwoHopNeighborTuple const & tuple) [member function] + cls.add_method('EraseTwoHopNeighborTuple', + 'void', + [param('ns3::olsr::TwoHopNeighborTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::EraseTwoHopNeighborTuples(ns3::Ipv4Address const & neighbor) [member function] + cls.add_method('EraseTwoHopNeighborTuples', + 'void', + [param('ns3::Ipv4Address const &', 'neighbor')]) + ## olsr-state.h: void ns3::OlsrState::EraseTwoHopNeighborTuples(ns3::Ipv4Address const & neighbor, ns3::Ipv4Address const & twoHopNeighbor) [member function] + cls.add_method('EraseTwoHopNeighborTuples', + 'void', + [param('ns3::Ipv4Address const &', 'neighbor'), param('ns3::Ipv4Address const &', 'twoHopNeighbor')]) + ## olsr-state.h: ns3::olsr::DuplicateTuple * ns3::OlsrState::FindDuplicateTuple(ns3::Ipv4Address const & address, uint16_t sequenceNumber) [member function] + cls.add_method('FindDuplicateTuple', + 'ns3::olsr::DuplicateTuple *', + [param('ns3::Ipv4Address const &', 'address'), param('uint16_t', 'sequenceNumber')]) + ## olsr-state.h: ns3::olsr::IfaceAssocTuple * ns3::OlsrState::FindIfaceAssocTuple(ns3::Ipv4Address const & ifaceAddr) [member function] + cls.add_method('FindIfaceAssocTuple', + 'ns3::olsr::IfaceAssocTuple *', + [param('ns3::Ipv4Address const &', 'ifaceAddr')]) + ## olsr-state.h: ns3::olsr::IfaceAssocTuple const * ns3::OlsrState::FindIfaceAssocTuple(ns3::Ipv4Address const & ifaceAddr) const [member function] + cls.add_method('FindIfaceAssocTuple', + 'ns3::olsr::IfaceAssocTuple const *', + [param('ns3::Ipv4Address const &', 'ifaceAddr')], + is_const=True) + ## olsr-state.h: ns3::olsr::LinkTuple * ns3::OlsrState::FindLinkTuple(ns3::Ipv4Address const & ifaceAddr) [member function] + cls.add_method('FindLinkTuple', + 'ns3::olsr::LinkTuple *', + [param('ns3::Ipv4Address const &', 'ifaceAddr')]) + ## olsr-state.h: bool ns3::OlsrState::FindMprAddress(ns3::Ipv4Address const & address) [member function] + cls.add_method('FindMprAddress', + 'bool', + [param('ns3::Ipv4Address const &', 'address')]) + ## olsr-state.h: ns3::olsr::MprSelectorTuple * ns3::OlsrState::FindMprSelectorTuple(ns3::Ipv4Address const & mainAddr) [member function] + cls.add_method('FindMprSelectorTuple', + 'ns3::olsr::MprSelectorTuple *', + [param('ns3::Ipv4Address const &', 'mainAddr')]) + ## olsr-state.h: std::vector > ns3::OlsrState::FindNeighborInterfaces(ns3::Ipv4Address const & neighborMainAddr) const [member function] + cls.add_method('FindNeighborInterfaces', + 'std::vector< ns3::Ipv4Address >', + [param('ns3::Ipv4Address const &', 'neighborMainAddr')], + is_const=True) + ## olsr-state.h: ns3::olsr::NeighborTuple * ns3::OlsrState::FindNeighborTuple(ns3::Ipv4Address const & mainAddr) [member function] + cls.add_method('FindNeighborTuple', + 'ns3::olsr::NeighborTuple *', + [param('ns3::Ipv4Address const &', 'mainAddr')]) + ## olsr-state.h: ns3::olsr::NeighborTuple * ns3::OlsrState::FindNeighborTuple(ns3::Ipv4Address const & mainAddr, uint8_t willingness) [member function] + cls.add_method('FindNeighborTuple', + 'ns3::olsr::NeighborTuple *', + [param('ns3::Ipv4Address const &', 'mainAddr'), param('uint8_t', 'willingness')]) + ## olsr-state.h: ns3::olsr::TopologyTuple * ns3::OlsrState::FindNewerTopologyTuple(ns3::Ipv4Address const & lastAddr, uint16_t ansn) [member function] + cls.add_method('FindNewerTopologyTuple', + 'ns3::olsr::TopologyTuple *', + [param('ns3::Ipv4Address const &', 'lastAddr'), param('uint16_t', 'ansn')]) + ## olsr-state.h: ns3::olsr::LinkTuple * ns3::OlsrState::FindSymLinkTuple(ns3::Ipv4Address const & ifaceAddr, ns3::Time time) [member function] + cls.add_method('FindSymLinkTuple', + 'ns3::olsr::LinkTuple *', + [param('ns3::Ipv4Address const &', 'ifaceAddr'), param('ns3::Time', 'time')]) + ## olsr-state.h: ns3::olsr::NeighborTuple const * ns3::OlsrState::FindSymNeighborTuple(ns3::Ipv4Address const & mainAddr) const [member function] + cls.add_method('FindSymNeighborTuple', + 'ns3::olsr::NeighborTuple const *', + [param('ns3::Ipv4Address const &', 'mainAddr')], + is_const=True) + ## olsr-state.h: ns3::olsr::TopologyTuple * ns3::OlsrState::FindTopologyTuple(ns3::Ipv4Address const & destAddr, ns3::Ipv4Address const & lastAddr) [member function] + cls.add_method('FindTopologyTuple', + 'ns3::olsr::TopologyTuple *', + [param('ns3::Ipv4Address const &', 'destAddr'), param('ns3::Ipv4Address const &', 'lastAddr')]) + ## olsr-state.h: ns3::olsr::TwoHopNeighborTuple * ns3::OlsrState::FindTwoHopNeighborTuple(ns3::Ipv4Address const & neighbor, ns3::Ipv4Address const & twoHopNeighbor) [member function] + cls.add_method('FindTwoHopNeighborTuple', + 'ns3::olsr::TwoHopNeighborTuple *', + [param('ns3::Ipv4Address const &', 'neighbor'), param('ns3::Ipv4Address const &', 'twoHopNeighbor')]) + ## olsr-state.h: ns3::olsr::IfaceAssocSet const & ns3::OlsrState::GetIfaceAssocSet() const [member function] + cls.add_method('GetIfaceAssocSet', + 'ns3::olsr::IfaceAssocSet const &', + [], + is_const=True) + ## olsr-state.h: ns3::olsr::IfaceAssocSet & ns3::OlsrState::GetIfaceAssocSetMutable() [member function] + cls.add_method('GetIfaceAssocSetMutable', + 'ns3::olsr::IfaceAssocSet &', + []) + ## olsr-state.h: ns3::olsr::LinkSet const & ns3::OlsrState::GetLinks() const [member function] + cls.add_method('GetLinks', + 'ns3::olsr::LinkSet const &', + [], + is_const=True) + ## olsr-state.h: ns3::olsr::MprSelectorSet const & ns3::OlsrState::GetMprSelectors() const [member function] + cls.add_method('GetMprSelectors', + 'ns3::olsr::MprSelectorSet const &', + [], + is_const=True) + ## olsr-state.h: ns3::olsr::NeighborSet const & ns3::OlsrState::GetNeighbors() const [member function] + cls.add_method('GetNeighbors', + 'ns3::olsr::NeighborSet const &', + [], + is_const=True) + ## olsr-state.h: ns3::olsr::NeighborSet & ns3::OlsrState::GetNeighbors() [member function] + cls.add_method('GetNeighbors', + 'ns3::olsr::NeighborSet &', + []) + ## olsr-state.h: ns3::olsr::TopologySet const & ns3::OlsrState::GetTopologySet() const [member function] + cls.add_method('GetTopologySet', + 'ns3::olsr::TopologySet const &', + [], + is_const=True) + ## olsr-state.h: ns3::olsr::TwoHopNeighborSet const & ns3::OlsrState::GetTwoHopNeighbors() const [member function] + cls.add_method('GetTwoHopNeighbors', + 'ns3::olsr::TwoHopNeighborSet const &', + [], + is_const=True) + ## olsr-state.h: ns3::olsr::TwoHopNeighborSet & ns3::OlsrState::GetTwoHopNeighbors() [member function] + cls.add_method('GetTwoHopNeighbors', + 'ns3::olsr::TwoHopNeighborSet &', + []) + ## olsr-state.h: void ns3::OlsrState::InsertDuplicateTuple(ns3::olsr::DuplicateTuple const & tuple) [member function] + cls.add_method('InsertDuplicateTuple', + 'void', + [param('ns3::olsr::DuplicateTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::InsertIfaceAssocTuple(ns3::olsr::IfaceAssocTuple const & tuple) [member function] + cls.add_method('InsertIfaceAssocTuple', + 'void', + [param('ns3::olsr::IfaceAssocTuple const &', 'tuple')]) + ## olsr-state.h: ns3::olsr::LinkTuple & ns3::OlsrState::InsertLinkTuple(ns3::olsr::LinkTuple const & tuple) [member function] + cls.add_method('InsertLinkTuple', + 'ns3::olsr::LinkTuple &', + [param('ns3::olsr::LinkTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::InsertMprSelectorTuple(ns3::olsr::MprSelectorTuple const & tuple) [member function] + cls.add_method('InsertMprSelectorTuple', + 'void', + [param('ns3::olsr::MprSelectorTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::InsertNeighborTuple(ns3::olsr::NeighborTuple const & tuple) [member function] + cls.add_method('InsertNeighborTuple', + 'void', + [param('ns3::olsr::NeighborTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::InsertTopologyTuple(ns3::olsr::TopologyTuple const & tuple) [member function] + cls.add_method('InsertTopologyTuple', + 'void', + [param('ns3::olsr::TopologyTuple const &', 'tuple')]) + ## olsr-state.h: void ns3::OlsrState::InsertTwoHopNeighborTuple(ns3::olsr::TwoHopNeighborTuple const & tuple) [member function] + cls.add_method('InsertTwoHopNeighborTuple', + 'void', + [param('ns3::olsr::TwoHopNeighborTuple const &', 'tuple')]) + ## olsr-state.h: std::string ns3::OlsrState::PrintMprSelectorSet() const [member function] + cls.add_method('PrintMprSelectorSet', + 'std::string', + [], + is_const=True) + ## olsr-state.h: void ns3::OlsrState::SetMprSet(ns3::olsr::MprSet mprSet) [member function] + cls.add_method('SetMprSet', + 'void', + [param('ns3::olsr::MprSet', 'mprSet')]) + return + +def register_Ns3OlsrDuplicateTuple_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + ## olsr-repositories.h: ns3::olsr::DuplicateTuple::DuplicateTuple() [constructor] + cls.add_constructor([]) + ## olsr-repositories.h: ns3::olsr::DuplicateTuple::DuplicateTuple(ns3::olsr::DuplicateTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::DuplicateTuple const &', 'arg0')]) + ## olsr-repositories.h: ns3::olsr::DuplicateTuple::address [variable] + cls.add_instance_attribute('address', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::DuplicateTuple::expirationTime [variable] + cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False) + ## olsr-repositories.h: ns3::olsr::DuplicateTuple::ifaceList [variable] + cls.add_instance_attribute('ifaceList', 'std::vector< ns3::Ipv4Address >', is_const=False) + ## olsr-repositories.h: ns3::olsr::DuplicateTuple::retransmitted [variable] + cls.add_instance_attribute('retransmitted', 'bool', is_const=False) + ## olsr-repositories.h: ns3::olsr::DuplicateTuple::sequenceNumber [variable] + cls.add_instance_attribute('sequenceNumber', 'uint16_t', is_const=False) + return + +def register_Ns3OlsrIfaceAssocTuple_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## olsr-repositories.h: ns3::olsr::IfaceAssocTuple::IfaceAssocTuple() [constructor] + cls.add_constructor([]) + ## olsr-repositories.h: ns3::olsr::IfaceAssocTuple::IfaceAssocTuple(ns3::olsr::IfaceAssocTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::IfaceAssocTuple const &', 'arg0')]) + ## olsr-repositories.h: ns3::olsr::IfaceAssocTuple::ifaceAddr [variable] + cls.add_instance_attribute('ifaceAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::IfaceAssocTuple::mainAddr [variable] + cls.add_instance_attribute('mainAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::IfaceAssocTuple::time [variable] + cls.add_instance_attribute('time', 'ns3::Time', is_const=False) + return + +def register_Ns3OlsrLinkTuple_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## olsr-repositories.h: ns3::olsr::LinkTuple::LinkTuple() [constructor] + cls.add_constructor([]) + ## olsr-repositories.h: ns3::olsr::LinkTuple::LinkTuple(ns3::olsr::LinkTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::LinkTuple const &', 'arg0')]) + ## olsr-repositories.h: ns3::olsr::LinkTuple::asymTime [variable] + cls.add_instance_attribute('asymTime', 'ns3::Time', is_const=False) + ## olsr-repositories.h: ns3::olsr::LinkTuple::localIfaceAddr [variable] + cls.add_instance_attribute('localIfaceAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::LinkTuple::neighborIfaceAddr [variable] + cls.add_instance_attribute('neighborIfaceAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::LinkTuple::symTime [variable] + cls.add_instance_attribute('symTime', 'ns3::Time', is_const=False) + ## olsr-repositories.h: ns3::olsr::LinkTuple::time [variable] + cls.add_instance_attribute('time', 'ns3::Time', is_const=False) + return + +def register_Ns3OlsrMessageHeader_methods(root_module, cls): + cls.add_output_stream_operator() + ## olsr-header.h: ns3::olsr::MessageHeader::MessageHeader(ns3::olsr::MessageHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::MessageHeader const &', 'arg0')]) + ## olsr-header.h: ns3::olsr::MessageHeader::MessageHeader() [constructor] + cls.add_constructor([]) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello & ns3::olsr::MessageHeader::GetHello() [member function] + cls.add_method('GetHello', + 'ns3::olsr::MessageHeader::Hello &', + []) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello const & ns3::olsr::MessageHeader::GetHello() const [member function] + cls.add_method('GetHello', + 'ns3::olsr::MessageHeader::Hello const &', + [], + is_const=True) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna & ns3::olsr::MessageHeader::GetHna() [member function] + cls.add_method('GetHna', + 'ns3::olsr::MessageHeader::Hna &', + []) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna const & ns3::olsr::MessageHeader::GetHna() const [member function] + cls.add_method('GetHna', + 'ns3::olsr::MessageHeader::Hna const &', + [], + is_const=True) + ## olsr-header.h: uint8_t ns3::olsr::MessageHeader::GetHopCount() const [member function] + cls.add_method('GetHopCount', + 'uint8_t', + [], + is_const=True) + ## olsr-header.h: ns3::TypeId ns3::olsr::MessageHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## olsr-header.h: uint16_t ns3::olsr::MessageHeader::GetMessageSequenceNumber() const [member function] + cls.add_method('GetMessageSequenceNumber', + 'uint16_t', + [], + is_const=True) + ## olsr-header.h: ns3::olsr::MessageHeader::MessageType ns3::olsr::MessageHeader::GetMessageType() const [member function] + cls.add_method('GetMessageType', + 'ns3::olsr::MessageHeader::MessageType', + [], + is_const=True) + ## olsr-header.h: ns3::olsr::MessageHeader::Mid & ns3::olsr::MessageHeader::GetMid() [member function] + cls.add_method('GetMid', + 'ns3::olsr::MessageHeader::Mid &', + []) + ## olsr-header.h: ns3::olsr::MessageHeader::Mid const & ns3::olsr::MessageHeader::GetMid() const [member function] + cls.add_method('GetMid', + 'ns3::olsr::MessageHeader::Mid const &', + [], + is_const=True) + ## olsr-header.h: ns3::Ipv4Address ns3::olsr::MessageHeader::GetOriginatorAddress() const [member function] + cls.add_method('GetOriginatorAddress', + 'ns3::Ipv4Address', + [], + is_const=True) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## olsr-header.h: ns3::olsr::MessageHeader::Tc & ns3::olsr::MessageHeader::GetTc() [member function] + cls.add_method('GetTc', + 'ns3::olsr::MessageHeader::Tc &', + []) + ## olsr-header.h: ns3::olsr::MessageHeader::Tc const & ns3::olsr::MessageHeader::GetTc() const [member function] + cls.add_method('GetTc', + 'ns3::olsr::MessageHeader::Tc const &', + [], + is_const=True) + ## olsr-header.h: uint8_t ns3::olsr::MessageHeader::GetTimeToLive() const [member function] + cls.add_method('GetTimeToLive', + 'uint8_t', + [], + is_const=True) + ## olsr-header.h: static ns3::TypeId ns3::olsr::MessageHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## olsr-header.h: ns3::Time ns3::olsr::MessageHeader::GetVTime() const [member function] + cls.add_method('GetVTime', + 'ns3::Time', + [], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::SetHopCount(uint8_t hopCount) [member function] + cls.add_method('SetHopCount', + 'void', + [param('uint8_t', 'hopCount')]) + ## olsr-header.h: void ns3::olsr::MessageHeader::SetMessageSequenceNumber(uint16_t messageSequenceNumber) [member function] + cls.add_method('SetMessageSequenceNumber', + 'void', + [param('uint16_t', 'messageSequenceNumber')]) + ## olsr-header.h: void ns3::olsr::MessageHeader::SetMessageType(ns3::olsr::MessageHeader::MessageType messageType) [member function] + cls.add_method('SetMessageType', + 'void', + [param('ns3::olsr::MessageHeader::MessageType', 'messageType')]) + ## olsr-header.h: void ns3::olsr::MessageHeader::SetOriginatorAddress(ns3::Ipv4Address originatorAddress) [member function] + cls.add_method('SetOriginatorAddress', + 'void', + [param('ns3::Ipv4Address', 'originatorAddress')]) + ## olsr-header.h: void ns3::olsr::MessageHeader::SetTimeToLive(uint8_t timeToLive) [member function] + cls.add_method('SetTimeToLive', + 'void', + [param('uint8_t', 'timeToLive')]) + ## olsr-header.h: void ns3::olsr::MessageHeader::SetVTime(ns3::Time time) [member function] + cls.add_method('SetVTime', + 'void', + [param('ns3::Time', 'time')]) + return + +def register_Ns3OlsrMessageHeaderHello_methods(root_module, cls): + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::Hello() [constructor] + cls.add_constructor([]) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::Hello(ns3::olsr::MessageHeader::Hello const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::MessageHeader::Hello const &', 'arg0')]) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hello::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')]) + ## olsr-header.h: ns3::Time ns3::olsr::MessageHeader::Hello::GetHTime() const [member function] + cls.add_method('GetHTime', + 'ns3::Time', + [], + is_const=True) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hello::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Hello::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Hello::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Hello::SetHTime(ns3::Time time) [member function] + cls.add_method('SetHTime', + 'void', + [param('ns3::Time', 'time')]) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::hTime [variable] + cls.add_instance_attribute('hTime', 'uint8_t', is_const=False) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::linkMessages [variable] + cls.add_instance_attribute('linkMessages', 'std::vector< ns3::olsr::MessageHeader::Hello::LinkMessage >', is_const=False) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::willingness [variable] + cls.add_instance_attribute('willingness', 'uint8_t', is_const=False) + return + +def register_Ns3OlsrMessageHeaderHelloLinkMessage_methods(root_module, cls): + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::LinkMessage() [constructor] + cls.add_constructor([]) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::LinkMessage(ns3::olsr::MessageHeader::Hello::LinkMessage const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::MessageHeader::Hello::LinkMessage const &', 'arg0')]) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode [variable] + cls.add_instance_attribute('linkCode', 'uint8_t', is_const=False) + ## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses [variable] + cls.add_instance_attribute('neighborInterfaceAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False) + return + +def register_Ns3OlsrMessageHeaderHna_methods(root_module, cls): + ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Hna() [constructor] + cls.add_constructor([]) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Hna(ns3::olsr::MessageHeader::Hna const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::MessageHeader::Hna const &', 'arg0')]) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hna::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')]) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hna::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Hna::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Hna::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna::associations [variable] + cls.add_instance_attribute('associations', 'std::vector< ns3::olsr::MessageHeader::Hna::Association >', is_const=False) + return + +def register_Ns3OlsrMessageHeaderHnaAssociation_methods(root_module, cls): + ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::Association() [constructor] + cls.add_constructor([]) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::Association(ns3::olsr::MessageHeader::Hna::Association const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::MessageHeader::Hna::Association const &', 'arg0')]) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::address [variable] + cls.add_instance_attribute('address', 'ns3::Ipv4Address', is_const=False) + ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::mask [variable] + cls.add_instance_attribute('mask', 'ns3::Ipv4Mask', is_const=False) + return + +def register_Ns3OlsrMessageHeaderMid_methods(root_module, cls): + ## olsr-header.h: ns3::olsr::MessageHeader::Mid::Mid() [constructor] + cls.add_constructor([]) + ## olsr-header.h: ns3::olsr::MessageHeader::Mid::Mid(ns3::olsr::MessageHeader::Mid const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::MessageHeader::Mid const &', 'arg0')]) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Mid::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')]) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Mid::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Mid::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Mid::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True) + ## olsr-header.h: ns3::olsr::MessageHeader::Mid::interfaceAddresses [variable] + cls.add_instance_attribute('interfaceAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False) + return + +def register_Ns3OlsrMessageHeaderTc_methods(root_module, cls): + ## olsr-header.h: ns3::olsr::MessageHeader::Tc::Tc() [constructor] + cls.add_constructor([]) + ## olsr-header.h: ns3::olsr::MessageHeader::Tc::Tc(ns3::olsr::MessageHeader::Tc const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::MessageHeader::Tc const &', 'arg0')]) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Tc::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')]) + ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Tc::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Tc::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True) + ## olsr-header.h: void ns3::olsr::MessageHeader::Tc::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True) + ## olsr-header.h: ns3::olsr::MessageHeader::Tc::ansn [variable] + cls.add_instance_attribute('ansn', 'uint16_t', is_const=False) + ## olsr-header.h: ns3::olsr::MessageHeader::Tc::neighborAddresses [variable] + cls.add_instance_attribute('neighborAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False) + return + +def register_Ns3OlsrMprSelectorTuple_methods(root_module, cls): + cls.add_binary_comparison_operator('==') + ## olsr-repositories.h: ns3::olsr::MprSelectorTuple::MprSelectorTuple() [constructor] + cls.add_constructor([]) + ## olsr-repositories.h: ns3::olsr::MprSelectorTuple::MprSelectorTuple(ns3::olsr::MprSelectorTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::MprSelectorTuple const &', 'arg0')]) + ## olsr-repositories.h: ns3::olsr::MprSelectorTuple::expirationTime [variable] + cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False) + ## olsr-repositories.h: ns3::olsr::MprSelectorTuple::mainAddr [variable] + cls.add_instance_attribute('mainAddr', 'ns3::Ipv4Address', is_const=False) + return + +def register_Ns3OlsrNeighborTuple_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## olsr-repositories.h: ns3::olsr::NeighborTuple::NeighborTuple() [constructor] + cls.add_constructor([]) + ## olsr-repositories.h: ns3::olsr::NeighborTuple::NeighborTuple(ns3::olsr::NeighborTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::NeighborTuple const &', 'arg0')]) + ## olsr-repositories.h: ns3::olsr::NeighborTuple::neighborMainAddr [variable] + cls.add_instance_attribute('neighborMainAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::NeighborTuple::status [variable] + cls.add_instance_attribute('status', 'ns3::olsr::NeighborTuple::Status', is_const=False) + ## olsr-repositories.h: ns3::olsr::NeighborTuple::willingness [variable] + cls.add_instance_attribute('willingness', 'uint8_t', is_const=False) + return + +def register_Ns3OlsrPacketHeader_methods(root_module, cls): + cls.add_output_stream_operator() + ## olsr-header.h: ns3::olsr::PacketHeader::PacketHeader(ns3::olsr::PacketHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::PacketHeader const &', 'arg0')]) + ## olsr-header.h: ns3::olsr::PacketHeader::PacketHeader() [constructor] + cls.add_constructor([]) + ## olsr-header.h: uint32_t ns3::olsr::PacketHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## olsr-header.h: ns3::TypeId ns3::olsr::PacketHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## olsr-header.h: uint16_t ns3::olsr::PacketHeader::GetPacketLength() const [member function] + cls.add_method('GetPacketLength', + 'uint16_t', + [], + is_const=True) + ## olsr-header.h: uint16_t ns3::olsr::PacketHeader::GetPacketSequenceNumber() const [member function] + cls.add_method('GetPacketSequenceNumber', + 'uint16_t', + [], + is_const=True) + ## olsr-header.h: uint32_t ns3::olsr::PacketHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## olsr-header.h: static ns3::TypeId ns3::olsr::PacketHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## olsr-header.h: void ns3::olsr::PacketHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## olsr-header.h: void ns3::olsr::PacketHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## olsr-header.h: void ns3::olsr::PacketHeader::SetPacketLength(uint16_t length) [member function] + cls.add_method('SetPacketLength', + 'void', + [param('uint16_t', 'length')]) + ## olsr-header.h: void ns3::olsr::PacketHeader::SetPacketSequenceNumber(uint16_t seqnum) [member function] + cls.add_method('SetPacketSequenceNumber', + 'void', + [param('uint16_t', 'seqnum')]) + return + +def register_Ns3OlsrRoutingProtocol_methods(root_module, cls): + ## olsr-routing-protocol.h: ns3::olsr::RoutingProtocol::RoutingProtocol(ns3::olsr::RoutingProtocol const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::RoutingProtocol const &', 'arg0')]) + ## olsr-routing-protocol.h: ns3::olsr::RoutingProtocol::RoutingProtocol() [constructor] + cls.add_constructor([]) + ## olsr-routing-protocol.h: static ns3::TypeId ns3::olsr::RoutingProtocol::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::SetMainInterface(uint32_t interface) [member function] + cls.add_method('SetMainInterface', + 'void', + [param('uint32_t', 'interface')]) + ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + visibility='private', is_virtual=True) + ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + visibility='private', is_virtual=True) + ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + visibility='private', is_virtual=True) + ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + visibility='private', is_virtual=True) + ## olsr-routing-protocol.h: bool ns3::olsr::RoutingProtocol::RouteInput(ns3::Ptr p, ns3::Ipv4Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + visibility='private', is_virtual=True) + ## olsr-routing-protocol.h: ns3::Ptr ns3::olsr::RoutingProtocol::RouteOutput(ns3::Ptr p, ns3::Ipv4Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv4Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + visibility='private', is_virtual=True) + ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::SetIpv4(ns3::Ptr ipv4) [member function] + cls.add_method('SetIpv4', + 'void', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], + visibility='private', is_virtual=True) + return + +def register_Ns3OlsrRoutingTableEntry_methods(root_module, cls): + ## olsr-routing-protocol.h: ns3::olsr::RoutingTableEntry::RoutingTableEntry(ns3::olsr::RoutingTableEntry const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::RoutingTableEntry const &', 'arg0')]) + ## olsr-routing-protocol.h: ns3::olsr::RoutingTableEntry::RoutingTableEntry() [constructor] + cls.add_constructor([]) + ## olsr-routing-protocol.h: ns3::olsr::RoutingTableEntry::destAddr [variable] + cls.add_instance_attribute('destAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-routing-protocol.h: ns3::olsr::RoutingTableEntry::distance [variable] + cls.add_instance_attribute('distance', 'uint32_t', is_const=False) + ## olsr-routing-protocol.h: ns3::olsr::RoutingTableEntry::interface [variable] + cls.add_instance_attribute('interface', 'uint32_t', is_const=False) + ## olsr-routing-protocol.h: ns3::olsr::RoutingTableEntry::nextAddr [variable] + cls.add_instance_attribute('nextAddr', 'ns3::Ipv4Address', is_const=False) + return + +def register_Ns3OlsrTopologyTuple_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## olsr-repositories.h: ns3::olsr::TopologyTuple::TopologyTuple() [constructor] + cls.add_constructor([]) + ## olsr-repositories.h: ns3::olsr::TopologyTuple::TopologyTuple(ns3::olsr::TopologyTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::TopologyTuple const &', 'arg0')]) + ## olsr-repositories.h: ns3::olsr::TopologyTuple::destAddr [variable] + cls.add_instance_attribute('destAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::TopologyTuple::expirationTime [variable] + cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False) + ## olsr-repositories.h: ns3::olsr::TopologyTuple::lastAddr [variable] + cls.add_instance_attribute('lastAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::TopologyTuple::sequenceNumber [variable] + cls.add_instance_attribute('sequenceNumber', 'uint16_t', is_const=False) + return + +def register_Ns3OlsrTwoHopNeighborTuple_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## olsr-repositories.h: ns3::olsr::TwoHopNeighborTuple::TwoHopNeighborTuple() [constructor] + cls.add_constructor([]) + ## olsr-repositories.h: ns3::olsr::TwoHopNeighborTuple::TwoHopNeighborTuple(ns3::olsr::TwoHopNeighborTuple const & arg0) [copy constructor] + cls.add_constructor([param('ns3::olsr::TwoHopNeighborTuple const &', 'arg0')]) + ## olsr-repositories.h: ns3::olsr::TwoHopNeighborTuple::expirationTime [variable] + cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False) + ## olsr-repositories.h: ns3::olsr::TwoHopNeighborTuple::neighborMainAddr [variable] + cls.add_instance_attribute('neighborMainAddr', 'ns3::Ipv4Address', is_const=False) + ## olsr-repositories.h: ns3::olsr::TwoHopNeighborTuple::twoHopNeighborAddr [variable] + cls.add_instance_attribute('twoHopNeighborAddr', 'ns3::Ipv4Address', is_const=False) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + ## olsr-header.h: extern double ns3::olsr::EmfToSeconds(uint8_t emf) [free function] + module.add_function('EmfToSeconds', + 'double', + [param('uint8_t', 'emf')]) + ## olsr-header.h: extern uint8_t ns3::olsr::SecondsToEmf(double seconds) [free function] + module.add_function('SecondsToEmf', + 'uint8_t', + [param('double', 'seconds')]) + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_onoff.py b/bindings/python/apidefs/gcc-LP64/ns3_module_onoff.py new file mode 100644 index 000000000..d22c42dca --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_onoff.py @@ -0,0 +1,145 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## onoff-application.h: ns3::OnOffApplication [class] + module.add_class('OnOffApplication', parent=root_module['ns3::Application']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3OnOffApplication_methods(root_module, root_module['ns3::OnOffApplication']) + return + +def register_Ns3OnOffApplication_methods(root_module, cls): + ## onoff-application.h: ns3::OnOffApplication::OnOffApplication(ns3::OnOffApplication const & arg0) [copy constructor] + cls.add_constructor([param('ns3::OnOffApplication const &', 'arg0')]) + ## onoff-application.h: ns3::OnOffApplication::OnOffApplication() [constructor] + cls.add_constructor([]) + ## onoff-application.h: static ns3::TypeId ns3::OnOffApplication::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## onoff-application.h: void ns3::OnOffApplication::SetMaxBytes(uint32_t maxBytes) [member function] + cls.add_method('SetMaxBytes', + 'void', + [param('uint32_t', 'maxBytes')]) + ## onoff-application.h: void ns3::OnOffApplication::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## onoff-application.h: void ns3::OnOffApplication::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## onoff-application.h: void ns3::OnOffApplication::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_packet_sink.py b/bindings/python/apidefs/gcc-LP64/ns3_module_packet_sink.py new file mode 100644 index 000000000..abb082d98 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_packet_sink.py @@ -0,0 +1,141 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## packet-sink.h: ns3::PacketSink [class] + module.add_class('PacketSink', parent=root_module['ns3::Application']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3PacketSink_methods(root_module, root_module['ns3::PacketSink']) + return + +def register_Ns3PacketSink_methods(root_module, cls): + ## packet-sink.h: ns3::PacketSink::PacketSink(ns3::PacketSink const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSink const &', 'arg0')]) + ## packet-sink.h: ns3::PacketSink::PacketSink() [constructor] + cls.add_constructor([]) + ## packet-sink.h: static ns3::TypeId ns3::PacketSink::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## packet-sink.h: void ns3::PacketSink::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## packet-sink.h: void ns3::PacketSink::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## packet-sink.h: void ns3::PacketSink::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_ping6.py b/bindings/python/apidefs/gcc-LP64/ns3_module_ping6.py new file mode 100644 index 000000000..f66bb20fb --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_ping6.py @@ -0,0 +1,153 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## ping6.h: ns3::Ping6 [class] + module.add_class('Ping6', parent=root_module['ns3::Application']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Ping6_methods(root_module, root_module['ns3::Ping6']) + return + +def register_Ns3Ping6_methods(root_module, cls): + ## ping6.h: ns3::Ping6::Ping6(ns3::Ping6 const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ping6 const &', 'arg0')]) + ## ping6.h: ns3::Ping6::Ping6() [constructor] + cls.add_constructor([]) + ## ping6.h: static ns3::TypeId ns3::Ping6::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ping6.h: void ns3::Ping6::SetIfIndex(uint32_t ifIndex) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t', 'ifIndex')]) + ## ping6.h: void ns3::Ping6::SetLocal(ns3::Ipv6Address ipv6) [member function] + cls.add_method('SetLocal', + 'void', + [param('ns3::Ipv6Address', 'ipv6')]) + ## ping6.h: void ns3::Ping6::SetRemote(ns3::Ipv6Address ipv6) [member function] + cls.add_method('SetRemote', + 'void', + [param('ns3::Ipv6Address', 'ipv6')]) + ## ping6.h: void ns3::Ping6::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## ping6.h: void ns3::Ping6::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## ping6.h: void ns3::Ping6::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_point_to_point.py b/bindings/python/apidefs/gcc-LP64/ns3_module_point_to_point.py new file mode 100644 index 000000000..817a3baac --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_point_to_point.py @@ -0,0 +1,362 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## ppp-header.h: ns3::PppHeader [class] + module.add_class('PppHeader', parent=root_module['ns3::Header']) + ## point-to-point-channel.h: ns3::PointToPointChannel [class] + module.add_class('PointToPointChannel', parent=root_module['ns3::Channel']) + ## point-to-point-net-device.h: ns3::PointToPointNetDevice [class] + module.add_class('PointToPointNetDevice', parent=root_module['ns3::NetDevice']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3PppHeader_methods(root_module, root_module['ns3::PppHeader']) + register_Ns3PointToPointChannel_methods(root_module, root_module['ns3::PointToPointChannel']) + register_Ns3PointToPointNetDevice_methods(root_module, root_module['ns3::PointToPointNetDevice']) + return + +def register_Ns3PppHeader_methods(root_module, cls): + ## ppp-header.h: ns3::PppHeader::PppHeader(ns3::PppHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PppHeader const &', 'arg0')]) + ## ppp-header.h: ns3::PppHeader::PppHeader() [constructor] + cls.add_constructor([]) + ## ppp-header.h: uint32_t ns3::PppHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## ppp-header.h: ns3::TypeId ns3::PppHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## ppp-header.h: uint32_t ns3::PppHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## ppp-header.h: static ns3::TypeId ns3::PppHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ppp-header.h: void ns3::PppHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## ppp-header.h: void ns3::PppHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + return + +def register_Ns3PointToPointChannel_methods(root_module, cls): + ## point-to-point-channel.h: ns3::PointToPointChannel::PointToPointChannel(ns3::PointToPointChannel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointChannel const &', 'arg0')]) + ## point-to-point-channel.h: ns3::PointToPointChannel::PointToPointChannel() [constructor] + cls.add_constructor([]) + ## point-to-point-channel.h: void ns3::PointToPointChannel::Attach(ns3::Ptr device) [member function] + cls.add_method('Attach', + 'void', + [param('ns3::Ptr< ns3::PointToPointNetDevice >', 'device')]) + ## point-to-point-channel.h: ns3::Ptr ns3::PointToPointChannel::GetDevice(uint32_t i) const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## point-to-point-channel.h: uint32_t ns3::PointToPointChannel::GetNDevices() const [member function] + cls.add_method('GetNDevices', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## point-to-point-channel.h: ns3::Ptr ns3::PointToPointChannel::GetPointToPointDevice(uint32_t i) const [member function] + cls.add_method('GetPointToPointDevice', + 'ns3::Ptr< ns3::PointToPointNetDevice >', + [param('uint32_t', 'i')], + is_const=True) + ## point-to-point-channel.h: static ns3::TypeId ns3::PointToPointChannel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## point-to-point-channel.h: bool ns3::PointToPointChannel::TransmitStart(ns3::Ptr p, ns3::Ptr src, ns3::Time txTime) [member function] + cls.add_method('TransmitStart', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ptr< ns3::PointToPointNetDevice >', 'src'), param('ns3::Time', 'txTime')]) + return + +def register_Ns3PointToPointNetDevice_methods(root_module, cls): + ## point-to-point-net-device.h: ns3::PointToPointNetDevice::PointToPointNetDevice(ns3::PointToPointNetDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointNetDevice const &', 'arg0')]) + ## point-to-point-net-device.h: ns3::PointToPointNetDevice::PointToPointNetDevice() [constructor] + cls.add_constructor([]) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::Attach(ns3::Ptr ch) [member function] + cls.add_method('Attach', + 'bool', + [param('ns3::Ptr< ns3::PointToPointChannel >', 'ch')]) + ## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: ns3::Ptr ns3::PointToPointNetDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: uint16_t ns3::PointToPointNetDevice::GetFrameSize() const [member function] + cls.add_method('GetFrameSize', + 'uint16_t', + [], + is_const=True) + ## point-to-point-net-device.h: uint32_t ns3::PointToPointNetDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: uint16_t ns3::PointToPointNetDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: ns3::Ptr ns3::PointToPointNetDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: static ns3::TypeId ns3::PointToPointNetDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::Receive(ns3::Ptr p) [member function] + cls.add_method('Receive', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetDataRate(ns3::DataRate bps) [member function] + cls.add_method('SetDataRate', + 'void', + [param('ns3::DataRate', 'bps')]) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetFrameSize(uint16_t frameSize) [member function] + cls.add_method('SetFrameSize', + 'void', + [param('uint16_t', 'frameSize')]) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetInterframeGap(ns3::Time t) [member function] + cls.add_method('SetInterframeGap', + 'void', + [param('ns3::Time', 't')]) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetQueue(ns3::Ptr queue) [member function] + cls.add_method('SetQueue', + 'void', + [param('ns3::Ptr< ns3::Queue >', 'queue')]) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetReceiveErrorModel(ns3::Ptr em) [member function] + cls.add_method('SetReceiveErrorModel', + 'void', + [param('ns3::Ptr< ns3::ErrorModel >', 'em')]) + ## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## point-to-point-net-device.h: void ns3::PointToPointNetDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_radvd.py b/bindings/python/apidefs/gcc-LP64/ns3_module_radvd.py new file mode 100644 index 000000000..aad164940 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_radvd.py @@ -0,0 +1,417 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## radvd-interface.h: ns3::RadvdInterface [class] + module.add_class('RadvdInterface', parent=root_module['ns3::RefCountBase']) + ## radvd-prefix.h: ns3::RadvdPrefix [class] + module.add_class('RadvdPrefix', parent=root_module['ns3::RefCountBase']) + ## radvd.h: ns3::Radvd [class] + module.add_class('Radvd', parent=root_module['ns3::Application']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3RadvdInterface_methods(root_module, root_module['ns3::RadvdInterface']) + register_Ns3RadvdPrefix_methods(root_module, root_module['ns3::RadvdPrefix']) + register_Ns3Radvd_methods(root_module, root_module['ns3::Radvd']) + return + +def register_Ns3RadvdInterface_methods(root_module, cls): + ## radvd-interface.h: ns3::RadvdInterface::RadvdInterface(ns3::RadvdInterface const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RadvdInterface const &', 'arg0')]) + ## radvd-interface.h: ns3::RadvdInterface::RadvdInterface(uint32_t interface) [constructor] + cls.add_constructor([param('uint32_t', 'interface')]) + ## radvd-interface.h: ns3::RadvdInterface::RadvdInterface(uint32_t interface, uint32_t maxRtrAdvInterval, uint32_t minRtrAdvInterval) [constructor] + cls.add_constructor([param('uint32_t', 'interface'), param('uint32_t', 'maxRtrAdvInterval'), param('uint32_t', 'minRtrAdvInterval')]) + ## radvd-interface.h: void ns3::RadvdInterface::AddPrefix(ns3::Ptr routerPrefix) [member function] + cls.add_method('AddPrefix', + 'void', + [param('ns3::Ptr< ns3::RadvdPrefix >', 'routerPrefix')]) + ## radvd-interface.h: uint8_t ns3::RadvdInterface::GetCurHopLimit() const [member function] + cls.add_method('GetCurHopLimit', + 'uint8_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetDefaultLifeTime() const [member function] + cls.add_method('GetDefaultLifeTime', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: uint8_t ns3::RadvdInterface::GetDefaultPreference() const [member function] + cls.add_method('GetDefaultPreference', + 'uint8_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetHomeAgentLifeTime() const [member function] + cls.add_method('GetHomeAgentLifeTime', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetHomeAgentPreference() const [member function] + cls.add_method('GetHomeAgentPreference', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetInterface() const [member function] + cls.add_method('GetInterface', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetLinkMtu() const [member function] + cls.add_method('GetLinkMtu', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetMaxRtrAdvInterval() const [member function] + cls.add_method('GetMaxRtrAdvInterval', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetMinDelayBetweenRAs() const [member function] + cls.add_method('GetMinDelayBetweenRAs', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetMinRtrAdvInterval() const [member function] + cls.add_method('GetMinRtrAdvInterval', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: std::list, std::allocator > > ns3::RadvdInterface::GetPrefixes() const [member function] + cls.add_method('GetPrefixes', + 'std::list< ns3::Ptr< ns3::RadvdPrefix > >', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetReachableTime() const [member function] + cls.add_method('GetReachableTime', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: uint32_t ns3::RadvdInterface::GetRetransTimer() const [member function] + cls.add_method('GetRetransTimer', + 'uint32_t', + [], + is_const=True) + ## radvd-interface.h: bool ns3::RadvdInterface::IsHomeAgentFlag() const [member function] + cls.add_method('IsHomeAgentFlag', + 'bool', + [], + is_const=True) + ## radvd-interface.h: bool ns3::RadvdInterface::IsHomeAgentInfo() const [member function] + cls.add_method('IsHomeAgentInfo', + 'bool', + [], + is_const=True) + ## radvd-interface.h: bool ns3::RadvdInterface::IsIntervalOpt() const [member function] + cls.add_method('IsIntervalOpt', + 'bool', + [], + is_const=True) + ## radvd-interface.h: bool ns3::RadvdInterface::IsManagedFlag() const [member function] + cls.add_method('IsManagedFlag', + 'bool', + [], + is_const=True) + ## radvd-interface.h: bool ns3::RadvdInterface::IsMobRtrSupportFlag() const [member function] + cls.add_method('IsMobRtrSupportFlag', + 'bool', + [], + is_const=True) + ## radvd-interface.h: bool ns3::RadvdInterface::IsOtherConfigFlag() const [member function] + cls.add_method('IsOtherConfigFlag', + 'bool', + [], + is_const=True) + ## radvd-interface.h: bool ns3::RadvdInterface::IsSendAdvert() const [member function] + cls.add_method('IsSendAdvert', + 'bool', + [], + is_const=True) + ## radvd-interface.h: bool ns3::RadvdInterface::IsSourceLLAddress() const [member function] + cls.add_method('IsSourceLLAddress', + 'bool', + [], + is_const=True) + ## radvd-interface.h: void ns3::RadvdInterface::SetCurHopLimit(uint8_t curHopLimit) [member function] + cls.add_method('SetCurHopLimit', + 'void', + [param('uint8_t', 'curHopLimit')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetDefaultLifeTime(uint32_t defaultLifeTime) [member function] + cls.add_method('SetDefaultLifeTime', + 'void', + [param('uint32_t', 'defaultLifeTime')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetDefaultPreference(uint8_t defaultPreference) [member function] + cls.add_method('SetDefaultPreference', + 'void', + [param('uint8_t', 'defaultPreference')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetHomeAgentFlag(bool homeAgentFlag) [member function] + cls.add_method('SetHomeAgentFlag', + 'void', + [param('bool', 'homeAgentFlag')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetHomeAgentInfo(bool homeAgentFlag) [member function] + cls.add_method('SetHomeAgentInfo', + 'void', + [param('bool', 'homeAgentFlag')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetHomeAgentLifeTime(uint32_t homeAgentLifeTime) [member function] + cls.add_method('SetHomeAgentLifeTime', + 'void', + [param('uint32_t', 'homeAgentLifeTime')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetHomeAgentPreference(uint32_t homeAgentPreference) [member function] + cls.add_method('SetHomeAgentPreference', + 'void', + [param('uint32_t', 'homeAgentPreference')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetIntervalOpt(bool intervalOpt) [member function] + cls.add_method('SetIntervalOpt', + 'void', + [param('bool', 'intervalOpt')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetLinkMtu(uint32_t linkMtu) [member function] + cls.add_method('SetLinkMtu', + 'void', + [param('uint32_t', 'linkMtu')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetManagedFlag(bool managedFlag) [member function] + cls.add_method('SetManagedFlag', + 'void', + [param('bool', 'managedFlag')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetMaxRtrAdvInterval(uint32_t maxRtrAdvInterval) [member function] + cls.add_method('SetMaxRtrAdvInterval', + 'void', + [param('uint32_t', 'maxRtrAdvInterval')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetMinDelayBetweenRAs(uint32_t minDelayBetweenRAs) [member function] + cls.add_method('SetMinDelayBetweenRAs', + 'void', + [param('uint32_t', 'minDelayBetweenRAs')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetMinRtrAdvInterval(uint32_t minRtrAdvInterval) [member function] + cls.add_method('SetMinRtrAdvInterval', + 'void', + [param('uint32_t', 'minRtrAdvInterval')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetMobRtrSupportFlag(bool mobRtrSupportFlag) [member function] + cls.add_method('SetMobRtrSupportFlag', + 'void', + [param('bool', 'mobRtrSupportFlag')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetOtherConfigFlag(bool otherConfigFlag) [member function] + cls.add_method('SetOtherConfigFlag', + 'void', + [param('bool', 'otherConfigFlag')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetReachableTime(uint32_t reachableTime) [member function] + cls.add_method('SetReachableTime', + 'void', + [param('uint32_t', 'reachableTime')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetRetransTimer(uint32_t retransTimer) [member function] + cls.add_method('SetRetransTimer', + 'void', + [param('uint32_t', 'retransTimer')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetSendAdvert(bool sendAdvert) [member function] + cls.add_method('SetSendAdvert', + 'void', + [param('bool', 'sendAdvert')]) + ## radvd-interface.h: void ns3::RadvdInterface::SetSourceLLAddress(bool sourceLLAddress) [member function] + cls.add_method('SetSourceLLAddress', + 'void', + [param('bool', 'sourceLLAddress')]) + return + +def register_Ns3RadvdPrefix_methods(root_module, cls): + ## radvd-prefix.h: ns3::RadvdPrefix::RadvdPrefix(ns3::RadvdPrefix const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RadvdPrefix const &', 'arg0')]) + ## radvd-prefix.h: ns3::RadvdPrefix::RadvdPrefix(ns3::Ipv6Address network, uint8_t prefixLength, uint32_t preferredLifeTime=604800, uint32_t validLifeTime=2592000, bool onLinkFlag=true, bool autonomousFlag=true, bool routerAddrFlag=false) [constructor] + cls.add_constructor([param('ns3::Ipv6Address', 'network'), param('uint8_t', 'prefixLength'), param('uint32_t', 'preferredLifeTime', default_value='604800'), param('uint32_t', 'validLifeTime', default_value='2592000'), param('bool', 'onLinkFlag', default_value='true'), param('bool', 'autonomousFlag', default_value='true'), param('bool', 'routerAddrFlag', default_value='false')]) + ## radvd-prefix.h: ns3::Ipv6Address ns3::RadvdPrefix::GetNetwork() const [member function] + cls.add_method('GetNetwork', + 'ns3::Ipv6Address', + [], + is_const=True) + ## radvd-prefix.h: uint32_t ns3::RadvdPrefix::GetPreferredLifeTime() const [member function] + cls.add_method('GetPreferredLifeTime', + 'uint32_t', + [], + is_const=True) + ## radvd-prefix.h: uint8_t ns3::RadvdPrefix::GetPrefixLength() const [member function] + cls.add_method('GetPrefixLength', + 'uint8_t', + [], + is_const=True) + ## radvd-prefix.h: uint32_t ns3::RadvdPrefix::GetValidLifeTime() const [member function] + cls.add_method('GetValidLifeTime', + 'uint32_t', + [], + is_const=True) + ## radvd-prefix.h: bool ns3::RadvdPrefix::IsAutonomousFlag() const [member function] + cls.add_method('IsAutonomousFlag', + 'bool', + [], + is_const=True) + ## radvd-prefix.h: bool ns3::RadvdPrefix::IsOnLinkFlag() const [member function] + cls.add_method('IsOnLinkFlag', + 'bool', + [], + is_const=True) + ## radvd-prefix.h: bool ns3::RadvdPrefix::IsRouterAddrFlag() const [member function] + cls.add_method('IsRouterAddrFlag', + 'bool', + [], + is_const=True) + ## radvd-prefix.h: void ns3::RadvdPrefix::SetAutonomousFlag(bool autonomousFlag) [member function] + cls.add_method('SetAutonomousFlag', + 'void', + [param('bool', 'autonomousFlag')]) + ## radvd-prefix.h: void ns3::RadvdPrefix::SetNetwork(ns3::Ipv6Address network) [member function] + cls.add_method('SetNetwork', + 'void', + [param('ns3::Ipv6Address', 'network')]) + ## radvd-prefix.h: void ns3::RadvdPrefix::SetOnLinkFlag(bool onLinkFlag) [member function] + cls.add_method('SetOnLinkFlag', + 'void', + [param('bool', 'onLinkFlag')]) + ## radvd-prefix.h: void ns3::RadvdPrefix::SetPreferredLifeTime(uint32_t preferredLifeTime) [member function] + cls.add_method('SetPreferredLifeTime', + 'void', + [param('uint32_t', 'preferredLifeTime')]) + ## radvd-prefix.h: void ns3::RadvdPrefix::SetPrefixLength(uint8_t prefixLength) [member function] + cls.add_method('SetPrefixLength', + 'void', + [param('uint8_t', 'prefixLength')]) + ## radvd-prefix.h: void ns3::RadvdPrefix::SetRouterAddrFlag(bool routerAddrFlag) [member function] + cls.add_method('SetRouterAddrFlag', + 'void', + [param('bool', 'routerAddrFlag')]) + ## radvd-prefix.h: void ns3::RadvdPrefix::SetValidLifeTime(uint32_t validLifeTime) [member function] + cls.add_method('SetValidLifeTime', + 'void', + [param('uint32_t', 'validLifeTime')]) + return + +def register_Ns3Radvd_methods(root_module, cls): + ## radvd.h: ns3::Radvd::Radvd(ns3::Radvd const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Radvd const &', 'arg0')]) + ## radvd.h: ns3::Radvd::Radvd() [constructor] + cls.add_constructor([]) + ## radvd.h: void ns3::Radvd::AddConfiguration(ns3::Ptr routerInterface) [member function] + cls.add_method('AddConfiguration', + 'void', + [param('ns3::Ptr< ns3::RadvdInterface >', 'routerInterface')]) + ## radvd.h: static ns3::TypeId ns3::Radvd::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## radvd.h: ns3::Radvd::MAX_RA_DELAY_TIME [variable] + cls.add_static_attribute('MAX_RA_DELAY_TIME', 'uint32_t const', is_const=True) + ## radvd.h: void ns3::Radvd::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## radvd.h: void ns3::Radvd::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## radvd.h: void ns3::Radvd::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py b/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py new file mode 100644 index 000000000..8f0850175 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py @@ -0,0 +1,1591 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## event-id.h: ns3::EventId [class] + module.add_class('EventId') + ## event-impl.h: ns3::EventImpl [class] + module.add_class('EventImpl', allow_subclassing=True) + ## high-precision-128.h: ns3::HighPrecision [class] + module.add_class('HighPrecision') + ## simulator.h: ns3::Simulator [class] + module.add_class('Simulator', is_singleton=True) + ## nstime.h: ns3::TimeUnit<-1> [class] + module.add_class('TimeInvert') + ## nstime.h: ns3::TimeUnit<0> [class] + module.add_class('Scalar') + ## nstime.h: ns3::TimeUnit<1> [class] + module.add_class('Time') + ## nstime.h: ns3::TimeUnit<2> [class] + module.add_class('TimeSquare') + ## timer.h: ns3::Timer [class] + module.add_class('Timer') + ## timer.h: ns3::Timer::DestroyPolicy [enumeration] + module.add_enum('DestroyPolicy', ['CANCEL_ON_DESTROY', 'REMOVE_ON_DESTROY', 'CHECK_ON_DESTROY'], outer_class=root_module['ns3::Timer']) + ## timer.h: ns3::Timer::State [enumeration] + module.add_enum('State', ['RUNNING', 'EXPIRED', 'SUSPENDED'], outer_class=root_module['ns3::Timer']) + ## timer-impl.h: ns3::TimerImpl [class] + module.add_class('TimerImpl', allow_subclassing=True) + ## watchdog.h: ns3::Watchdog [class] + module.add_class('Watchdog') + ## scheduler.h: ns3::Scheduler [class] + module.add_class('Scheduler', parent=root_module['ns3::Object']) + ## scheduler.h: ns3::Scheduler::Event [struct] + module.add_class('Event', outer_class=root_module['ns3::Scheduler']) + ## scheduler.h: ns3::Scheduler::EventKey [struct] + module.add_class('EventKey', outer_class=root_module['ns3::Scheduler']) + ## simulator-impl.h: ns3::SimulatorImpl [class] + module.add_class('SimulatorImpl', parent=root_module['ns3::Object']) + ## synchronizer.h: ns3::Synchronizer [class] + module.add_class('Synchronizer', parent=root_module['ns3::Object']) + ## nstime.h: ns3::TimeChecker [class] + module.add_class('TimeChecker', parent=root_module['ns3::AttributeChecker']) + ## nstime.h: ns3::TimeValue [class] + module.add_class('TimeValue', parent=root_module['ns3::AttributeValue']) + ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer [class] + module.add_class('WallClockSynchronizer', parent=root_module['ns3::Synchronizer']) + ## calendar-scheduler.h: ns3::CalendarScheduler [class] + module.add_class('CalendarScheduler', parent=root_module['ns3::Scheduler']) + ## default-simulator-impl.h: ns3::DefaultSimulatorImpl [class] + module.add_class('DefaultSimulatorImpl', parent=root_module['ns3::SimulatorImpl']) + ## heap-scheduler.h: ns3::HeapScheduler [class] + module.add_class('HeapScheduler', parent=root_module['ns3::Scheduler']) + ## list-scheduler.h: ns3::ListScheduler [class] + module.add_class('ListScheduler', parent=root_module['ns3::Scheduler']) + ## map-scheduler.h: ns3::MapScheduler [class] + module.add_class('MapScheduler', parent=root_module['ns3::Scheduler']) + ## ns2-calendar-scheduler.h: ns3::Ns2CalendarScheduler [class] + module.add_class('Ns2CalendarScheduler', parent=root_module['ns3::Scheduler']) + ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl [class] + 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< 2 >*', 'ns3::TimeSquare*') + typehandlers.add_type_alias('ns3::TimeUnit< 2 >&', 'ns3::TimeSquare&') + typehandlers.add_type_alias('ns3::TimeUnit< - 1 >', 'ns3::TimeInvert') + typehandlers.add_type_alias('ns3::TimeUnit< - 1 >*', 'ns3::TimeInvert*') + typehandlers.add_type_alias('ns3::TimeUnit< - 1 >&', 'ns3::TimeInvert&') + typehandlers.add_type_alias('ns3::TimeUnit< 0 >', 'ns3::Scalar') + typehandlers.add_type_alias('ns3::TimeUnit< 0 >*', 'ns3::Scalar*') + typehandlers.add_type_alias('ns3::TimeUnit< 0 >&', 'ns3::Scalar&') + typehandlers.add_type_alias('ns3::TimeUnit< 1 >', 'ns3::Time') + typehandlers.add_type_alias('ns3::TimeUnit< 1 >*', 'ns3::Time*') + typehandlers.add_type_alias('ns3::TimeUnit< 1 >&', 'ns3::Time&') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + ## nstime.h: ns3::TimeStepPrecision::precision_t [enumeration] + module.add_enum('precision_t', ['S', 'MS', 'US', 'NS', 'PS', 'FS']) + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3EventId_methods(root_module, root_module['ns3::EventId']) + register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl']) + register_Ns3HighPrecision_methods(root_module, root_module['ns3::HighPrecision']) + register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator']) + register_Ns3TimeInvert_methods(root_module, root_module['ns3::TimeInvert']) + register_Ns3Scalar_methods(root_module, root_module['ns3::Scalar']) + register_Ns3Time_methods(root_module, root_module['ns3::Time']) + register_Ns3TimeSquare_methods(root_module, root_module['ns3::TimeSquare']) + register_Ns3Timer_methods(root_module, root_module['ns3::Timer']) + register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl']) + register_Ns3Watchdog_methods(root_module, root_module['ns3::Watchdog']) + register_Ns3Scheduler_methods(root_module, root_module['ns3::Scheduler']) + register_Ns3SchedulerEvent_methods(root_module, root_module['ns3::Scheduler::Event']) + register_Ns3SchedulerEventKey_methods(root_module, root_module['ns3::Scheduler::EventKey']) + register_Ns3SimulatorImpl_methods(root_module, root_module['ns3::SimulatorImpl']) + register_Ns3Synchronizer_methods(root_module, root_module['ns3::Synchronizer']) + register_Ns3TimeChecker_methods(root_module, root_module['ns3::TimeChecker']) + register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue']) + register_Ns3WallClockSynchronizer_methods(root_module, root_module['ns3::WallClockSynchronizer']) + register_Ns3CalendarScheduler_methods(root_module, root_module['ns3::CalendarScheduler']) + register_Ns3DefaultSimulatorImpl_methods(root_module, root_module['ns3::DefaultSimulatorImpl']) + register_Ns3HeapScheduler_methods(root_module, root_module['ns3::HeapScheduler']) + register_Ns3ListScheduler_methods(root_module, root_module['ns3::ListScheduler']) + register_Ns3MapScheduler_methods(root_module, root_module['ns3::MapScheduler']) + register_Ns3Ns2CalendarScheduler_methods(root_module, root_module['ns3::Ns2CalendarScheduler']) + register_Ns3RealtimeSimulatorImpl_methods(root_module, root_module['ns3::RealtimeSimulatorImpl']) + return + +def register_Ns3EventId_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_binary_comparison_operator('==') + ## event-id.h: ns3::EventId::EventId(ns3::EventId const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EventId const &', 'arg0')]) + ## event-id.h: ns3::EventId::EventId() [constructor] + cls.add_constructor([]) + ## event-id.h: ns3::EventId::EventId(ns3::Ptr const & impl, uint64_t ts, uint32_t uid) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::EventImpl > const &', 'impl'), param('uint64_t', 'ts'), param('uint32_t', 'uid')]) + ## event-id.h: void ns3::EventId::Cancel() [member function] + cls.add_method('Cancel', + 'void', + []) + ## event-id.h: uint64_t ns3::EventId::GetTs() const [member function] + cls.add_method('GetTs', + 'uint64_t', + [], + is_const=True) + ## event-id.h: uint32_t ns3::EventId::GetUid() const [member function] + cls.add_method('GetUid', + 'uint32_t', + [], + is_const=True) + ## event-id.h: bool ns3::EventId::IsExpired() const [member function] + cls.add_method('IsExpired', + 'bool', + [], + is_const=True) + ## event-id.h: bool ns3::EventId::IsRunning() const [member function] + cls.add_method('IsRunning', + 'bool', + [], + is_const=True) + ## event-id.h: ns3::EventImpl * ns3::EventId::PeekEventImpl() const [member function] + cls.add_method('PeekEventImpl', + 'ns3::EventImpl *', + [], + is_const=True) + return + +def register_Ns3EventImpl_methods(root_module, cls): + ## event-impl.h: ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EventImpl const &', 'arg0')]) + ## event-impl.h: ns3::EventImpl::EventImpl() [constructor] + cls.add_constructor([]) + ## event-impl.h: void ns3::EventImpl::Cancel() [member function] + cls.add_method('Cancel', + 'void', + []) + ## event-impl.h: void ns3::EventImpl::Invoke() [member function] + cls.add_method('Invoke', + 'void', + []) + ## event-impl.h: bool ns3::EventImpl::IsCancelled() [member function] + cls.add_method('IsCancelled', + 'bool', + []) + ## event-impl.h: void ns3::EventImpl::Ref() const [member function] + cls.add_method('Ref', + 'void', + [], + is_const=True) + ## event-impl.h: void ns3::EventImpl::Unref() const [member function] + cls.add_method('Unref', + 'void', + [], + is_const=True) + ## event-impl.h: void ns3::EventImpl::Notify() [member function] + cls.add_method('Notify', + 'void', + [], + is_pure_virtual=True, visibility='protected', is_virtual=True) + return + +def register_Ns3HighPrecision_methods(root_module, cls): + ## high-precision-128.h: ns3::HighPrecision::HighPrecision(ns3::HighPrecision const & arg0) [copy constructor] + cls.add_constructor([param('ns3::HighPrecision const &', 'arg0')]) + ## high-precision-128.h: ns3::HighPrecision::HighPrecision(double value) [constructor] + cls.add_constructor([param('double', 'value')]) + ## high-precision-128.h: ns3::HighPrecision::HighPrecision() [constructor] + cls.add_constructor([]) + ## high-precision-128.h: ns3::HighPrecision::HighPrecision(int64_t value, bool dummy) [constructor] + cls.add_constructor([param('int64_t', 'value'), param('bool', 'dummy')]) + ## high-precision-128.h: bool ns3::HighPrecision::Add(ns3::HighPrecision const & o) [member function] + cls.add_method('Add', + 'bool', + [param('ns3::HighPrecision const &', 'o')]) + ## high-precision-128.h: int ns3::HighPrecision::Compare(ns3::HighPrecision const & o) const [member function] + cls.add_method('Compare', + 'int', + [param('ns3::HighPrecision const &', 'o')], + is_const=True) + ## high-precision-128.h: bool ns3::HighPrecision::Div(ns3::HighPrecision const & o) [member function] + cls.add_method('Div', + 'bool', + [param('ns3::HighPrecision const &', 'o')]) + ## high-precision-128.h: double ns3::HighPrecision::GetDouble() const [member function] + cls.add_method('GetDouble', + 'double', + [], + is_const=True) + ## high-precision-128.h: int64_t ns3::HighPrecision::GetInteger() const [member function] + cls.add_method('GetInteger', + 'int64_t', + [], + is_const=True) + ## high-precision-128.h: bool ns3::HighPrecision::Mul(ns3::HighPrecision const & o) [member function] + cls.add_method('Mul', + 'bool', + [param('ns3::HighPrecision const &', 'o')]) + ## high-precision-128.h: static void ns3::HighPrecision::PrintStats() [member function] + cls.add_method('PrintStats', + 'void', + [], + is_static=True) + ## high-precision-128.h: bool ns3::HighPrecision::Sub(ns3::HighPrecision const & o) [member function] + cls.add_method('Sub', + 'bool', + [param('ns3::HighPrecision const &', 'o')]) + ## high-precision-128.h: static ns3::HighPrecision ns3::HighPrecision::Zero() [member function] + cls.add_method('Zero', + 'ns3::HighPrecision', + [], + is_static=True) + return + +def register_Ns3Simulator_methods(root_module, cls): + ## simulator.h: ns3::Simulator::Simulator(ns3::Simulator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Simulator const &', 'arg0')]) + ## simulator.h: static void ns3::Simulator::Cancel(ns3::EventId const & id) [member function] + cls.add_method('Cancel', + 'void', + [param('ns3::EventId const &', 'id')], + is_static=True) + ## simulator.h: static void ns3::Simulator::Destroy() [member function] + cls.add_method('Destroy', + 'void', + [], + is_static=True) + ## simulator.h: static ns3::Time ns3::Simulator::GetDelayLeft(ns3::EventId const & id) [member function] + cls.add_method('GetDelayLeft', + 'ns3::Time', + [param('ns3::EventId const &', 'id')], + is_static=True) + ## simulator.h: static ns3::Ptr ns3::Simulator::GetImplementation() [member function] + cls.add_method('GetImplementation', + 'ns3::Ptr< ns3::SimulatorImpl >', + [], + is_static=True) + ## simulator.h: static ns3::Time ns3::Simulator::GetMaximumSimulationTime() [member function] + cls.add_method('GetMaximumSimulationTime', + 'ns3::Time', + [], + is_static=True) + ## simulator.h: static bool ns3::Simulator::IsExpired(ns3::EventId const & id) [member function] + cls.add_method('IsExpired', + 'bool', + [param('ns3::EventId const &', 'id')], + is_static=True) + ## simulator.h: static bool ns3::Simulator::IsFinished() [member function] + cls.add_method('IsFinished', + 'bool', + [], + is_static=True) + ## simulator.h: static ns3::Time ns3::Simulator::Next() [member function] + cls.add_method('Next', + 'ns3::Time', + [], + is_static=True) + ## simulator.h: static ns3::Time ns3::Simulator::Now() [member function] + cls.add_method('Now', + 'ns3::Time', + [], + is_static=True) + ## simulator.h: static void ns3::Simulator::Remove(ns3::EventId const & id) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::EventId const &', 'id')], + is_static=True) + ## simulator.h: static void ns3::Simulator::RunOneEvent() [member function] + cls.add_method('RunOneEvent', + 'void', + [], + is_static=True) + ## simulator.h: static void ns3::Simulator::SetImplementation(ns3::Ptr impl) [member function] + cls.add_method('SetImplementation', + 'void', + [param('ns3::Ptr< ns3::SimulatorImpl >', 'impl')], + is_static=True) + ## simulator.h: static void ns3::Simulator::SetScheduler(ns3::Ptr scheduler) [member function] + cls.add_method('SetScheduler', + 'void', + [param('ns3::Ptr< ns3::Scheduler >', 'scheduler')], + is_static=True) + ## simulator.h: static void ns3::Simulator::Stop() [member function] + cls.add_method('Stop', + 'void', + [], + is_static=True) + ## simulator.h: static void ns3::Simulator::Stop(ns3::Time const & time) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::Time const &', 'time')], + is_static=True) + return + +def register_Ns3TimeInvert_methods(root_module, cls): + ## nstime.h: ns3::TimeUnit<-1>::TimeUnit() [constructor] + cls.add_constructor([]) + ## nstime.h: ns3::TimeUnit<-1>::TimeUnit(ns3::TimeUnit<-1> const & o) [copy constructor] + cls.add_constructor([param('ns3::TimeUnit< - 1 > const &', 'o')]) + ## nstime.h: ns3::TimeUnit<-1>::TimeUnit(ns3::HighPrecision data) [constructor] + cls.add_constructor([param('ns3::HighPrecision', 'data')]) + ## nstime.h: ns3::HighPrecision const & ns3::TimeUnit<-1>::GetHighPrecision() const [member function] + cls.add_method('GetHighPrecision', + 'ns3::HighPrecision const &', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<-1>::IsNegative() const [member function] + cls.add_method('IsNegative', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<-1>::IsPositive() const [member function] + cls.add_method('IsPositive', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<-1>::IsStrictlyNegative() const [member function] + cls.add_method('IsStrictlyNegative', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<-1>::IsStrictlyPositive() const [member function] + cls.add_method('IsStrictlyPositive', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<-1>::IsZero() const [member function] + cls.add_method('IsZero', + 'bool', + [], + is_const=True) + ## nstime.h: ns3::HighPrecision * ns3::TimeUnit<-1>::PeekHighPrecision() [member function] + cls.add_method('PeekHighPrecision', + 'ns3::HighPrecision *', + []) + return + +def register_Ns3Scalar_methods(root_module, cls): + cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Scalar'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_numeric_operator('/', root_module['ns3::TimeInvert'], root_module['ns3::Scalar'], param('ns3::TimeUnit< 1 > const &', 'right')) + ## nstime.h: ns3::TimeUnit<0>::TimeUnit(double scalar) [constructor] + cls.add_constructor([param('double', 'scalar')]) + ## nstime.h: ns3::TimeUnit<0>::TimeUnit() [constructor] + cls.add_constructor([]) + ## nstime.h: ns3::TimeUnit<0>::TimeUnit(ns3::TimeUnit<0> const & o) [copy constructor] + cls.add_constructor([param('ns3::TimeUnit< 0 > const &', 'o')]) + ## nstime.h: ns3::TimeUnit<0>::TimeUnit(ns3::HighPrecision data) [constructor] + cls.add_constructor([param('ns3::HighPrecision', 'data')]) + ## nstime.h: double ns3::TimeUnit<0>::GetDouble() const [member function] + cls.add_method('GetDouble', + 'double', + [], + is_const=True) + ## nstime.h: ns3::HighPrecision const & ns3::TimeUnit<0>::GetHighPrecision() const [member function] + cls.add_method('GetHighPrecision', + 'ns3::HighPrecision const &', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<0>::IsNegative() const [member function] + cls.add_method('IsNegative', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<0>::IsPositive() const [member function] + cls.add_method('IsPositive', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<0>::IsStrictlyNegative() const [member function] + cls.add_method('IsStrictlyNegative', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<0>::IsStrictlyPositive() const [member function] + cls.add_method('IsStrictlyPositive', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<0>::IsZero() const [member function] + cls.add_method('IsZero', + 'bool', + [], + is_const=True) + ## nstime.h: ns3::HighPrecision * ns3::TimeUnit<0>::PeekHighPrecision() [member function] + cls.add_method('PeekHighPrecision', + 'ns3::HighPrecision *', + []) + return + +def register_Ns3Time_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_binary_numeric_operator('*', root_module['ns3::TimeSquare'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::TimeUnit< 0 > const &', 'right')) + cls.add_binary_numeric_operator('/', root_module['ns3::Scalar'], root_module['ns3::Time'], param('ns3::TimeUnit< 1 > const &', 'right')) + cls.add_binary_comparison_operator('<') + cls.add_binary_comparison_operator('>') + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('<=') + cls.add_binary_comparison_operator('==') + cls.add_binary_comparison_operator('>=') + ## nstime.h: ns3::TimeUnit<1>::TimeUnit(std::string const & s) [constructor] + cls.add_constructor([param('std::string const &', 's')]) + ## nstime.h: ns3::TimeUnit<1>::TimeUnit() [constructor] + cls.add_constructor([]) + ## nstime.h: ns3::TimeUnit<1>::TimeUnit(ns3::TimeUnit<1> const & o) [copy constructor] + cls.add_constructor([param('ns3::TimeUnit< 1 > const &', 'o')]) + ## nstime.h: ns3::TimeUnit<1>::TimeUnit(ns3::HighPrecision data) [constructor] + cls.add_constructor([param('ns3::HighPrecision', 'data')]) + ## nstime.h: int64_t ns3::TimeUnit<1>::GetFemtoSeconds() const [member function] + cls.add_method('GetFemtoSeconds', + 'int64_t', + [], + is_const=True) + ## nstime.h: ns3::HighPrecision const & ns3::TimeUnit<1>::GetHighPrecision() const [member function] + cls.add_method('GetHighPrecision', + 'ns3::HighPrecision const &', + [], + is_const=True) + ## nstime.h: int64_t ns3::TimeUnit<1>::GetMicroSeconds() const [member function] + cls.add_method('GetMicroSeconds', + 'int64_t', + [], + is_const=True) + ## nstime.h: int64_t ns3::TimeUnit<1>::GetMilliSeconds() const [member function] + cls.add_method('GetMilliSeconds', + 'int64_t', + [], + is_const=True) + ## nstime.h: int64_t ns3::TimeUnit<1>::GetNanoSeconds() const [member function] + cls.add_method('GetNanoSeconds', + 'int64_t', + [], + is_const=True) + ## nstime.h: int64_t ns3::TimeUnit<1>::GetPicoSeconds() const [member function] + cls.add_method('GetPicoSeconds', + 'int64_t', + [], + is_const=True) + ## nstime.h: double ns3::TimeUnit<1>::GetSeconds() const [member function] + cls.add_method('GetSeconds', + 'double', + [], + is_const=True) + ## nstime.h: int64_t ns3::TimeUnit<1>::GetTimeStep() const [member function] + cls.add_method('GetTimeStep', + 'int64_t', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<1>::IsNegative() const [member function] + cls.add_method('IsNegative', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<1>::IsPositive() const [member function] + cls.add_method('IsPositive', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<1>::IsStrictlyNegative() const [member function] + cls.add_method('IsStrictlyNegative', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<1>::IsStrictlyPositive() const [member function] + cls.add_method('IsStrictlyPositive', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<1>::IsZero() const [member function] + cls.add_method('IsZero', + 'bool', + [], + is_const=True) + ## nstime.h: ns3::HighPrecision * ns3::TimeUnit<1>::PeekHighPrecision() [member function] + cls.add_method('PeekHighPrecision', + 'ns3::HighPrecision *', + []) + ## nstime.h: static uint64_t ns3::TimeUnit<1>::UnitsToTimestep(uint64_t unitValue, uint64_t unitFactor) [member function] + cls.add_method('UnitsToTimestep', + 'uint64_t', + [param('uint64_t', 'unitValue'), param('uint64_t', 'unitFactor')], + is_static=True) + return + +def register_Ns3TimeSquare_methods(root_module, cls): + cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::TimeSquare'], param('ns3::TimeUnit< 1 > const &', 'right')) + ## nstime.h: ns3::TimeUnit<2>::TimeUnit() [constructor] + cls.add_constructor([]) + ## nstime.h: ns3::TimeUnit<2>::TimeUnit(ns3::TimeUnit<2> const & o) [copy constructor] + cls.add_constructor([param('ns3::TimeUnit< 2 > const &', 'o')]) + ## nstime.h: ns3::TimeUnit<2>::TimeUnit(ns3::HighPrecision data) [constructor] + cls.add_constructor([param('ns3::HighPrecision', 'data')]) + ## nstime.h: ns3::HighPrecision const & ns3::TimeUnit<2>::GetHighPrecision() const [member function] + cls.add_method('GetHighPrecision', + 'ns3::HighPrecision const &', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<2>::IsNegative() const [member function] + cls.add_method('IsNegative', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<2>::IsPositive() const [member function] + cls.add_method('IsPositive', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<2>::IsStrictlyNegative() const [member function] + cls.add_method('IsStrictlyNegative', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<2>::IsStrictlyPositive() const [member function] + cls.add_method('IsStrictlyPositive', + 'bool', + [], + is_const=True) + ## nstime.h: bool ns3::TimeUnit<2>::IsZero() const [member function] + cls.add_method('IsZero', + 'bool', + [], + is_const=True) + ## nstime.h: ns3::HighPrecision * ns3::TimeUnit<2>::PeekHighPrecision() [member function] + cls.add_method('PeekHighPrecision', + 'ns3::HighPrecision *', + []) + return + +def register_Ns3Timer_methods(root_module, cls): + ## timer.h: ns3::Timer::Timer(ns3::Timer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Timer const &', 'arg0')]) + ## timer.h: ns3::Timer::Timer() [constructor] + cls.add_constructor([]) + ## timer.h: ns3::Timer::Timer(ns3::Timer::DestroyPolicy destroyPolicy) [constructor] + cls.add_constructor([param('ns3::Timer::DestroyPolicy', 'destroyPolicy')]) + ## timer.h: void ns3::Timer::Cancel() [member function] + cls.add_method('Cancel', + 'void', + []) + ## timer.h: ns3::Time ns3::Timer::GetDelay() const [member function] + cls.add_method('GetDelay', + 'ns3::Time', + [], + is_const=True) + ## timer.h: ns3::Time ns3::Timer::GetDelayLeft() const [member function] + cls.add_method('GetDelayLeft', + 'ns3::Time', + [], + is_const=True) + ## timer.h: ns3::Timer::State ns3::Timer::GetState() const [member function] + cls.add_method('GetState', + 'ns3::Timer::State', + [], + is_const=True) + ## timer.h: bool ns3::Timer::IsExpired() const [member function] + cls.add_method('IsExpired', + 'bool', + [], + is_const=True) + ## timer.h: bool ns3::Timer::IsRunning() const [member function] + cls.add_method('IsRunning', + 'bool', + [], + is_const=True) + ## timer.h: bool ns3::Timer::IsSuspended() const [member function] + cls.add_method('IsSuspended', + 'bool', + [], + is_const=True) + ## timer.h: void ns3::Timer::Remove() [member function] + cls.add_method('Remove', + 'void', + []) + ## timer.h: void ns3::Timer::Resume() [member function] + cls.add_method('Resume', + 'void', + []) + ## timer.h: void ns3::Timer::Schedule() [member function] + cls.add_method('Schedule', + 'void', + []) + ## timer.h: void ns3::Timer::Schedule(ns3::Time delay) [member function] + cls.add_method('Schedule', + 'void', + [param('ns3::Time', 'delay')]) + ## timer.h: void ns3::Timer::SetDelay(ns3::Time const & delay) [member function] + cls.add_method('SetDelay', + 'void', + [param('ns3::Time const &', 'delay')]) + ## timer.h: void ns3::Timer::Suspend() [member function] + cls.add_method('Suspend', + 'void', + []) + return + +def register_Ns3TimerImpl_methods(root_module, cls): + ## timer-impl.h: ns3::TimerImpl::TimerImpl() [constructor] + cls.add_constructor([]) + ## timer-impl.h: ns3::TimerImpl::TimerImpl(ns3::TimerImpl const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TimerImpl const &', 'arg0')]) + ## timer-impl.h: void ns3::TimerImpl::Invoke() [member function] + cls.add_method('Invoke', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## timer-impl.h: ns3::EventId ns3::TimerImpl::Schedule(ns3::Time const & delay) [member function] + cls.add_method('Schedule', + 'ns3::EventId', + [param('ns3::Time const &', 'delay')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3Watchdog_methods(root_module, cls): + ## watchdog.h: ns3::Watchdog::Watchdog(ns3::Watchdog const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Watchdog const &', 'arg0')]) + ## watchdog.h: ns3::Watchdog::Watchdog() [constructor] + cls.add_constructor([]) + ## watchdog.h: void ns3::Watchdog::Ping(ns3::Time delay) [member function] + cls.add_method('Ping', + 'void', + [param('ns3::Time', 'delay')]) + return + +def register_Ns3Scheduler_methods(root_module, cls): + ## scheduler.h: ns3::Scheduler::Scheduler() [constructor] + cls.add_constructor([]) + ## scheduler.h: ns3::Scheduler::Scheduler(ns3::Scheduler const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Scheduler const &', 'arg0')]) + ## scheduler.h: static ns3::TypeId ns3::Scheduler::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## scheduler.h: void ns3::Scheduler::Insert(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_pure_virtual=True, is_virtual=True) + ## scheduler.h: bool ns3::Scheduler::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## scheduler.h: ns3::Scheduler::Event ns3::Scheduler::PeekNext() const [member function] + cls.add_method('PeekNext', + 'ns3::Scheduler::Event', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## scheduler.h: void ns3::Scheduler::Remove(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_pure_virtual=True, is_virtual=True) + ## scheduler.h: ns3::Scheduler::Event ns3::Scheduler::RemoveNext() [member function] + cls.add_method('RemoveNext', + 'ns3::Scheduler::Event', + [], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3SchedulerEvent_methods(root_module, cls): + cls.add_binary_comparison_operator('<') + ## scheduler.h: ns3::Scheduler::Event::Event() [constructor] + cls.add_constructor([]) + ## scheduler.h: ns3::Scheduler::Event::Event(ns3::Scheduler::Event const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Scheduler::Event const &', 'arg0')]) + ## scheduler.h: ns3::Scheduler::Event::impl [variable] + cls.add_instance_attribute('impl', 'ns3::EventImpl *', is_const=False) + ## scheduler.h: ns3::Scheduler::Event::key [variable] + cls.add_instance_attribute('key', 'ns3::Scheduler::EventKey', is_const=False) + return + +def register_Ns3SchedulerEventKey_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') + cls.add_binary_comparison_operator('<') + cls.add_binary_comparison_operator('>') + ## scheduler.h: ns3::Scheduler::EventKey::EventKey() [constructor] + cls.add_constructor([]) + ## scheduler.h: ns3::Scheduler::EventKey::EventKey(ns3::Scheduler::EventKey const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Scheduler::EventKey const &', 'arg0')]) + ## scheduler.h: ns3::Scheduler::EventKey::m_ts [variable] + cls.add_instance_attribute('m_ts', 'uint64_t', is_const=False) + ## scheduler.h: ns3::Scheduler::EventKey::m_uid [variable] + cls.add_instance_attribute('m_uid', 'uint32_t', is_const=False) + return + +def register_Ns3SimulatorImpl_methods(root_module, cls): + ## simulator-impl.h: ns3::SimulatorImpl::SimulatorImpl() [constructor] + cls.add_constructor([]) + ## simulator-impl.h: ns3::SimulatorImpl::SimulatorImpl(ns3::SimulatorImpl const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SimulatorImpl const &', 'arg0')]) + ## simulator-impl.h: void ns3::SimulatorImpl::Cancel(ns3::EventId const & ev) [member function] + cls.add_method('Cancel', + 'void', + [param('ns3::EventId const &', 'ev')], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: void ns3::SimulatorImpl::Destroy() [member function] + cls.add_method('Destroy', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: ns3::Time ns3::SimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function] + cls.add_method('GetDelayLeft', + 'ns3::Time', + [param('ns3::EventId const &', 'id')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## simulator-impl.h: ns3::Time ns3::SimulatorImpl::GetMaximumSimulationTime() const [member function] + cls.add_method('GetMaximumSimulationTime', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## simulator-impl.h: bool ns3::SimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function] + cls.add_method('IsExpired', + 'bool', + [param('ns3::EventId const &', 'ev')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## simulator-impl.h: bool ns3::SimulatorImpl::IsFinished() const [member function] + cls.add_method('IsFinished', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## simulator-impl.h: ns3::Time ns3::SimulatorImpl::Next() const [member function] + cls.add_method('Next', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## simulator-impl.h: ns3::Time ns3::SimulatorImpl::Now() const [member function] + cls.add_method('Now', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## simulator-impl.h: void ns3::SimulatorImpl::Remove(ns3::EventId const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::EventId const &', 'ev')], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: void ns3::SimulatorImpl::Run() [member function] + cls.add_method('Run', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: void ns3::SimulatorImpl::RunOneEvent() [member function] + cls.add_method('RunOneEvent', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function] + cls.add_method('Schedule', + 'ns3::EventId', + [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: ns3::EventId ns3::SimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function] + cls.add_method('ScheduleDestroy', + 'ns3::EventId', + [param('ns3::EventImpl *', 'event')], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: ns3::EventId ns3::SimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function] + cls.add_method('ScheduleNow', + 'ns3::EventId', + [param('ns3::EventImpl *', 'event')], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: void ns3::SimulatorImpl::SetScheduler(ns3::Ptr scheduler) [member function] + cls.add_method('SetScheduler', + 'void', + [param('ns3::Ptr< ns3::Scheduler >', 'scheduler')], + is_pure_virtual=True, is_virtual=True) + ## simulator-impl.h: void ns3::SimulatorImpl::Stop() [member function] + cls.add_method('Stop', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3Synchronizer_methods(root_module, cls): + ## synchronizer.h: ns3::Synchronizer::Synchronizer(ns3::Synchronizer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Synchronizer const &', 'arg0')]) + ## synchronizer.h: ns3::Synchronizer::Synchronizer() [constructor] + cls.add_constructor([]) + ## synchronizer.h: uint64_t ns3::Synchronizer::EventEnd() [member function] + cls.add_method('EventEnd', + 'uint64_t', + []) + ## synchronizer.h: void ns3::Synchronizer::EventStart() [member function] + cls.add_method('EventStart', + 'void', + []) + ## synchronizer.h: uint64_t ns3::Synchronizer::GetCurrentRealtime() [member function] + cls.add_method('GetCurrentRealtime', + 'uint64_t', + []) + ## synchronizer.h: int64_t ns3::Synchronizer::GetDrift(uint64_t ts) [member function] + cls.add_method('GetDrift', + 'int64_t', + [param('uint64_t', 'ts')]) + ## synchronizer.h: uint64_t ns3::Synchronizer::GetOrigin() [member function] + cls.add_method('GetOrigin', + 'uint64_t', + []) + ## synchronizer.h: static ns3::TypeId ns3::Synchronizer::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## synchronizer.h: bool ns3::Synchronizer::Realtime() [member function] + cls.add_method('Realtime', + 'bool', + []) + ## synchronizer.h: void ns3::Synchronizer::SetCondition(bool arg0) [member function] + cls.add_method('SetCondition', + 'void', + [param('bool', 'arg0')]) + ## synchronizer.h: void ns3::Synchronizer::SetOrigin(uint64_t ts) [member function] + cls.add_method('SetOrigin', + 'void', + [param('uint64_t', 'ts')]) + ## synchronizer.h: void ns3::Synchronizer::Signal() [member function] + cls.add_method('Signal', + 'void', + []) + ## synchronizer.h: bool ns3::Synchronizer::Synchronize(uint64_t tsCurrent, uint64_t tsDelay) [member function] + cls.add_method('Synchronize', + 'bool', + [param('uint64_t', 'tsCurrent'), param('uint64_t', 'tsDelay')]) + ## synchronizer.h: uint64_t ns3::Synchronizer::DoEventEnd() [member function] + cls.add_method('DoEventEnd', + 'uint64_t', + [], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## synchronizer.h: void ns3::Synchronizer::DoEventStart() [member function] + cls.add_method('DoEventStart', + 'void', + [], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## synchronizer.h: uint64_t ns3::Synchronizer::DoGetCurrentRealtime() [member function] + cls.add_method('DoGetCurrentRealtime', + 'uint64_t', + [], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## synchronizer.h: int64_t ns3::Synchronizer::DoGetDrift(uint64_t ns) [member function] + cls.add_method('DoGetDrift', + 'int64_t', + [param('uint64_t', 'ns')], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## synchronizer.h: bool ns3::Synchronizer::DoRealtime() [member function] + cls.add_method('DoRealtime', + 'bool', + [], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## synchronizer.h: void ns3::Synchronizer::DoSetCondition(bool arg0) [member function] + cls.add_method('DoSetCondition', + 'void', + [param('bool', 'arg0')], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## synchronizer.h: void ns3::Synchronizer::DoSetOrigin(uint64_t ns) [member function] + cls.add_method('DoSetOrigin', + 'void', + [param('uint64_t', 'ns')], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## synchronizer.h: void ns3::Synchronizer::DoSignal() [member function] + cls.add_method('DoSignal', + 'void', + [], + is_pure_virtual=True, visibility='protected', is_virtual=True) + ## synchronizer.h: bool ns3::Synchronizer::DoSynchronize(uint64_t nsCurrent, uint64_t nsDelay) [member function] + cls.add_method('DoSynchronize', + 'bool', + [param('uint64_t', 'nsCurrent'), param('uint64_t', 'nsDelay')], + is_pure_virtual=True, visibility='protected', is_virtual=True) + return + +def register_Ns3TimeChecker_methods(root_module, cls): + ## nstime.h: ns3::TimeChecker::TimeChecker() [constructor] + cls.add_constructor([]) + ## nstime.h: ns3::TimeChecker::TimeChecker(ns3::TimeChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TimeChecker const &', 'arg0')]) + return + +def register_Ns3TimeValue_methods(root_module, cls): + ## nstime.h: ns3::TimeValue::TimeValue() [constructor] + cls.add_constructor([]) + ## nstime.h: ns3::TimeValue::TimeValue(ns3::TimeValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TimeValue const &', 'arg0')]) + ## nstime.h: ns3::TimeValue::TimeValue(ns3::Time const & value) [constructor] + cls.add_constructor([param('ns3::Time const &', 'value')]) + ## nstime.h: ns3::Ptr ns3::TimeValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## nstime.h: bool ns3::TimeValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## nstime.h: ns3::Time ns3::TimeValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Time', + [], + is_const=True) + ## nstime.h: std::string ns3::TimeValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## nstime.h: void ns3::TimeValue::Set(ns3::Time const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Time const &', 'value')]) + return + +def register_Ns3WallClockSynchronizer_methods(root_module, cls): + ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer::WallClockSynchronizer(ns3::WallClockSynchronizer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WallClockSynchronizer const &', 'arg0')]) + ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer::WallClockSynchronizer() [constructor] + cls.add_constructor([]) + ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer::NS_PER_SEC [variable] + cls.add_static_attribute('NS_PER_SEC', 'uint64_t const', is_const=True) + ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer::US_PER_NS [variable] + cls.add_static_attribute('US_PER_NS', 'uint64_t const', is_const=True) + ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer::US_PER_SEC [variable] + cls.add_static_attribute('US_PER_SEC', 'uint64_t const', is_const=True) + ## wall-clock-synchronizer.h: uint64_t ns3::WallClockSynchronizer::DoEventEnd() [member function] + cls.add_method('DoEventEnd', + 'uint64_t', + [], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: void ns3::WallClockSynchronizer::DoEventStart() [member function] + cls.add_method('DoEventStart', + 'void', + [], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: uint64_t ns3::WallClockSynchronizer::DoGetCurrentRealtime() [member function] + cls.add_method('DoGetCurrentRealtime', + 'uint64_t', + [], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: int64_t ns3::WallClockSynchronizer::DoGetDrift(uint64_t ns) [member function] + cls.add_method('DoGetDrift', + 'int64_t', + [param('uint64_t', 'ns')], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: bool ns3::WallClockSynchronizer::DoRealtime() [member function] + cls.add_method('DoRealtime', + 'bool', + [], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: void ns3::WallClockSynchronizer::DoSetCondition(bool cond) [member function] + cls.add_method('DoSetCondition', + 'void', + [param('bool', 'cond')], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: void ns3::WallClockSynchronizer::DoSetOrigin(uint64_t ns) [member function] + cls.add_method('DoSetOrigin', + 'void', + [param('uint64_t', 'ns')], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: void ns3::WallClockSynchronizer::DoSignal() [member function] + cls.add_method('DoSignal', + 'void', + [], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: bool ns3::WallClockSynchronizer::DoSynchronize(uint64_t nsCurrent, uint64_t nsDelay) [member function] + cls.add_method('DoSynchronize', + 'bool', + [param('uint64_t', 'nsCurrent'), param('uint64_t', 'nsDelay')], + visibility='protected', is_virtual=True) + ## wall-clock-synchronizer.h: uint64_t ns3::WallClockSynchronizer::DriftCorrect(uint64_t nsNow, uint64_t nsDelay) [member function] + cls.add_method('DriftCorrect', + 'uint64_t', + [param('uint64_t', 'nsNow'), param('uint64_t', 'nsDelay')], + visibility='protected') + ## wall-clock-synchronizer.h: uint64_t ns3::WallClockSynchronizer::GetNormalizedRealtime() [member function] + cls.add_method('GetNormalizedRealtime', + 'uint64_t', + [], + visibility='protected') + ## wall-clock-synchronizer.h: uint64_t ns3::WallClockSynchronizer::GetRealtime() [member function] + cls.add_method('GetRealtime', + 'uint64_t', + [], + visibility='protected') + ## wall-clock-synchronizer.h: void ns3::WallClockSynchronizer::NsToTimeval(int64_t ns, timeval * tv) [member function] + cls.add_method('NsToTimeval', + 'void', + [param('int64_t', 'ns'), param('timeval *', 'tv')], + visibility='protected') + ## wall-clock-synchronizer.h: bool ns3::WallClockSynchronizer::SleepWait(uint64_t arg0) [member function] + cls.add_method('SleepWait', + 'bool', + [param('uint64_t', 'arg0')], + visibility='protected') + ## wall-clock-synchronizer.h: bool ns3::WallClockSynchronizer::SpinWait(uint64_t arg0) [member function] + cls.add_method('SpinWait', + 'bool', + [param('uint64_t', 'arg0')], + visibility='protected') + ## wall-clock-synchronizer.h: void ns3::WallClockSynchronizer::TimevalAdd(timeval * tv1, timeval * tv2, timeval * result) [member function] + cls.add_method('TimevalAdd', + 'void', + [param('timeval *', 'tv1'), param('timeval *', 'tv2'), param('timeval *', 'result')], + visibility='protected') + ## wall-clock-synchronizer.h: uint64_t ns3::WallClockSynchronizer::TimevalToNs(timeval * tv) [member function] + cls.add_method('TimevalToNs', + 'uint64_t', + [param('timeval *', 'tv')], + visibility='protected') + return + +def register_Ns3CalendarScheduler_methods(root_module, cls): + ## calendar-scheduler.h: ns3::CalendarScheduler::CalendarScheduler(ns3::CalendarScheduler const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CalendarScheduler const &', 'arg0')]) + ## calendar-scheduler.h: ns3::CalendarScheduler::CalendarScheduler() [constructor] + cls.add_constructor([]) + ## calendar-scheduler.h: static ns3::TypeId ns3::CalendarScheduler::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## calendar-scheduler.h: void ns3::CalendarScheduler::Insert(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## calendar-scheduler.h: bool ns3::CalendarScheduler::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True, is_virtual=True) + ## calendar-scheduler.h: ns3::Scheduler::Event ns3::CalendarScheduler::PeekNext() const [member function] + cls.add_method('PeekNext', + 'ns3::Scheduler::Event', + [], + is_const=True, is_virtual=True) + ## calendar-scheduler.h: void ns3::CalendarScheduler::Remove(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## calendar-scheduler.h: ns3::Scheduler::Event ns3::CalendarScheduler::RemoveNext() [member function] + cls.add_method('RemoveNext', + 'ns3::Scheduler::Event', + [], + is_virtual=True) + return + +def register_Ns3DefaultSimulatorImpl_methods(root_module, cls): + ## default-simulator-impl.h: ns3::DefaultSimulatorImpl::DefaultSimulatorImpl(ns3::DefaultSimulatorImpl const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DefaultSimulatorImpl const &', 'arg0')]) + ## default-simulator-impl.h: ns3::DefaultSimulatorImpl::DefaultSimulatorImpl() [constructor] + cls.add_constructor([]) + ## default-simulator-impl.h: void ns3::DefaultSimulatorImpl::Cancel(ns3::EventId const & ev) [member function] + cls.add_method('Cancel', + 'void', + [param('ns3::EventId const &', 'ev')], + is_virtual=True) + ## default-simulator-impl.h: void ns3::DefaultSimulatorImpl::Destroy() [member function] + cls.add_method('Destroy', + 'void', + [], + is_virtual=True) + ## default-simulator-impl.h: ns3::Time ns3::DefaultSimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function] + cls.add_method('GetDelayLeft', + 'ns3::Time', + [param('ns3::EventId const &', 'id')], + is_const=True, is_virtual=True) + ## default-simulator-impl.h: ns3::Time ns3::DefaultSimulatorImpl::GetMaximumSimulationTime() const [member function] + cls.add_method('GetMaximumSimulationTime', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## default-simulator-impl.h: static ns3::TypeId ns3::DefaultSimulatorImpl::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## default-simulator-impl.h: bool ns3::DefaultSimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function] + cls.add_method('IsExpired', + 'bool', + [param('ns3::EventId const &', 'ev')], + is_const=True, is_virtual=True) + ## default-simulator-impl.h: bool ns3::DefaultSimulatorImpl::IsFinished() const [member function] + cls.add_method('IsFinished', + 'bool', + [], + is_const=True, is_virtual=True) + ## default-simulator-impl.h: ns3::Time ns3::DefaultSimulatorImpl::Next() const [member function] + cls.add_method('Next', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## default-simulator-impl.h: ns3::Time ns3::DefaultSimulatorImpl::Now() const [member function] + cls.add_method('Now', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## default-simulator-impl.h: void ns3::DefaultSimulatorImpl::Remove(ns3::EventId const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::EventId const &', 'ev')], + is_virtual=True) + ## default-simulator-impl.h: void ns3::DefaultSimulatorImpl::Run() [member function] + cls.add_method('Run', + 'void', + [], + is_virtual=True) + ## default-simulator-impl.h: void ns3::DefaultSimulatorImpl::RunOneEvent() [member function] + cls.add_method('RunOneEvent', + 'void', + [], + is_virtual=True) + ## default-simulator-impl.h: ns3::EventId ns3::DefaultSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function] + cls.add_method('Schedule', + 'ns3::EventId', + [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], + is_virtual=True) + ## default-simulator-impl.h: ns3::EventId ns3::DefaultSimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function] + cls.add_method('ScheduleDestroy', + 'ns3::EventId', + [param('ns3::EventImpl *', 'event')], + is_virtual=True) + ## default-simulator-impl.h: ns3::EventId ns3::DefaultSimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function] + cls.add_method('ScheduleNow', + 'ns3::EventId', + [param('ns3::EventImpl *', 'event')], + is_virtual=True) + ## default-simulator-impl.h: void ns3::DefaultSimulatorImpl::SetScheduler(ns3::Ptr scheduler) [member function] + cls.add_method('SetScheduler', + 'void', + [param('ns3::Ptr< ns3::Scheduler >', 'scheduler')], + is_virtual=True) + ## default-simulator-impl.h: void ns3::DefaultSimulatorImpl::Stop() [member function] + cls.add_method('Stop', + 'void', + [], + is_virtual=True) + return + +def register_Ns3HeapScheduler_methods(root_module, cls): + ## heap-scheduler.h: ns3::HeapScheduler::HeapScheduler(ns3::HeapScheduler const & arg0) [copy constructor] + cls.add_constructor([param('ns3::HeapScheduler const &', 'arg0')]) + ## heap-scheduler.h: ns3::HeapScheduler::HeapScheduler() [constructor] + cls.add_constructor([]) + ## heap-scheduler.h: static ns3::TypeId ns3::HeapScheduler::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## heap-scheduler.h: void ns3::HeapScheduler::Insert(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## heap-scheduler.h: bool ns3::HeapScheduler::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True, is_virtual=True) + ## heap-scheduler.h: ns3::Scheduler::Event ns3::HeapScheduler::PeekNext() const [member function] + cls.add_method('PeekNext', + 'ns3::Scheduler::Event', + [], + is_const=True, is_virtual=True) + ## heap-scheduler.h: void ns3::HeapScheduler::Remove(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## heap-scheduler.h: ns3::Scheduler::Event ns3::HeapScheduler::RemoveNext() [member function] + cls.add_method('RemoveNext', + 'ns3::Scheduler::Event', + [], + is_virtual=True) + return + +def register_Ns3ListScheduler_methods(root_module, cls): + ## list-scheduler.h: ns3::ListScheduler::ListScheduler(ns3::ListScheduler const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ListScheduler const &', 'arg0')]) + ## list-scheduler.h: ns3::ListScheduler::ListScheduler() [constructor] + cls.add_constructor([]) + ## list-scheduler.h: static ns3::TypeId ns3::ListScheduler::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## list-scheduler.h: void ns3::ListScheduler::Insert(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## list-scheduler.h: bool ns3::ListScheduler::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True, is_virtual=True) + ## list-scheduler.h: ns3::Scheduler::Event ns3::ListScheduler::PeekNext() const [member function] + cls.add_method('PeekNext', + 'ns3::Scheduler::Event', + [], + is_const=True, is_virtual=True) + ## list-scheduler.h: void ns3::ListScheduler::Remove(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## list-scheduler.h: ns3::Scheduler::Event ns3::ListScheduler::RemoveNext() [member function] + cls.add_method('RemoveNext', + 'ns3::Scheduler::Event', + [], + is_virtual=True) + return + +def register_Ns3MapScheduler_methods(root_module, cls): + ## map-scheduler.h: ns3::MapScheduler::MapScheduler(ns3::MapScheduler const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MapScheduler const &', 'arg0')]) + ## map-scheduler.h: ns3::MapScheduler::MapScheduler() [constructor] + cls.add_constructor([]) + ## map-scheduler.h: static ns3::TypeId ns3::MapScheduler::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## map-scheduler.h: void ns3::MapScheduler::Insert(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## map-scheduler.h: bool ns3::MapScheduler::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True, is_virtual=True) + ## map-scheduler.h: ns3::Scheduler::Event ns3::MapScheduler::PeekNext() const [member function] + cls.add_method('PeekNext', + 'ns3::Scheduler::Event', + [], + is_const=True, is_virtual=True) + ## map-scheduler.h: void ns3::MapScheduler::Remove(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## map-scheduler.h: ns3::Scheduler::Event ns3::MapScheduler::RemoveNext() [member function] + cls.add_method('RemoveNext', + 'ns3::Scheduler::Event', + [], + is_virtual=True) + return + +def register_Ns3Ns2CalendarScheduler_methods(root_module, cls): + ## ns2-calendar-scheduler.h: ns3::Ns2CalendarScheduler::Ns2CalendarScheduler(ns3::Ns2CalendarScheduler const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ns2CalendarScheduler const &', 'arg0')]) + ## ns2-calendar-scheduler.h: ns3::Ns2CalendarScheduler::Ns2CalendarScheduler() [constructor] + cls.add_constructor([]) + ## ns2-calendar-scheduler.h: static ns3::TypeId ns3::Ns2CalendarScheduler::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ns2-calendar-scheduler.h: void ns3::Ns2CalendarScheduler::Insert(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## ns2-calendar-scheduler.h: bool ns3::Ns2CalendarScheduler::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True, is_virtual=True) + ## ns2-calendar-scheduler.h: ns3::Scheduler::Event ns3::Ns2CalendarScheduler::PeekNext() const [member function] + cls.add_method('PeekNext', + 'ns3::Scheduler::Event', + [], + is_const=True, is_virtual=True) + ## ns2-calendar-scheduler.h: void ns3::Ns2CalendarScheduler::Remove(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## ns2-calendar-scheduler.h: ns3::Scheduler::Event ns3::Ns2CalendarScheduler::RemoveNext() [member function] + cls.add_method('RemoveNext', + 'ns3::Scheduler::Event', + [], + is_virtual=True) + return + +def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls): + ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl(ns3::RealtimeSimulatorImpl const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RealtimeSimulatorImpl const &', 'arg0')]) + ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl() [constructor] + cls.add_constructor([]) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::Cancel(ns3::EventId const & ev) [member function] + cls.add_method('Cancel', + 'void', + [param('ns3::EventId const &', 'ev')], + is_virtual=True) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::Destroy() [member function] + cls.add_method('Destroy', + 'void', + [], + is_virtual=True) + ## realtime-simulator-impl.h: ns3::Time ns3::RealtimeSimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function] + cls.add_method('GetDelayLeft', + 'ns3::Time', + [param('ns3::EventId const &', 'id')], + is_const=True, is_virtual=True) + ## realtime-simulator-impl.h: ns3::Time ns3::RealtimeSimulatorImpl::GetHardLimit() const [member function] + cls.add_method('GetHardLimit', + 'ns3::Time', + [], + is_const=True) + ## realtime-simulator-impl.h: ns3::Time ns3::RealtimeSimulatorImpl::GetMaximumSimulationTime() const [member function] + cls.add_method('GetMaximumSimulationTime', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl::SynchronizationMode ns3::RealtimeSimulatorImpl::GetSynchronizationMode() const [member function] + cls.add_method('GetSynchronizationMode', + 'ns3::RealtimeSimulatorImpl::SynchronizationMode', + [], + is_const=True) + ## realtime-simulator-impl.h: static ns3::TypeId ns3::RealtimeSimulatorImpl::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## realtime-simulator-impl.h: bool ns3::RealtimeSimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function] + cls.add_method('IsExpired', + 'bool', + [param('ns3::EventId const &', 'ev')], + is_const=True, is_virtual=True) + ## realtime-simulator-impl.h: bool ns3::RealtimeSimulatorImpl::IsFinished() const [member function] + cls.add_method('IsFinished', + 'bool', + [], + is_const=True, is_virtual=True) + ## realtime-simulator-impl.h: ns3::Time ns3::RealtimeSimulatorImpl::Next() const [member function] + cls.add_method('Next', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## realtime-simulator-impl.h: ns3::Time ns3::RealtimeSimulatorImpl::Now() const [member function] + cls.add_method('Now', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## realtime-simulator-impl.h: ns3::Time ns3::RealtimeSimulatorImpl::RealtimeNow() const [member function] + cls.add_method('RealtimeNow', + 'ns3::Time', + [], + is_const=True) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::Remove(ns3::EventId const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::EventId const &', 'ev')], + is_virtual=True) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::Run() [member function] + cls.add_method('Run', + 'void', + [], + is_virtual=True) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::RunOneEvent() [member function] + cls.add_method('RunOneEvent', + 'void', + [], + is_virtual=True) + ## realtime-simulator-impl.h: ns3::EventId ns3::RealtimeSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function] + cls.add_method('Schedule', + 'ns3::EventId', + [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], + is_virtual=True) + ## realtime-simulator-impl.h: ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function] + cls.add_method('ScheduleDestroy', + 'ns3::EventId', + [param('ns3::EventImpl *', 'event')], + is_virtual=True) + ## realtime-simulator-impl.h: ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function] + cls.add_method('ScheduleNow', + 'ns3::EventId', + [param('ns3::EventImpl *', 'event')], + is_virtual=True) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::ScheduleRealtime(ns3::Time const & time, ns3::EventImpl * event) [member function] + cls.add_method('ScheduleRealtime', + 'void', + [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')]) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNow(ns3::EventImpl * event) [member function] + cls.add_method('ScheduleRealtimeNow', + 'void', + [param('ns3::EventImpl *', 'event')]) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::SetHardLimit(ns3::Time limit) [member function] + cls.add_method('SetHardLimit', + 'void', + [param('ns3::Time', 'limit')]) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::SetScheduler(ns3::Ptr scheduler) [member function] + cls.add_method('SetScheduler', + 'void', + [param('ns3::Ptr< ns3::Scheduler >', 'scheduler')], + is_virtual=True) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::SetSynchronizationMode(ns3::RealtimeSimulatorImpl::SynchronizationMode mode) [member function] + cls.add_method('SetSynchronizationMode', + 'void', + [param('ns3::RealtimeSimulatorImpl::SynchronizationMode', 'mode')]) + ## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::Stop() [member function] + cls.add_method('Stop', + 'void', + [], + is_virtual=True) + return + +def register_functions(root_module): + module = root_module + ## high-precision.h: extern ns3::HighPrecision ns3::Abs(ns3::HighPrecision const & value) [free function] + module.add_function('Abs', + 'ns3::HighPrecision', + [param('ns3::HighPrecision const &', 'value')]) + ## nstime.h: extern ns3::Time ns3::FemtoSeconds(uint64_t fs) [free function] + module.add_function('FemtoSeconds', + 'ns3::Time', + [param('uint64_t', 'fs')]) + ## make-event.h: extern ns3::EventImpl * ns3::MakeEvent(void (*)( ) * f) [free function] + module.add_function('MakeEvent', + 'ns3::EventImpl *', + [param('void ( * ) ( ) *', 'f')]) + ## nstime.h: extern ns3::Ptr ns3::MakeTimeChecker() [free function] + module.add_function('MakeTimeChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## high-precision.h: extern ns3::HighPrecision ns3::Max(ns3::HighPrecision const & a, ns3::HighPrecision const & b) [free function] + module.add_function('Max', + 'ns3::HighPrecision', + [param('ns3::HighPrecision const &', 'a'), param('ns3::HighPrecision const &', 'b')]) + ## nstime.h: extern ns3::Time ns3::MicroSeconds(uint64_t us) [free function] + module.add_function('MicroSeconds', + 'ns3::Time', + [param('uint64_t', 'us')]) + ## nstime.h: extern ns3::Time ns3::MilliSeconds(uint64_t ms) [free function] + module.add_function('MilliSeconds', + 'ns3::Time', + [param('uint64_t', 'ms')]) + ## high-precision.h: extern ns3::HighPrecision ns3::Min(ns3::HighPrecision const & a, ns3::HighPrecision const & b) [free function] + module.add_function('Min', + 'ns3::HighPrecision', + [param('ns3::HighPrecision const &', 'a'), param('ns3::HighPrecision const &', 'b')]) + ## nstime.h: extern ns3::Time ns3::NanoSeconds(uint64_t ns) [free function] + module.add_function('NanoSeconds', + 'ns3::Time', + [param('uint64_t', 'ns')]) + ## simulator.h: extern ns3::Time ns3::Now() [free function] + module.add_function('Now', + 'ns3::Time', + []) + ## nstime.h: extern ns3::Time ns3::PicoSeconds(uint64_t ps) [free function] + module.add_function('PicoSeconds', + 'ns3::Time', + [param('uint64_t', 'ps')]) + ## nstime.h: extern ns3::Time ns3::Seconds(double seconds) [free function] + module.add_function('Seconds', + 'ns3::Time', + [param('double', 'seconds')]) + ## nstime.h: extern ns3::Time ns3::TimeStep(uint64_t ts) [free function] + module.add_function('TimeStep', + 'ns3::Time', + [param('uint64_t', 'ts')]) + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + ## nstime.h: extern ns3::TimeStepPrecision::precision_t ns3::TimeStepPrecision::Get() [free function] + module.add_function('Get', + 'ns3::TimeStepPrecision::precision_t', + []) + ## nstime.h: extern void ns3::TimeStepPrecision::Set(ns3::TimeStepPrecision::precision_t precision) [free function] + module.add_function('Set', + 'void', + [param('ns3::TimeStepPrecision::precision_t', 'precision')]) + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_static_routing.py b/bindings/python/apidefs/gcc-LP64/ns3_module_static_routing.py new file mode 100644 index 000000000..22b6f3c13 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_static_routing.py @@ -0,0 +1,651 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## ipv4-routing-table-entry.h: ns3::Ipv4MulticastRoutingTableEntry [class] + module.add_class('Ipv4MulticastRoutingTableEntry') + ## ipv4-routing-table-entry.h: ns3::Ipv4RoutingTableEntry [class] + module.add_class('Ipv4RoutingTableEntry') + ## ipv6-routing-table-entry.h: ns3::Ipv6MulticastRoutingTableEntry [class] + module.add_class('Ipv6MulticastRoutingTableEntry') + ## ipv6-routing-table-entry.h: ns3::Ipv6RoutingTableEntry [class] + module.add_class('Ipv6RoutingTableEntry') + ## ipv4-static-routing.h: ns3::Ipv4StaticRouting [class] + module.add_class('Ipv4StaticRouting', parent=root_module['ns3::Ipv4RoutingProtocol']) + ## ipv6-static-routing.h: ns3::Ipv6StaticRouting [class] + module.add_class('Ipv6StaticRouting', parent=root_module['ns3::Ipv6RoutingProtocol']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3Ipv4MulticastRoutingTableEntry_methods(root_module, root_module['ns3::Ipv4MulticastRoutingTableEntry']) + register_Ns3Ipv4RoutingTableEntry_methods(root_module, root_module['ns3::Ipv4RoutingTableEntry']) + register_Ns3Ipv6MulticastRoutingTableEntry_methods(root_module, root_module['ns3::Ipv6MulticastRoutingTableEntry']) + register_Ns3Ipv6RoutingTableEntry_methods(root_module, root_module['ns3::Ipv6RoutingTableEntry']) + register_Ns3Ipv4StaticRouting_methods(root_module, root_module['ns3::Ipv4StaticRouting']) + register_Ns3Ipv6StaticRouting_methods(root_module, root_module['ns3::Ipv6StaticRouting']) + return + +def register_Ns3Ipv4MulticastRoutingTableEntry_methods(root_module, cls): + cls.add_output_stream_operator() + ## ipv4-routing-table-entry.h: ns3::Ipv4MulticastRoutingTableEntry::Ipv4MulticastRoutingTableEntry() [constructor] + cls.add_constructor([]) + ## ipv4-routing-table-entry.h: ns3::Ipv4MulticastRoutingTableEntry::Ipv4MulticastRoutingTableEntry(ns3::Ipv4MulticastRoutingTableEntry const & route) [copy constructor] + cls.add_constructor([param('ns3::Ipv4MulticastRoutingTableEntry const &', 'route')]) + ## ipv4-routing-table-entry.h: ns3::Ipv4MulticastRoutingTableEntry::Ipv4MulticastRoutingTableEntry(ns3::Ipv4MulticastRoutingTableEntry const * route) [constructor] + cls.add_constructor([param('ns3::Ipv4MulticastRoutingTableEntry const *', 'route')]) + ## ipv4-routing-table-entry.h: static ns3::Ipv4MulticastRoutingTableEntry ns3::Ipv4MulticastRoutingTableEntry::CreateMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector > outputInterfaces) [member function] + cls.add_method('CreateMulticastRoute', + 'ns3::Ipv4MulticastRoutingTableEntry', + [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')], + is_static=True) + ## ipv4-routing-table-entry.h: ns3::Ipv4Address ns3::Ipv4MulticastRoutingTableEntry::GetGroup() const [member function] + cls.add_method('GetGroup', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-routing-table-entry.h: uint32_t ns3::Ipv4MulticastRoutingTableEntry::GetInputInterface() const [member function] + cls.add_method('GetInputInterface', + 'uint32_t', + [], + is_const=True) + ## ipv4-routing-table-entry.h: uint32_t ns3::Ipv4MulticastRoutingTableEntry::GetNOutputInterfaces() const [member function] + cls.add_method('GetNOutputInterfaces', + 'uint32_t', + [], + is_const=True) + ## ipv4-routing-table-entry.h: ns3::Ipv4Address ns3::Ipv4MulticastRoutingTableEntry::GetOrigin() const [member function] + cls.add_method('GetOrigin', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-routing-table-entry.h: uint32_t ns3::Ipv4MulticastRoutingTableEntry::GetOutputInterface(uint32_t n) const [member function] + cls.add_method('GetOutputInterface', + 'uint32_t', + [param('uint32_t', 'n')], + is_const=True) + ## ipv4-routing-table-entry.h: std::vector > ns3::Ipv4MulticastRoutingTableEntry::GetOutputInterfaces() const [member function] + cls.add_method('GetOutputInterfaces', + 'std::vector< unsigned int >', + [], + is_const=True) + return + +def register_Ns3Ipv4RoutingTableEntry_methods(root_module, cls): + cls.add_output_stream_operator() + ## ipv4-routing-table-entry.h: ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry() [constructor] + cls.add_constructor([]) + ## ipv4-routing-table-entry.h: ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry(ns3::Ipv4RoutingTableEntry const & route) [copy constructor] + cls.add_constructor([param('ns3::Ipv4RoutingTableEntry const &', 'route')]) + ## ipv4-routing-table-entry.h: ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry(ns3::Ipv4RoutingTableEntry const * route) [constructor] + cls.add_constructor([param('ns3::Ipv4RoutingTableEntry const *', 'route')]) + ## ipv4-routing-table-entry.h: static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function] + cls.add_method('CreateDefaultRoute', + 'ns3::Ipv4RoutingTableEntry', + [param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')], + is_static=True) + ## ipv4-routing-table-entry.h: static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function] + cls.add_method('CreateHostRouteTo', + 'ns3::Ipv4RoutingTableEntry', + [param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')], + is_static=True) + ## ipv4-routing-table-entry.h: static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function] + cls.add_method('CreateHostRouteTo', + 'ns3::Ipv4RoutingTableEntry', + [param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')], + is_static=True) + ## ipv4-routing-table-entry.h: static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function] + cls.add_method('CreateNetworkRouteTo', + 'ns3::Ipv4RoutingTableEntry', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')], + is_static=True) + ## ipv4-routing-table-entry.h: static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function] + cls.add_method('CreateNetworkRouteTo', + 'ns3::Ipv4RoutingTableEntry', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')], + is_static=True) + ## ipv4-routing-table-entry.h: ns3::Ipv4Address ns3::Ipv4RoutingTableEntry::GetDest() const [member function] + cls.add_method('GetDest', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-routing-table-entry.h: ns3::Ipv4Address ns3::Ipv4RoutingTableEntry::GetDestNetwork() const [member function] + cls.add_method('GetDestNetwork', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-routing-table-entry.h: ns3::Ipv4Mask ns3::Ipv4RoutingTableEntry::GetDestNetworkMask() const [member function] + cls.add_method('GetDestNetworkMask', + 'ns3::Ipv4Mask', + [], + is_const=True) + ## ipv4-routing-table-entry.h: ns3::Ipv4Address ns3::Ipv4RoutingTableEntry::GetGateway() const [member function] + cls.add_method('GetGateway', + 'ns3::Ipv4Address', + [], + is_const=True) + ## ipv4-routing-table-entry.h: uint32_t ns3::Ipv4RoutingTableEntry::GetInterface() const [member function] + cls.add_method('GetInterface', + 'uint32_t', + [], + is_const=True) + ## ipv4-routing-table-entry.h: bool ns3::Ipv4RoutingTableEntry::IsDefault() const [member function] + cls.add_method('IsDefault', + 'bool', + [], + is_const=True) + ## ipv4-routing-table-entry.h: bool ns3::Ipv4RoutingTableEntry::IsGateway() const [member function] + cls.add_method('IsGateway', + 'bool', + [], + is_const=True) + ## ipv4-routing-table-entry.h: bool ns3::Ipv4RoutingTableEntry::IsHost() const [member function] + cls.add_method('IsHost', + 'bool', + [], + is_const=True) + ## ipv4-routing-table-entry.h: bool ns3::Ipv4RoutingTableEntry::IsNetwork() const [member function] + cls.add_method('IsNetwork', + 'bool', + [], + is_const=True) + return + +def register_Ns3Ipv6MulticastRoutingTableEntry_methods(root_module, cls): + cls.add_output_stream_operator() + ## ipv6-routing-table-entry.h: ns3::Ipv6MulticastRoutingTableEntry::Ipv6MulticastRoutingTableEntry() [constructor] + cls.add_constructor([]) + ## ipv6-routing-table-entry.h: ns3::Ipv6MulticastRoutingTableEntry::Ipv6MulticastRoutingTableEntry(ns3::Ipv6MulticastRoutingTableEntry const & route) [copy constructor] + cls.add_constructor([param('ns3::Ipv6MulticastRoutingTableEntry const &', 'route')]) + ## ipv6-routing-table-entry.h: ns3::Ipv6MulticastRoutingTableEntry::Ipv6MulticastRoutingTableEntry(ns3::Ipv6MulticastRoutingTableEntry const * route) [constructor] + cls.add_constructor([param('ns3::Ipv6MulticastRoutingTableEntry const *', 'route')]) + ## ipv6-routing-table-entry.h: static ns3::Ipv6MulticastRoutingTableEntry ns3::Ipv6MulticastRoutingTableEntry::CreateMulticastRoute(ns3::Ipv6Address origin, ns3::Ipv6Address group, uint32_t inputInterface, std::vector > outputInterfaces) [member function] + cls.add_method('CreateMulticastRoute', + 'ns3::Ipv6MulticastRoutingTableEntry', + [param('ns3::Ipv6Address', 'origin'), param('ns3::Ipv6Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')], + is_static=True) + ## ipv6-routing-table-entry.h: ns3::Ipv6Address ns3::Ipv6MulticastRoutingTableEntry::GetGroup() const [member function] + cls.add_method('GetGroup', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-routing-table-entry.h: uint32_t ns3::Ipv6MulticastRoutingTableEntry::GetInputInterface() const [member function] + cls.add_method('GetInputInterface', + 'uint32_t', + [], + is_const=True) + ## ipv6-routing-table-entry.h: uint32_t ns3::Ipv6MulticastRoutingTableEntry::GetNOutputInterfaces() const [member function] + cls.add_method('GetNOutputInterfaces', + 'uint32_t', + [], + is_const=True) + ## ipv6-routing-table-entry.h: ns3::Ipv6Address ns3::Ipv6MulticastRoutingTableEntry::GetOrigin() const [member function] + cls.add_method('GetOrigin', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-routing-table-entry.h: uint32_t ns3::Ipv6MulticastRoutingTableEntry::GetOutputInterface(uint32_t n) const [member function] + cls.add_method('GetOutputInterface', + 'uint32_t', + [param('uint32_t', 'n')], + is_const=True) + ## ipv6-routing-table-entry.h: std::vector > ns3::Ipv6MulticastRoutingTableEntry::GetOutputInterfaces() const [member function] + cls.add_method('GetOutputInterfaces', + 'std::vector< unsigned int >', + [], + is_const=True) + return + +def register_Ns3Ipv6RoutingTableEntry_methods(root_module, cls): + cls.add_output_stream_operator() + ## ipv6-routing-table-entry.h: ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry() [constructor] + cls.add_constructor([]) + ## ipv6-routing-table-entry.h: ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry(ns3::Ipv6RoutingTableEntry const & route) [copy constructor] + cls.add_constructor([param('ns3::Ipv6RoutingTableEntry const &', 'route')]) + ## ipv6-routing-table-entry.h: ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry(ns3::Ipv6RoutingTableEntry const * route) [constructor] + cls.add_constructor([param('ns3::Ipv6RoutingTableEntry const *', 'route')]) + ## ipv6-routing-table-entry.h: static ns3::Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateDefaultRoute(ns3::Ipv6Address nextHop, uint32_t interface) [member function] + cls.add_method('CreateDefaultRoute', + 'ns3::Ipv6RoutingTableEntry', + [param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface')], + is_static=True) + ## ipv6-routing-table-entry.h: static ns3::Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateHostRouteTo(ns3::Ipv6Address dest, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address()) [member function] + cls.add_method('CreateHostRouteTo', + 'ns3::Ipv6RoutingTableEntry', + [param('ns3::Ipv6Address', 'dest'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address()')], + is_static=True) + ## ipv6-routing-table-entry.h: static ns3::Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateHostRouteTo(ns3::Ipv6Address dest, uint32_t interface) [member function] + cls.add_method('CreateHostRouteTo', + 'ns3::Ipv6RoutingTableEntry', + [param('ns3::Ipv6Address', 'dest'), param('uint32_t', 'interface')], + is_static=True) + ## ipv6-routing-table-entry.h: static ns3::Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv6Address network, ns3::Ipv6Prefix networkPrefix, ns3::Ipv6Address nextHop, uint32_t interface) [member function] + cls.add_method('CreateNetworkRouteTo', + 'ns3::Ipv6RoutingTableEntry', + [param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'networkPrefix'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface')], + is_static=True) + ## ipv6-routing-table-entry.h: static ns3::Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv6Address network, ns3::Ipv6Prefix networkPrefix, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse) [member function] + cls.add_method('CreateNetworkRouteTo', + 'ns3::Ipv6RoutingTableEntry', + [param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'networkPrefix'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse')], + is_static=True) + ## ipv6-routing-table-entry.h: static ns3::Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv6Address network, ns3::Ipv6Prefix networkPrefix, uint32_t interface) [member function] + cls.add_method('CreateNetworkRouteTo', + 'ns3::Ipv6RoutingTableEntry', + [param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'networkPrefix'), param('uint32_t', 'interface')], + is_static=True) + ## ipv6-routing-table-entry.h: ns3::Ipv6Address ns3::Ipv6RoutingTableEntry::GetDest() const [member function] + cls.add_method('GetDest', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-routing-table-entry.h: ns3::Ipv6Address ns3::Ipv6RoutingTableEntry::GetDestNetwork() const [member function] + cls.add_method('GetDestNetwork', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-routing-table-entry.h: ns3::Ipv6Prefix ns3::Ipv6RoutingTableEntry::GetDestNetworkPrefix() const [member function] + cls.add_method('GetDestNetworkPrefix', + 'ns3::Ipv6Prefix', + [], + is_const=True) + ## ipv6-routing-table-entry.h: ns3::Ipv6Address ns3::Ipv6RoutingTableEntry::GetGateway() const [member function] + cls.add_method('GetGateway', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-routing-table-entry.h: uint32_t ns3::Ipv6RoutingTableEntry::GetInterface() const [member function] + cls.add_method('GetInterface', + 'uint32_t', + [], + is_const=True) + ## ipv6-routing-table-entry.h: ns3::Ipv6Address ns3::Ipv6RoutingTableEntry::GetPrefixToUse() const [member function] + cls.add_method('GetPrefixToUse', + 'ns3::Ipv6Address', + [], + is_const=True) + ## ipv6-routing-table-entry.h: bool ns3::Ipv6RoutingTableEntry::IsDefault() const [member function] + cls.add_method('IsDefault', + 'bool', + [], + is_const=True) + ## ipv6-routing-table-entry.h: bool ns3::Ipv6RoutingTableEntry::IsGateway() const [member function] + cls.add_method('IsGateway', + 'bool', + [], + is_const=True) + ## ipv6-routing-table-entry.h: bool ns3::Ipv6RoutingTableEntry::IsHost() const [member function] + cls.add_method('IsHost', + 'bool', + [], + is_const=True) + ## ipv6-routing-table-entry.h: bool ns3::Ipv6RoutingTableEntry::IsNetwork() const [member function] + cls.add_method('IsNetwork', + 'bool', + [], + is_const=True) + ## ipv6-routing-table-entry.h: void ns3::Ipv6RoutingTableEntry::SetPrefixToUse(ns3::Ipv6Address prefix) [member function] + cls.add_method('SetPrefixToUse', + 'void', + [param('ns3::Ipv6Address', 'prefix')]) + return + +def register_Ns3Ipv4StaticRouting_methods(root_module, cls): + ## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting(ns3::Ipv4StaticRouting const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv4StaticRouting const &', 'arg0')]) + ## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting() [constructor] + cls.add_constructor([]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function] + cls.add_method('AddHostRouteTo', + 'void', + [param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface, uint32_t metric=0) [member function] + cls.add_method('AddHostRouteTo', + 'void', + [param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector > outputInterfaces) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function] + cls.add_method('AddNetworkRouteTo', + 'void', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface, uint32_t metric=0) [member function] + cls.add_method('AddNetworkRouteTo', + 'void', + [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')]) + ## ipv4-static-routing.h: ns3::Ipv4RoutingTableEntry ns3::Ipv4StaticRouting::GetDefaultRoute() [member function] + cls.add_method('GetDefaultRoute', + 'ns3::Ipv4RoutingTableEntry', + []) + ## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) [member function] + cls.add_method('GetMetric', + 'uint32_t', + [param('uint32_t', 'index')]) + ## ipv4-static-routing.h: ns3::Ipv4MulticastRoutingTableEntry ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function] + cls.add_method('GetMulticastRoute', + 'ns3::Ipv4MulticastRoutingTableEntry', + [param('uint32_t', 'i')], + is_const=True) + ## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNMulticastRoutes() const [member function] + cls.add_method('GetNMulticastRoutes', + 'uint32_t', + [], + is_const=True) + ## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNRoutes() [member function] + cls.add_method('GetNRoutes', + 'uint32_t', + []) + ## ipv4-static-routing.h: ns3::Ipv4RoutingTableEntry ns3::Ipv4StaticRouting::GetRoute(uint32_t i) [member function] + cls.add_method('GetRoute', + 'ns3::Ipv4RoutingTableEntry', + [param('uint32_t', 'i')]) + ## ipv4-static-routing.h: static ns3::TypeId ns3::Ipv4StaticRouting::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_virtual=True) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], + is_virtual=True) + ## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RemoveMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface) [member function] + cls.add_method('RemoveMulticastRoute', + 'bool', + [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface')]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveMulticastRoute(uint32_t index) [member function] + cls.add_method('RemoveMulticastRoute', + 'void', + [param('uint32_t', 'index')]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveRoute(uint32_t i) [member function] + cls.add_method('RemoveRoute', + 'void', + [param('uint32_t', 'i')]) + ## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RouteInput(ns3::Ptr p, ns3::Ipv4Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + is_virtual=True) + ## ipv4-static-routing.h: ns3::Ptr ns3::Ipv4StaticRouting::RouteOutput(ns3::Ptr p, ns3::Ipv4Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv4Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + is_virtual=True) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) [member function] + cls.add_method('SetDefaultMulticastRoute', + 'void', + [param('uint32_t', 'outputInterface')]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function] + cls.add_method('SetDefaultRoute', + 'void', + [param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')]) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetIpv4(ns3::Ptr ipv4) [member function] + cls.add_method('SetIpv4', + 'void', + [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], + is_virtual=True) + ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3Ipv6StaticRouting_methods(root_module, cls): + ## ipv6-static-routing.h: ns3::Ipv6StaticRouting::Ipv6StaticRouting(ns3::Ipv6StaticRouting const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ipv6StaticRouting const &', 'arg0')]) + ## ipv6-static-routing.h: ns3::Ipv6StaticRouting::Ipv6StaticRouting() [constructor] + cls.add_constructor([]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::AddHostRouteTo(ns3::Ipv6Address dest, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address(((const char*)"::")), uint32_t metric=0) [member function] + cls.add_method('AddHostRouteTo', + 'void', + [param('ns3::Ipv6Address', 'dest'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address(((const char*)"::"))'), param('uint32_t', 'metric', default_value='0')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::AddHostRouteTo(ns3::Ipv6Address dest, uint32_t interface, uint32_t metric=0) [member function] + cls.add_method('AddHostRouteTo', + 'void', + [param('ns3::Ipv6Address', 'dest'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::AddMulticastRoute(ns3::Ipv6Address origin, ns3::Ipv6Address group, uint32_t inputInterface, std::vector > outputInterfaces) [member function] + cls.add_method('AddMulticastRoute', + 'void', + [param('ns3::Ipv6Address', 'origin'), param('ns3::Ipv6Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::AddNetworkRouteTo(ns3::Ipv6Address network, ns3::Ipv6Prefix networkPrefix, ns3::Ipv6Address nextHop, uint32_t interface, uint32_t metric=0) [member function] + cls.add_method('AddNetworkRouteTo', + 'void', + [param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'networkPrefix'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::AddNetworkRouteTo(ns3::Ipv6Address network, ns3::Ipv6Prefix networkPrefix, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse, uint32_t metric=0) [member function] + cls.add_method('AddNetworkRouteTo', + 'void', + [param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'networkPrefix'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse'), param('uint32_t', 'metric', default_value='0')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::AddNetworkRouteTo(ns3::Ipv6Address network, ns3::Ipv6Prefix networkPrefix, uint32_t interface, uint32_t metric=0) [member function] + cls.add_method('AddNetworkRouteTo', + 'void', + [param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'networkPrefix'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')]) + ## ipv6-static-routing.h: ns3::Ipv6RoutingTableEntry ns3::Ipv6StaticRouting::GetDefaultRoute() [member function] + cls.add_method('GetDefaultRoute', + 'ns3::Ipv6RoutingTableEntry', + []) + ## ipv6-static-routing.h: uint32_t ns3::Ipv6StaticRouting::GetMetric(uint32_t index) [member function] + cls.add_method('GetMetric', + 'uint32_t', + [param('uint32_t', 'index')]) + ## ipv6-static-routing.h: ns3::Ipv6MulticastRoutingTableEntry ns3::Ipv6StaticRouting::GetMulticastRoute(uint32_t i) const [member function] + cls.add_method('GetMulticastRoute', + 'ns3::Ipv6MulticastRoutingTableEntry', + [param('uint32_t', 'i')], + is_const=True) + ## ipv6-static-routing.h: uint32_t ns3::Ipv6StaticRouting::GetNMulticastRoutes() const [member function] + cls.add_method('GetNMulticastRoutes', + 'uint32_t', + [], + is_const=True) + ## ipv6-static-routing.h: uint32_t ns3::Ipv6StaticRouting::GetNRoutes() [member function] + cls.add_method('GetNRoutes', + 'uint32_t', + []) + ## ipv6-static-routing.h: ns3::Ipv6RoutingTableEntry ns3::Ipv6StaticRouting::GetRoute(uint32_t i) [member function] + cls.add_method('GetRoute', + 'ns3::Ipv6RoutingTableEntry', + [param('uint32_t', 'i')]) + ## ipv6-static-routing.h: static ns3::TypeId ns3::Ipv6StaticRouting::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ipv6-static-routing.h: bool ns3::Ipv6StaticRouting::HasNetworkDest(ns3::Ipv6Address dest, uint32_t interfaceIndex) [member function] + cls.add_method('HasNetworkDest', + 'bool', + [param('ns3::Ipv6Address', 'dest'), param('uint32_t', 'interfaceIndex')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('NotifyAddAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_virtual=True) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::NotifyAddRoute(ns3::Ipv6Address dst, ns3::Ipv6Prefix mask, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address::GetZero( )) [member function] + cls.add_method('NotifyAddRoute', + 'void', + [param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Prefix', 'mask'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address::GetZero( )')], + is_virtual=True) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::NotifyInterfaceDown(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceDown', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::NotifyInterfaceUp(uint32_t interface) [member function] + cls.add_method('NotifyInterfaceUp', + 'void', + [param('uint32_t', 'interface')], + is_virtual=True) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv6InterfaceAddress address) [member function] + cls.add_method('NotifyRemoveAddress', + 'void', + [param('uint32_t', 'interface'), param('ns3::Ipv6InterfaceAddress', 'address')], + is_virtual=True) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::NotifyRemoveRoute(ns3::Ipv6Address dst, ns3::Ipv6Prefix mask, ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address::GetZero( )) [member function] + cls.add_method('NotifyRemoveRoute', + 'void', + [param('ns3::Ipv6Address', 'dst'), param('ns3::Ipv6Prefix', 'mask'), param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address::GetZero( )')], + is_virtual=True) + ## ipv6-static-routing.h: bool ns3::Ipv6StaticRouting::RemoveMulticastRoute(ns3::Ipv6Address origin, ns3::Ipv6Address group, uint32_t inputInterface) [member function] + cls.add_method('RemoveMulticastRoute', + 'bool', + [param('ns3::Ipv6Address', 'origin'), param('ns3::Ipv6Address', 'group'), param('uint32_t', 'inputInterface')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::RemoveMulticastRoute(uint32_t i) [member function] + cls.add_method('RemoveMulticastRoute', + 'void', + [param('uint32_t', 'i')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::RemoveRoute(uint32_t i) [member function] + cls.add_method('RemoveRoute', + 'void', + [param('uint32_t', 'i')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::RemoveRoute(ns3::Ipv6Address network, ns3::Ipv6Prefix prefix, uint32_t ifIndex, ns3::Ipv6Address prefixToUse) [member function] + cls.add_method('RemoveRoute', + 'void', + [param('ns3::Ipv6Address', 'network'), param('ns3::Ipv6Prefix', 'prefix'), param('uint32_t', 'ifIndex'), param('ns3::Ipv6Address', 'prefixToUse')]) + ## ipv6-static-routing.h: bool ns3::Ipv6StaticRouting::RouteInput(ns3::Ptr p, ns3::Ipv6Header const & header, ns3::Ptr idev, ns3::Callback,ns3::Ptr,const ns3::Ipv6Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback,ns3::Ptr,const ns3::Ipv6Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback,const ns3::Ipv6Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback,const ns3::Ipv6Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] + cls.add_method('RouteInput', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv6Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv6MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv6Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], + is_virtual=True) + ## ipv6-static-routing.h: ns3::Ptr ns3::Ipv6StaticRouting::RouteOutput(ns3::Ptr p, ns3::Ipv6Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function] + cls.add_method('RouteOutput', + 'ns3::Ptr< ns3::Ipv6Route >', + [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], + is_virtual=True) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) [member function] + cls.add_method('SetDefaultMulticastRoute', + 'void', + [param('uint32_t', 'outputInterface')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::SetDefaultRoute(ns3::Ipv6Address nextHop, uint32_t interface, ns3::Ipv6Address prefixToUse=ns3::Ipv6Address(((const char*)"::")), uint32_t metric=0) [member function] + cls.add_method('SetDefaultRoute', + 'void', + [param('ns3::Ipv6Address', 'nextHop'), param('uint32_t', 'interface'), param('ns3::Ipv6Address', 'prefixToUse', default_value='ns3::Ipv6Address(((const char*)"::"))'), param('uint32_t', 'metric', default_value='0')]) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::SetIpv6(ns3::Ptr ipv6) [member function] + cls.add_method('SetIpv6', + 'void', + [param('ns3::Ptr< ns3::Ipv6 >', 'ipv6')], + is_virtual=True) + ## ipv6-static-routing.h: void ns3::Ipv6StaticRouting::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_stats.py b/bindings/python/apidefs/gcc-LP64/ns3_module_stats.py new file mode 100644 index 000000000..610739ccc --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_stats.py @@ -0,0 +1,476 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## data-output-interface.h: ns3::DataOutputCallback [class] + module.add_class('DataOutputCallback', allow_subclassing=True) + ## data-calculator.h: ns3::DataCalculator [class] + module.add_class('DataCalculator', parent=root_module['ns3::Object']) + ## data-collector.h: ns3::DataCollector [class] + module.add_class('DataCollector', parent=root_module['ns3::Object']) + ## data-output-interface.h: ns3::DataOutputInterface [class] + module.add_class('DataOutputInterface', parent=root_module['ns3::Object']) + ## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator [class] + module.add_class('MinMaxAvgTotalCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator']) + ## omnet-data-output.h: ns3::OmnetDataOutput [class] + module.add_class('OmnetDataOutput', parent=root_module['ns3::DataOutputInterface']) + ## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator [class] + module.add_class('PacketSizeMinMaxAvgTotalCalculator', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >']) + ## sqlite-data-output.h: ns3::SqliteDataOutput [class] + module.add_class('SqliteDataOutput', parent=root_module['ns3::DataOutputInterface']) + ## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator [class] + module.add_class('TimeMinMaxAvgTotalCalculator', parent=root_module['ns3::DataCalculator']) + ## basic-data-calculators.h: ns3::CounterCalculator [class] + 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< ns3::Ptr< ns3::DataCalculator >, std::allocator< ns3::Ptr< ns3::DataCalculator > > >*', 'ns3::DataCalculatorList*') + 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') + typehandlers.add_type_alias('std::list< std::pair< std::string, std::string >, std::allocator< std::pair< std::string, std::string > > >*', 'ns3::MetadataList*') + 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 + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3DataOutputCallback_methods(root_module, root_module['ns3::DataOutputCallback']) + register_Ns3DataCalculator_methods(root_module, root_module['ns3::DataCalculator']) + register_Ns3DataCollector_methods(root_module, root_module['ns3::DataCollector']) + register_Ns3DataOutputInterface_methods(root_module, root_module['ns3::DataOutputInterface']) + register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >']) + register_Ns3OmnetDataOutput_methods(root_module, root_module['ns3::OmnetDataOutput']) + register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::PacketSizeMinMaxAvgTotalCalculator']) + register_Ns3SqliteDataOutput_methods(root_module, root_module['ns3::SqliteDataOutput']) + register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::TimeMinMaxAvgTotalCalculator']) + register_Ns3CounterCalculator__Unsigned_int_methods(root_module, root_module['ns3::CounterCalculator< unsigned int >']) + register_Ns3PacketCounterCalculator_methods(root_module, root_module['ns3::PacketCounterCalculator']) + return + +def register_Ns3DataOutputCallback_methods(root_module, cls): + ## data-output-interface.h: ns3::DataOutputCallback::DataOutputCallback() [constructor] + cls.add_constructor([]) + ## data-output-interface.h: ns3::DataOutputCallback::DataOutputCallback(ns3::DataOutputCallback const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DataOutputCallback const &', 'arg0')]) + ## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, int val) [member function] + cls.add_method('OutputSingleton', + 'void', + [param('std::string', 'key'), param('std::string', 'variable'), param('int', 'val')], + is_pure_virtual=True, is_virtual=True) + ## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, uint32_t val) [member function] + cls.add_method('OutputSingleton', + 'void', + [param('std::string', 'key'), param('std::string', 'variable'), param('uint32_t', 'val')], + is_pure_virtual=True, is_virtual=True) + ## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, double val) [member function] + cls.add_method('OutputSingleton', + 'void', + [param('std::string', 'key'), param('std::string', 'variable'), param('double', 'val')], + is_pure_virtual=True, is_virtual=True) + ## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, std::string val) [member function] + cls.add_method('OutputSingleton', + 'void', + [param('std::string', 'key'), param('std::string', 'variable'), param('std::string', 'val')], + is_pure_virtual=True, is_virtual=True) + ## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, ns3::Time val) [member function] + cls.add_method('OutputSingleton', + 'void', + [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::Time', 'val')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3DataCalculator_methods(root_module, cls): + ## data-calculator.h: ns3::DataCalculator::DataCalculator(ns3::DataCalculator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DataCalculator const &', 'arg0')]) + ## data-calculator.h: ns3::DataCalculator::DataCalculator() [constructor] + cls.add_constructor([]) + ## data-calculator.h: void ns3::DataCalculator::Disable() [member function] + cls.add_method('Disable', + 'void', + []) + ## data-calculator.h: void ns3::DataCalculator::Enable() [member function] + cls.add_method('Enable', + 'void', + []) + ## data-calculator.h: bool ns3::DataCalculator::GetEnabled() const [member function] + cls.add_method('GetEnabled', + 'bool', + [], + is_const=True) + ## data-calculator.h: std::string ns3::DataCalculator::GetKey() const [member function] + cls.add_method('GetKey', + 'std::string', + [], + is_const=True) + ## data-calculator.h: void ns3::DataCalculator::Output(ns3::DataOutputCallback & callback) const [member function] + cls.add_method('Output', + 'void', + [param('ns3::DataOutputCallback &', 'callback')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## data-calculator.h: void ns3::DataCalculator::SetKey(std::string const key) [member function] + cls.add_method('SetKey', + 'void', + [param('std::string const', 'key')]) + ## data-calculator.h: void ns3::DataCalculator::Start(ns3::Time const & startTime) [member function] + cls.add_method('Start', + 'void', + [param('ns3::Time const &', 'startTime')], + is_virtual=True) + ## data-calculator.h: void ns3::DataCalculator::Stop(ns3::Time const & stopTime) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::Time const &', 'stopTime')], + is_virtual=True) + ## data-calculator.h: void ns3::DataCalculator::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3DataCollector_methods(root_module, cls): + ## data-collector.h: ns3::DataCollector::DataCollector(ns3::DataCollector const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DataCollector const &', 'arg0')]) + ## data-collector.h: ns3::DataCollector::DataCollector() [constructor] + cls.add_constructor([]) + ## data-collector.h: void ns3::DataCollector::AddDataCalculator(ns3::Ptr datac) [member function] + cls.add_method('AddDataCalculator', + 'void', + [param('ns3::Ptr< ns3::DataCalculator >', 'datac')]) + ## data-collector.h: void ns3::DataCollector::AddMetadata(std::string key, std::string value) [member function] + cls.add_method('AddMetadata', + 'void', + [param('std::string', 'key'), param('std::string', 'value')]) + ## data-collector.h: void ns3::DataCollector::AddMetadata(std::string key, double value) [member function] + cls.add_method('AddMetadata', + 'void', + [param('std::string', 'key'), param('double', 'value')]) + ## data-collector.h: void ns3::DataCollector::AddMetadata(std::string key, uint32_t value) [member function] + cls.add_method('AddMetadata', + 'void', + [param('std::string', 'key'), param('uint32_t', 'value')]) + ## data-collector.h: std::_List_iterator > ns3::DataCollector::DataCalculatorBegin() [member function] + cls.add_method('DataCalculatorBegin', + 'std::_List_iterator< ns3::Ptr< ns3::DataCalculator > >', + []) + ## data-collector.h: std::_List_iterator > ns3::DataCollector::DataCalculatorEnd() [member function] + cls.add_method('DataCalculatorEnd', + 'std::_List_iterator< ns3::Ptr< ns3::DataCalculator > >', + []) + ## data-collector.h: void ns3::DataCollector::DescribeRun(std::string experiment, std::string strategy, std::string input, std::string runID, std::string description="") [member function] + cls.add_method('DescribeRun', + 'void', + [param('std::string', 'experiment'), param('std::string', 'strategy'), param('std::string', 'input'), param('std::string', 'runID'), param('std::string', 'description', default_value='""')]) + ## data-collector.h: std::string ns3::DataCollector::GetDescription() const [member function] + cls.add_method('GetDescription', + 'std::string', + [], + is_const=True) + ## data-collector.h: std::string ns3::DataCollector::GetExperimentLabel() const [member function] + cls.add_method('GetExperimentLabel', + 'std::string', + [], + is_const=True) + ## data-collector.h: std::string ns3::DataCollector::GetInputLabel() const [member function] + cls.add_method('GetInputLabel', + 'std::string', + [], + is_const=True) + ## data-collector.h: std::string ns3::DataCollector::GetRunLabel() const [member function] + cls.add_method('GetRunLabel', + 'std::string', + [], + is_const=True) + ## data-collector.h: std::string ns3::DataCollector::GetStrategyLabel() const [member function] + cls.add_method('GetStrategyLabel', + 'std::string', + [], + is_const=True) + ## data-collector.h: std::_List_iterator, std::allocator >, std::basic_string, std::allocator > > > ns3::DataCollector::MetadataBegin() [member function] + cls.add_method('MetadataBegin', + 'std::_List_iterator< std::pair< std::basic_string< char, std::char_traits< char >, std::allocator< char > >, std::basic_string< char, std::char_traits< char >, std::allocator< char > > > >', + []) + ## data-collector.h: std::_List_iterator, std::allocator >, std::basic_string, std::allocator > > > ns3::DataCollector::MetadataEnd() [member function] + cls.add_method('MetadataEnd', + 'std::_List_iterator< std::pair< std::basic_string< char, std::char_traits< char >, std::allocator< char > >, std::basic_string< char, std::char_traits< char >, std::allocator< char > > > >', + []) + ## data-collector.h: void ns3::DataCollector::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3DataOutputInterface_methods(root_module, cls): + ## data-output-interface.h: ns3::DataOutputInterface::DataOutputInterface(ns3::DataOutputInterface const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DataOutputInterface const &', 'arg0')]) + ## data-output-interface.h: ns3::DataOutputInterface::DataOutputInterface() [constructor] + cls.add_constructor([]) + ## data-output-interface.h: std::string ns3::DataOutputInterface::GetFilePrefix() const [member function] + cls.add_method('GetFilePrefix', + 'std::string', + [], + is_const=True) + ## data-output-interface.h: void ns3::DataOutputInterface::Output(ns3::DataCollector & dc) [member function] + cls.add_method('Output', + 'void', + [param('ns3::DataCollector &', 'dc')], + is_pure_virtual=True, is_virtual=True) + ## data-output-interface.h: void ns3::DataOutputInterface::SetFilePrefix(std::string const prefix) [member function] + cls.add_method('SetFilePrefix', + 'void', + [param('std::string const', 'prefix')]) + ## data-output-interface.h: void ns3::DataOutputInterface::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, cls): + ## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator::MinMaxAvgTotalCalculator(ns3::MinMaxAvgTotalCalculator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MinMaxAvgTotalCalculator< unsigned int > const &', 'arg0')]) + ## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator::MinMaxAvgTotalCalculator() [constructor] + cls.add_constructor([]) + ## basic-data-calculators.h: void ns3::MinMaxAvgTotalCalculator::Output(ns3::DataOutputCallback & callback) const [member function] + cls.add_method('Output', + 'void', + [param('ns3::DataOutputCallback &', 'callback')], + is_const=True, is_virtual=True) + ## basic-data-calculators.h: void ns3::MinMaxAvgTotalCalculator::Update(unsigned int const i) [member function] + cls.add_method('Update', + 'void', + [param('unsigned int const', 'i')]) + ## basic-data-calculators.h: void ns3::MinMaxAvgTotalCalculator::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3OmnetDataOutput_methods(root_module, cls): + ## omnet-data-output.h: ns3::OmnetDataOutput::OmnetDataOutput(ns3::OmnetDataOutput const & arg0) [copy constructor] + cls.add_constructor([param('ns3::OmnetDataOutput const &', 'arg0')]) + ## omnet-data-output.h: ns3::OmnetDataOutput::OmnetDataOutput() [constructor] + cls.add_constructor([]) + ## omnet-data-output.h: void ns3::OmnetDataOutput::Output(ns3::DataCollector & dc) [member function] + cls.add_method('Output', + 'void', + [param('ns3::DataCollector &', 'dc')], + is_virtual=True) + ## omnet-data-output.h: void ns3::OmnetDataOutput::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, cls): + ## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator(ns3::PacketSizeMinMaxAvgTotalCalculator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSizeMinMaxAvgTotalCalculator const &', 'arg0')]) + ## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator() [constructor] + cls.add_constructor([]) + ## packet-data-calculators.h: void ns3::PacketSizeMinMaxAvgTotalCalculator::FrameUpdate(std::string path, ns3::Ptr packet, ns3::Mac48Address realto) [member function] + cls.add_method('FrameUpdate', + 'void', + [param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'realto')]) + ## packet-data-calculators.h: void ns3::PacketSizeMinMaxAvgTotalCalculator::PacketUpdate(std::string path, ns3::Ptr packet) [member function] + cls.add_method('PacketUpdate', + 'void', + [param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## packet-data-calculators.h: void ns3::PacketSizeMinMaxAvgTotalCalculator::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3SqliteDataOutput_methods(root_module, cls): + ## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput(ns3::SqliteDataOutput const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SqliteDataOutput const &', 'arg0')]) + ## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput() [constructor] + cls.add_constructor([]) + ## sqlite-data-output.h: void ns3::SqliteDataOutput::Output(ns3::DataCollector & dc) [member function] + cls.add_method('Output', + 'void', + [param('ns3::DataCollector &', 'dc')], + is_virtual=True) + ## sqlite-data-output.h: void ns3::SqliteDataOutput::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, cls): + ## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator::TimeMinMaxAvgTotalCalculator(ns3::TimeMinMaxAvgTotalCalculator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TimeMinMaxAvgTotalCalculator const &', 'arg0')]) + ## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator::TimeMinMaxAvgTotalCalculator() [constructor] + cls.add_constructor([]) + ## time-data-calculators.h: void ns3::TimeMinMaxAvgTotalCalculator::Output(ns3::DataOutputCallback & callback) const [member function] + cls.add_method('Output', + 'void', + [param('ns3::DataOutputCallback &', 'callback')], + is_const=True, is_virtual=True) + ## time-data-calculators.h: void ns3::TimeMinMaxAvgTotalCalculator::Update(ns3::Time const i) [member function] + cls.add_method('Update', + 'void', + [param('ns3::Time const', 'i')]) + ## time-data-calculators.h: void ns3::TimeMinMaxAvgTotalCalculator::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3CounterCalculator__Unsigned_int_methods(root_module, cls): + ## basic-data-calculators.h: ns3::CounterCalculator::CounterCalculator(ns3::CounterCalculator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CounterCalculator< unsigned int > const &', 'arg0')]) + ## basic-data-calculators.h: ns3::CounterCalculator::CounterCalculator() [constructor] + cls.add_constructor([]) + ## basic-data-calculators.h: unsigned int ns3::CounterCalculator::GetCount() const [member function] + cls.add_method('GetCount', + 'unsigned int', + [], + is_const=True) + ## basic-data-calculators.h: void ns3::CounterCalculator::Output(ns3::DataOutputCallback & callback) const [member function] + cls.add_method('Output', + 'void', + [param('ns3::DataOutputCallback &', 'callback')], + is_const=True, is_virtual=True) + ## basic-data-calculators.h: void ns3::CounterCalculator::Update() [member function] + cls.add_method('Update', + 'void', + []) + ## basic-data-calculators.h: void ns3::CounterCalculator::Update(unsigned int const i) [member function] + cls.add_method('Update', + 'void', + [param('unsigned int const', 'i')]) + ## basic-data-calculators.h: void ns3::CounterCalculator::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_Ns3PacketCounterCalculator_methods(root_module, cls): + ## packet-data-calculators.h: ns3::PacketCounterCalculator::PacketCounterCalculator(ns3::PacketCounterCalculator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketCounterCalculator const &', 'arg0')]) + ## packet-data-calculators.h: ns3::PacketCounterCalculator::PacketCounterCalculator() [constructor] + cls.add_constructor([]) + ## packet-data-calculators.h: void ns3::PacketCounterCalculator::FrameUpdate(std::string path, ns3::Ptr packet, ns3::Mac48Address realto) [member function] + cls.add_method('FrameUpdate', + 'void', + [param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'realto')]) + ## packet-data-calculators.h: void ns3::PacketCounterCalculator::PacketUpdate(std::string path, ns3::Ptr packet) [member function] + cls.add_method('PacketUpdate', + 'void', + [param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## packet-data-calculators.h: void ns3::PacketCounterCalculator::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_tap_bridge.py b/bindings/python/apidefs/gcc-LP64/ns3_module_tap_bridge.py new file mode 100644 index 000000000..cf1171490 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_tap_bridge.py @@ -0,0 +1,287 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## tap-bridge.h: ns3::TapBridge [class] + module.add_class('TapBridge', parent=root_module['ns3::NetDevice']) + ## tap-bridge.h: ns3::TapBridge::Mode [enumeration] + module.add_enum('Mode', ['ILLEGAL', 'CONFIGURE_LOCAL', 'USE_LOCAL', 'USE_BRIDGE'], outer_class=root_module['ns3::TapBridge']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3TapBridge_methods(root_module, root_module['ns3::TapBridge']) + return + +def register_Ns3TapBridge_methods(root_module, cls): + ## tap-bridge.h: ns3::TapBridge::TapBridge(ns3::TapBridge const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TapBridge const &', 'arg0')]) + ## tap-bridge.h: ns3::TapBridge::TapBridge() [constructor] + cls.add_constructor([]) + ## tap-bridge.h: void ns3::TapBridge::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## tap-bridge.h: ns3::Address ns3::TapBridge::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: ns3::Ptr ns3::TapBridge::GetBridgedNetDevice() [member function] + cls.add_method('GetBridgedNetDevice', + 'ns3::Ptr< ns3::NetDevice >', + []) + ## tap-bridge.h: ns3::Address ns3::TapBridge::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: ns3::Ptr ns3::TapBridge::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: uint32_t ns3::TapBridge::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: ns3::TapBridge::Mode ns3::TapBridge::GetMode() [member function] + cls.add_method('GetMode', + 'ns3::TapBridge::Mode', + []) + ## tap-bridge.h: uint16_t ns3::TapBridge::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: ns3::Address ns3::TapBridge::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## tap-bridge.h: ns3::Address ns3::TapBridge::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## tap-bridge.h: ns3::Ptr ns3::TapBridge::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: static ns3::TypeId ns3::TapBridge::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tap-bridge.h: bool ns3::TapBridge::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## tap-bridge.h: void ns3::TapBridge::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + is_virtual=True) + ## tap-bridge.h: void ns3::TapBridge::SetBridgedNetDevice(ns3::Ptr bridgedDevice) [member function] + cls.add_method('SetBridgedNetDevice', + 'void', + [param('ns3::Ptr< ns3::NetDevice >', 'bridgedDevice')]) + ## tap-bridge.h: void ns3::TapBridge::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## tap-bridge.h: void ns3::TapBridge::SetMode(ns3::TapBridge::Mode mode) [member function] + cls.add_method('SetMode', + 'void', + [param('ns3::TapBridge::Mode', 'mode')]) + ## tap-bridge.h: bool ns3::TapBridge::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## tap-bridge.h: void ns3::TapBridge::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## tap-bridge.h: void ns3::TapBridge::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## tap-bridge.h: void ns3::TapBridge::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## tap-bridge.h: void ns3::TapBridge::Start(ns3::Time tStart) [member function] + cls.add_method('Start', + 'void', + [param('ns3::Time', 'tStart')]) + ## tap-bridge.h: void ns3::TapBridge::Stop(ns3::Time tStop) [member function] + cls.add_method('Stop', + 'void', + [param('ns3::Time', 'tStop')]) + ## tap-bridge.h: bool ns3::TapBridge::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::DiscardFromBridgedDevice(ns3::Ptr device, ns3::Ptr packet, uint16_t protocol, ns3::Address const & src) [member function] + cls.add_method('DiscardFromBridgedDevice', + 'bool', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'src')], + visibility='protected') + ## tap-bridge.h: void ns3::TapBridge::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## tap-bridge.h: bool ns3::TapBridge::ReceiveFromBridgedDevice(ns3::Ptr device, ns3::Ptr packet, uint16_t protocol, ns3::Address const & src, ns3::Address const & dst, ns3::NetDevice::PacketType packetType) [member function] + cls.add_method('ReceiveFromBridgedDevice', + 'bool', + [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'src'), param('ns3::Address const &', 'dst'), param('ns3::NetDevice::PacketType', 'packetType')], + visibility='protected') + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_udp_echo.py b/bindings/python/apidefs/gcc-LP64/ns3_module_udp_echo.py new file mode 100644 index 000000000..b79097d2f --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_udp_echo.py @@ -0,0 +1,196 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## udp-echo-client.h: ns3::UdpEchoClient [class] + module.add_class('UdpEchoClient', parent=root_module['ns3::Application']) + ## udp-echo-server.h: ns3::UdpEchoServer [class] + module.add_class('UdpEchoServer', parent=root_module['ns3::Application']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3UdpEchoClient_methods(root_module, root_module['ns3::UdpEchoClient']) + register_Ns3UdpEchoServer_methods(root_module, root_module['ns3::UdpEchoServer']) + return + +def register_Ns3UdpEchoClient_methods(root_module, cls): + ## udp-echo-client.h: ns3::UdpEchoClient::UdpEchoClient(ns3::UdpEchoClient const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UdpEchoClient const &', 'arg0')]) + ## udp-echo-client.h: ns3::UdpEchoClient::UdpEchoClient() [constructor] + cls.add_constructor([]) + ## udp-echo-client.h: uint32_t ns3::UdpEchoClient::GetDataSize() const [member function] + cls.add_method('GetDataSize', + 'uint32_t', + [], + is_const=True) + ## udp-echo-client.h: static ns3::TypeId ns3::UdpEchoClient::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## udp-echo-client.h: void ns3::UdpEchoClient::SetDataSize(uint32_t dataSize) [member function] + cls.add_method('SetDataSize', + 'void', + [param('uint32_t', 'dataSize')]) + ## udp-echo-client.h: void ns3::UdpEchoClient::SetFill(std::string fill) [member function] + cls.add_method('SetFill', + 'void', + [param('std::string', 'fill')]) + ## udp-echo-client.h: void ns3::UdpEchoClient::SetFill(uint8_t fill, uint32_t dataSize) [member function] + cls.add_method('SetFill', + 'void', + [param('uint8_t', 'fill'), param('uint32_t', 'dataSize')]) + ## udp-echo-client.h: void ns3::UdpEchoClient::SetFill(uint8_t * fill, uint32_t fillSize, uint32_t dataSize) [member function] + cls.add_method('SetFill', + 'void', + [param('uint8_t *', 'fill'), param('uint32_t', 'fillSize'), param('uint32_t', 'dataSize')]) + ## udp-echo-client.h: void ns3::UdpEchoClient::SetRemote(ns3::Ipv4Address ip, uint16_t port) [member function] + cls.add_method('SetRemote', + 'void', + [param('ns3::Ipv4Address', 'ip'), param('uint16_t', 'port')]) + ## udp-echo-client.h: void ns3::UdpEchoClient::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## udp-echo-client.h: void ns3::UdpEchoClient::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## udp-echo-client.h: void ns3::UdpEchoClient::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3UdpEchoServer_methods(root_module, cls): + ## udp-echo-server.h: ns3::UdpEchoServer::UdpEchoServer(ns3::UdpEchoServer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::UdpEchoServer const &', 'arg0')]) + ## udp-echo-server.h: ns3::UdpEchoServer::UdpEchoServer() [constructor] + cls.add_constructor([]) + ## udp-echo-server.h: static ns3::TypeId ns3::UdpEchoServer::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## udp-echo-server.h: void ns3::UdpEchoServer::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## udp-echo-server.h: void ns3::UdpEchoServer::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## udp-echo-server.h: void ns3::UdpEchoServer::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_v4ping.py b/bindings/python/apidefs/gcc-LP64/ns3_module_v4ping.py new file mode 100644 index 000000000..b087bfb02 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_v4ping.py @@ -0,0 +1,141 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## v4ping.h: ns3::V4Ping [class] + module.add_class('V4Ping', parent=root_module['ns3::Application']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3V4Ping_methods(root_module, root_module['ns3::V4Ping']) + return + +def register_Ns3V4Ping_methods(root_module, cls): + ## v4ping.h: ns3::V4Ping::V4Ping(ns3::V4Ping const & arg0) [copy constructor] + cls.add_constructor([param('ns3::V4Ping const &', 'arg0')]) + ## v4ping.h: ns3::V4Ping::V4Ping() [constructor] + cls.add_constructor([]) + ## v4ping.h: static ns3::TypeId ns3::V4Ping::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## v4ping.h: void ns3::V4Ping::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## v4ping.h: void ns3::V4Ping::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## v4ping.h: void ns3::V4Ping::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_virtual_net_device.py b/bindings/python/apidefs/gcc-LP64/ns3_module_virtual_net_device.py new file mode 100644 index 000000000..f03bcc785 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_virtual_net_device.py @@ -0,0 +1,271 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## virtual-net-device.h: ns3::VirtualNetDevice [class] + module.add_class('VirtualNetDevice', parent=root_module['ns3::NetDevice']) + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3VirtualNetDevice_methods(root_module, root_module['ns3::VirtualNetDevice']) + return + +def register_Ns3VirtualNetDevice_methods(root_module, cls): + ## virtual-net-device.h: ns3::VirtualNetDevice::VirtualNetDevice(ns3::VirtualNetDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::VirtualNetDevice const &', 'arg0')]) + ## virtual-net-device.h: ns3::VirtualNetDevice::VirtualNetDevice() [constructor] + cls.add_constructor([]) + ## virtual-net-device.h: void ns3::VirtualNetDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## virtual-net-device.h: ns3::Address ns3::VirtualNetDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: ns3::Address ns3::VirtualNetDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: ns3::Ptr ns3::VirtualNetDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: uint32_t ns3::VirtualNetDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: uint16_t ns3::VirtualNetDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: ns3::Address ns3::VirtualNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## virtual-net-device.h: ns3::Address ns3::VirtualNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## virtual-net-device.h: ns3::Ptr ns3::VirtualNetDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: static ns3::TypeId ns3::VirtualNetDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::Receive(ns3::Ptr packet, uint16_t protocol, ns3::Address const & source, ns3::Address const & destination, ns3::NetDevice::PacketType packetType) [member function] + cls.add_method('Receive', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'destination'), param('ns3::NetDevice::PacketType', 'packetType')]) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + is_virtual=True) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetIsPointToPoint(bool isPointToPoint) [member function] + cls.add_method('SetIsPointToPoint', + 'void', + [param('bool', 'isPointToPoint')]) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetNeedsArp(bool needsArp) [member function] + cls.add_method('SetNeedsArp', + 'void', + [param('bool', 'needsArp')]) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetSendCallback(ns3::Callback, ns3::Address const&, ns3::Address const&, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> transmitCb) [member function] + cls.add_method('SetSendCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::Address const &, ns3::Address const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'transmitCb')]) + ## virtual-net-device.h: void ns3::VirtualNetDevice::SetSupportsSendFrom(bool supportsSendFrom) [member function] + cls.add_method('SetSupportsSendFrom', + 'void', + [param('bool', 'supportsSendFrom')]) + ## virtual-net-device.h: bool ns3::VirtualNetDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## virtual-net-device.h: void ns3::VirtualNetDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_wifi.py b/bindings/python/apidefs/gcc-LP64/ns3_module_wifi.py new file mode 100644 index 000000000..7d28518e3 --- /dev/null +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_wifi.py @@ -0,0 +1,5566 @@ +from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers + +def register_types(module): + root_module = module.get_root() + + ## wifi-mac-header.h: ns3::WifiMacType [enumeration] + module.add_enum('WifiMacType', ['WIFI_MAC_CTL_RTS', 'WIFI_MAC_CTL_CTS', 'WIFI_MAC_CTL_ACK', 'WIFI_MAC_CTL_BACKREQ', 'WIFI_MAC_CTL_BACKRESP', 'WIFI_MAC_MGT_BEACON', 'WIFI_MAC_MGT_ASSOCIATION_REQUEST', 'WIFI_MAC_MGT_ASSOCIATION_RESPONSE', 'WIFI_MAC_MGT_DISASSOCIATION', 'WIFI_MAC_MGT_REASSOCIATION_REQUEST', 'WIFI_MAC_MGT_REASSOCIATION_RESPONSE', 'WIFI_MAC_MGT_PROBE_REQUEST', 'WIFI_MAC_MGT_PROBE_RESPONSE', 'WIFI_MAC_MGT_AUTHENTICATION', 'WIFI_MAC_MGT_DEAUTHENTICATION', 'WIFI_MAC_MGT_ACTION', 'WIFI_MAC_MGT_ACTION_NO_ACK', 'WIFI_MAC_MGT_MULTIHOP_ACTION', 'WIFI_MAC_DATA', 'WIFI_MAC_DATA_CFACK', 'WIFI_MAC_DATA_CFPOLL', 'WIFI_MAC_DATA_CFACK_CFPOLL', 'WIFI_MAC_DATA_NULL', 'WIFI_MAC_DATA_NULL_CFACK', 'WIFI_MAC_DATA_NULL_CFPOLL', 'WIFI_MAC_DATA_NULL_CFACK_CFPOLL', 'WIFI_MAC_QOSDATA', 'WIFI_MAC_QOSDATA_CFACK', 'WIFI_MAC_QOSDATA_CFPOLL', 'WIFI_MAC_QOSDATA_CFACK_CFPOLL', 'WIFI_MAC_QOSDATA_NULL', 'WIFI_MAC_QOSDATA_NULL_CFPOLL', 'WIFI_MAC_QOSDATA_NULL_CFACK_CFPOLL']) + ## 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_80211_10Mhz', 'WIFI_PHY_STANDARD_80211_5Mhz', 'WIFI_PHY_STANDARD_holland', 'WIFI_PHY_UNKNOWN']) + ## qos-utils.h: ns3::AccessClass [enumeration] + module.add_enum('AccessClass', ['AC_VO', 'AC_VI', 'AC_BE', 'AC_BK', 'AC_BE_NQOS', 'AC_UNDEF']) + ## edca-txop-n.h: ns3::TypeOfStation [enumeration] + module.add_enum('TypeOfStation', ['STA', 'AP', 'ADHOC_STA']) + ## capability-information.h: ns3::CapabilityInformation [class] + module.add_class('CapabilityInformation') + ## dcf-manager.h: ns3::DcfManager [class] + module.add_class('DcfManager') + ## dcf-manager.h: ns3::DcfState [class] + module.add_class('DcfState', allow_subclassing=True) + ## interference-helper.h: ns3::InterferenceHelper [class] + module.add_class('InterferenceHelper', allow_subclassing=False) + ## interference-helper.h: ns3::InterferenceHelper::SnrPer [struct] + module.add_class('SnrPer', outer_class=root_module['ns3::InterferenceHelper']) + ## mac-low.h: ns3::MacLowDcfListener [class] + module.add_class('MacLowDcfListener', allow_subclassing=True) + ## mac-low.h: ns3::MacLowTransmissionListener [class] + module.add_class('MacLowTransmissionListener', allow_subclassing=True) + ## mac-low.h: ns3::MacLowTransmissionParameters [class] + module.add_class('MacLowTransmissionParameters') + ## mac-rx-middle.h: ns3::MacRxMiddle [class] + module.add_class('MacRxMiddle') + ## minstrel-wifi-manager.h: ns3::RateInfo [struct] + module.add_class('RateInfo') + ## ssid.h: ns3::Ssid [class] + module.add_class('Ssid') + ## status-code.h: ns3::StatusCode [class] + module.add_class('StatusCode') + ## supported-rates.h: ns3::SupportedRates [class] + module.add_class('SupportedRates') + ## rraa-wifi-manager.h: ns3::ThresholdsItem [struct] + module.add_class('ThresholdsItem') + ## wifi-mode.h: ns3::WifiMode [class] + module.add_class('WifiMode') + ## wifi-mode.h: ns3::WifiMode::ModulationType [enumeration] + module.add_enum('ModulationType', ['BPSK', 'DBPSK', 'DQPSK', 'QAM', 'UNKNOWN'], outer_class=root_module['ns3::WifiMode']) + ## wifi-mode.h: ns3::WifiModeFactory [class] + module.add_class('WifiModeFactory') + ## wifi-phy.h: ns3::WifiPhyListener [class] + module.add_class('WifiPhyListener', allow_subclassing=True) + ## wifi-remote-station-manager.h: ns3::WifiRemoteStation [class] + module.add_class('WifiRemoteStation', allow_subclassing=True) + ## amrr-wifi-manager.h: ns3::AmrrWifiRemoteStation [class] + module.add_class('AmrrWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation']) + ## arf-wifi-manager.h: ns3::ArfWifiRemoteStation [class] + module.add_class('ArfWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation']) + ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiRemoteStation [class] + module.add_class('ConstantRateWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation']) + ## ideal-wifi-manager.h: ns3::IdealWifiRemoteStation [class] + module.add_class('IdealWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation']) + ## mgt-headers.h: ns3::MgtAssocRequestHeader [class] + module.add_class('MgtAssocRequestHeader', parent=root_module['ns3::Header']) + ## mgt-headers.h: ns3::MgtAssocResponseHeader [class] + module.add_class('MgtAssocResponseHeader', parent=root_module['ns3::Header']) + ## mgt-headers.h: ns3::MgtProbeRequestHeader [class] + module.add_class('MgtProbeRequestHeader', parent=root_module['ns3::Header']) + ## mgt-headers.h: ns3::MgtProbeResponseHeader [class] + module.add_class('MgtProbeResponseHeader', parent=root_module['ns3::Header']) + ## minstrel-wifi-manager.h: ns3::MinstrelWifiRemoteStation [class] + module.add_class('MinstrelWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation']) + ## onoe-wifi-manager.h: ns3::OnoeWifiRemoteStation [class] + module.add_class('OnoeWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation']) + ## propagation-delay-model.h: ns3::PropagationDelayModel [class] + module.add_class('PropagationDelayModel', parent=root_module['ns3::Object']) + ## propagation-loss-model.h: ns3::PropagationLossModel [class] + module.add_class('PropagationLossModel', parent=root_module['ns3::Object']) + ## qos-tag.h: ns3::QosTag [class] + module.add_class('QosTag', parent=root_module['ns3::Tag']) + ## propagation-delay-model.h: ns3::RandomPropagationDelayModel [class] + module.add_class('RandomPropagationDelayModel', parent=root_module['ns3::PropagationDelayModel']) + ## propagation-loss-model.h: ns3::RandomPropagationLossModel [class] + module.add_class('RandomPropagationLossModel', parent=root_module['ns3::PropagationLossModel']) + ## rraa-wifi-manager.h: ns3::RraaWifiRemoteStation [class] + module.add_class('RraaWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation']) + ## ssid.h: ns3::SsidChecker [class] + module.add_class('SsidChecker', parent=root_module['ns3::AttributeChecker']) + ## ssid.h: ns3::SsidValue [class] + module.add_class('SsidValue', parent=root_module['ns3::AttributeValue']) + ## propagation-loss-model.h: ns3::ThreeLogDistancePropagationLossModel [class] + module.add_class('ThreeLogDistancePropagationLossModel', parent=root_module['ns3::PropagationLossModel']) + ## wifi-mac.h: ns3::WifiMac [class] + module.add_class('WifiMac', parent=root_module['ns3::Object']) + ## wifi-mac-header.h: ns3::WifiMacHeader [class] + module.add_class('WifiMacHeader', parent=root_module['ns3::Header']) + ## wifi-mac-header.h: ns3::WifiMacHeader::QosAckPolicy [enumeration] + module.add_enum('QosAckPolicy', ['NORMAL_ACK', 'NO_ACK', 'NO_EXPLICIT_ACK', 'BLOCK_ACK'], outer_class=root_module['ns3::WifiMacHeader']) + ## wifi-mac-header.h: ns3::WifiMacHeader::AddressType [enumeration] + module.add_enum('AddressType', ['ADDR1', 'ADDR2', 'ADDR3', 'ADDR4'], outer_class=root_module['ns3::WifiMacHeader']) + ## wifi-mode.h: ns3::WifiModeChecker [class] + module.add_class('WifiModeChecker', parent=root_module['ns3::AttributeChecker']) + ## wifi-mode.h: ns3::WifiModeValue [class] + module.add_class('WifiModeValue', parent=root_module['ns3::AttributeValue']) + ## wifi-phy.h: ns3::WifiPhy [class] + module.add_class('WifiPhy', parent=root_module['ns3::Object']) + ## wifi-phy.h: ns3::WifiPhy::State [enumeration] + module.add_enum('State', ['SYNC', 'TX', 'CCA_BUSY', 'IDLE', 'SWITCHING'], outer_class=root_module['ns3::WifiPhy']) + ## wifi-remote-station-manager.h: ns3::WifiRemoteStationManager [class] + module.add_class('WifiRemoteStationManager', parent=root_module['ns3::Object']) + ## yans-wifi-phy.h: ns3::YansWifiPhy [class] + module.add_class('YansWifiPhy', parent=root_module['ns3::WifiPhy']) + ## aarf-wifi-manager.h: ns3::AarfWifiRemoteStation [class] + module.add_class('AarfWifiRemoteStation', parent=root_module['ns3::ArfWifiRemoteStation']) + ## adhoc-wifi-mac.h: ns3::AdhocWifiMac [class] + module.add_class('AdhocWifiMac', parent=root_module['ns3::WifiMac']) + ## amrr-wifi-manager.h: ns3::AmrrWifiManager [class] + module.add_class('AmrrWifiManager', parent=root_module['ns3::WifiRemoteStationManager']) + ## amsdu-subframe-header.h: ns3::AmsduSubframeHeader [class] + module.add_class('AmsduSubframeHeader', parent=root_module['ns3::Header']) + ## arf-wifi-manager.h: ns3::ArfWifiManager [class] + module.add_class('ArfWifiManager', parent=root_module['ns3::WifiRemoteStationManager']) + ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiManager [class] + module.add_class('ConstantRateWifiManager', parent=root_module['ns3::WifiRemoteStationManager']) + ## propagation-delay-model.h: ns3::ConstantSpeedPropagationDelayModel [class] + module.add_class('ConstantSpeedPropagationDelayModel', parent=root_module['ns3::PropagationDelayModel']) + ## dcf.h: ns3::Dcf [class] + module.add_class('Dcf', parent=root_module['ns3::Object']) + ## edca-txop-n.h: ns3::EdcaTxopN [class] + module.add_class('EdcaTxopN', parent=root_module['ns3::Dcf']) + ## error-rate-model.h: ns3::ErrorRateModel [class] + module.add_class('ErrorRateModel', parent=root_module['ns3::Object']) + ## propagation-loss-model.h: ns3::FixedRssLossModel [class] + module.add_class('FixedRssLossModel', parent=root_module['ns3::PropagationLossModel']) + ## propagation-loss-model.h: ns3::FriisPropagationLossModel [class] + module.add_class('FriisPropagationLossModel', parent=root_module['ns3::PropagationLossModel']) + ## ideal-wifi-manager.h: ns3::IdealWifiManager [class] + module.add_class('IdealWifiManager', parent=root_module['ns3::WifiRemoteStationManager']) + ## jakes-propagation-loss-model.h: ns3::JakesPropagationLossModel [class] + module.add_class('JakesPropagationLossModel', parent=root_module['ns3::PropagationLossModel']) + ## propagation-loss-model.h: ns3::LogDistancePropagationLossModel [class] + module.add_class('LogDistancePropagationLossModel', parent=root_module['ns3::PropagationLossModel']) + ## mac-low.h: ns3::MacLow [class] + module.add_class('MacLow', parent=root_module['ns3::Object']) + ## mgt-headers.h: ns3::MgtBeaconHeader [class] + module.add_class('MgtBeaconHeader', parent=root_module['ns3::MgtProbeResponseHeader']) + ## minstrel-wifi-manager.h: ns3::MinstrelWifiManager [class] + module.add_class('MinstrelWifiManager', parent=root_module['ns3::WifiRemoteStationManager']) + ## msdu-aggregator.h: ns3::MsduAggregator [class] + module.add_class('MsduAggregator', parent=root_module['ns3::Object']) + ## propagation-loss-model.h: ns3::NakagamiPropagationLossModel [class] + module.add_class('NakagamiPropagationLossModel', parent=root_module['ns3::PropagationLossModel']) + ## nqap-wifi-mac.h: ns3::NqapWifiMac [class] + module.add_class('NqapWifiMac', parent=root_module['ns3::WifiMac']) + ## nqsta-wifi-mac.h: ns3::NqstaWifiMac [class] + module.add_class('NqstaWifiMac', parent=root_module['ns3::WifiMac']) + ## onoe-wifi-manager.h: ns3::OnoeWifiManager [class] + module.add_class('OnoeWifiManager', parent=root_module['ns3::WifiRemoteStationManager']) + ## qadhoc-wifi-mac.h: ns3::QadhocWifiMac [class] + module.add_class('QadhocWifiMac', parent=root_module['ns3::WifiMac']) + ## qap-wifi-mac.h: ns3::QapWifiMac [class] + module.add_class('QapWifiMac', parent=root_module['ns3::WifiMac']) + ## qsta-wifi-mac.h: ns3::QstaWifiMac [class] + module.add_class('QstaWifiMac', parent=root_module['ns3::WifiMac']) + ## rraa-wifi-manager.h: ns3::RraaWifiManager [class] + module.add_class('RraaWifiManager', parent=root_module['ns3::WifiRemoteStationManager']) + ## wifi-channel.h: ns3::WifiChannel [class] + module.add_class('WifiChannel', parent=root_module['ns3::Channel']) + ## wifi-net-device.h: ns3::WifiNetDevice [class] + module.add_class('WifiNetDevice', parent=root_module['ns3::NetDevice']) + ## yans-error-rate-model.h: ns3::YansErrorRateModel [class] + module.add_class('YansErrorRateModel', parent=root_module['ns3::ErrorRateModel']) + ## yans-wifi-channel.h: ns3::YansWifiChannel [class] + 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']) + ## dca-txop.h: ns3::DcaTxop [class] + module.add_class('DcaTxop', parent=root_module['ns3::Dcf']) + typehandlers.add_type_alias('std::vector< ns3::RateInfo, std::allocator< ns3::RateInfo > >', 'ns3::MinstrelRate') + typehandlers.add_type_alias('std::vector< ns3::RateInfo, std::allocator< ns3::RateInfo > >*', 'ns3::MinstrelRate*') + typehandlers.add_type_alias('std::vector< ns3::RateInfo, std::allocator< ns3::RateInfo > >&', 'ns3::MinstrelRate&') + typehandlers.add_type_alias('std::vector< std::vector< unsigned int, std::allocator< unsigned int > >, std::allocator< std::vector< unsigned int, std::allocator< unsigned int > > > >', 'ns3::SampleRate') + typehandlers.add_type_alias('std::vector< std::vector< unsigned int, std::allocator< unsigned int > >, std::allocator< std::vector< unsigned int, std::allocator< unsigned int > > > >*', 'ns3::SampleRate*') + typehandlers.add_type_alias('std::vector< std::vector< unsigned int, std::allocator< unsigned int > >, std::allocator< std::vector< unsigned int, std::allocator< unsigned int > > > >&', 'ns3::SampleRate&') + typehandlers.add_type_alias('std::vector< ns3::ThresholdsItem, std::allocator< ns3::ThresholdsItem > >', 'ns3::Thresholds') + typehandlers.add_type_alias('std::vector< ns3::ThresholdsItem, std::allocator< ns3::ThresholdsItem > >*', 'ns3::Thresholds*') + typehandlers.add_type_alias('std::vector< ns3::ThresholdsItem, std::allocator< ns3::ThresholdsItem > >&', 'ns3::Thresholds&') + + ## Register a nested module for the namespace Config + + nested_module = module.add_cpp_namespace('Config') + register_types_ns3_Config(nested_module) + + + ## Register a nested module for the namespace TimeStepPrecision + + nested_module = module.add_cpp_namespace('TimeStepPrecision') + register_types_ns3_TimeStepPrecision(nested_module) + + + ## Register a nested module for the namespace addressUtils + + nested_module = module.add_cpp_namespace('addressUtils') + register_types_ns3_addressUtils(nested_module) + + + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + + ## Register a nested module for the namespace internal + + nested_module = module.add_cpp_namespace('internal') + register_types_ns3_internal(nested_module) + + + ## Register a nested module for the namespace olsr + + nested_module = module.add_cpp_namespace('olsr') + register_types_ns3_olsr(nested_module) + + +def register_types_ns3_Config(module): + root_module = module.get_root() + + +def register_types_ns3_TimeStepPrecision(module): + root_module = module.get_root() + + +def register_types_ns3_addressUtils(module): + root_module = module.get_root() + + +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + +def register_types_ns3_internal(module): + root_module = module.get_root() + + +def register_types_ns3_olsr(module): + root_module = module.get_root() + + +def register_methods(root_module): + register_Ns3CapabilityInformation_methods(root_module, root_module['ns3::CapabilityInformation']) + register_Ns3DcfManager_methods(root_module, root_module['ns3::DcfManager']) + register_Ns3DcfState_methods(root_module, root_module['ns3::DcfState']) + register_Ns3InterferenceHelper_methods(root_module, root_module['ns3::InterferenceHelper']) + register_Ns3InterferenceHelperSnrPer_methods(root_module, root_module['ns3::InterferenceHelper::SnrPer']) + register_Ns3MacLowDcfListener_methods(root_module, root_module['ns3::MacLowDcfListener']) + register_Ns3MacLowTransmissionListener_methods(root_module, root_module['ns3::MacLowTransmissionListener']) + register_Ns3MacLowTransmissionParameters_methods(root_module, root_module['ns3::MacLowTransmissionParameters']) + register_Ns3MacRxMiddle_methods(root_module, root_module['ns3::MacRxMiddle']) + register_Ns3RateInfo_methods(root_module, root_module['ns3::RateInfo']) + register_Ns3Ssid_methods(root_module, root_module['ns3::Ssid']) + register_Ns3StatusCode_methods(root_module, root_module['ns3::StatusCode']) + register_Ns3SupportedRates_methods(root_module, root_module['ns3::SupportedRates']) + register_Ns3ThresholdsItem_methods(root_module, root_module['ns3::ThresholdsItem']) + register_Ns3WifiMode_methods(root_module, root_module['ns3::WifiMode']) + register_Ns3WifiModeFactory_methods(root_module, root_module['ns3::WifiModeFactory']) + register_Ns3WifiPhyListener_methods(root_module, root_module['ns3::WifiPhyListener']) + register_Ns3WifiRemoteStation_methods(root_module, root_module['ns3::WifiRemoteStation']) + register_Ns3AmrrWifiRemoteStation_methods(root_module, root_module['ns3::AmrrWifiRemoteStation']) + register_Ns3ArfWifiRemoteStation_methods(root_module, root_module['ns3::ArfWifiRemoteStation']) + register_Ns3ConstantRateWifiRemoteStation_methods(root_module, root_module['ns3::ConstantRateWifiRemoteStation']) + register_Ns3IdealWifiRemoteStation_methods(root_module, root_module['ns3::IdealWifiRemoteStation']) + register_Ns3MgtAssocRequestHeader_methods(root_module, root_module['ns3::MgtAssocRequestHeader']) + register_Ns3MgtAssocResponseHeader_methods(root_module, root_module['ns3::MgtAssocResponseHeader']) + register_Ns3MgtProbeRequestHeader_methods(root_module, root_module['ns3::MgtProbeRequestHeader']) + register_Ns3MgtProbeResponseHeader_methods(root_module, root_module['ns3::MgtProbeResponseHeader']) + register_Ns3MinstrelWifiRemoteStation_methods(root_module, root_module['ns3::MinstrelWifiRemoteStation']) + register_Ns3OnoeWifiRemoteStation_methods(root_module, root_module['ns3::OnoeWifiRemoteStation']) + register_Ns3PropagationDelayModel_methods(root_module, root_module['ns3::PropagationDelayModel']) + register_Ns3PropagationLossModel_methods(root_module, root_module['ns3::PropagationLossModel']) + register_Ns3QosTag_methods(root_module, root_module['ns3::QosTag']) + register_Ns3RandomPropagationDelayModel_methods(root_module, root_module['ns3::RandomPropagationDelayModel']) + register_Ns3RandomPropagationLossModel_methods(root_module, root_module['ns3::RandomPropagationLossModel']) + register_Ns3RraaWifiRemoteStation_methods(root_module, root_module['ns3::RraaWifiRemoteStation']) + register_Ns3SsidChecker_methods(root_module, root_module['ns3::SsidChecker']) + register_Ns3SsidValue_methods(root_module, root_module['ns3::SsidValue']) + register_Ns3ThreeLogDistancePropagationLossModel_methods(root_module, root_module['ns3::ThreeLogDistancePropagationLossModel']) + register_Ns3WifiMac_methods(root_module, root_module['ns3::WifiMac']) + register_Ns3WifiMacHeader_methods(root_module, root_module['ns3::WifiMacHeader']) + register_Ns3WifiModeChecker_methods(root_module, root_module['ns3::WifiModeChecker']) + register_Ns3WifiModeValue_methods(root_module, root_module['ns3::WifiModeValue']) + register_Ns3WifiPhy_methods(root_module, root_module['ns3::WifiPhy']) + register_Ns3WifiRemoteStationManager_methods(root_module, root_module['ns3::WifiRemoteStationManager']) + register_Ns3YansWifiPhy_methods(root_module, root_module['ns3::YansWifiPhy']) + register_Ns3AarfWifiRemoteStation_methods(root_module, root_module['ns3::AarfWifiRemoteStation']) + register_Ns3AdhocWifiMac_methods(root_module, root_module['ns3::AdhocWifiMac']) + register_Ns3AmrrWifiManager_methods(root_module, root_module['ns3::AmrrWifiManager']) + register_Ns3AmsduSubframeHeader_methods(root_module, root_module['ns3::AmsduSubframeHeader']) + register_Ns3ArfWifiManager_methods(root_module, root_module['ns3::ArfWifiManager']) + register_Ns3ConstantRateWifiManager_methods(root_module, root_module['ns3::ConstantRateWifiManager']) + register_Ns3ConstantSpeedPropagationDelayModel_methods(root_module, root_module['ns3::ConstantSpeedPropagationDelayModel']) + register_Ns3Dcf_methods(root_module, root_module['ns3::Dcf']) + register_Ns3EdcaTxopN_methods(root_module, root_module['ns3::EdcaTxopN']) + register_Ns3ErrorRateModel_methods(root_module, root_module['ns3::ErrorRateModel']) + register_Ns3FixedRssLossModel_methods(root_module, root_module['ns3::FixedRssLossModel']) + register_Ns3FriisPropagationLossModel_methods(root_module, root_module['ns3::FriisPropagationLossModel']) + register_Ns3IdealWifiManager_methods(root_module, root_module['ns3::IdealWifiManager']) + register_Ns3JakesPropagationLossModel_methods(root_module, root_module['ns3::JakesPropagationLossModel']) + register_Ns3LogDistancePropagationLossModel_methods(root_module, root_module['ns3::LogDistancePropagationLossModel']) + register_Ns3MacLow_methods(root_module, root_module['ns3::MacLow']) + register_Ns3MgtBeaconHeader_methods(root_module, root_module['ns3::MgtBeaconHeader']) + register_Ns3MinstrelWifiManager_methods(root_module, root_module['ns3::MinstrelWifiManager']) + register_Ns3MsduAggregator_methods(root_module, root_module['ns3::MsduAggregator']) + register_Ns3NakagamiPropagationLossModel_methods(root_module, root_module['ns3::NakagamiPropagationLossModel']) + register_Ns3NqapWifiMac_methods(root_module, root_module['ns3::NqapWifiMac']) + register_Ns3NqstaWifiMac_methods(root_module, root_module['ns3::NqstaWifiMac']) + register_Ns3OnoeWifiManager_methods(root_module, root_module['ns3::OnoeWifiManager']) + register_Ns3QadhocWifiMac_methods(root_module, root_module['ns3::QadhocWifiMac']) + register_Ns3QapWifiMac_methods(root_module, root_module['ns3::QapWifiMac']) + register_Ns3QstaWifiMac_methods(root_module, root_module['ns3::QstaWifiMac']) + register_Ns3RraaWifiManager_methods(root_module, root_module['ns3::RraaWifiManager']) + register_Ns3WifiChannel_methods(root_module, root_module['ns3::WifiChannel']) + register_Ns3WifiNetDevice_methods(root_module, root_module['ns3::WifiNetDevice']) + register_Ns3YansErrorRateModel_methods(root_module, root_module['ns3::YansErrorRateModel']) + register_Ns3YansWifiChannel_methods(root_module, root_module['ns3::YansWifiChannel']) + register_Ns3AarfWifiManager_methods(root_module, root_module['ns3::AarfWifiManager']) + register_Ns3DcaTxop_methods(root_module, root_module['ns3::DcaTxop']) + return + +def register_Ns3CapabilityInformation_methods(root_module, cls): + ## capability-information.h: ns3::CapabilityInformation::CapabilityInformation(ns3::CapabilityInformation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CapabilityInformation const &', 'arg0')]) + ## capability-information.h: ns3::CapabilityInformation::CapabilityInformation() [constructor] + cls.add_constructor([]) + ## capability-information.h: ns3::Buffer::Iterator ns3::CapabilityInformation::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'start')]) + ## capability-information.h: uint32_t ns3::CapabilityInformation::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## capability-information.h: bool ns3::CapabilityInformation::IsEss() const [member function] + cls.add_method('IsEss', + 'bool', + [], + is_const=True) + ## capability-information.h: bool ns3::CapabilityInformation::IsIbss() const [member function] + cls.add_method('IsIbss', + 'bool', + [], + is_const=True) + ## capability-information.h: ns3::Buffer::Iterator ns3::CapabilityInformation::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True) + ## capability-information.h: void ns3::CapabilityInformation::SetEss() [member function] + cls.add_method('SetEss', + 'void', + []) + ## capability-information.h: void ns3::CapabilityInformation::SetIbss() [member function] + cls.add_method('SetIbss', + 'void', + []) + return + +def register_Ns3DcfManager_methods(root_module, cls): + ## dcf-manager.h: ns3::DcfManager::DcfManager(ns3::DcfManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DcfManager const &', 'arg0')]) + ## dcf-manager.h: ns3::DcfManager::DcfManager() [constructor] + cls.add_constructor([]) + ## dcf-manager.h: void ns3::DcfManager::Add(ns3::DcfState * dcf) [member function] + cls.add_method('Add', + 'void', + [param('ns3::DcfState *', 'dcf')]) + ## dcf-manager.h: ns3::Time ns3::DcfManager::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True) + ## dcf-manager.h: void ns3::DcfManager::NotifyAckTimeoutResetNow() [member function] + cls.add_method('NotifyAckTimeoutResetNow', + 'void', + []) + ## dcf-manager.h: void ns3::DcfManager::NotifyAckTimeoutStartNow(ns3::Time duration) [member function] + cls.add_method('NotifyAckTimeoutStartNow', + 'void', + [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::NotifyCtsTimeoutResetNow() [member function] + cls.add_method('NotifyCtsTimeoutResetNow', + 'void', + []) + ## dcf-manager.h: void ns3::DcfManager::NotifyCtsTimeoutStartNow(ns3::Time duration) [member function] + cls.add_method('NotifyCtsTimeoutStartNow', + 'void', + [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::NotifyMaybeCcaBusyStartNow(ns3::Time duration) [member function] + cls.add_method('NotifyMaybeCcaBusyStartNow', + 'void', + [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::NotifyNavResetNow(ns3::Time duration) [member function] + cls.add_method('NotifyNavResetNow', + 'void', + [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::NotifyNavStartNow(ns3::Time duration) [member function] + cls.add_method('NotifyNavStartNow', + 'void', + [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::NotifyRxEndErrorNow() [member function] + cls.add_method('NotifyRxEndErrorNow', + 'void', + []) + ## dcf-manager.h: void ns3::DcfManager::NotifyRxEndOkNow() [member function] + cls.add_method('NotifyRxEndOkNow', + 'void', + []) + ## dcf-manager.h: void ns3::DcfManager::NotifyRxStartNow(ns3::Time duration) [member function] + cls.add_method('NotifyRxStartNow', + 'void', + [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::NotifySwitchingStartNow(ns3::Time duration) [member function] + cls.add_method('NotifySwitchingStartNow', + 'void', + [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::NotifyTxStartNow(ns3::Time duration) [member function] + cls.add_method('NotifyTxStartNow', + 'void', + [param('ns3::Time', 'duration')]) + ## dcf-manager.h: void ns3::DcfManager::RequestAccess(ns3::DcfState * state) [member function] + cls.add_method('RequestAccess', + 'void', + [param('ns3::DcfState *', 'state')]) + ## dcf-manager.h: void ns3::DcfManager::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')]) + ## dcf-manager.h: void ns3::DcfManager::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')]) + ## dcf-manager.h: void ns3::DcfManager::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')]) + ## dcf-manager.h: void ns3::DcfManager::SetupLowListener(ns3::Ptr low) [member function] + cls.add_method('SetupLowListener', + 'void', + [param('ns3::Ptr< ns3::MacLow >', 'low')]) + ## dcf-manager.h: void ns3::DcfManager::SetupPhyListener(ns3::Ptr phy) [member function] + cls.add_method('SetupPhyListener', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')]) + return + +def register_Ns3DcfState_methods(root_module, cls): + ## dcf-manager.h: ns3::DcfState::DcfState(ns3::DcfState const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DcfState const &', 'arg0')]) + ## dcf-manager.h: ns3::DcfState::DcfState() [constructor] + cls.add_constructor([]) + ## dcf-manager.h: uint32_t ns3::DcfState::GetAifsn() const [member function] + cls.add_method('GetAifsn', + 'uint32_t', + [], + is_const=True) + ## dcf-manager.h: uint32_t ns3::DcfState::GetCw() const [member function] + cls.add_method('GetCw', + 'uint32_t', + [], + is_const=True) + ## dcf-manager.h: uint32_t ns3::DcfState::GetCwMax() const [member function] + cls.add_method('GetCwMax', + 'uint32_t', + [], + is_const=True) + ## dcf-manager.h: uint32_t ns3::DcfState::GetCwMin() const [member function] + cls.add_method('GetCwMin', + 'uint32_t', + [], + is_const=True) + ## dcf-manager.h: bool ns3::DcfState::IsAccessRequested() const [member function] + cls.add_method('IsAccessRequested', + 'bool', + [], + is_const=True) + ## dcf-manager.h: void ns3::DcfState::ResetCw() [member function] + cls.add_method('ResetCw', + 'void', + []) + ## dcf-manager.h: void ns3::DcfState::SetAifsn(uint32_t aifsn) [member function] + cls.add_method('SetAifsn', + 'void', + [param('uint32_t', 'aifsn')]) + ## dcf-manager.h: void ns3::DcfState::SetCwMax(uint32_t maxCw) [member function] + cls.add_method('SetCwMax', + 'void', + [param('uint32_t', 'maxCw')]) + ## dcf-manager.h: void ns3::DcfState::SetCwMin(uint32_t minCw) [member function] + cls.add_method('SetCwMin', + 'void', + [param('uint32_t', 'minCw')]) + ## dcf-manager.h: void ns3::DcfState::StartBackoffNow(uint32_t nSlots) [member function] + cls.add_method('StartBackoffNow', + 'void', + [param('uint32_t', 'nSlots')]) + ## dcf-manager.h: void ns3::DcfState::UpdateFailedCw() [member function] + cls.add_method('UpdateFailedCw', + 'void', + []) + ## dcf-manager.h: void ns3::DcfState::DoNotifyAccessGranted() [member function] + cls.add_method('DoNotifyAccessGranted', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## dcf-manager.h: void ns3::DcfState::DoNotifyChannelSwitching() [member function] + cls.add_method('DoNotifyChannelSwitching', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## dcf-manager.h: void ns3::DcfState::DoNotifyCollision() [member function] + cls.add_method('DoNotifyCollision', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## dcf-manager.h: void ns3::DcfState::DoNotifyInternalCollision() [member function] + cls.add_method('DoNotifyInternalCollision', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3InterferenceHelper_methods(root_module, cls): + ## interference-helper.h: ns3::InterferenceHelper::InterferenceHelper() [constructor] + cls.add_constructor([]) + ## interference-helper.h: ns3::Ptr ns3::InterferenceHelper::Add(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble, ns3::Time duration, double rxPower) [member function] + cls.add_method('Add', + 'ns3::Ptr< ns3::InterferenceHelper::Event >', + [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble'), param('ns3::Time', 'duration'), param('double', 'rxPower')]) + ## interference-helper.h: ns3::InterferenceHelper::SnrPer ns3::InterferenceHelper::CalculateSnrPer(ns3::Ptr event) [member function] + cls.add_method('CalculateSnrPer', + 'ns3::InterferenceHelper::SnrPer', + [param('ns3::Ptr< ns3::InterferenceHelper::Event >', 'event')]) + ## 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_static=True) + ## interference-helper.h: void ns3::InterferenceHelper::EraseEvents() [member function] + cls.add_method('EraseEvents', + 'void', + []) + ## interference-helper.h: ns3::Time ns3::InterferenceHelper::GetEnergyDuration(double energyW) [member function] + cls.add_method('GetEnergyDuration', + 'ns3::Time', + [param('double', 'energyW')]) + ## interference-helper.h: ns3::Ptr ns3::InterferenceHelper::GetErrorRateModel() const [member function] + cls.add_method('GetErrorRateModel', + 'ns3::Ptr< ns3::ErrorRateModel >', + [], + is_const=True) + ## interference-helper.h: double ns3::InterferenceHelper::GetNoiseFigure() const [member function] + cls.add_method('GetNoiseFigure', + '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', + [param('ns3::Ptr< ns3::ErrorRateModel >', 'rate')]) + ## interference-helper.h: void ns3::InterferenceHelper::SetNoiseFigure(double value) [member function] + cls.add_method('SetNoiseFigure', + 'void', + [param('double', 'value')]) + return + +def register_Ns3InterferenceHelperSnrPer_methods(root_module, cls): + ## interference-helper.h: ns3::InterferenceHelper::SnrPer::SnrPer() [constructor] + cls.add_constructor([]) + ## interference-helper.h: ns3::InterferenceHelper::SnrPer::SnrPer(ns3::InterferenceHelper::SnrPer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::InterferenceHelper::SnrPer const &', 'arg0')]) + ## interference-helper.h: ns3::InterferenceHelper::SnrPer::per [variable] + cls.add_instance_attribute('per', 'double', is_const=False) + ## interference-helper.h: ns3::InterferenceHelper::SnrPer::snr [variable] + cls.add_instance_attribute('snr', 'double', is_const=False) + return + +def register_Ns3MacLowDcfListener_methods(root_module, cls): + ## mac-low.h: ns3::MacLowDcfListener::MacLowDcfListener(ns3::MacLowDcfListener const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MacLowDcfListener const &', 'arg0')]) + ## mac-low.h: ns3::MacLowDcfListener::MacLowDcfListener() [constructor] + cls.add_constructor([]) + ## mac-low.h: void ns3::MacLowDcfListener::AckTimeoutReset() [member function] + cls.add_method('AckTimeoutReset', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowDcfListener::AckTimeoutStart(ns3::Time duration) [member function] + cls.add_method('AckTimeoutStart', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowDcfListener::CtsTimeoutReset() [member function] + cls.add_method('CtsTimeoutReset', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowDcfListener::CtsTimeoutStart(ns3::Time duration) [member function] + cls.add_method('CtsTimeoutStart', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowDcfListener::NavReset(ns3::Time duration) [member function] + cls.add_method('NavReset', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowDcfListener::NavStart(ns3::Time duration) [member function] + cls.add_method('NavStart', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3MacLowTransmissionListener_methods(root_module, cls): + ## mac-low.h: ns3::MacLowTransmissionListener::MacLowTransmissionListener(ns3::MacLowTransmissionListener const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MacLowTransmissionListener const &', 'arg0')]) + ## mac-low.h: ns3::MacLowTransmissionListener::MacLowTransmissionListener() [constructor] + cls.add_constructor([]) + ## mac-low.h: void ns3::MacLowTransmissionListener::Cancel() [member function] + cls.add_method('Cancel', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowTransmissionListener::GotAck(double snr, ns3::WifiMode txMode) [member function] + cls.add_method('GotAck', + 'void', + [param('double', 'snr'), param('ns3::WifiMode', 'txMode')], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowTransmissionListener::GotCts(double snr, ns3::WifiMode txMode) [member function] + cls.add_method('GotCts', + 'void', + [param('double', 'snr'), param('ns3::WifiMode', 'txMode')], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowTransmissionListener::MissedAck() [member function] + cls.add_method('MissedAck', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowTransmissionListener::MissedCts() [member function] + cls.add_method('MissedCts', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## mac-low.h: void ns3::MacLowTransmissionListener::StartNext() [member function] + cls.add_method('StartNext', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3MacLowTransmissionParameters_methods(root_module, cls): + cls.add_output_stream_operator() + ## mac-low.h: ns3::MacLowTransmissionParameters::MacLowTransmissionParameters(ns3::MacLowTransmissionParameters const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MacLowTransmissionParameters const &', 'arg0')]) + ## mac-low.h: ns3::MacLowTransmissionParameters::MacLowTransmissionParameters() [constructor] + cls.add_constructor([]) + ## mac-low.h: void ns3::MacLowTransmissionParameters::DisableAck() [member function] + cls.add_method('DisableAck', + 'void', + []) + ## mac-low.h: void ns3::MacLowTransmissionParameters::DisableNextData() [member function] + cls.add_method('DisableNextData', + 'void', + []) + ## mac-low.h: void ns3::MacLowTransmissionParameters::DisableOverrideDurationId() [member function] + cls.add_method('DisableOverrideDurationId', + 'void', + []) + ## mac-low.h: void ns3::MacLowTransmissionParameters::DisableRts() [member function] + cls.add_method('DisableRts', + 'void', + []) + ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableAck() [member function] + cls.add_method('EnableAck', + 'void', + []) + ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableFastAck() [member function] + cls.add_method('EnableFastAck', + 'void', + []) + ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableNextData(uint32_t size) [member function] + cls.add_method('EnableNextData', + 'void', + [param('uint32_t', 'size')]) + ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableOverrideDurationId(ns3::Time durationId) [member function] + cls.add_method('EnableOverrideDurationId', + 'void', + [param('ns3::Time', 'durationId')]) + ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableRts() [member function] + cls.add_method('EnableRts', + 'void', + []) + ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableSuperFastAck() [member function] + cls.add_method('EnableSuperFastAck', + 'void', + []) + ## mac-low.h: ns3::Time ns3::MacLowTransmissionParameters::GetDurationId() const [member function] + cls.add_method('GetDurationId', + 'ns3::Time', + [], + is_const=True) + ## mac-low.h: uint32_t ns3::MacLowTransmissionParameters::GetNextPacketSize() const [member function] + cls.add_method('GetNextPacketSize', + 'uint32_t', + [], + is_const=True) + ## mac-low.h: bool ns3::MacLowTransmissionParameters::HasDurationId() const [member function] + cls.add_method('HasDurationId', + 'bool', + [], + is_const=True) + ## mac-low.h: bool ns3::MacLowTransmissionParameters::HasNextPacket() const [member function] + cls.add_method('HasNextPacket', + 'bool', + [], + is_const=True) + ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustSendRts() const [member function] + cls.add_method('MustSendRts', + 'bool', + [], + is_const=True) + ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustWaitAck() const [member function] + cls.add_method('MustWaitAck', + 'bool', + [], + is_const=True) + ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustWaitFastAck() const [member function] + cls.add_method('MustWaitFastAck', + 'bool', + [], + is_const=True) + ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustWaitNormalAck() const [member function] + cls.add_method('MustWaitNormalAck', + 'bool', + [], + is_const=True) + ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustWaitSuperFastAck() const [member function] + cls.add_method('MustWaitSuperFastAck', + 'bool', + [], + is_const=True) + return + +def register_Ns3MacRxMiddle_methods(root_module, cls): + ## mac-rx-middle.h: ns3::MacRxMiddle::MacRxMiddle(ns3::MacRxMiddle const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MacRxMiddle const &', 'arg0')]) + ## mac-rx-middle.h: ns3::MacRxMiddle::MacRxMiddle() [constructor] + cls.add_constructor([]) + ## mac-rx-middle.h: void ns3::MacRxMiddle::Receive(ns3::Ptr packet, ns3::WifiMacHeader const * hdr) [member function] + cls.add_method('Receive', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::WifiMacHeader const *', 'hdr')]) + ## mac-rx-middle.h: void ns3::MacRxMiddle::SetForwardCallback(ns3::Callback, ns3::WifiMacHeader const*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function] + cls.add_method('SetForwardCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::WifiMacHeader const *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + return + +def register_Ns3RateInfo_methods(root_module, cls): + ## minstrel-wifi-manager.h: ns3::RateInfo::RateInfo() [constructor] + cls.add_constructor([]) + ## minstrel-wifi-manager.h: ns3::RateInfo::RateInfo(ns3::RateInfo const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RateInfo const &', 'arg0')]) + ## minstrel-wifi-manager.h: ns3::RateInfo::adjustedRetryCount [variable] + cls.add_instance_attribute('adjustedRetryCount', 'uint32_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::attemptHist [variable] + cls.add_instance_attribute('attemptHist', 'uint64_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::ewmaProb [variable] + cls.add_instance_attribute('ewmaProb', 'uint32_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::numRateAttempt [variable] + cls.add_instance_attribute('numRateAttempt', 'uint32_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::numRateSuccess [variable] + cls.add_instance_attribute('numRateSuccess', 'uint32_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::perfectTxTime [variable] + cls.add_instance_attribute('perfectTxTime', 'ns3::Time', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::prevNumRateAttempt [variable] + cls.add_instance_attribute('prevNumRateAttempt', 'uint32_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::prevNumRateSuccess [variable] + cls.add_instance_attribute('prevNumRateSuccess', 'uint32_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::prob [variable] + cls.add_instance_attribute('prob', 'uint32_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::retryCount [variable] + cls.add_instance_attribute('retryCount', 'uint32_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::successHist [variable] + cls.add_instance_attribute('successHist', 'uint64_t', is_const=False) + ## minstrel-wifi-manager.h: ns3::RateInfo::throughput [variable] + cls.add_instance_attribute('throughput', 'uint32_t', is_const=False) + return + +def register_Ns3Ssid_methods(root_module, cls): + cls.add_output_stream_operator() + ## ssid.h: ns3::Ssid::Ssid(ns3::Ssid const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Ssid const &', 'arg0')]) + ## ssid.h: ns3::Ssid::Ssid() [constructor] + cls.add_constructor([]) + ## ssid.h: ns3::Ssid::Ssid(std::string s) [constructor] + cls.add_constructor([param('std::string', 's')]) + ## ssid.h: ns3::Ssid::Ssid(char const * ssid, uint8_t length) [constructor] + cls.add_constructor([param('char const *', 'ssid'), param('uint8_t', 'length')]) + ## ssid.h: ns3::Buffer::Iterator ns3::Ssid::Deserialize(ns3::Buffer::Iterator i) [member function] + cls.add_method('Deserialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'i')]) + ## ssid.h: uint32_t ns3::Ssid::GetLength() const [member function] + cls.add_method('GetLength', + 'uint32_t', + [], + is_const=True) + ## ssid.h: uint32_t ns3::Ssid::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## ssid.h: bool ns3::Ssid::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True) + ## ssid.h: bool ns3::Ssid::IsEqual(ns3::Ssid const & o) const [member function] + cls.add_method('IsEqual', + 'bool', + [param('ns3::Ssid const &', 'o')], + is_const=True) + ## ssid.h: char * ns3::Ssid::PeekString() const [member function] + cls.add_method('PeekString', + 'char *', + [], + is_const=True) + ## ssid.h: ns3::Buffer::Iterator ns3::Ssid::Serialize(ns3::Buffer::Iterator i) const [member function] + cls.add_method('Serialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'i')], + is_const=True) + return + +def register_Ns3StatusCode_methods(root_module, cls): + cls.add_output_stream_operator() + ## status-code.h: ns3::StatusCode::StatusCode(ns3::StatusCode const & arg0) [copy constructor] + cls.add_constructor([param('ns3::StatusCode const &', 'arg0')]) + ## status-code.h: ns3::StatusCode::StatusCode() [constructor] + cls.add_constructor([]) + ## status-code.h: ns3::Buffer::Iterator ns3::StatusCode::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'start')]) + ## status-code.h: uint32_t ns3::StatusCode::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## status-code.h: bool ns3::StatusCode::IsSuccess() const [member function] + cls.add_method('IsSuccess', + 'bool', + [], + is_const=True) + ## status-code.h: ns3::Buffer::Iterator ns3::StatusCode::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True) + ## status-code.h: void ns3::StatusCode::SetFailure() [member function] + cls.add_method('SetFailure', + 'void', + []) + ## status-code.h: void ns3::StatusCode::SetSuccess() [member function] + cls.add_method('SetSuccess', + 'void', + []) + return + +def register_Ns3SupportedRates_methods(root_module, cls): + cls.add_output_stream_operator() + ## supported-rates.h: ns3::SupportedRates::SupportedRates(ns3::SupportedRates const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SupportedRates const &', 'arg0')]) + ## supported-rates.h: ns3::SupportedRates::SupportedRates() [constructor] + cls.add_constructor([]) + ## supported-rates.h: void ns3::SupportedRates::AddSupportedRate(uint32_t bs) [member function] + cls.add_method('AddSupportedRate', + 'void', + [param('uint32_t', 'bs')]) + ## supported-rates.h: ns3::Buffer::Iterator ns3::SupportedRates::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'start')]) + ## supported-rates.h: uint8_t ns3::SupportedRates::GetNRates() const [member function] + cls.add_method('GetNRates', + 'uint8_t', + [], + is_const=True) + ## supported-rates.h: uint32_t ns3::SupportedRates::GetRate(uint8_t i) const [member function] + cls.add_method('GetRate', + 'uint32_t', + [param('uint8_t', 'i')], + is_const=True) + ## supported-rates.h: uint32_t ns3::SupportedRates::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True) + ## supported-rates.h: bool ns3::SupportedRates::IsBasicRate(uint32_t bs) const [member function] + cls.add_method('IsBasicRate', + 'bool', + [param('uint32_t', 'bs')], + is_const=True) + ## supported-rates.h: bool ns3::SupportedRates::IsSupportedRate(uint32_t bs) const [member function] + cls.add_method('IsSupportedRate', + 'bool', + [param('uint32_t', 'bs')], + is_const=True) + ## supported-rates.h: ns3::Buffer::Iterator ns3::SupportedRates::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'ns3::Buffer::Iterator', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True) + ## supported-rates.h: void ns3::SupportedRates::SetBasicRate(uint32_t bs) [member function] + cls.add_method('SetBasicRate', + 'void', + [param('uint32_t', 'bs')]) + return + +def register_Ns3ThresholdsItem_methods(root_module, cls): + ## rraa-wifi-manager.h: ns3::ThresholdsItem::ThresholdsItem() [constructor] + cls.add_constructor([]) + ## rraa-wifi-manager.h: ns3::ThresholdsItem::ThresholdsItem(ns3::ThresholdsItem const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ThresholdsItem const &', 'arg0')]) + ## rraa-wifi-manager.h: ns3::ThresholdsItem::datarate [variable] + cls.add_instance_attribute('datarate', 'uint32_t', is_const=False) + ## rraa-wifi-manager.h: ns3::ThresholdsItem::ewnd [variable] + cls.add_instance_attribute('ewnd', 'uint32_t', is_const=False) + ## rraa-wifi-manager.h: ns3::ThresholdsItem::pmtl [variable] + cls.add_instance_attribute('pmtl', 'double', is_const=False) + ## rraa-wifi-manager.h: ns3::ThresholdsItem::pori [variable] + cls.add_instance_attribute('pori', 'double', is_const=False) + return + +def register_Ns3WifiMode_methods(root_module, cls): + cls.add_output_stream_operator() + cls.add_binary_comparison_operator('==') + ## wifi-mode.h: ns3::WifiMode::WifiMode(ns3::WifiMode const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiMode const &', 'arg0')]) + ## wifi-mode.h: ns3::WifiMode::WifiMode() [constructor] + cls.add_constructor([]) + ## wifi-mode.h: ns3::WifiMode::WifiMode(std::string name) [constructor] + cls.add_constructor([param('std::string', 'name')]) + ## wifi-mode.h: uint32_t ns3::WifiMode::GetBandwidth() const [member function] + cls.add_method('GetBandwidth', + 'uint32_t', + [], + is_const=True) + ## wifi-mode.h: uint8_t ns3::WifiMode::GetConstellationSize() const [member function] + cls.add_method('GetConstellationSize', + 'uint8_t', + [], + is_const=True) + ## wifi-mode.h: uint32_t ns3::WifiMode::GetDataRate() const [member function] + cls.add_method('GetDataRate', + 'uint32_t', + [], + is_const=True) + ## wifi-mode.h: ns3::WifiMode::ModulationType ns3::WifiMode::GetModulationType() const [member function] + cls.add_method('GetModulationType', + 'ns3::WifiMode::ModulationType', + [], + is_const=True) + ## wifi-mode.h: uint32_t ns3::WifiMode::GetPhyRate() const [member function] + cls.add_method('GetPhyRate', + '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', + [], + is_const=True) + ## wifi-mode.h: std::string ns3::WifiMode::GetUniqueName() const [member function] + cls.add_method('GetUniqueName', + 'std::string', + [], + is_const=True) + ## wifi-mode.h: bool ns3::WifiMode::IsMandatory() const [member function] + cls.add_method('IsMandatory', + 'bool', + [], + is_const=True) + ## wifi-mode.h: bool ns3::WifiMode::IsModulationBpsk() const [member function] + cls.add_method('IsModulationBpsk', + 'bool', + [], + is_const=True) + ## wifi-mode.h: bool ns3::WifiMode::IsModulationQam() const [member function] + cls.add_method('IsModulationQam', + 'bool', + [], + is_const=True) + return + +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, 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('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, 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('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, 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('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, 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('ns3::WifiPhyStandard', 'standard')], + is_static=True) + return + +def register_Ns3WifiPhyListener_methods(root_module, cls): + ## wifi-phy.h: ns3::WifiPhyListener::WifiPhyListener() [constructor] + cls.add_constructor([]) + ## wifi-phy.h: ns3::WifiPhyListener::WifiPhyListener(ns3::WifiPhyListener const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiPhyListener const &', 'arg0')]) + ## wifi-phy.h: void ns3::WifiPhyListener::NotifyMaybeCcaBusyStart(ns3::Time duration) [member function] + cls.add_method('NotifyMaybeCcaBusyStart', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhyListener::NotifyRxEndError() [member function] + cls.add_method('NotifyRxEndError', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhyListener::NotifyRxEndOk() [member function] + cls.add_method('NotifyRxEndOk', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhyListener::NotifyRxStart(ns3::Time duration) [member function] + cls.add_method('NotifyRxStart', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] + cls.add_method('NotifySwitchingStart', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration) [member function] + cls.add_method('NotifyTxStart', + 'void', + [param('ns3::Time', 'duration')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3WifiRemoteStation_methods(root_module, cls): + ## wifi-remote-station-manager.h: ns3::WifiRemoteStation::WifiRemoteStation(ns3::WifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiRemoteStation const &', 'arg0')]) + ## wifi-remote-station-manager.h: ns3::WifiRemoteStation::WifiRemoteStation() [constructor] + cls.add_constructor([]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::AddSupportedMode(ns3::WifiMode mode) [member function] + cls.add_method('AddSupportedMode', + 'void', + [param('ns3::WifiMode', 'mode')]) + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStation::GetAckMode(ns3::WifiMode dataMode) [member function] + cls.add_method('GetAckMode', + 'ns3::WifiMode', + [param('ns3::WifiMode', 'dataMode')]) + ## wifi-remote-station-manager.h: ns3::Mac48Address ns3::WifiRemoteStation::GetAddress() [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + []) + ## wifi-remote-station-manager.h: double ns3::WifiRemoteStation::GetAvgSlrc() const [member function] + cls.add_method('GetAvgSlrc', + 'double', + [], + is_const=True) + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStation::GetCtsMode(ns3::WifiMode rtsMode) [member function] + cls.add_method('GetCtsMode', + 'ns3::WifiMode', + [param('ns3::WifiMode', 'rtsMode')]) + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStation::GetDataMode(ns3::Ptr packet, uint32_t fullPacketSize) [member function] + cls.add_method('GetDataMode', + 'ns3::WifiMode', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fullPacketSize')]) + ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStation::GetFragmentOffset(ns3::Ptr packet, uint32_t fragmentNumber) [member function] + cls.add_method('GetFragmentOffset', + 'uint32_t', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fragmentNumber')], + is_virtual=True) + ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStation::GetFragmentSize(ns3::Ptr packet, uint32_t fragmentNumber) [member function] + cls.add_method('GetFragmentSize', + 'uint32_t', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fragmentNumber')], + is_virtual=True) + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStation::GetRtsMode(ns3::Ptr packet) [member function] + cls.add_method('GetRtsMode', + 'ns3::WifiMode', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-remote-station-manager.h: static ns3::TypeId ns3::WifiRemoteStation::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::IsAssociated() const [member function] + cls.add_method('IsAssociated', + 'bool', + [], + is_const=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::IsBrandNew() const [member function] + cls.add_method('IsBrandNew', + 'bool', + [], + is_const=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::IsLastFragment(ns3::Ptr packet, uint32_t fragmentNumber) [member function] + cls.add_method('IsLastFragment', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fragmentNumber')], + is_virtual=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::IsWaitAssocTxOk() const [member function] + cls.add_method('IsWaitAssocTxOk', + 'bool', + [], + is_const=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::NeedDataRetransmission(ns3::Ptr packet) [member function] + cls.add_method('NeedDataRetransmission', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'packet')], + is_virtual=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::NeedFragmentation(ns3::Ptr packet) [member function] + cls.add_method('NeedFragmentation', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'packet')], + is_virtual=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::NeedRts(ns3::Ptr packet) [member function] + cls.add_method('NeedRts', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'packet')], + is_virtual=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::NeedRtsRetransmission(ns3::Ptr packet) [member function] + cls.add_method('NeedRtsRetransmission', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'packet')], + is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::PrepareForQueue(ns3::Ptr packet, uint32_t fullPacketSize) [member function] + cls.add_method('PrepareForQueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fullPacketSize')]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::RecordDisassociated() [member function] + cls.add_method('RecordDisassociated', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::RecordGotAssocTxFailed() [member function] + cls.add_method('RecordGotAssocTxFailed', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::RecordGotAssocTxOk() [member function] + cls.add_method('RecordGotAssocTxOk', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::RecordWaitAssocTxOk() [member function] + cls.add_method('RecordWaitAssocTxOk', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::ReportDataFailed() [member function] + cls.add_method('ReportDataFailed', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::ReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('ReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::ReportFinalDataFailed() [member function] + cls.add_method('ReportFinalDataFailed', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::ReportFinalRtsFailed() [member function] + cls.add_method('ReportFinalRtsFailed', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::ReportRtsFailed() [member function] + cls.add_method('ReportRtsFailed', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::ReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('ReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::ReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('ReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::Reset() [member function] + cls.add_method('Reset', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')]) + ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStation::GetNSupportedModes() const [member function] + cls.add_method('GetNSupportedModes', + 'uint32_t', + [], + is_const=True, visibility='protected') + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStation::GetSupportedMode(uint32_t i) const [member function] + cls.add_method('GetSupportedMode', + 'ns3::WifiMode', + [param('uint32_t', 'i')], + is_const=True, visibility='protected') + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStation::DoGetDataMode(uint32_t size) [member function] + cls.add_method('DoGetDataMode', + 'ns3::WifiMode', + [param('uint32_t', 'size')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStation::DoGetRtsMode() [member function] + cls.add_method('DoGetRtsMode', + 'ns3::WifiMode', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::DoReportDataFailed() [member function] + cls.add_method('DoReportDataFailed', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('DoReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::DoReportFinalDataFailed() [member function] + cls.add_method('DoReportFinalDataFailed', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::DoReportFinalRtsFailed() [member function] + cls.add_method('DoReportFinalRtsFailed', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::DoReportRtsFailed() [member function] + cls.add_method('DoReportRtsFailed', + 'void', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('DoReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('DoReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## wifi-remote-station-manager.h: ns3::Ptr ns3::WifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3AmrrWifiRemoteStation_methods(root_module, cls): + ## amrr-wifi-manager.h: ns3::AmrrWifiRemoteStation::AmrrWifiRemoteStation(ns3::AmrrWifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AmrrWifiRemoteStation const &', 'arg0')]) + ## amrr-wifi-manager.h: ns3::AmrrWifiRemoteStation::AmrrWifiRemoteStation(ns3::Ptr stations) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::AmrrWifiManager >', 'stations')]) + ## amrr-wifi-manager.h: void ns3::AmrrWifiRemoteStation::DoReportDataFailed() [member function] + cls.add_method('DoReportDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## amrr-wifi-manager.h: void ns3::AmrrWifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('DoReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], + visibility='protected', is_virtual=True) + ## amrr-wifi-manager.h: void ns3::AmrrWifiRemoteStation::DoReportFinalDataFailed() [member function] + cls.add_method('DoReportFinalDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## amrr-wifi-manager.h: void ns3::AmrrWifiRemoteStation::DoReportFinalRtsFailed() [member function] + cls.add_method('DoReportFinalRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## amrr-wifi-manager.h: void ns3::AmrrWifiRemoteStation::DoReportRtsFailed() [member function] + cls.add_method('DoReportRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## amrr-wifi-manager.h: void ns3::AmrrWifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('DoReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], + visibility='protected', is_virtual=True) + ## amrr-wifi-manager.h: void ns3::AmrrWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('DoReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], + visibility='protected', is_virtual=True) + ## amrr-wifi-manager.h: ns3::WifiMode ns3::AmrrWifiRemoteStation::DoGetDataMode(uint32_t size) [member function] + cls.add_method('DoGetDataMode', + 'ns3::WifiMode', + [param('uint32_t', 'size')], + visibility='private', is_virtual=True) + ## amrr-wifi-manager.h: ns3::WifiMode ns3::AmrrWifiRemoteStation::DoGetRtsMode() [member function] + cls.add_method('DoGetRtsMode', + 'ns3::WifiMode', + [], + visibility='private', is_virtual=True) + ## amrr-wifi-manager.h: ns3::Ptr ns3::AmrrWifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3ArfWifiRemoteStation_methods(root_module, cls): + ## arf-wifi-manager.h: ns3::ArfWifiRemoteStation::ArfWifiRemoteStation(ns3::ArfWifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ArfWifiRemoteStation const &', 'arg0')]) + ## arf-wifi-manager.h: ns3::ArfWifiRemoteStation::ArfWifiRemoteStation(ns3::Ptr manager) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::ArfWifiManager >', 'manager')]) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::DoReportDataFailed() [member function] + cls.add_method('DoReportDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('DoReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], + visibility='protected', is_virtual=True) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::DoReportFinalDataFailed() [member function] + cls.add_method('DoReportFinalDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::DoReportFinalRtsFailed() [member function] + cls.add_method('DoReportFinalRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::DoReportRtsFailed() [member function] + cls.add_method('DoReportRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('DoReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], + visibility='protected', is_virtual=True) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('DoReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], + visibility='protected', is_virtual=True) + ## arf-wifi-manager.h: uint32_t ns3::ArfWifiRemoteStation::GetMinSuccessThreshold() [member function] + cls.add_method('GetMinSuccessThreshold', + 'uint32_t', + [], + visibility='protected') + ## arf-wifi-manager.h: uint32_t ns3::ArfWifiRemoteStation::GetMinTimerTimeout() [member function] + cls.add_method('GetMinTimerTimeout', + 'uint32_t', + [], + visibility='protected') + ## arf-wifi-manager.h: uint32_t ns3::ArfWifiRemoteStation::GetSuccessThreshold() [member function] + cls.add_method('GetSuccessThreshold', + 'uint32_t', + [], + visibility='protected') + ## arf-wifi-manager.h: uint32_t ns3::ArfWifiRemoteStation::GetTimerTimeout() [member function] + cls.add_method('GetTimerTimeout', + 'uint32_t', + [], + visibility='protected') + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::SetSuccessThreshold(uint32_t successThreshold) [member function] + cls.add_method('SetSuccessThreshold', + 'void', + [param('uint32_t', 'successThreshold')], + visibility='protected') + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::SetTimerTimeout(uint32_t timerTimeout) [member function] + cls.add_method('SetTimerTimeout', + 'void', + [param('uint32_t', 'timerTimeout')], + visibility='protected') + ## arf-wifi-manager.h: ns3::WifiMode ns3::ArfWifiRemoteStation::DoGetDataMode(uint32_t size) [member function] + cls.add_method('DoGetDataMode', + 'ns3::WifiMode', + [param('uint32_t', 'size')], + visibility='private', is_virtual=True) + ## arf-wifi-manager.h: ns3::WifiMode ns3::ArfWifiRemoteStation::DoGetRtsMode() [member function] + cls.add_method('DoGetRtsMode', + 'ns3::WifiMode', + [], + visibility='private', is_virtual=True) + ## arf-wifi-manager.h: ns3::Ptr ns3::ArfWifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True, visibility='private', is_virtual=True) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::ReportFailure() [member function] + cls.add_method('ReportFailure', + 'void', + [], + visibility='private', is_virtual=True) + ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::ReportRecoveryFailure() [member function] + cls.add_method('ReportRecoveryFailure', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3ConstantRateWifiRemoteStation_methods(root_module, cls): + ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiRemoteStation::ConstantRateWifiRemoteStation(ns3::ConstantRateWifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConstantRateWifiRemoteStation const &', 'arg0')]) + ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiRemoteStation::ConstantRateWifiRemoteStation(ns3::Ptr stations) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::ConstantRateWifiManager >', 'stations')]) + ## constant-rate-wifi-manager.h: void ns3::ConstantRateWifiRemoteStation::DoReportDataFailed() [member function] + cls.add_method('DoReportDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## constant-rate-wifi-manager.h: void ns3::ConstantRateWifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('DoReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], + visibility='protected', is_virtual=True) + ## constant-rate-wifi-manager.h: void ns3::ConstantRateWifiRemoteStation::DoReportFinalDataFailed() [member function] + cls.add_method('DoReportFinalDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## constant-rate-wifi-manager.h: void ns3::ConstantRateWifiRemoteStation::DoReportFinalRtsFailed() [member function] + cls.add_method('DoReportFinalRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## constant-rate-wifi-manager.h: void ns3::ConstantRateWifiRemoteStation::DoReportRtsFailed() [member function] + cls.add_method('DoReportRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## constant-rate-wifi-manager.h: void ns3::ConstantRateWifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('DoReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], + visibility='protected', is_virtual=True) + ## constant-rate-wifi-manager.h: void ns3::ConstantRateWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('DoReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], + visibility='protected', is_virtual=True) + ## constant-rate-wifi-manager.h: ns3::WifiMode ns3::ConstantRateWifiRemoteStation::DoGetDataMode(uint32_t size) [member function] + cls.add_method('DoGetDataMode', + 'ns3::WifiMode', + [param('uint32_t', 'size')], + visibility='private', is_virtual=True) + ## constant-rate-wifi-manager.h: ns3::WifiMode ns3::ConstantRateWifiRemoteStation::DoGetRtsMode() [member function] + cls.add_method('DoGetRtsMode', + 'ns3::WifiMode', + [], + visibility='private', is_virtual=True) + ## constant-rate-wifi-manager.h: ns3::Ptr ns3::ConstantRateWifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3IdealWifiRemoteStation_methods(root_module, cls): + ## ideal-wifi-manager.h: ns3::IdealWifiRemoteStation::IdealWifiRemoteStation(ns3::IdealWifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IdealWifiRemoteStation const &', 'arg0')]) + ## ideal-wifi-manager.h: ns3::IdealWifiRemoteStation::IdealWifiRemoteStation(ns3::Ptr stations) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::IdealWifiManager >', 'stations')]) + ## ideal-wifi-manager.h: void ns3::IdealWifiRemoteStation::DoReportDataFailed() [member function] + cls.add_method('DoReportDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## ideal-wifi-manager.h: void ns3::IdealWifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('DoReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], + visibility='protected', is_virtual=True) + ## ideal-wifi-manager.h: void ns3::IdealWifiRemoteStation::DoReportFinalDataFailed() [member function] + cls.add_method('DoReportFinalDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## ideal-wifi-manager.h: void ns3::IdealWifiRemoteStation::DoReportFinalRtsFailed() [member function] + cls.add_method('DoReportFinalRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## ideal-wifi-manager.h: void ns3::IdealWifiRemoteStation::DoReportRtsFailed() [member function] + cls.add_method('DoReportRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## ideal-wifi-manager.h: void ns3::IdealWifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('DoReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], + visibility='protected', is_virtual=True) + ## ideal-wifi-manager.h: void ns3::IdealWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('DoReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], + visibility='protected', is_virtual=True) + ## ideal-wifi-manager.h: ns3::WifiMode ns3::IdealWifiRemoteStation::DoGetDataMode(uint32_t size) [member function] + cls.add_method('DoGetDataMode', + 'ns3::WifiMode', + [param('uint32_t', 'size')], + visibility='private', is_virtual=True) + ## ideal-wifi-manager.h: ns3::WifiMode ns3::IdealWifiRemoteStation::DoGetRtsMode() [member function] + cls.add_method('DoGetRtsMode', + 'ns3::WifiMode', + [], + visibility='private', is_virtual=True) + ## ideal-wifi-manager.h: ns3::Ptr ns3::IdealWifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3MgtAssocRequestHeader_methods(root_module, cls): + ## mgt-headers.h: ns3::MgtAssocRequestHeader::MgtAssocRequestHeader(ns3::MgtAssocRequestHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MgtAssocRequestHeader const &', 'arg0')]) + ## mgt-headers.h: ns3::MgtAssocRequestHeader::MgtAssocRequestHeader() [constructor] + cls.add_constructor([]) + ## mgt-headers.h: uint32_t ns3::MgtAssocRequestHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## mgt-headers.h: ns3::TypeId ns3::MgtAssocRequestHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## mgt-headers.h: uint16_t ns3::MgtAssocRequestHeader::GetListenInterval() const [member function] + cls.add_method('GetListenInterval', + 'uint16_t', + [], + is_const=True) + ## mgt-headers.h: uint32_t ns3::MgtAssocRequestHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## mgt-headers.h: ns3::Ssid ns3::MgtAssocRequestHeader::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True) + ## mgt-headers.h: ns3::SupportedRates ns3::MgtAssocRequestHeader::GetSupportedRates() const [member function] + cls.add_method('GetSupportedRates', + 'ns3::SupportedRates', + [], + is_const=True) + ## mgt-headers.h: static ns3::TypeId ns3::MgtAssocRequestHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mgt-headers.h: void ns3::MgtAssocRequestHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## mgt-headers.h: void ns3::MgtAssocRequestHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## mgt-headers.h: void ns3::MgtAssocRequestHeader::SetListenInterval(uint16_t interval) [member function] + cls.add_method('SetListenInterval', + 'void', + [param('uint16_t', 'interval')]) + ## mgt-headers.h: void ns3::MgtAssocRequestHeader::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')]) + ## mgt-headers.h: void ns3::MgtAssocRequestHeader::SetSupportedRates(ns3::SupportedRates rates) [member function] + cls.add_method('SetSupportedRates', + 'void', + [param('ns3::SupportedRates', 'rates')]) + return + +def register_Ns3MgtAssocResponseHeader_methods(root_module, cls): + ## mgt-headers.h: ns3::MgtAssocResponseHeader::MgtAssocResponseHeader(ns3::MgtAssocResponseHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MgtAssocResponseHeader const &', 'arg0')]) + ## mgt-headers.h: ns3::MgtAssocResponseHeader::MgtAssocResponseHeader() [constructor] + cls.add_constructor([]) + ## mgt-headers.h: uint32_t ns3::MgtAssocResponseHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## mgt-headers.h: ns3::TypeId ns3::MgtAssocResponseHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## mgt-headers.h: uint32_t ns3::MgtAssocResponseHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## mgt-headers.h: ns3::StatusCode ns3::MgtAssocResponseHeader::GetStatusCode() [member function] + cls.add_method('GetStatusCode', + 'ns3::StatusCode', + []) + ## mgt-headers.h: ns3::SupportedRates ns3::MgtAssocResponseHeader::GetSupportedRates() [member function] + cls.add_method('GetSupportedRates', + 'ns3::SupportedRates', + []) + ## mgt-headers.h: static ns3::TypeId ns3::MgtAssocResponseHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mgt-headers.h: void ns3::MgtAssocResponseHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## mgt-headers.h: void ns3::MgtAssocResponseHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## mgt-headers.h: void ns3::MgtAssocResponseHeader::SetStatusCode(ns3::StatusCode code) [member function] + cls.add_method('SetStatusCode', + 'void', + [param('ns3::StatusCode', 'code')]) + ## mgt-headers.h: void ns3::MgtAssocResponseHeader::SetSupportedRates(ns3::SupportedRates rates) [member function] + cls.add_method('SetSupportedRates', + 'void', + [param('ns3::SupportedRates', 'rates')]) + return + +def register_Ns3MgtProbeRequestHeader_methods(root_module, cls): + ## mgt-headers.h: ns3::MgtProbeRequestHeader::MgtProbeRequestHeader() [constructor] + cls.add_constructor([]) + ## mgt-headers.h: ns3::MgtProbeRequestHeader::MgtProbeRequestHeader(ns3::MgtProbeRequestHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MgtProbeRequestHeader const &', 'arg0')]) + ## mgt-headers.h: uint32_t ns3::MgtProbeRequestHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## mgt-headers.h: ns3::TypeId ns3::MgtProbeRequestHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## mgt-headers.h: uint32_t ns3::MgtProbeRequestHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## mgt-headers.h: ns3::Ssid ns3::MgtProbeRequestHeader::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True) + ## mgt-headers.h: ns3::SupportedRates ns3::MgtProbeRequestHeader::GetSupportedRates() const [member function] + cls.add_method('GetSupportedRates', + 'ns3::SupportedRates', + [], + is_const=True) + ## mgt-headers.h: static ns3::TypeId ns3::MgtProbeRequestHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mgt-headers.h: void ns3::MgtProbeRequestHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## mgt-headers.h: void ns3::MgtProbeRequestHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## mgt-headers.h: void ns3::MgtProbeRequestHeader::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')]) + ## mgt-headers.h: void ns3::MgtProbeRequestHeader::SetSupportedRates(ns3::SupportedRates rates) [member function] + cls.add_method('SetSupportedRates', + 'void', + [param('ns3::SupportedRates', 'rates')]) + return + +def register_Ns3MgtProbeResponseHeader_methods(root_module, cls): + ## mgt-headers.h: ns3::MgtProbeResponseHeader::MgtProbeResponseHeader(ns3::MgtProbeResponseHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MgtProbeResponseHeader const &', 'arg0')]) + ## mgt-headers.h: ns3::MgtProbeResponseHeader::MgtProbeResponseHeader() [constructor] + cls.add_constructor([]) + ## mgt-headers.h: uint32_t ns3::MgtProbeResponseHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## mgt-headers.h: uint64_t ns3::MgtProbeResponseHeader::GetBeaconIntervalUs() const [member function] + cls.add_method('GetBeaconIntervalUs', + 'uint64_t', + [], + is_const=True) + ## mgt-headers.h: ns3::TypeId ns3::MgtProbeResponseHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## mgt-headers.h: uint32_t ns3::MgtProbeResponseHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## mgt-headers.h: ns3::Ssid ns3::MgtProbeResponseHeader::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True) + ## mgt-headers.h: ns3::SupportedRates ns3::MgtProbeResponseHeader::GetSupportedRates() const [member function] + cls.add_method('GetSupportedRates', + 'ns3::SupportedRates', + [], + is_const=True) + ## mgt-headers.h: uint64_t ns3::MgtProbeResponseHeader::GetTimestamp() [member function] + cls.add_method('GetTimestamp', + 'uint64_t', + []) + ## mgt-headers.h: static ns3::TypeId ns3::MgtProbeResponseHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## mgt-headers.h: void ns3::MgtProbeResponseHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## mgt-headers.h: void ns3::MgtProbeResponseHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## mgt-headers.h: void ns3::MgtProbeResponseHeader::SetBeaconIntervalUs(uint64_t us) [member function] + cls.add_method('SetBeaconIntervalUs', + 'void', + [param('uint64_t', 'us')]) + ## mgt-headers.h: void ns3::MgtProbeResponseHeader::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')]) + ## mgt-headers.h: void ns3::MgtProbeResponseHeader::SetSupportedRates(ns3::SupportedRates rates) [member function] + cls.add_method('SetSupportedRates', + 'void', + [param('ns3::SupportedRates', 'rates')]) + return + +def register_Ns3MinstrelWifiRemoteStation_methods(root_module, cls): + ## minstrel-wifi-manager.h: ns3::MinstrelWifiRemoteStation::MinstrelWifiRemoteStation(ns3::MinstrelWifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MinstrelWifiRemoteStation const &', 'arg0')]) + ## minstrel-wifi-manager.h: ns3::MinstrelWifiRemoteStation::MinstrelWifiRemoteStation(ns3::Ptr stations) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::MinstrelWifiManager >', 'stations')]) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportDataFailed() [member function] + cls.add_method('DoReportDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('DoReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], + visibility='protected', is_virtual=True) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportFinalDataFailed() [member function] + cls.add_method('DoReportFinalDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportFinalRtsFailed() [member function] + cls.add_method('DoReportFinalRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportRtsFailed() [member function] + cls.add_method('DoReportRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('DoReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], + visibility='protected', is_virtual=True) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('DoReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], + visibility='protected', is_virtual=True) + ## minstrel-wifi-manager.h: ns3::WifiMode ns3::MinstrelWifiRemoteStation::DoGetDataMode(uint32_t size) [member function] + cls.add_method('DoGetDataMode', + 'ns3::WifiMode', + [param('uint32_t', 'size')], + visibility='private', is_virtual=True) + ## minstrel-wifi-manager.h: ns3::WifiMode ns3::MinstrelWifiRemoteStation::DoGetRtsMode() [member function] + cls.add_method('DoGetRtsMode', + 'ns3::WifiMode', + [], + visibility='private', is_virtual=True) + ## minstrel-wifi-manager.h: ns3::Ptr ns3::MinstrelWifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3OnoeWifiRemoteStation_methods(root_module, cls): + ## onoe-wifi-manager.h: ns3::OnoeWifiRemoteStation::OnoeWifiRemoteStation(ns3::OnoeWifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::OnoeWifiRemoteStation const &', 'arg0')]) + ## onoe-wifi-manager.h: ns3::OnoeWifiRemoteStation::OnoeWifiRemoteStation(ns3::Ptr stations) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::OnoeWifiManager >', 'stations')]) + ## onoe-wifi-manager.h: void ns3::OnoeWifiRemoteStation::DoReportDataFailed() [member function] + cls.add_method('DoReportDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## onoe-wifi-manager.h: void ns3::OnoeWifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('DoReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], + visibility='protected', is_virtual=True) + ## onoe-wifi-manager.h: void ns3::OnoeWifiRemoteStation::DoReportFinalDataFailed() [member function] + cls.add_method('DoReportFinalDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## onoe-wifi-manager.h: void ns3::OnoeWifiRemoteStation::DoReportFinalRtsFailed() [member function] + cls.add_method('DoReportFinalRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## onoe-wifi-manager.h: void ns3::OnoeWifiRemoteStation::DoReportRtsFailed() [member function] + cls.add_method('DoReportRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## onoe-wifi-manager.h: void ns3::OnoeWifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('DoReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], + visibility='protected', is_virtual=True) + ## onoe-wifi-manager.h: void ns3::OnoeWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('DoReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], + visibility='protected', is_virtual=True) + ## onoe-wifi-manager.h: ns3::WifiMode ns3::OnoeWifiRemoteStation::DoGetDataMode(uint32_t size) [member function] + cls.add_method('DoGetDataMode', + 'ns3::WifiMode', + [param('uint32_t', 'size')], + visibility='private', is_virtual=True) + ## onoe-wifi-manager.h: ns3::WifiMode ns3::OnoeWifiRemoteStation::DoGetRtsMode() [member function] + cls.add_method('DoGetRtsMode', + 'ns3::WifiMode', + [], + visibility='private', is_virtual=True) + ## onoe-wifi-manager.h: ns3::Ptr ns3::OnoeWifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3PropagationDelayModel_methods(root_module, cls): + ## propagation-delay-model.h: ns3::PropagationDelayModel::PropagationDelayModel() [constructor] + cls.add_constructor([]) + ## propagation-delay-model.h: ns3::PropagationDelayModel::PropagationDelayModel(ns3::PropagationDelayModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PropagationDelayModel const &', 'arg0')]) + ## propagation-delay-model.h: ns3::Time ns3::PropagationDelayModel::GetDelay(ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('GetDelay', + 'ns3::Time', + [param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## propagation-delay-model.h: static ns3::TypeId ns3::PropagationDelayModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3PropagationLossModel_methods(root_module, cls): + ## propagation-loss-model.h: static ns3::TypeId ns3::PropagationLossModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## propagation-loss-model.h: ns3::PropagationLossModel::PropagationLossModel() [constructor] + cls.add_constructor([]) + ## propagation-loss-model.h: void ns3::PropagationLossModel::SetNext(ns3::Ptr next) [member function] + cls.add_method('SetNext', + 'void', + [param('ns3::Ptr< ns3::PropagationLossModel >', 'next')]) + ## propagation-loss-model.h: double ns3::PropagationLossModel::CalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('CalcRxPower', + 'double', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True) + ## propagation-loss-model.h: double ns3::PropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('DoCalcRxPower', + 'double', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3QosTag_methods(root_module, cls): + ## qos-tag.h: ns3::QosTag::QosTag(ns3::QosTag const & arg0) [copy constructor] + cls.add_constructor([param('ns3::QosTag const &', 'arg0')]) + ## qos-tag.h: ns3::QosTag::QosTag() [constructor] + cls.add_constructor([]) + ## qos-tag.h: ns3::QosTag::QosTag(uint8_t tid) [constructor] + cls.add_constructor([param('uint8_t', 'tid')]) + ## qos-tag.h: void ns3::QosTag::Deserialize(ns3::TagBuffer i) [member function] + cls.add_method('Deserialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_virtual=True) + ## qos-tag.h: uint8_t ns3::QosTag::Get() const [member function] + cls.add_method('Get', + 'uint8_t', + [], + is_const=True) + ## qos-tag.h: ns3::TypeId ns3::QosTag::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## qos-tag.h: uint32_t ns3::QosTag::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## qos-tag.h: static ns3::TypeId ns3::QosTag::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## qos-tag.h: void ns3::QosTag::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## qos-tag.h: void ns3::QosTag::Serialize(ns3::TagBuffer i) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::TagBuffer', 'i')], + is_const=True, is_virtual=True) + ## qos-tag.h: void ns3::QosTag::Set(uint8_t tid) [member function] + cls.add_method('Set', + 'void', + [param('uint8_t', 'tid')]) + return + +def register_Ns3RandomPropagationDelayModel_methods(root_module, cls): + ## propagation-delay-model.h: ns3::RandomPropagationDelayModel::RandomPropagationDelayModel(ns3::RandomPropagationDelayModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RandomPropagationDelayModel const &', 'arg0')]) + ## propagation-delay-model.h: ns3::RandomPropagationDelayModel::RandomPropagationDelayModel() [constructor] + cls.add_constructor([]) + ## propagation-delay-model.h: ns3::Time ns3::RandomPropagationDelayModel::GetDelay(ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('GetDelay', + 'ns3::Time', + [param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, is_virtual=True) + ## propagation-delay-model.h: static ns3::TypeId ns3::RandomPropagationDelayModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3RandomPropagationLossModel_methods(root_module, cls): + ## propagation-loss-model.h: static ns3::TypeId ns3::RandomPropagationLossModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## propagation-loss-model.h: ns3::RandomPropagationLossModel::RandomPropagationLossModel() [constructor] + cls.add_constructor([]) + ## propagation-loss-model.h: double ns3::RandomPropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('DoCalcRxPower', + 'double', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3RraaWifiRemoteStation_methods(root_module, cls): + ## rraa-wifi-manager.h: ns3::RraaWifiRemoteStation::RraaWifiRemoteStation(ns3::RraaWifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RraaWifiRemoteStation const &', 'arg0')]) + ## rraa-wifi-manager.h: ns3::RraaWifiRemoteStation::RraaWifiRemoteStation(ns3::Ptr stations) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::RraaWifiManager >', 'stations')]) + ## rraa-wifi-manager.h: bool ns3::RraaWifiRemoteStation::NeedRts(ns3::Ptr packet) [member function] + cls.add_method('NeedRts', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'packet')], + is_virtual=True) + ## rraa-wifi-manager.h: void ns3::RraaWifiRemoteStation::DoReportDataFailed() [member function] + cls.add_method('DoReportDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## rraa-wifi-manager.h: void ns3::RraaWifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] + cls.add_method('DoReportDataOk', + 'void', + [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], + visibility='protected', is_virtual=True) + ## rraa-wifi-manager.h: void ns3::RraaWifiRemoteStation::DoReportFinalDataFailed() [member function] + cls.add_method('DoReportFinalDataFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## rraa-wifi-manager.h: void ns3::RraaWifiRemoteStation::DoReportFinalRtsFailed() [member function] + cls.add_method('DoReportFinalRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## rraa-wifi-manager.h: void ns3::RraaWifiRemoteStation::DoReportRtsFailed() [member function] + cls.add_method('DoReportRtsFailed', + 'void', + [], + visibility='protected', is_virtual=True) + ## rraa-wifi-manager.h: void ns3::RraaWifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] + cls.add_method('DoReportRtsOk', + 'void', + [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], + visibility='protected', is_virtual=True) + ## rraa-wifi-manager.h: void ns3::RraaWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] + cls.add_method('DoReportRxOk', + 'void', + [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], + visibility='protected', is_virtual=True) + ## rraa-wifi-manager.h: ns3::WifiMode ns3::RraaWifiRemoteStation::DoGetDataMode(uint32_t size) [member function] + cls.add_method('DoGetDataMode', + 'ns3::WifiMode', + [param('uint32_t', 'size')], + visibility='private', is_virtual=True) + ## rraa-wifi-manager.h: ns3::WifiMode ns3::RraaWifiRemoteStation::DoGetRtsMode() [member function] + cls.add_method('DoGetRtsMode', + 'ns3::WifiMode', + [], + visibility='private', is_virtual=True) + ## rraa-wifi-manager.h: ns3::Ptr ns3::RraaWifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3SsidChecker_methods(root_module, cls): + ## ssid.h: ns3::SsidChecker::SsidChecker() [constructor] + cls.add_constructor([]) + ## ssid.h: ns3::SsidChecker::SsidChecker(ns3::SsidChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SsidChecker const &', 'arg0')]) + return + +def register_Ns3SsidValue_methods(root_module, cls): + ## ssid.h: ns3::SsidValue::SsidValue() [constructor] + cls.add_constructor([]) + ## ssid.h: ns3::SsidValue::SsidValue(ns3::SsidValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SsidValue const &', 'arg0')]) + ## ssid.h: ns3::SsidValue::SsidValue(ns3::Ssid const & value) [constructor] + cls.add_constructor([param('ns3::Ssid const &', 'value')]) + ## ssid.h: ns3::Ptr ns3::SsidValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## ssid.h: bool ns3::SsidValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## ssid.h: ns3::Ssid ns3::SsidValue::Get() const [member function] + cls.add_method('Get', + 'ns3::Ssid', + [], + is_const=True) + ## ssid.h: std::string ns3::SsidValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## ssid.h: void ns3::SsidValue::Set(ns3::Ssid const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::Ssid const &', 'value')]) + return + +def register_Ns3ThreeLogDistancePropagationLossModel_methods(root_module, cls): + ## propagation-loss-model.h: static ns3::TypeId ns3::ThreeLogDistancePropagationLossModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## propagation-loss-model.h: ns3::ThreeLogDistancePropagationLossModel::ThreeLogDistancePropagationLossModel() [constructor] + cls.add_constructor([]) + ## propagation-loss-model.h: double ns3::ThreeLogDistancePropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('DoCalcRxPower', + 'double', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3WifiMac_methods(root_module, cls): + ## wifi-mac.h: ns3::WifiMac::WifiMac() [constructor] + cls.add_constructor([]) + ## wifi-mac.h: ns3::WifiMac::WifiMac(ns3::WifiMac const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiMac const &', 'arg0')]) + ## wifi-mac.h: void ns3::WifiMac::ConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('ConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')]) + ## wifi-mac.h: void ns3::WifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: ns3::Time ns3::WifiMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: ns3::Mac48Address ns3::WifiMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: ns3::Mac48Address ns3::WifiMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: ns3::Time ns3::WifiMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: ns3::Time ns3::WifiMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: uint32_t ns3::WifiMac::GetMaxMsduSize() const [member function] + cls.add_method('GetMaxMsduSize', + 'uint32_t', + [], + is_const=True) + ## wifi-mac.h: ns3::Time ns3::WifiMac::GetMaxPropagationDelay() const [member function] + cls.add_method('GetMaxPropagationDelay', + 'ns3::Time', + [], + is_const=True) + ## wifi-mac.h: ns3::Time ns3::WifiMac::GetMsduLifetime() const [member function] + cls.add_method('GetMsduLifetime', + 'ns3::Time', + [], + is_const=True) + ## wifi-mac.h: ns3::Time ns3::WifiMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: ns3::Time ns3::WifiMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: ns3::Time ns3::WifiMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: ns3::Ssid ns3::WifiMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: static ns3::TypeId ns3::WifiMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-mac.h: void ns3::WifiMac::NotifyPromiscRx(ns3::Ptr packet) [member function] + cls.add_method('NotifyPromiscRx', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-mac.h: void ns3::WifiMac::NotifyRx(ns3::Ptr packet) [member function] + cls.add_method('NotifyRx', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-mac.h: void ns3::WifiMac::NotifyRxDrop(ns3::Ptr packet) [member function] + cls.add_method('NotifyRxDrop', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-mac.h: void ns3::WifiMac::NotifyTx(ns3::Ptr packet) [member function] + cls.add_method('NotifyTx', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-mac.h: void ns3::WifiMac::NotifyTxDrop(ns3::Ptr packet) [member function] + cls.add_method('NotifyTxDrop', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-mac.h: void ns3::WifiMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetMaxPropagationDelay(ns3::Time delay) [member function] + cls.add_method('SetMaxPropagationDelay', + 'void', + [param('ns3::Time', 'delay')]) + ## wifi-mac.h: void ns3::WifiMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_pure_virtual=True, is_virtual=True) + ## wifi-mac.h: bool ns3::WifiMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-mac.h: void ns3::WifiMac::ConfigureDcf(ns3::Ptr dcf, uint32_t cwmin, uint32_t cwmax, ns3::AccessClass ac) [member function] + cls.add_method('ConfigureDcf', + 'void', + [param('ns3::Ptr< ns3::Dcf >', 'dcf'), param('uint32_t', 'cwmin'), param('uint32_t', 'cwmax'), param('ns3::AccessClass', 'ac')], + visibility='protected') + ## wifi-mac.h: void ns3::WifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3WifiMacHeader_methods(root_module, cls): + ## wifi-mac-header.h: ns3::WifiMacHeader::WifiMacHeader(ns3::WifiMacHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiMacHeader const &', 'arg0')]) + ## wifi-mac-header.h: ns3::WifiMacHeader::WifiMacHeader() [constructor] + cls.add_constructor([]) + ## wifi-mac-header.h: uint32_t ns3::WifiMacHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## wifi-mac-header.h: ns3::Mac48Address ns3::WifiMacHeader::GetAddr1() const [member function] + cls.add_method('GetAddr1', + 'ns3::Mac48Address', + [], + is_const=True) + ## wifi-mac-header.h: ns3::Mac48Address ns3::WifiMacHeader::GetAddr2() const [member function] + cls.add_method('GetAddr2', + 'ns3::Mac48Address', + [], + is_const=True) + ## wifi-mac-header.h: ns3::Mac48Address ns3::WifiMacHeader::GetAddr3() const [member function] + cls.add_method('GetAddr3', + 'ns3::Mac48Address', + [], + is_const=True) + ## wifi-mac-header.h: ns3::Mac48Address ns3::WifiMacHeader::GetAddr4() const [member function] + cls.add_method('GetAddr4', + 'ns3::Mac48Address', + [], + is_const=True) + ## wifi-mac-header.h: ns3::Time ns3::WifiMacHeader::GetDuration() const [member function] + cls.add_method('GetDuration', + 'ns3::Time', + [], + is_const=True) + ## wifi-mac-header.h: uint16_t ns3::WifiMacHeader::GetFragmentNumber() const [member function] + cls.add_method('GetFragmentNumber', + 'uint16_t', + [], + is_const=True) + ## wifi-mac-header.h: ns3::TypeId ns3::WifiMacHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## wifi-mac-header.h: ns3::WifiMacHeader::QosAckPolicy ns3::WifiMacHeader::GetQosAckPolicy() const [member function] + cls.add_method('GetQosAckPolicy', + 'ns3::WifiMacHeader::QosAckPolicy', + [], + is_const=True) + ## wifi-mac-header.h: uint8_t ns3::WifiMacHeader::GetQosTid() const [member function] + cls.add_method('GetQosTid', + 'uint8_t', + [], + is_const=True) + ## wifi-mac-header.h: uint8_t ns3::WifiMacHeader::GetQosTxopLimit() const [member function] + cls.add_method('GetQosTxopLimit', + 'uint8_t', + [], + is_const=True) + ## wifi-mac-header.h: uint16_t ns3::WifiMacHeader::GetRawDuration() const [member function] + cls.add_method('GetRawDuration', + 'uint16_t', + [], + is_const=True) + ## wifi-mac-header.h: uint16_t ns3::WifiMacHeader::GetSequenceControl() const [member function] + cls.add_method('GetSequenceControl', + 'uint16_t', + [], + is_const=True) + ## wifi-mac-header.h: uint16_t ns3::WifiMacHeader::GetSequenceNumber() const [member function] + cls.add_method('GetSequenceNumber', + 'uint16_t', + [], + is_const=True) + ## wifi-mac-header.h: uint32_t ns3::WifiMacHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## wifi-mac-header.h: uint32_t ns3::WifiMacHeader::GetSize() const [member function] + cls.add_method('GetSize', + 'uint32_t', + [], + is_const=True) + ## wifi-mac-header.h: ns3::WifiMacType ns3::WifiMacHeader::GetType() const [member function] + cls.add_method('GetType', + 'ns3::WifiMacType', + [], + is_const=True) + ## wifi-mac-header.h: static ns3::TypeId ns3::WifiMacHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-mac-header.h: char const * ns3::WifiMacHeader::GetTypeString() const [member function] + cls.add_method('GetTypeString', + 'char const *', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsAck() const [member function] + cls.add_method('IsAck', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsAction() const [member function] + cls.add_method('IsAction', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsAssocReq() const [member function] + cls.add_method('IsAssocReq', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsAssocResp() const [member function] + cls.add_method('IsAssocResp', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsAuthentication() const [member function] + cls.add_method('IsAuthentication', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsBeacon() const [member function] + cls.add_method('IsBeacon', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsCfpoll() const [member function] + cls.add_method('IsCfpoll', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsCtl() const [member function] + cls.add_method('IsCtl', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsCts() const [member function] + cls.add_method('IsCts', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsData() const [member function] + cls.add_method('IsData', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsDeauthentication() const [member function] + cls.add_method('IsDeauthentication', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsDisassociation() const [member function] + cls.add_method('IsDisassociation', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsFromDs() const [member function] + cls.add_method('IsFromDs', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsMgt() const [member function] + cls.add_method('IsMgt', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsMoreFragments() const [member function] + cls.add_method('IsMoreFragments', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsMultihopAction() const [member function] + cls.add_method('IsMultihopAction', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsProbeReq() const [member function] + cls.add_method('IsProbeReq', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsProbeResp() const [member function] + cls.add_method('IsProbeResp', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsQosAck() const [member function] + cls.add_method('IsQosAck', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsQosAmsdu() const [member function] + cls.add_method('IsQosAmsdu', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsQosBlockAck() const [member function] + cls.add_method('IsQosBlockAck', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsQosData() const [member function] + cls.add_method('IsQosData', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsQosEosp() const [member function] + cls.add_method('IsQosEosp', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsQosNoAck() const [member function] + cls.add_method('IsQosNoAck', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsReassocReq() const [member function] + cls.add_method('IsReassocReq', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsReassocResp() const [member function] + cls.add_method('IsReassocResp', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsRetry() const [member function] + cls.add_method('IsRetry', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsRts() const [member function] + cls.add_method('IsRts', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsToDs() const [member function] + cls.add_method('IsToDs', + 'bool', + [], + is_const=True) + ## wifi-mac-header.h: void ns3::WifiMacHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## wifi-mac-header.h: void ns3::WifiMacHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetAction() [member function] + cls.add_method('SetAction', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetAddr1(ns3::Mac48Address address) [member function] + cls.add_method('SetAddr1', + 'void', + [param('ns3::Mac48Address', 'address')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetAddr2(ns3::Mac48Address address) [member function] + cls.add_method('SetAddr2', + 'void', + [param('ns3::Mac48Address', 'address')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetAddr3(ns3::Mac48Address address) [member function] + cls.add_method('SetAddr3', + 'void', + [param('ns3::Mac48Address', 'address')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetAddr4(ns3::Mac48Address address) [member function] + cls.add_method('SetAddr4', + 'void', + [param('ns3::Mac48Address', 'address')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetAssocReq() [member function] + cls.add_method('SetAssocReq', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetAssocResp() [member function] + cls.add_method('SetAssocResp', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetBeacon() [member function] + cls.add_method('SetBeacon', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetDsFrom() [member function] + cls.add_method('SetDsFrom', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetDsNotFrom() [member function] + cls.add_method('SetDsNotFrom', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetDsNotTo() [member function] + cls.add_method('SetDsNotTo', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetDsTo() [member function] + cls.add_method('SetDsTo', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetDuration(ns3::Time duration) [member function] + cls.add_method('SetDuration', + 'void', + [param('ns3::Time', 'duration')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetFragmentNumber(uint8_t frag) [member function] + cls.add_method('SetFragmentNumber', + 'void', + [param('uint8_t', 'frag')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetId(uint16_t id) [member function] + cls.add_method('SetId', + 'void', + [param('uint16_t', 'id')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetMoreFragments() [member function] + cls.add_method('SetMoreFragments', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetMultihopAction() [member function] + cls.add_method('SetMultihopAction', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetNoMoreFragments() [member function] + cls.add_method('SetNoMoreFragments', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetNoRetry() [member function] + cls.add_method('SetNoRetry', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetProbeReq() [member function] + cls.add_method('SetProbeReq', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetProbeResp() [member function] + cls.add_method('SetProbeResp', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetQosAckPolicy(ns3::WifiMacHeader::QosAckPolicy arg0) [member function] + cls.add_method('SetQosAckPolicy', + 'void', + [param('ns3::WifiMacHeader::QosAckPolicy', 'arg0')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetQosAmsdu() [member function] + cls.add_method('SetQosAmsdu', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetQosEosp() [member function] + cls.add_method('SetQosEosp', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetQosNoAmsdu() [member function] + cls.add_method('SetQosNoAmsdu', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetQosNoEosp() [member function] + cls.add_method('SetQosNoEosp', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetQosTid(uint8_t tid) [member function] + cls.add_method('SetQosTid', + 'void', + [param('uint8_t', 'tid')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetQosTxopLimit(uint8_t txop) [member function] + cls.add_method('SetQosTxopLimit', + 'void', + [param('uint8_t', 'txop')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetRawDuration(uint16_t duration) [member function] + cls.add_method('SetRawDuration', + 'void', + [param('uint16_t', 'duration')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetRetry() [member function] + cls.add_method('SetRetry', + 'void', + []) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetSequenceNumber(uint16_t seq) [member function] + cls.add_method('SetSequenceNumber', + 'void', + [param('uint16_t', 'seq')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetType(ns3::WifiMacType type) [member function] + cls.add_method('SetType', + 'void', + [param('ns3::WifiMacType', 'type')]) + ## wifi-mac-header.h: void ns3::WifiMacHeader::SetTypeData() [member function] + cls.add_method('SetTypeData', + 'void', + []) + return + +def register_Ns3WifiModeChecker_methods(root_module, cls): + ## wifi-mode.h: ns3::WifiModeChecker::WifiModeChecker() [constructor] + cls.add_constructor([]) + ## wifi-mode.h: ns3::WifiModeChecker::WifiModeChecker(ns3::WifiModeChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiModeChecker const &', 'arg0')]) + return + +def register_Ns3WifiModeValue_methods(root_module, cls): + ## wifi-mode.h: ns3::WifiModeValue::WifiModeValue() [constructor] + cls.add_constructor([]) + ## wifi-mode.h: ns3::WifiModeValue::WifiModeValue(ns3::WifiModeValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiModeValue const &', 'arg0')]) + ## wifi-mode.h: ns3::WifiModeValue::WifiModeValue(ns3::WifiMode const & value) [constructor] + cls.add_constructor([param('ns3::WifiMode const &', 'value')]) + ## wifi-mode.h: ns3::Ptr ns3::WifiModeValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## wifi-mode.h: bool ns3::WifiModeValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## wifi-mode.h: ns3::WifiMode ns3::WifiModeValue::Get() const [member function] + cls.add_method('Get', + 'ns3::WifiMode', + [], + is_const=True) + ## wifi-mode.h: std::string ns3::WifiModeValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## wifi-mode.h: void ns3::WifiModeValue::Set(ns3::WifiMode const & value) [member function] + cls.add_method('Set', + 'void', + [param('ns3::WifiMode const &', 'value')]) + return + +def register_Ns3WifiPhy_methods(root_module, cls): + ## wifi-phy.h: ns3::WifiPhy::WifiPhy(ns3::WifiPhy const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiPhy const &', 'arg0')]) + ## wifi-phy.h: ns3::WifiPhy::WifiPhy() [constructor] + cls.add_constructor([]) + ## wifi-phy.h: double ns3::WifiPhy::CalculateSnr(ns3::WifiMode txMode, double ber) const [member function] + cls.add_method('CalculateSnr', + 'double', + [param('ns3::WifiMode', 'txMode'), param('double', 'ber')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: ns3::Time ns3::WifiPhy::CalculateTxDuration(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) const [member function] + cls.add_method('CalculateTxDuration', + 'ns3::Time', + [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhy::ConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('ConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get11mbb() [member function] + cls.add_method('Get11mbb', + '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::Get12mb5Mhz() [member function] + cls.add_method('Get12mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get12mba() [member function] + cls.add_method('Get12mba', + '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: 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::Get18mba() [member function] + cls.add_method('Get18mba', + '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::Get1mbb() [member function] + cls.add_method('Get1mbb', + '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::Get24mba() [member function] + cls.add_method('Get24mba', + '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::Get2_25mb5Mhz() [member function] + cls.add_method('Get2_25mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get2mbb() [member function] + cls.add_method('Get2mbb', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get36mba() [member function] + cls.add_method('Get36mba', + '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::Get3mb5Mhz() [member function] + cls.add_method('Get3mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get48mba() [member function] + cls.add_method('Get48mba', + '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::Get4_5mb5Mhz() [member function] + cls.add_method('Get4_5mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get54mba() [member function] + cls.add_method('Get54mba', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get5_5mbb() [member function] + cls.add_method('Get5_5mbb', + '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::Get6mb5Mhz() [member function] + cls.add_method('Get6mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get6mba() [member function] + cls.add_method('Get6mba', + '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::Get9mb5Mhz() [member function] + cls.add_method('Get9mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get9mba() [member function] + cls.add_method('Get9mba', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: ns3::Ptr ns3::WifiPhy::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::WifiChannel >', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: uint16_t ns3::WifiPhy::GetChannelNumber() const [member function] + cls.add_method('GetChannelNumber', + 'uint16_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: ns3::Time ns3::WifiPhy::GetDelayUntilIdle() [member function] + cls.add_method('GetDelayUntilIdle', + 'ns3::Time', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: ns3::Time ns3::WifiPhy::GetLastRxStartTime() const [member function] + cls.add_method('GetLastRxStartTime', + 'ns3::Time', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: ns3::WifiMode ns3::WifiPhy::GetMode(uint32_t mode) const [member function] + cls.add_method('GetMode', + 'ns3::WifiMode', + [param('uint32_t', 'mode')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: uint32_t ns3::WifiPhy::GetNModes() const [member function] + cls.add_method('GetNModes', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: uint32_t ns3::WifiPhy::GetNTxPower() const [member function] + cls.add_method('GetNTxPower', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: ns3::Time ns3::WifiPhy::GetStateDuration() [member function] + cls.add_method('GetStateDuration', + 'ns3::Time', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: double ns3::WifiPhy::GetTxPowerEnd() const [member function] + cls.add_method('GetTxPowerEnd', + 'double', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: double ns3::WifiPhy::GetTxPowerStart() const [member function] + cls.add_method('GetTxPowerStart', + 'double', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-phy.h: static ns3::TypeId ns3::WifiPhy::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-phy.h: bool ns3::WifiPhy::IsStateBusy() [member function] + cls.add_method('IsStateBusy', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: bool ns3::WifiPhy::IsStateCcaBusy() [member function] + cls.add_method('IsStateCcaBusy', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: bool ns3::WifiPhy::IsStateIdle() [member function] + cls.add_method('IsStateIdle', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: bool ns3::WifiPhy::IsStateSync() [member function] + cls.add_method('IsStateSync', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: bool ns3::WifiPhy::IsStateTx() [member function] + cls.add_method('IsStateTx', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhy::NotifyPromiscSniffRx(ns3::Ptr packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) [member function] + cls.add_method('NotifyPromiscSniffRx', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('double', 'signalDbm'), param('double', 'noiseDbm')]) + ## wifi-phy.h: void ns3::WifiPhy::NotifyPromiscSniffTx(ns3::Ptr packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble) [member function] + cls.add_method('NotifyPromiscSniffTx', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble')]) + ## wifi-phy.h: void ns3::WifiPhy::NotifyRxBegin(ns3::Ptr packet) [member function] + cls.add_method('NotifyRxBegin', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-phy.h: void ns3::WifiPhy::NotifyRxDrop(ns3::Ptr packet) [member function] + cls.add_method('NotifyRxDrop', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-phy.h: void ns3::WifiPhy::NotifyRxEnd(ns3::Ptr packet) [member function] + cls.add_method('NotifyRxEnd', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-phy.h: void ns3::WifiPhy::NotifyTxBegin(ns3::Ptr packet) [member function] + cls.add_method('NotifyTxBegin', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-phy.h: void ns3::WifiPhy::NotifyTxDrop(ns3::Ptr packet) [member function] + cls.add_method('NotifyTxDrop', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-phy.h: void ns3::WifiPhy::NotifyTxEnd(ns3::Ptr packet) [member function] + cls.add_method('NotifyTxEnd', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-phy.h: void ns3::WifiPhy::RegisterListener(ns3::WifiPhyListener * listener) [member function] + cls.add_method('RegisterListener', + 'void', + [param('ns3::WifiPhyListener *', 'listener')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiMode mode, ns3::WifiPreamble preamble, uint8_t txPowerLevel) [member function] + cls.add_method('SendPacket', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble'), param('uint8_t', 'txPowerLevel')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhy::SetChannelNumber(uint16_t id) [member function] + cls.add_method('SetChannelNumber', + 'void', + [param('uint16_t', 'id')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhy::SetReceiveErrorCallback(ns3::Callback,double,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] + cls.add_method('SetReceiveErrorCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, double, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h: void ns3::WifiPhy::SetReceiveOkCallback(ns3::Callback,double,ns3::WifiMode,ns3::WifiPreamble,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] + cls.add_method('SetReceiveOkCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, double, ns3::WifiMode, ns3::WifiPreamble, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3WifiRemoteStationManager_methods(root_module, cls): + ## wifi-remote-station-manager.h: ns3::WifiRemoteStationManager::WifiRemoteStationManager(ns3::WifiRemoteStationManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiRemoteStationManager const &', 'arg0')]) + ## wifi-remote-station-manager.h: ns3::WifiRemoteStationManager::WifiRemoteStationManager() [constructor] + cls.add_constructor([]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStationManager::AddBasicMode(ns3::WifiMode mode) [member function] + cls.add_method('AddBasicMode', + 'void', + [param('ns3::WifiMode', 'mode')]) + ## wifi-remote-station-manager.h: __gnu_cxx::__normal_iterator > > ns3::WifiRemoteStationManager::BeginBasicModes() const [member function] + cls.add_method('BeginBasicModes', + '__gnu_cxx::__normal_iterator< ns3::WifiMode const *, std::vector< ns3::WifiMode > >', + [], + is_const=True) + ## wifi-remote-station-manager.h: __gnu_cxx::__normal_iterator > > ns3::WifiRemoteStationManager::EndBasicModes() const [member function] + cls.add_method('EndBasicModes', + '__gnu_cxx::__normal_iterator< ns3::WifiMode const *, std::vector< ns3::WifiMode > >', + [], + is_const=True) + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStationManager::GetBasicMode(uint32_t i) const [member function] + cls.add_method('GetBasicMode', + 'ns3::WifiMode', + [param('uint32_t', 'i')], + is_const=True) + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStationManager::GetDefaultMode() const [member function] + cls.add_method('GetDefaultMode', + 'ns3::WifiMode', + [], + is_const=True) + ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStationManager::GetFragmentationThreshold() const [member function] + cls.add_method('GetFragmentationThreshold', + 'uint32_t', + [], + is_const=True) + ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStationManager::GetMaxSlrc() const [member function] + cls.add_method('GetMaxSlrc', + 'uint32_t', + [], + is_const=True) + ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStationManager::GetMaxSsrc() const [member function] + cls.add_method('GetMaxSsrc', + 'uint32_t', + [], + is_const=True) + ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStationManager::GetNBasicModes() const [member function] + cls.add_method('GetNBasicModes', + 'uint32_t', + [], + is_const=True) + ## wifi-remote-station-manager.h: ns3::WifiMode ns3::WifiRemoteStationManager::GetNonUnicastMode() const [member function] + cls.add_method('GetNonUnicastMode', + 'ns3::WifiMode', + [], + is_const=True) + ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStationManager::GetRtsCtsThreshold() const [member function] + cls.add_method('GetRtsCtsThreshold', + 'uint32_t', + [], + is_const=True) + ## wifi-remote-station-manager.h: static ns3::TypeId ns3::WifiRemoteStationManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-remote-station-manager.h: bool ns3::WifiRemoteStationManager::IsLowLatency() const [member function] + cls.add_method('IsLowLatency', + 'bool', + [], + is_const=True) + ## wifi-remote-station-manager.h: ns3::WifiRemoteStation * ns3::WifiRemoteStationManager::Lookup(ns3::Mac48Address address) [member function] + cls.add_method('Lookup', + 'ns3::WifiRemoteStation *', + [param('ns3::Mac48Address', 'address')]) + ## wifi-remote-station-manager.h: ns3::WifiRemoteStation * ns3::WifiRemoteStationManager::LookupNonUnicast() [member function] + cls.add_method('LookupNonUnicast', + 'ns3::WifiRemoteStation *', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStationManager::Reset() [member function] + cls.add_method('Reset', + 'void', + []) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStationManager::SetFragmentationThreshold(uint32_t threshold) [member function] + cls.add_method('SetFragmentationThreshold', + 'void', + [param('uint32_t', 'threshold')]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStationManager::SetMaxSlrc(uint32_t maxSlrc) [member function] + cls.add_method('SetMaxSlrc', + 'void', + [param('uint32_t', 'maxSlrc')]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStationManager::SetMaxSsrc(uint32_t maxSsrc) [member function] + cls.add_method('SetMaxSsrc', + 'void', + [param('uint32_t', 'maxSsrc')]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStationManager::SetRtsCtsThreshold(uint32_t threshold) [member function] + cls.add_method('SetRtsCtsThreshold', + 'void', + [param('uint32_t', 'threshold')]) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStationManager::SetupPhy(ns3::Ptr phy) [member function] + cls.add_method('SetupPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## wifi-remote-station-manager.h: void ns3::WifiRemoteStationManager::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## wifi-remote-station-manager.h: ns3::WifiRemoteStation * ns3::WifiRemoteStationManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + return + +def register_Ns3YansWifiPhy_methods(root_module, cls): + ## yans-wifi-phy.h: static ns3::TypeId ns3::YansWifiPhy::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## yans-wifi-phy.h: ns3::YansWifiPhy::YansWifiPhy() [constructor] + cls.add_constructor([]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetChannel(ns3::Ptr channel) [member function] + cls.add_method('SetChannel', + 'void', + [param('ns3::Ptr< ns3::YansWifiChannel >', 'channel')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetChannelNumber(uint16_t id) [member function] + cls.add_method('SetChannelNumber', + 'void', + [param('uint16_t', 'id')], + is_virtual=True) + ## yans-wifi-phy.h: uint16_t ns3::YansWifiPhy::GetChannelNumber() const [member function] + cls.add_method('GetChannelNumber', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetChannelFrequencyMhz() const [member function] + cls.add_method('GetChannelFrequencyMhz', + 'double', + [], + is_const=True) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::StartReceivePacket(ns3::Ptr packet, double rxPowerDbm, ns3::WifiMode mode, ns3::WifiPreamble preamble) [member function] + cls.add_method('StartReceivePacket', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('double', 'rxPowerDbm'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetRxNoiseFigure(double noiseFigureDb) [member function] + cls.add_method('SetRxNoiseFigure', + 'void', + [param('double', 'noiseFigureDb')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetTxPowerStart(double start) [member function] + cls.add_method('SetTxPowerStart', + 'void', + [param('double', 'start')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetTxPowerEnd(double end) [member function] + cls.add_method('SetTxPowerEnd', + 'void', + [param('double', 'end')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetNTxPower(uint32_t n) [member function] + cls.add_method('SetNTxPower', + 'void', + [param('uint32_t', 'n')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetTxGain(double gain) [member function] + cls.add_method('SetTxGain', + 'void', + [param('double', 'gain')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetRxGain(double gain) [member function] + cls.add_method('SetRxGain', + 'void', + [param('double', 'gain')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetEdThreshold(double threshold) [member function] + cls.add_method('SetEdThreshold', + 'void', + [param('double', 'threshold')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetCcaMode1Threshold(double threshold) [member function] + cls.add_method('SetCcaMode1Threshold', + 'void', + [param('double', 'threshold')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetErrorRateModel(ns3::Ptr rate) [member function] + cls.add_method('SetErrorRateModel', + 'void', + [param('ns3::Ptr< ns3::ErrorRateModel >', 'rate')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetDevice(ns3::Ptr device) [member function] + cls.add_method('SetDevice', + 'void', + [param('ns3::Ptr< ns3::Object >', 'device')]) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetMobility(ns3::Ptr mobility) [member function] + cls.add_method('SetMobility', + 'void', + [param('ns3::Ptr< ns3::Object >', 'mobility')]) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetRxNoiseFigure() const [member function] + cls.add_method('GetRxNoiseFigure', + 'double', + [], + is_const=True) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetTxGain() const [member function] + cls.add_method('GetTxGain', + 'double', + [], + is_const=True) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetRxGain() const [member function] + cls.add_method('GetRxGain', + 'double', + [], + is_const=True) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetEdThreshold() const [member function] + cls.add_method('GetEdThreshold', + 'double', + [], + is_const=True) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetCcaMode1Threshold() const [member function] + cls.add_method('GetCcaMode1Threshold', + 'double', + [], + is_const=True) + ## yans-wifi-phy.h: ns3::Ptr ns3::YansWifiPhy::GetErrorRateModel() const [member function] + cls.add_method('GetErrorRateModel', + 'ns3::Ptr< ns3::ErrorRateModel >', + [], + is_const=True) + ## yans-wifi-phy.h: ns3::Ptr ns3::YansWifiPhy::GetDevice() const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::Object >', + [], + is_const=True) + ## yans-wifi-phy.h: ns3::Ptr ns3::YansWifiPhy::GetMobility() [member function] + cls.add_method('GetMobility', + 'ns3::Ptr< ns3::Object >', + []) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetTxPowerStart() const [member function] + cls.add_method('GetTxPowerStart', + 'double', + [], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetTxPowerEnd() const [member function] + cls.add_method('GetTxPowerEnd', + 'double', + [], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: uint32_t ns3::YansWifiPhy::GetNTxPower() const [member function] + cls.add_method('GetNTxPower', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetReceiveOkCallback(ns3::Callback,double,ns3::WifiMode,ns3::WifiPreamble,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] + cls.add_method('SetReceiveOkCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, double, ns3::WifiMode, ns3::WifiPreamble, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetReceiveErrorCallback(ns3::Callback,double,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] + cls.add_method('SetReceiveErrorCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, double, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiMode mode, ns3::WifiPreamble preamble, uint8_t txPowerLevel) [member function] + cls.add_method('SendPacket', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble'), param('uint8_t', 'txPowerLevel')], + is_virtual=True) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::RegisterListener(ns3::WifiPhyListener * listener) [member function] + cls.add_method('RegisterListener', + 'void', + [param('ns3::WifiPhyListener *', 'listener')], + is_virtual=True) + ## yans-wifi-phy.h: bool ns3::YansWifiPhy::IsStateCcaBusy() [member function] + cls.add_method('IsStateCcaBusy', + 'bool', + [], + is_virtual=True) + ## yans-wifi-phy.h: bool ns3::YansWifiPhy::IsStateIdle() [member function] + cls.add_method('IsStateIdle', + 'bool', + [], + is_virtual=True) + ## yans-wifi-phy.h: bool ns3::YansWifiPhy::IsStateBusy() [member function] + cls.add_method('IsStateBusy', + 'bool', + [], + is_virtual=True) + ## yans-wifi-phy.h: bool ns3::YansWifiPhy::IsStateSync() [member function] + cls.add_method('IsStateSync', + 'bool', + [], + is_virtual=True) + ## yans-wifi-phy.h: bool ns3::YansWifiPhy::IsStateTx() [member function] + cls.add_method('IsStateTx', + 'bool', + [], + is_virtual=True) + ## yans-wifi-phy.h: bool ns3::YansWifiPhy::IsStateSwitching() [member function] + cls.add_method('IsStateSwitching', + 'bool', + [], + is_virtual=True) + ## yans-wifi-phy.h: ns3::Time ns3::YansWifiPhy::GetStateDuration() [member function] + cls.add_method('GetStateDuration', + 'ns3::Time', + [], + is_virtual=True) + ## yans-wifi-phy.h: ns3::Time ns3::YansWifiPhy::GetDelayUntilIdle() [member function] + cls.add_method('GetDelayUntilIdle', + 'ns3::Time', + [], + is_virtual=True) + ## yans-wifi-phy.h: ns3::Time ns3::YansWifiPhy::GetLastRxStartTime() const [member function] + cls.add_method('GetLastRxStartTime', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: ns3::Time ns3::YansWifiPhy::CalculateTxDuration(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) const [member function] + cls.add_method('CalculateTxDuration', + 'ns3::Time', + [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: uint32_t ns3::YansWifiPhy::GetNModes() const [member function] + cls.add_method('GetNModes', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: ns3::WifiMode ns3::YansWifiPhy::GetMode(uint32_t mode) const [member function] + cls.add_method('GetMode', + 'ns3::WifiMode', + [param('uint32_t', 'mode')], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: double ns3::YansWifiPhy::CalculateSnr(ns3::WifiMode txMode, double ber) const [member function] + cls.add_method('CalculateSnr', + 'double', + [param('ns3::WifiMode', 'txMode'), param('double', 'ber')], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: ns3::Ptr ns3::YansWifiPhy::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::WifiChannel >', + [], + is_const=True, is_virtual=True) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::ConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('ConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + is_virtual=True) + ## yans-wifi-phy.h: void ns3::YansWifiPhy::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3AarfWifiRemoteStation_methods(root_module, cls): + ## aarf-wifi-manager.h: ns3::AarfWifiRemoteStation::AarfWifiRemoteStation(ns3::AarfWifiRemoteStation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AarfWifiRemoteStation const &', 'arg0')]) + ## aarf-wifi-manager.h: ns3::AarfWifiRemoteStation::AarfWifiRemoteStation(ns3::Ptr stations) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::AarfWifiManager >', 'stations')]) + ## aarf-wifi-manager.h: ns3::Ptr ns3::AarfWifiRemoteStation::GetManager() const [member function] + cls.add_method('GetManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True, visibility='private', is_virtual=True) + ## aarf-wifi-manager.h: void ns3::AarfWifiRemoteStation::ReportFailure() [member function] + cls.add_method('ReportFailure', + 'void', + [], + visibility='private', is_virtual=True) + ## aarf-wifi-manager.h: void ns3::AarfWifiRemoteStation::ReportRecoveryFailure() [member function] + cls.add_method('ReportRecoveryFailure', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3AdhocWifiMac_methods(root_module, cls): + ## adhoc-wifi-mac.h: static ns3::TypeId ns3::AdhocWifiMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## adhoc-wifi-mac.h: ns3::AdhocWifiMac::AdhocWifiMac() [constructor] + cls.add_constructor([]) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Time ns3::AdhocWifiMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Time ns3::AdhocWifiMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Time ns3::AdhocWifiMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Time ns3::AdhocWifiMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Time ns3::AdhocWifiMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Time ns3::AdhocWifiMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_virtual=True) + ## adhoc-wifi-mac.h: bool ns3::AdhocWifiMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Mac48Address ns3::AdhocWifiMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Ssid ns3::AdhocWifiMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_virtual=True) + ## adhoc-wifi-mac.h: ns3::Mac48Address ns3::AdhocWifiMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + visibility='private', is_virtual=True) + return + +def register_Ns3AmrrWifiManager_methods(root_module, cls): + ## amrr-wifi-manager.h: ns3::AmrrWifiManager::AmrrWifiManager(ns3::AmrrWifiManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AmrrWifiManager const &', 'arg0')]) + ## amrr-wifi-manager.h: ns3::AmrrWifiManager::AmrrWifiManager() [constructor] + cls.add_constructor([]) + ## amrr-wifi-manager.h: static ns3::TypeId ns3::AmrrWifiManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## amrr-wifi-manager.h: ns3::WifiRemoteStation * ns3::AmrrWifiManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3AmsduSubframeHeader_methods(root_module, cls): + ## amsdu-subframe-header.h: ns3::AmsduSubframeHeader::AmsduSubframeHeader(ns3::AmsduSubframeHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AmsduSubframeHeader const &', 'arg0')]) + ## amsdu-subframe-header.h: ns3::AmsduSubframeHeader::AmsduSubframeHeader() [constructor] + cls.add_constructor([]) + ## amsdu-subframe-header.h: uint32_t ns3::AmsduSubframeHeader::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## amsdu-subframe-header.h: ns3::Mac48Address ns3::AmsduSubframeHeader::GetDestinationAddr() const [member function] + cls.add_method('GetDestinationAddr', + 'ns3::Mac48Address', + [], + is_const=True) + ## amsdu-subframe-header.h: ns3::TypeId ns3::AmsduSubframeHeader::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## amsdu-subframe-header.h: uint16_t ns3::AmsduSubframeHeader::GetLength() const [member function] + cls.add_method('GetLength', + 'uint16_t', + [], + is_const=True) + ## amsdu-subframe-header.h: uint32_t ns3::AmsduSubframeHeader::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## amsdu-subframe-header.h: ns3::Mac48Address ns3::AmsduSubframeHeader::GetSourceAddr() const [member function] + cls.add_method('GetSourceAddr', + 'ns3::Mac48Address', + [], + is_const=True) + ## amsdu-subframe-header.h: static ns3::TypeId ns3::AmsduSubframeHeader::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## amsdu-subframe-header.h: void ns3::AmsduSubframeHeader::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## amsdu-subframe-header.h: void ns3::AmsduSubframeHeader::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + ## amsdu-subframe-header.h: void ns3::AmsduSubframeHeader::SetDestinationAddr(ns3::Mac48Address to) [member function] + cls.add_method('SetDestinationAddr', + 'void', + [param('ns3::Mac48Address', 'to')]) + ## amsdu-subframe-header.h: void ns3::AmsduSubframeHeader::SetLength(uint16_t arg0) [member function] + cls.add_method('SetLength', + 'void', + [param('uint16_t', 'arg0')]) + ## amsdu-subframe-header.h: void ns3::AmsduSubframeHeader::SetSourceAddr(ns3::Mac48Address to) [member function] + cls.add_method('SetSourceAddr', + 'void', + [param('ns3::Mac48Address', 'to')]) + return + +def register_Ns3ArfWifiManager_methods(root_module, cls): + ## arf-wifi-manager.h: ns3::ArfWifiManager::ArfWifiManager(ns3::ArfWifiManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ArfWifiManager const &', 'arg0')]) + ## arf-wifi-manager.h: ns3::ArfWifiManager::ArfWifiManager() [constructor] + cls.add_constructor([]) + ## arf-wifi-manager.h: static ns3::TypeId ns3::ArfWifiManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## arf-wifi-manager.h: ns3::WifiRemoteStation * ns3::ArfWifiManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3ConstantRateWifiManager_methods(root_module, cls): + ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiManager::ConstantRateWifiManager(ns3::ConstantRateWifiManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConstantRateWifiManager const &', 'arg0')]) + ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiManager::ConstantRateWifiManager() [constructor] + cls.add_constructor([]) + ## constant-rate-wifi-manager.h: ns3::WifiMode ns3::ConstantRateWifiManager::GetCtlMode() const [member function] + cls.add_method('GetCtlMode', + 'ns3::WifiMode', + [], + is_const=True) + ## constant-rate-wifi-manager.h: ns3::WifiMode ns3::ConstantRateWifiManager::GetDataMode() const [member function] + cls.add_method('GetDataMode', + 'ns3::WifiMode', + [], + is_const=True) + ## constant-rate-wifi-manager.h: static ns3::TypeId ns3::ConstantRateWifiManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## constant-rate-wifi-manager.h: ns3::WifiRemoteStation * ns3::ConstantRateWifiManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3ConstantSpeedPropagationDelayModel_methods(root_module, cls): + ## propagation-delay-model.h: ns3::ConstantSpeedPropagationDelayModel::ConstantSpeedPropagationDelayModel(ns3::ConstantSpeedPropagationDelayModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ConstantSpeedPropagationDelayModel const &', 'arg0')]) + ## propagation-delay-model.h: ns3::ConstantSpeedPropagationDelayModel::ConstantSpeedPropagationDelayModel() [constructor] + cls.add_constructor([]) + ## propagation-delay-model.h: ns3::Time ns3::ConstantSpeedPropagationDelayModel::GetDelay(ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('GetDelay', + 'ns3::Time', + [param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, is_virtual=True) + ## propagation-delay-model.h: double ns3::ConstantSpeedPropagationDelayModel::GetSpeed() const [member function] + cls.add_method('GetSpeed', + 'double', + [], + is_const=True) + ## propagation-delay-model.h: static ns3::TypeId ns3::ConstantSpeedPropagationDelayModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## propagation-delay-model.h: void ns3::ConstantSpeedPropagationDelayModel::SetSpeed(double speed) [member function] + cls.add_method('SetSpeed', + 'void', + [param('double', 'speed')]) + return + +def register_Ns3Dcf_methods(root_module, cls): + ## dcf.h: ns3::Dcf::Dcf() [constructor] + cls.add_constructor([]) + ## dcf.h: ns3::Dcf::Dcf(ns3::Dcf const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Dcf const &', 'arg0')]) + ## dcf.h: uint32_t ns3::Dcf::GetAifsn() const [member function] + cls.add_method('GetAifsn', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## dcf.h: uint32_t ns3::Dcf::GetMaxCw() const [member function] + cls.add_method('GetMaxCw', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## dcf.h: uint32_t ns3::Dcf::GetMinCw() const [member function] + cls.add_method('GetMinCw', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## dcf.h: static ns3::TypeId ns3::Dcf::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## dcf.h: void ns3::Dcf::SetAifsn(uint32_t aifsn) [member function] + cls.add_method('SetAifsn', + 'void', + [param('uint32_t', 'aifsn')], + is_pure_virtual=True, is_virtual=True) + ## dcf.h: void ns3::Dcf::SetMaxCw(uint32_t maxCw) [member function] + cls.add_method('SetMaxCw', + 'void', + [param('uint32_t', 'maxCw')], + is_pure_virtual=True, is_virtual=True) + ## dcf.h: void ns3::Dcf::SetMinCw(uint32_t minCw) [member function] + cls.add_method('SetMinCw', + 'void', + [param('uint32_t', 'minCw')], + is_pure_virtual=True, is_virtual=True) + return + +def register_Ns3EdcaTxopN_methods(root_module, cls): + ## edca-txop-n.h: static ns3::TypeId ns3::EdcaTxopN::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## edca-txop-n.h: ns3::EdcaTxopN::EdcaTxopN() [constructor] + cls.add_constructor([]) + ## edca-txop-n.h: void ns3::EdcaTxopN::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + is_virtual=True) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetLow(ns3::Ptr low) [member function] + cls.add_method('SetLow', + 'void', + [param('ns3::Ptr< ns3::MacLow >', 'low')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetTxMiddle(ns3::MacTxMiddle * txMiddle) [member function] + cls.add_method('SetTxMiddle', + 'void', + [param('ns3::MacTxMiddle *', 'txMiddle')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetManager(ns3::DcfManager * manager) [member function] + cls.add_method('SetManager', + 'void', + [param('ns3::DcfManager *', 'manager')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetTxOkCallback(ns3::Callback callback) [member function] + cls.add_method('SetTxOkCallback', + 'void', + [param('ns3::Callback< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetTxFailedCallback(ns3::Callback callback) [member function] + cls.add_method('SetTxFailedCallback', + 'void', + [param('ns3::Callback< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetWifiRemoteStationManager(ns3::Ptr remoteManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'remoteManager')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetTypeOfStation(ns3::TypeOfStation type) [member function] + cls.add_method('SetTypeOfStation', + 'void', + [param('ns3::TypeOfStation', 'type')]) + ## edca-txop-n.h: ns3::TypeOfStation ns3::EdcaTxopN::GetTypeOfStation() const [member function] + cls.add_method('GetTypeOfStation', + 'ns3::TypeOfStation', + [], + is_const=True) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetMaxQueueSize(uint32_t size) [member function] + cls.add_method('SetMaxQueueSize', + 'void', + [param('uint32_t', 'size')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetMaxQueueDelay(ns3::Time delay) [member function] + cls.add_method('SetMaxQueueDelay', + 'void', + [param('ns3::Time', 'delay')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetMinCw(uint32_t minCw) [member function] + cls.add_method('SetMinCw', + 'void', + [param('uint32_t', 'minCw')], + is_virtual=True) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetMaxCw(uint32_t maxCw) [member function] + cls.add_method('SetMaxCw', + 'void', + [param('uint32_t', 'maxCw')], + is_virtual=True) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetAifsn(uint32_t aifsn) [member function] + cls.add_method('SetAifsn', + 'void', + [param('uint32_t', 'aifsn')], + is_virtual=True) + ## edca-txop-n.h: uint32_t ns3::EdcaTxopN::GetMinCw() const [member function] + cls.add_method('GetMinCw', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## edca-txop-n.h: uint32_t ns3::EdcaTxopN::GetMaxCw() const [member function] + cls.add_method('GetMaxCw', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## edca-txop-n.h: uint32_t ns3::EdcaTxopN::GetAifsn() const [member function] + cls.add_method('GetAifsn', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## edca-txop-n.h: ns3::Ptr ns3::EdcaTxopN::Low() [member function] + cls.add_method('Low', + 'ns3::Ptr< ns3::MacLow >', + []) + ## edca-txop-n.h: ns3::Ptr ns3::EdcaTxopN::GetMsduAggregator() const [member function] + cls.add_method('GetMsduAggregator', + 'ns3::Ptr< ns3::MsduAggregator >', + [], + is_const=True) + ## edca-txop-n.h: bool ns3::EdcaTxopN::NeedsAccess() const [member function] + cls.add_method('NeedsAccess', + 'bool', + [], + is_const=True) + ## edca-txop-n.h: void ns3::EdcaTxopN::NotifyAccessGranted() [member function] + cls.add_method('NotifyAccessGranted', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::NotifyInternalCollision() [member function] + cls.add_method('NotifyInternalCollision', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::NotifyCollision() [member function] + cls.add_method('NotifyCollision', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::NotifyChannelSwitching() [member function] + cls.add_method('NotifyChannelSwitching', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::GotCts(double snr, ns3::WifiMode txMode) [member function] + cls.add_method('GotCts', + 'void', + [param('double', 'snr'), param('ns3::WifiMode', 'txMode')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::MissedCts() [member function] + cls.add_method('MissedCts', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::GotAck(double snr, ns3::WifiMode txMode) [member function] + cls.add_method('GotAck', + 'void', + [param('double', 'snr'), param('ns3::WifiMode', 'txMode')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::MissedAck() [member function] + cls.add_method('MissedAck', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::StartNext() [member function] + cls.add_method('StartNext', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::Cancel() [member function] + cls.add_method('Cancel', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::RestartAccessIfNeeded() [member function] + cls.add_method('RestartAccessIfNeeded', + 'void', + []) + ## edca-txop-n.h: void ns3::EdcaTxopN::StartAccessIfNeeded() [member function] + cls.add_method('StartAccessIfNeeded', + 'void', + []) + ## edca-txop-n.h: bool ns3::EdcaTxopN::NeedRts() [member function] + cls.add_method('NeedRts', + 'bool', + []) + ## edca-txop-n.h: bool ns3::EdcaTxopN::NeedRtsRetransmission() [member function] + cls.add_method('NeedRtsRetransmission', + 'bool', + []) + ## edca-txop-n.h: bool ns3::EdcaTxopN::NeedDataRetransmission() [member function] + cls.add_method('NeedDataRetransmission', + 'bool', + []) + ## edca-txop-n.h: bool ns3::EdcaTxopN::NeedFragmentation() const [member function] + cls.add_method('NeedFragmentation', + 'bool', + [], + is_const=True) + ## edca-txop-n.h: uint32_t ns3::EdcaTxopN::GetNextFragmentSize() [member function] + cls.add_method('GetNextFragmentSize', + 'uint32_t', + []) + ## edca-txop-n.h: uint32_t ns3::EdcaTxopN::GetFragmentSize() [member function] + cls.add_method('GetFragmentSize', + 'uint32_t', + []) + ## edca-txop-n.h: uint32_t ns3::EdcaTxopN::GetFragmentOffset() [member function] + cls.add_method('GetFragmentOffset', + 'uint32_t', + []) + ## edca-txop-n.h: ns3::WifiRemoteStation * ns3::EdcaTxopN::GetStation(ns3::Mac48Address to) const [member function] + cls.add_method('GetStation', + 'ns3::WifiRemoteStation *', + [param('ns3::Mac48Address', 'to')], + is_const=True) + ## edca-txop-n.h: bool ns3::EdcaTxopN::IsLastFragment() const [member function] + cls.add_method('IsLastFragment', + 'bool', + [], + is_const=True) + ## edca-txop-n.h: void ns3::EdcaTxopN::NextFragment() [member function] + cls.add_method('NextFragment', + 'void', + []) + ## edca-txop-n.h: ns3::Ptr ns3::EdcaTxopN::GetFragmentPacket(ns3::WifiMacHeader * hdr) [member function] + cls.add_method('GetFragmentPacket', + 'ns3::Ptr< ns3::Packet >', + [param('ns3::WifiMacHeader *', 'hdr')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::Queue(ns3::Ptr packet, ns3::WifiMacHeader const & hdr) [member function] + cls.add_method('Queue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const &', 'hdr')]) + ## edca-txop-n.h: void ns3::EdcaTxopN::SetMsduAggregator(ns3::Ptr aggr) [member function] + cls.add_method('SetMsduAggregator', + 'void', + [param('ns3::Ptr< ns3::MsduAggregator >', 'aggr')]) + return + +def register_Ns3ErrorRateModel_methods(root_module, cls): + ## error-rate-model.h: ns3::ErrorRateModel::ErrorRateModel() [constructor] + cls.add_constructor([]) + ## error-rate-model.h: ns3::ErrorRateModel::ErrorRateModel(ns3::ErrorRateModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ErrorRateModel const &', 'arg0')]) + ## error-rate-model.h: double ns3::ErrorRateModel::CalculateSnr(ns3::WifiMode txMode, double ber) const [member function] + cls.add_method('CalculateSnr', + 'double', + [param('ns3::WifiMode', 'txMode'), param('double', 'ber')], + is_const=True) + ## error-rate-model.h: double ns3::ErrorRateModel::GetChunkSuccessRate(ns3::WifiMode mode, double snr, uint32_t nbits) const [member function] + cls.add_method('GetChunkSuccessRate', + 'double', + [param('ns3::WifiMode', 'mode'), param('double', 'snr'), param('uint32_t', 'nbits')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## error-rate-model.h: static ns3::TypeId ns3::ErrorRateModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3FixedRssLossModel_methods(root_module, cls): + ## propagation-loss-model.h: static ns3::TypeId ns3::FixedRssLossModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## propagation-loss-model.h: ns3::FixedRssLossModel::FixedRssLossModel() [constructor] + cls.add_constructor([]) + ## propagation-loss-model.h: void ns3::FixedRssLossModel::SetRss(double rss) [member function] + cls.add_method('SetRss', + 'void', + [param('double', 'rss')]) + ## propagation-loss-model.h: double ns3::FixedRssLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('DoCalcRxPower', + 'double', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3FriisPropagationLossModel_methods(root_module, cls): + ## propagation-loss-model.h: static ns3::TypeId ns3::FriisPropagationLossModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## propagation-loss-model.h: ns3::FriisPropagationLossModel::FriisPropagationLossModel() [constructor] + cls.add_constructor([]) + ## propagation-loss-model.h: void ns3::FriisPropagationLossModel::SetLambda(double frequency, double speed) [member function] + cls.add_method('SetLambda', + 'void', + [param('double', 'frequency'), param('double', 'speed')]) + ## propagation-loss-model.h: void ns3::FriisPropagationLossModel::SetLambda(double lambda) [member function] + cls.add_method('SetLambda', + 'void', + [param('double', 'lambda')]) + ## propagation-loss-model.h: void ns3::FriisPropagationLossModel::SetSystemLoss(double systemLoss) [member function] + cls.add_method('SetSystemLoss', + 'void', + [param('double', 'systemLoss')]) + ## propagation-loss-model.h: void ns3::FriisPropagationLossModel::SetMinDistance(double minDistance) [member function] + cls.add_method('SetMinDistance', + 'void', + [param('double', 'minDistance')]) + ## propagation-loss-model.h: double ns3::FriisPropagationLossModel::GetMinDistance() const [member function] + cls.add_method('GetMinDistance', + 'double', + [], + is_const=True) + ## propagation-loss-model.h: double ns3::FriisPropagationLossModel::GetLambda() const [member function] + cls.add_method('GetLambda', + 'double', + [], + is_const=True) + ## propagation-loss-model.h: double ns3::FriisPropagationLossModel::GetSystemLoss() const [member function] + cls.add_method('GetSystemLoss', + 'double', + [], + is_const=True) + ## propagation-loss-model.h: double ns3::FriisPropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('DoCalcRxPower', + 'double', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3IdealWifiManager_methods(root_module, cls): + ## ideal-wifi-manager.h: ns3::IdealWifiManager::IdealWifiManager(ns3::IdealWifiManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::IdealWifiManager const &', 'arg0')]) + ## ideal-wifi-manager.h: ns3::IdealWifiManager::IdealWifiManager() [constructor] + cls.add_constructor([]) + ## ideal-wifi-manager.h: void ns3::IdealWifiManager::AddModeSnrThreshold(ns3::WifiMode mode, double ber) [member function] + cls.add_method('AddModeSnrThreshold', + 'void', + [param('ns3::WifiMode', 'mode'), param('double', 'ber')]) + ## ideal-wifi-manager.h: double ns3::IdealWifiManager::GetSnrThreshold(ns3::WifiMode mode) const [member function] + cls.add_method('GetSnrThreshold', + 'double', + [param('ns3::WifiMode', 'mode')], + is_const=True) + ## ideal-wifi-manager.h: static ns3::TypeId ns3::IdealWifiManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ideal-wifi-manager.h: void ns3::IdealWifiManager::SetupPhy(ns3::Ptr phy) [member function] + cls.add_method('SetupPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## ideal-wifi-manager.h: ns3::WifiRemoteStation * ns3::IdealWifiManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3JakesPropagationLossModel_methods(root_module, cls): + ## jakes-propagation-loss-model.h: ns3::JakesPropagationLossModel::JakesPropagationLossModel() [constructor] + cls.add_constructor([]) + ## 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: uint8_t ns3::JakesPropagationLossModel::GetNRays() const [member function] + cls.add_method('GetNRays', + 'uint8_t', + [], + is_const=True) + ## jakes-propagation-loss-model.h: static ns3::TypeId ns3::JakesPropagationLossModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## jakes-propagation-loss-model.h: void ns3::JakesPropagationLossModel::SetNOscillators(uint8_t nOscillators) [member function] + cls.add_method('SetNOscillators', + 'void', + [param('uint8_t', 'nOscillators')]) + ## jakes-propagation-loss-model.h: void ns3::JakesPropagationLossModel::SetNRays(uint8_t nRays) [member function] + cls.add_method('SetNRays', + 'void', + [param('uint8_t', 'nRays')]) + ## 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', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3LogDistancePropagationLossModel_methods(root_module, cls): + ## propagation-loss-model.h: static ns3::TypeId ns3::LogDistancePropagationLossModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## propagation-loss-model.h: ns3::LogDistancePropagationLossModel::LogDistancePropagationLossModel() [constructor] + cls.add_constructor([]) + ## propagation-loss-model.h: void ns3::LogDistancePropagationLossModel::SetPathLossExponent(double n) [member function] + cls.add_method('SetPathLossExponent', + 'void', + [param('double', 'n')]) + ## propagation-loss-model.h: double ns3::LogDistancePropagationLossModel::GetPathLossExponent() const [member function] + cls.add_method('GetPathLossExponent', + 'double', + [], + is_const=True) + ## propagation-loss-model.h: void ns3::LogDistancePropagationLossModel::SetReference(double referenceDistance, double referenceLoss) [member function] + cls.add_method('SetReference', + 'void', + [param('double', 'referenceDistance'), param('double', 'referenceLoss')]) + ## propagation-loss-model.h: double ns3::LogDistancePropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('DoCalcRxPower', + 'double', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3MacLow_methods(root_module, cls): + ## mac-low.h: ns3::MacLow::MacLow(ns3::MacLow const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MacLow const &', 'arg0')]) + ## mac-low.h: ns3::MacLow::MacLow() [constructor] + cls.add_constructor([]) + ## mac-low.h: ns3::Time ns3::MacLow::CalculateTransmissionTime(ns3::Ptr packet, ns3::WifiMacHeader const * hdr, ns3::MacLowTransmissionParameters const & parameters) const [member function] + cls.add_method('CalculateTransmissionTime', + 'ns3::Time', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const *', 'hdr'), param('ns3::MacLowTransmissionParameters const &', 'parameters')], + is_const=True) + ## mac-low.h: ns3::Time ns3::MacLow::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True) + ## mac-low.h: ns3::Mac48Address ns3::MacLow::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True) + ## mac-low.h: ns3::Mac48Address ns3::MacLow::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True) + ## mac-low.h: ns3::Time ns3::MacLow::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True) + ## mac-low.h: ns3::Time ns3::MacLow::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True) + ## mac-low.h: ns3::Time ns3::MacLow::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True) + ## mac-low.h: ns3::Time ns3::MacLow::GetSlotTime() const [member function] + cls.add_method('GetSlotTime', + 'ns3::Time', + [], + is_const=True) + ## mac-low.h: void ns3::MacLow::NotifySwitchingStartNow(ns3::Time duration) [member function] + cls.add_method('NotifySwitchingStartNow', + 'void', + [param('ns3::Time', 'duration')]) + ## mac-low.h: void ns3::MacLow::ReceiveError(ns3::Ptr packet, double rxSnr) [member function] + cls.add_method('ReceiveError', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('double', 'rxSnr')]) + ## mac-low.h: void ns3::MacLow::ReceiveOk(ns3::Ptr packet, double rxSnr, ns3::WifiMode txMode, ns3::WifiPreamble preamble) [member function] + cls.add_method('ReceiveOk', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode'), param('ns3::WifiPreamble', 'preamble')]) + ## mac-low.h: void ns3::MacLow::RegisterDcfListener(ns3::MacLowDcfListener * listener) [member function] + cls.add_method('RegisterDcfListener', + 'void', + [param('ns3::MacLowDcfListener *', 'listener')]) + ## mac-low.h: void ns3::MacLow::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')]) + ## mac-low.h: void ns3::MacLow::SetAddress(ns3::Mac48Address ad) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'ad')]) + ## mac-low.h: void ns3::MacLow::SetBssid(ns3::Mac48Address ad) [member function] + cls.add_method('SetBssid', + 'void', + [param('ns3::Mac48Address', 'ad')]) + ## mac-low.h: void ns3::MacLow::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')]) + ## mac-low.h: void ns3::MacLow::SetPhy(ns3::Ptr phy) [member function] + cls.add_method('SetPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')]) + ## mac-low.h: void ns3::MacLow::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')]) + ## mac-low.h: void ns3::MacLow::SetRxCallback(ns3::Callback, ns3::WifiMacHeader const*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function] + cls.add_method('SetRxCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::WifiMacHeader const *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## mac-low.h: void ns3::MacLow::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')]) + ## mac-low.h: void ns3::MacLow::SetSlotTime(ns3::Time slotTime) [member function] + cls.add_method('SetSlotTime', + 'void', + [param('ns3::Time', 'slotTime')]) + ## mac-low.h: void ns3::MacLow::SetWifiRemoteStationManager(ns3::Ptr manager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'manager')]) + ## mac-low.h: void ns3::MacLow::StartTransmission(ns3::Ptr packet, ns3::WifiMacHeader const * hdr, ns3::MacLowTransmissionParameters parameters, ns3::MacLowTransmissionListener * listener) [member function] + cls.add_method('StartTransmission', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const *', 'hdr'), param('ns3::MacLowTransmissionParameters', 'parameters'), param('ns3::MacLowTransmissionListener *', 'listener')]) + ## mac-low.h: void ns3::MacLow::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3MgtBeaconHeader_methods(root_module, cls): + ## mgt-headers.h: ns3::MgtBeaconHeader::MgtBeaconHeader() [constructor] + cls.add_constructor([]) + ## mgt-headers.h: ns3::MgtBeaconHeader::MgtBeaconHeader(ns3::MgtBeaconHeader const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MgtBeaconHeader const &', 'arg0')]) + return + +def register_Ns3MinstrelWifiManager_methods(root_module, cls): + ## minstrel-wifi-manager.h: ns3::MinstrelWifiManager::MinstrelWifiManager(ns3::MinstrelWifiManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MinstrelWifiManager const &', 'arg0')]) + ## minstrel-wifi-manager.h: ns3::MinstrelWifiManager::MinstrelWifiManager() [constructor] + cls.add_constructor([]) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiManager::AddCalcTxTime(ns3::WifiMode mode, ns3::Time t) [member function] + cls.add_method('AddCalcTxTime', + 'void', + [param('ns3::WifiMode', 'mode'), param('ns3::Time', 't')]) + ## minstrel-wifi-manager.h: ns3::Time ns3::MinstrelWifiManager::GetCalcTxTime(ns3::WifiMode mode) const [member function] + cls.add_method('GetCalcTxTime', + 'ns3::Time', + [param('ns3::WifiMode', 'mode')], + is_const=True) + ## minstrel-wifi-manager.h: static ns3::TypeId ns3::MinstrelWifiManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## minstrel-wifi-manager.h: void ns3::MinstrelWifiManager::SetupPhy(ns3::Ptr phy) [member function] + cls.add_method('SetupPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## minstrel-wifi-manager.h: ns3::WifiRemoteStation * ns3::MinstrelWifiManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3MsduAggregator_methods(root_module, cls): + ## msdu-aggregator.h: ns3::MsduAggregator::MsduAggregator() [constructor] + cls.add_constructor([]) + ## msdu-aggregator.h: ns3::MsduAggregator::MsduAggregator(ns3::MsduAggregator const & arg0) [copy constructor] + cls.add_constructor([param('ns3::MsduAggregator const &', 'arg0')]) + ## msdu-aggregator.h: bool ns3::MsduAggregator::Aggregate(ns3::Ptr packet, ns3::Ptr aggregatedPacket, ns3::Mac48Address src, ns3::Mac48Address dest) [member function] + cls.add_method('Aggregate', + 'bool', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'aggregatedPacket'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dest')], + is_pure_virtual=True, is_virtual=True) + ## msdu-aggregator.h: static std::list, ns3::AmsduSubframeHeader>, std::allocator, ns3::AmsduSubframeHeader> > > ns3::MsduAggregator::Deaggregate(ns3::Ptr aggregatedPacket) [member function] + cls.add_method('Deaggregate', + 'std::list< std::pair< ns3::Ptr< ns3::Packet >, ns3::AmsduSubframeHeader > >', + [param('ns3::Ptr< ns3::Packet >', 'aggregatedPacket')], + is_static=True) + ## msdu-aggregator.h: static ns3::TypeId ns3::MsduAggregator::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3NakagamiPropagationLossModel_methods(root_module, cls): + ## propagation-loss-model.h: static ns3::TypeId ns3::NakagamiPropagationLossModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## propagation-loss-model.h: ns3::NakagamiPropagationLossModel::NakagamiPropagationLossModel() [constructor] + cls.add_constructor([]) + ## propagation-loss-model.h: double ns3::NakagamiPropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] + cls.add_method('DoCalcRxPower', + 'double', + [param('double', 'txPowerDbm'), param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3NqapWifiMac_methods(root_module, cls): + ## nqap-wifi-mac.h: static ns3::TypeId ns3::NqapWifiMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## nqap-wifi-mac.h: ns3::NqapWifiMac::NqapWifiMac() [constructor] + cls.add_constructor([]) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_virtual=True) + ## nqap-wifi-mac.h: ns3::Time ns3::NqapWifiMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: ns3::Time ns3::NqapWifiMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: ns3::Time ns3::NqapWifiMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: ns3::Time ns3::NqapWifiMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: ns3::Time ns3::NqapWifiMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: ns3::Time ns3::NqapWifiMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_virtual=True) + ## nqap-wifi-mac.h: bool ns3::NqapWifiMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_virtual=True) + ## nqap-wifi-mac.h: ns3::Mac48Address ns3::NqapWifiMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: ns3::Ssid ns3::NqapWifiMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_virtual=True) + ## nqap-wifi-mac.h: ns3::Mac48Address ns3::NqapWifiMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::SetBeaconInterval(ns3::Time interval) [member function] + cls.add_method('SetBeaconInterval', + 'void', + [param('ns3::Time', 'interval')]) + ## nqap-wifi-mac.h: ns3::Time ns3::NqapWifiMac::GetBeaconInterval() const [member function] + cls.add_method('GetBeaconInterval', + 'ns3::Time', + [], + is_const=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::StartBeaconing() [member function] + cls.add_method('StartBeaconing', + 'void', + []) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## nqap-wifi-mac.h: void ns3::NqapWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + visibility='private', is_virtual=True) + return + +def register_Ns3NqstaWifiMac_methods(root_module, cls): + ## nqsta-wifi-mac.h: static ns3::TypeId ns3::NqstaWifiMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## nqsta-wifi-mac.h: ns3::NqstaWifiMac::NqstaWifiMac() [constructor] + cls.add_constructor([]) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Time ns3::NqstaWifiMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Time ns3::NqstaWifiMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Time ns3::NqstaWifiMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Time ns3::NqstaWifiMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Time ns3::NqstaWifiMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Time ns3::NqstaWifiMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_virtual=True) + ## nqsta-wifi-mac.h: bool ns3::NqstaWifiMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Mac48Address ns3::NqstaWifiMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Ssid ns3::NqstaWifiMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_virtual=True) + ## nqsta-wifi-mac.h: ns3::Mac48Address ns3::NqstaWifiMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetMaxMissedBeacons(uint32_t missed) [member function] + cls.add_method('SetMaxMissedBeacons', + 'void', + [param('uint32_t', 'missed')]) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetProbeRequestTimeout(ns3::Time timeout) [member function] + cls.add_method('SetProbeRequestTimeout', + 'void', + [param('ns3::Time', 'timeout')]) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::SetAssocRequestTimeout(ns3::Time timeout) [member function] + cls.add_method('SetAssocRequestTimeout', + 'void', + [param('ns3::Time', 'timeout')]) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::StartActiveAssociation() [member function] + cls.add_method('StartActiveAssociation', + 'void', + []) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + visibility='private', is_virtual=True) + return + +def register_Ns3OnoeWifiManager_methods(root_module, cls): + ## onoe-wifi-manager.h: ns3::OnoeWifiManager::OnoeWifiManager(ns3::OnoeWifiManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::OnoeWifiManager const &', 'arg0')]) + ## onoe-wifi-manager.h: ns3::OnoeWifiManager::OnoeWifiManager() [constructor] + cls.add_constructor([]) + ## onoe-wifi-manager.h: static ns3::TypeId ns3::OnoeWifiManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## onoe-wifi-manager.h: ns3::WifiRemoteStation * ns3::OnoeWifiManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3QadhocWifiMac_methods(root_module, cls): + ## qadhoc-wifi-mac.h: static ns3::TypeId ns3::QadhocWifiMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## qadhoc-wifi-mac.h: ns3::QadhocWifiMac::QadhocWifiMac() [constructor] + cls.add_constructor([]) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Time ns3::QadhocWifiMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Time ns3::QadhocWifiMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Time ns3::QadhocWifiMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Time ns3::QadhocWifiMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Time ns3::QadhocWifiMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Time ns3::QadhocWifiMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_virtual=True) + ## qadhoc-wifi-mac.h: bool ns3::QadhocWifiMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Mac48Address ns3::QadhocWifiMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Ssid ns3::QadhocWifiMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_virtual=True) + ## qadhoc-wifi-mac.h: ns3::Mac48Address ns3::QadhocWifiMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + visibility='private', is_virtual=True) + return + +def register_Ns3QapWifiMac_methods(root_module, cls): + ## qap-wifi-mac.h: static ns3::TypeId ns3::QapWifiMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## qap-wifi-mac.h: ns3::QapWifiMac::QapWifiMac() [constructor] + cls.add_constructor([]) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_virtual=True) + ## qap-wifi-mac.h: ns3::Time ns3::QapWifiMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: ns3::Time ns3::QapWifiMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: ns3::Time ns3::QapWifiMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: ns3::Time ns3::QapWifiMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: ns3::Time ns3::QapWifiMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: ns3::Time ns3::QapWifiMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_virtual=True) + ## qap-wifi-mac.h: bool ns3::QapWifiMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_virtual=True) + ## qap-wifi-mac.h: ns3::Mac48Address ns3::QapWifiMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: ns3::Ssid ns3::QapWifiMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_virtual=True) + ## qap-wifi-mac.h: ns3::Mac48Address ns3::QapWifiMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::SetBeaconInterval(ns3::Time interval) [member function] + cls.add_method('SetBeaconInterval', + 'void', + [param('ns3::Time', 'interval')]) + ## qap-wifi-mac.h: ns3::Time ns3::QapWifiMac::GetBeaconInterval() const [member function] + cls.add_method('GetBeaconInterval', + 'ns3::Time', + [], + is_const=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::StartBeaconing() [member function] + cls.add_method('StartBeaconing', + 'void', + []) + ## qap-wifi-mac.h: void ns3::QapWifiMac::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## qap-wifi-mac.h: void ns3::QapWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + visibility='private', is_virtual=True) + return + +def register_Ns3QstaWifiMac_methods(root_module, cls): + ## qsta-wifi-mac.h: static ns3::TypeId ns3::QstaWifiMac::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## qsta-wifi-mac.h: ns3::QstaWifiMac::QstaWifiMac() [constructor] + cls.add_constructor([]) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetSlot(ns3::Time slotTime) [member function] + cls.add_method('SetSlot', + 'void', + [param('ns3::Time', 'slotTime')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetSifs(ns3::Time sifs) [member function] + cls.add_method('SetSifs', + 'void', + [param('ns3::Time', 'sifs')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] + cls.add_method('SetEifsNoDifs', + 'void', + [param('ns3::Time', 'eifsNoDifs')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetAckTimeout(ns3::Time ackTimeout) [member function] + cls.add_method('SetAckTimeout', + 'void', + [param('ns3::Time', 'ackTimeout')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] + cls.add_method('SetCtsTimeout', + 'void', + [param('ns3::Time', 'ctsTimeout')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetPifs(ns3::Time pifs) [member function] + cls.add_method('SetPifs', + 'void', + [param('ns3::Time', 'pifs')], + is_virtual=True) + ## qsta-wifi-mac.h: ns3::Time ns3::QstaWifiMac::GetSlot() const [member function] + cls.add_method('GetSlot', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: ns3::Time ns3::QstaWifiMac::GetSifs() const [member function] + cls.add_method('GetSifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: ns3::Time ns3::QstaWifiMac::GetEifsNoDifs() const [member function] + cls.add_method('GetEifsNoDifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: ns3::Time ns3::QstaWifiMac::GetAckTimeout() const [member function] + cls.add_method('GetAckTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: ns3::Time ns3::QstaWifiMac::GetCtsTimeout() const [member function] + cls.add_method('GetCtsTimeout', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: ns3::Time ns3::QstaWifiMac::GetPifs() const [member function] + cls.add_method('GetPifs', + 'ns3::Time', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetWifiPhy(ns3::Ptr phy) [member function] + cls.add_method('SetWifiPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetWifiRemoteStationManager(ns3::Ptr stationManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::Enqueue(ns3::Ptr packet, ns3::Mac48Address to) [member function] + cls.add_method('Enqueue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], + is_virtual=True) + ## qsta-wifi-mac.h: bool ns3::QstaWifiMac::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetForwardUpCallback(ns3::Callback, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> upCallback) [member function] + cls.add_method('SetForwardUpCallback', + 'void', + [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetLinkUpCallback(ns3::Callback linkUp) [member function] + cls.add_method('SetLinkUpCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetLinkDownCallback(ns3::Callback linkDown) [member function] + cls.add_method('SetLinkDownCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], + is_virtual=True) + ## qsta-wifi-mac.h: ns3::Mac48Address ns3::QstaWifiMac::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: ns3::Ssid ns3::QstaWifiMac::GetSsid() const [member function] + cls.add_method('GetSsid', + 'ns3::Ssid', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetAddress(ns3::Mac48Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Mac48Address', 'address')], + is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetSsid(ns3::Ssid ssid) [member function] + cls.add_method('SetSsid', + 'void', + [param('ns3::Ssid', 'ssid')], + is_virtual=True) + ## qsta-wifi-mac.h: ns3::Mac48Address ns3::QstaWifiMac::GetBssid() const [member function] + cls.add_method('GetBssid', + 'ns3::Mac48Address', + [], + is_const=True, is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetMaxMissedBeacons(uint32_t missed) [member function] + cls.add_method('SetMaxMissedBeacons', + 'void', + [param('uint32_t', 'missed')]) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetProbeRequestTimeout(ns3::Time timeout) [member function] + cls.add_method('SetProbeRequestTimeout', + 'void', + [param('ns3::Time', 'timeout')]) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::SetAssocRequestTimeout(ns3::Time timeout) [member function] + cls.add_method('SetAssocRequestTimeout', + 'void', + [param('ns3::Time', 'timeout')]) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::StartActiveAssociation() [member function] + cls.add_method('StartActiveAssociation', + 'void', + []) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## qsta-wifi-mac.h: void ns3::QstaWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('FinishConfigureStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')], + visibility='private', is_virtual=True) + return + +def register_Ns3RraaWifiManager_methods(root_module, cls): + ## rraa-wifi-manager.h: ns3::RraaWifiManager::RraaWifiManager(ns3::RraaWifiManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::RraaWifiManager const &', 'arg0')]) + ## rraa-wifi-manager.h: ns3::RraaWifiManager::RraaWifiManager() [constructor] + cls.add_constructor([]) + ## rraa-wifi-manager.h: ns3::ThresholdsItem ns3::RraaWifiManager::GetThresholds(ns3::WifiMode mode) const [member function] + cls.add_method('GetThresholds', + 'ns3::ThresholdsItem', + [param('ns3::WifiMode', 'mode')], + is_const=True) + ## rraa-wifi-manager.h: ns3::Time ns3::RraaWifiManager::GetTimeout() const [member function] + cls.add_method('GetTimeout', + 'ns3::Time', + [], + is_const=True) + ## rraa-wifi-manager.h: static ns3::TypeId ns3::RraaWifiManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## rraa-wifi-manager.h: bool ns3::RraaWifiManager::OnlyBasic() [member function] + cls.add_method('OnlyBasic', + 'bool', + []) + ## rraa-wifi-manager.h: ns3::WifiRemoteStation * ns3::RraaWifiManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3WifiChannel_methods(root_module, cls): + ## wifi-channel.h: ns3::WifiChannel::WifiChannel() [constructor] + cls.add_constructor([]) + ## wifi-channel.h: ns3::WifiChannel::WifiChannel(ns3::WifiChannel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiChannel const &', 'arg0')]) + ## wifi-channel.h: static ns3::TypeId ns3::WifiChannel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3WifiNetDevice_methods(root_module, cls): + ## wifi-net-device.h: ns3::WifiNetDevice::WifiNetDevice(ns3::WifiNetDevice const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiNetDevice const &', 'arg0')]) + ## wifi-net-device.h: ns3::WifiNetDevice::WifiNetDevice() [constructor] + cls.add_constructor([]) + ## wifi-net-device.h: void ns3::WifiNetDevice::AddLinkChangeCallback(ns3::Callback callback) [member function] + cls.add_method('AddLinkChangeCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], + is_virtual=True) + ## wifi-net-device.h: ns3::Address ns3::WifiNetDevice::GetAddress() const [member function] + cls.add_method('GetAddress', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: ns3::Address ns3::WifiNetDevice::GetBroadcast() const [member function] + cls.add_method('GetBroadcast', + 'ns3::Address', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: ns3::Ptr ns3::WifiNetDevice::GetChannel() const [member function] + cls.add_method('GetChannel', + 'ns3::Ptr< ns3::Channel >', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: uint32_t ns3::WifiNetDevice::GetIfIndex() const [member function] + cls.add_method('GetIfIndex', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: ns3::Ptr ns3::WifiNetDevice::GetMac() const [member function] + cls.add_method('GetMac', + 'ns3::Ptr< ns3::WifiMac >', + [], + is_const=True) + ## wifi-net-device.h: uint16_t ns3::WifiNetDevice::GetMtu() const [member function] + cls.add_method('GetMtu', + 'uint16_t', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: ns3::Address ns3::WifiNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv4Address', 'multicastGroup')], + is_const=True, is_virtual=True) + ## wifi-net-device.h: ns3::Address ns3::WifiNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] + cls.add_method('GetMulticast', + 'ns3::Address', + [param('ns3::Ipv6Address', 'addr')], + is_const=True, is_virtual=True) + ## wifi-net-device.h: ns3::Ptr ns3::WifiNetDevice::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: ns3::Ptr ns3::WifiNetDevice::GetPhy() const [member function] + cls.add_method('GetPhy', + 'ns3::Ptr< ns3::WifiPhy >', + [], + is_const=True) + ## wifi-net-device.h: ns3::Ptr ns3::WifiNetDevice::GetRemoteStationManager() const [member function] + cls.add_method('GetRemoteStationManager', + 'ns3::Ptr< ns3::WifiRemoteStationManager >', + [], + is_const=True) + ## wifi-net-device.h: static ns3::TypeId ns3::WifiNetDevice::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-net-device.h: bool ns3::WifiNetDevice::IsBridge() const [member function] + cls.add_method('IsBridge', + 'bool', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: bool ns3::WifiNetDevice::IsBroadcast() const [member function] + cls.add_method('IsBroadcast', + 'bool', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: bool ns3::WifiNetDevice::IsLinkUp() const [member function] + cls.add_method('IsLinkUp', + 'bool', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: bool ns3::WifiNetDevice::IsMulticast() const [member function] + cls.add_method('IsMulticast', + 'bool', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: bool ns3::WifiNetDevice::IsPointToPoint() const [member function] + cls.add_method('IsPointToPoint', + 'bool', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: bool ns3::WifiNetDevice::NeedsArp() const [member function] + cls.add_method('NeedsArp', + 'bool', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: bool ns3::WifiNetDevice::Send(ns3::Ptr packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('Send', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## wifi-net-device.h: bool ns3::WifiNetDevice::SendFrom(ns3::Ptr packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] + cls.add_method('SendFrom', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], + is_virtual=True) + ## wifi-net-device.h: void ns3::WifiNetDevice::SetAddress(ns3::Address address) [member function] + cls.add_method('SetAddress', + 'void', + [param('ns3::Address', 'address')], + is_virtual=True) + ## wifi-net-device.h: void ns3::WifiNetDevice::SetIfIndex(uint32_t const index) [member function] + cls.add_method('SetIfIndex', + 'void', + [param('uint32_t const', 'index')], + is_virtual=True) + ## wifi-net-device.h: void ns3::WifiNetDevice::SetMac(ns3::Ptr mac) [member function] + cls.add_method('SetMac', + 'void', + [param('ns3::Ptr< ns3::WifiMac >', 'mac')]) + ## wifi-net-device.h: bool ns3::WifiNetDevice::SetMtu(uint16_t const mtu) [member function] + cls.add_method('SetMtu', + 'bool', + [param('uint16_t const', 'mtu')], + is_virtual=True) + ## wifi-net-device.h: void ns3::WifiNetDevice::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_virtual=True) + ## wifi-net-device.h: void ns3::WifiNetDevice::SetPhy(ns3::Ptr phy) [member function] + cls.add_method('SetPhy', + 'void', + [param('ns3::Ptr< ns3::WifiPhy >', 'phy')]) + ## wifi-net-device.h: void ns3::WifiNetDevice::SetPromiscReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetPromiscReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## wifi-net-device.h: void ns3::WifiNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] + cls.add_method('SetReceiveCallback', + 'void', + [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], + is_virtual=True) + ## wifi-net-device.h: void ns3::WifiNetDevice::SetRemoteStationManager(ns3::Ptr manager) [member function] + cls.add_method('SetRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'manager')]) + ## wifi-net-device.h: bool ns3::WifiNetDevice::SupportsSendFrom() const [member function] + cls.add_method('SupportsSendFrom', + 'bool', + [], + is_const=True, is_virtual=True) + ## wifi-net-device.h: void ns3::WifiNetDevice::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3YansErrorRateModel_methods(root_module, cls): + ## yans-error-rate-model.h: ns3::YansErrorRateModel::YansErrorRateModel(ns3::YansErrorRateModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::YansErrorRateModel const &', 'arg0')]) + ## yans-error-rate-model.h: ns3::YansErrorRateModel::YansErrorRateModel() [constructor] + cls.add_constructor([]) + ## yans-error-rate-model.h: double ns3::YansErrorRateModel::GetChunkSuccessRate(ns3::WifiMode mode, double snr, uint32_t nbits) const [member function] + cls.add_method('GetChunkSuccessRate', + 'double', + [param('ns3::WifiMode', 'mode'), param('double', 'snr'), param('uint32_t', 'nbits')], + is_const=True, is_virtual=True) + ## yans-error-rate-model.h: static ns3::TypeId ns3::YansErrorRateModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3YansWifiChannel_methods(root_module, cls): + ## yans-wifi-channel.h: ns3::YansWifiChannel::YansWifiChannel(ns3::YansWifiChannel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::YansWifiChannel const &', 'arg0')]) + ## yans-wifi-channel.h: ns3::YansWifiChannel::YansWifiChannel() [constructor] + cls.add_constructor([]) + ## yans-wifi-channel.h: void ns3::YansWifiChannel::Add(ns3::Ptr phy) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::YansWifiPhy >', 'phy')]) + ## yans-wifi-channel.h: ns3::Ptr ns3::YansWifiChannel::GetDevice(uint32_t i) const [member function] + cls.add_method('GetDevice', + 'ns3::Ptr< ns3::NetDevice >', + [param('uint32_t', 'i')], + is_const=True, is_virtual=True) + ## yans-wifi-channel.h: uint32_t ns3::YansWifiChannel::GetNDevices() const [member function] + cls.add_method('GetNDevices', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## yans-wifi-channel.h: static ns3::TypeId ns3::YansWifiChannel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## yans-wifi-channel.h: void ns3::YansWifiChannel::Send(ns3::Ptr sender, ns3::Ptr packet, double txPowerDbm, ns3::WifiMode wifiMode, ns3::WifiPreamble preamble) const [member function] + cls.add_method('Send', + 'void', + [param('ns3::Ptr< ns3::YansWifiPhy >', 'sender'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('double', 'txPowerDbm'), param('ns3::WifiMode', 'wifiMode'), param('ns3::WifiPreamble', 'preamble')], + is_const=True) + ## yans-wifi-channel.h: void ns3::YansWifiChannel::SetPropagationDelayModel(ns3::Ptr delay) [member function] + cls.add_method('SetPropagationDelayModel', + 'void', + [param('ns3::Ptr< ns3::PropagationDelayModel >', 'delay')]) + ## yans-wifi-channel.h: void ns3::YansWifiChannel::SetPropagationLossModel(ns3::Ptr loss) [member function] + cls.add_method('SetPropagationLossModel', + 'void', + [param('ns3::Ptr< ns3::PropagationLossModel >', 'loss')]) + return + +def register_Ns3AarfWifiManager_methods(root_module, cls): + ## aarf-wifi-manager.h: ns3::AarfWifiManager::AarfWifiManager(ns3::AarfWifiManager const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AarfWifiManager const &', 'arg0')]) + ## aarf-wifi-manager.h: ns3::AarfWifiManager::AarfWifiManager() [constructor] + cls.add_constructor([]) + ## aarf-wifi-manager.h: static ns3::TypeId ns3::AarfWifiManager::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## aarf-wifi-manager.h: ns3::WifiRemoteStation * ns3::AarfWifiManager::CreateStation() [member function] + cls.add_method('CreateStation', + 'ns3::WifiRemoteStation *', + [], + visibility='private', is_virtual=True) + return + +def register_Ns3DcaTxop_methods(root_module, cls): + ## dca-txop.h: static ns3::TypeId ns3::DcaTxop::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## dca-txop.h: ns3::DcaTxop::DcaTxop() [constructor] + cls.add_constructor([]) + ## dca-txop.h: void ns3::DcaTxop::SetLow(ns3::Ptr low) [member function] + cls.add_method('SetLow', + 'void', + [param('ns3::Ptr< ns3::MacLow >', 'low')]) + ## dca-txop.h: void ns3::DcaTxop::SetManager(ns3::DcfManager * manager) [member function] + cls.add_method('SetManager', + 'void', + [param('ns3::DcfManager *', 'manager')]) + ## dca-txop.h: void ns3::DcaTxop::SetWifiRemoteStationManager(ns3::Ptr remoteManager) [member function] + cls.add_method('SetWifiRemoteStationManager', + 'void', + [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'remoteManager')]) + ## dca-txop.h: void ns3::DcaTxop::SetTxOkCallback(ns3::Callback callback) [member function] + cls.add_method('SetTxOkCallback', + 'void', + [param('ns3::Callback< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## dca-txop.h: void ns3::DcaTxop::SetTxFailedCallback(ns3::Callback callback) [member function] + cls.add_method('SetTxFailedCallback', + 'void', + [param('ns3::Callback< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## dca-txop.h: void ns3::DcaTxop::SetMaxQueueSize(uint32_t size) [member function] + cls.add_method('SetMaxQueueSize', + 'void', + [param('uint32_t', 'size')]) + ## dca-txop.h: void ns3::DcaTxop::SetMaxQueueDelay(ns3::Time delay) [member function] + cls.add_method('SetMaxQueueDelay', + 'void', + [param('ns3::Time', 'delay')]) + ## dca-txop.h: void ns3::DcaTxop::SetMinCw(uint32_t minCw) [member function] + cls.add_method('SetMinCw', + 'void', + [param('uint32_t', 'minCw')], + is_virtual=True) + ## dca-txop.h: void ns3::DcaTxop::SetMaxCw(uint32_t maxCw) [member function] + cls.add_method('SetMaxCw', + 'void', + [param('uint32_t', 'maxCw')], + is_virtual=True) + ## dca-txop.h: void ns3::DcaTxop::SetAifsn(uint32_t aifsn) [member function] + cls.add_method('SetAifsn', + 'void', + [param('uint32_t', 'aifsn')], + is_virtual=True) + ## dca-txop.h: uint32_t ns3::DcaTxop::GetMinCw() const [member function] + cls.add_method('GetMinCw', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## dca-txop.h: uint32_t ns3::DcaTxop::GetMaxCw() const [member function] + cls.add_method('GetMaxCw', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## dca-txop.h: uint32_t ns3::DcaTxop::GetAifsn() const [member function] + cls.add_method('GetAifsn', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## dca-txop.h: void ns3::DcaTxop::Queue(ns3::Ptr packet, ns3::WifiMacHeader const & hdr) [member function] + cls.add_method('Queue', + 'void', + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const &', 'hdr')]) + ## dca-txop.h: void ns3::DcaTxop::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + return + +def register_functions(root_module): + module = root_module + ## ssid.h: extern ns3::Ptr ns3::MakeSsidChecker() [free function] + module.add_function('MakeSsidChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## wifi-mode.h: extern ns3::Ptr ns3::MakeWifiModeChecker() [free function] + module.add_function('MakeWifiModeChecker', + 'ns3::Ptr< ns3::AttributeChecker const >', + []) + ## qos-utils.h: extern uint8_t ns3::QosUtilsGetTidForPacket(ns3::Ptr packet) [free function] + module.add_function('QosUtilsGetTidForPacket', + 'uint8_t', + [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## qos-utils.h: extern ns3::AccessClass ns3::QosUtilsMapTidToAc(uint8_t tid) [free function] + module.add_function('QosUtilsMapTidToAc', + 'ns3::AccessClass', + [param('uint8_t', 'tid')]) + register_functions_ns3_Config(module.get_submodule('Config'), root_module) + register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) + register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) + register_functions_ns3_internal(module.get_submodule('internal'), root_module) + register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) + return + +def register_functions_ns3_Config(module, root_module): + return + +def register_functions_ns3_TimeStepPrecision(module, root_module): + return + +def register_functions_ns3_addressUtils(module, root_module): + return + +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + +def register_functions_ns3_internal(module, root_module): + return + +def register_functions_ns3_olsr(module, root_module): + return + diff --git a/bindings/python/ns3modulegen_generated.py b/bindings/python/apidefs/gcc-LP64/ns3modulegen_generated.py similarity index 65% rename from bindings/python/ns3modulegen_generated.py rename to bindings/python/apidefs/gcc-LP64/ns3modulegen_generated.py index 93400d54f..065ca142f 100644 --- a/bindings/python/ns3modulegen_generated.py +++ b/bindings/python/apidefs/gcc-LP64/ns3modulegen_generated.py @@ -16,28 +16,33 @@ import ns3_module_core import ns3_module_simulator import ns3_module_mobility import ns3_module_common -import ns3_module_contrib import ns3_module_node -import ns3_module_tap_bridge -import ns3_module_v4ping -import ns3_module_packet_sink -import ns3_module_stats -import ns3_module_onoff -import ns3_module_internet_stack +import ns3_module_contrib import ns3_module_point_to_point +import ns3_module_internet_stack +import ns3_module_tap_bridge import ns3_module_csma -import ns3_module_list_routing -import ns3_module_static_routing -import ns3_module_virtual_net_device import ns3_module_wifi +import ns3_module_static_routing +import ns3_module_v4ping +import ns3_module_virtual_net_device +import ns3_module_packet_sink +import ns3_module_global_routing +import ns3_module_stats +import ns3_module_list_routing import ns3_module_emu import ns3_module_bridge -import ns3_module_global_routing +import ns3_module_onoff import ns3_module_udp_echo -import ns3_module_olsr -import ns3_module_radvd import ns3_module_ping6 +import ns3_module_nix_vector_routing +import ns3_module_olsr +import ns3_module_flow_monitor +import ns3_module_radvd +import ns3_module_mesh import ns3_module_helper +import ns3_module_dot11s +import ns3_module_flame def module_init(): root_module = Module('ns3', cpp_namespace='::ns3') @@ -90,17 +95,6 @@ def register_types(module): ns3_module_common__local.register_types(module) root_module.end_section('ns3_module_common') - root_module.begin_section('ns3_module_contrib') - ns3_module_contrib.register_types(module) - - try: - import ns3_module_contrib__local - except ImportError: - pass - else: - ns3_module_contrib__local.register_types(module) - - root_module.end_section('ns3_module_contrib') root_module.begin_section('ns3_module_node') ns3_module_node.register_types(module) @@ -112,72 +106,17 @@ def register_types(module): ns3_module_node__local.register_types(module) root_module.end_section('ns3_module_node') - root_module.begin_section('ns3_module_tap_bridge') - ns3_module_tap_bridge.register_types(module) + root_module.begin_section('ns3_module_contrib') + ns3_module_contrib.register_types(module) try: - import ns3_module_tap_bridge__local + import ns3_module_contrib__local except ImportError: pass else: - ns3_module_tap_bridge__local.register_types(module) + ns3_module_contrib__local.register_types(module) - root_module.end_section('ns3_module_tap_bridge') - root_module.begin_section('ns3_module_v4ping') - ns3_module_v4ping.register_types(module) - - try: - import ns3_module_v4ping__local - except ImportError: - pass - else: - ns3_module_v4ping__local.register_types(module) - - root_module.end_section('ns3_module_v4ping') - root_module.begin_section('ns3_module_packet_sink') - ns3_module_packet_sink.register_types(module) - - try: - import ns3_module_packet_sink__local - except ImportError: - pass - else: - ns3_module_packet_sink__local.register_types(module) - - root_module.end_section('ns3_module_packet_sink') - root_module.begin_section('ns3_module_stats') - ns3_module_stats.register_types(module) - - try: - import ns3_module_stats__local - except ImportError: - pass - else: - ns3_module_stats__local.register_types(module) - - root_module.end_section('ns3_module_stats') - root_module.begin_section('ns3_module_onoff') - ns3_module_onoff.register_types(module) - - try: - import ns3_module_onoff__local - except ImportError: - pass - else: - ns3_module_onoff__local.register_types(module) - - root_module.end_section('ns3_module_onoff') - root_module.begin_section('ns3_module_internet_stack') - ns3_module_internet_stack.register_types(module) - - try: - import ns3_module_internet_stack__local - except ImportError: - pass - else: - ns3_module_internet_stack__local.register_types(module) - - root_module.end_section('ns3_module_internet_stack') + root_module.end_section('ns3_module_contrib') root_module.begin_section('ns3_module_point_to_point') ns3_module_point_to_point.register_types(module) @@ -189,6 +128,28 @@ def register_types(module): ns3_module_point_to_point__local.register_types(module) root_module.end_section('ns3_module_point_to_point') + root_module.begin_section('ns3_module_internet_stack') + ns3_module_internet_stack.register_types(module) + + try: + import ns3_module_internet_stack__local + except ImportError: + pass + else: + ns3_module_internet_stack__local.register_types(module) + + root_module.end_section('ns3_module_internet_stack') + root_module.begin_section('ns3_module_tap_bridge') + ns3_module_tap_bridge.register_types(module) + + try: + import ns3_module_tap_bridge__local + except ImportError: + pass + else: + ns3_module_tap_bridge__local.register_types(module) + + root_module.end_section('ns3_module_tap_bridge') root_module.begin_section('ns3_module_csma') ns3_module_csma.register_types(module) @@ -200,39 +161,6 @@ def register_types(module): ns3_module_csma__local.register_types(module) root_module.end_section('ns3_module_csma') - root_module.begin_section('ns3_module_list_routing') - ns3_module_list_routing.register_types(module) - - try: - import ns3_module_list_routing__local - except ImportError: - pass - else: - ns3_module_list_routing__local.register_types(module) - - root_module.end_section('ns3_module_list_routing') - root_module.begin_section('ns3_module_static_routing') - ns3_module_static_routing.register_types(module) - - try: - import ns3_module_static_routing__local - except ImportError: - pass - else: - ns3_module_static_routing__local.register_types(module) - - root_module.end_section('ns3_module_static_routing') - root_module.begin_section('ns3_module_virtual_net_device') - ns3_module_virtual_net_device.register_types(module) - - try: - import ns3_module_virtual_net_device__local - except ImportError: - pass - else: - ns3_module_virtual_net_device__local.register_types(module) - - root_module.end_section('ns3_module_virtual_net_device') root_module.begin_section('ns3_module_wifi') ns3_module_wifi.register_types(module) @@ -244,6 +172,83 @@ def register_types(module): ns3_module_wifi__local.register_types(module) root_module.end_section('ns3_module_wifi') + root_module.begin_section('ns3_module_static_routing') + ns3_module_static_routing.register_types(module) + + try: + import ns3_module_static_routing__local + except ImportError: + pass + else: + ns3_module_static_routing__local.register_types(module) + + root_module.end_section('ns3_module_static_routing') + root_module.begin_section('ns3_module_v4ping') + ns3_module_v4ping.register_types(module) + + try: + import ns3_module_v4ping__local + except ImportError: + pass + else: + ns3_module_v4ping__local.register_types(module) + + root_module.end_section('ns3_module_v4ping') + root_module.begin_section('ns3_module_virtual_net_device') + ns3_module_virtual_net_device.register_types(module) + + try: + import ns3_module_virtual_net_device__local + except ImportError: + pass + else: + ns3_module_virtual_net_device__local.register_types(module) + + root_module.end_section('ns3_module_virtual_net_device') + root_module.begin_section('ns3_module_packet_sink') + ns3_module_packet_sink.register_types(module) + + try: + import ns3_module_packet_sink__local + except ImportError: + pass + else: + ns3_module_packet_sink__local.register_types(module) + + root_module.end_section('ns3_module_packet_sink') + root_module.begin_section('ns3_module_global_routing') + ns3_module_global_routing.register_types(module) + + try: + import ns3_module_global_routing__local + except ImportError: + pass + else: + ns3_module_global_routing__local.register_types(module) + + root_module.end_section('ns3_module_global_routing') + root_module.begin_section('ns3_module_stats') + ns3_module_stats.register_types(module) + + try: + import ns3_module_stats__local + except ImportError: + pass + else: + ns3_module_stats__local.register_types(module) + + root_module.end_section('ns3_module_stats') + root_module.begin_section('ns3_module_list_routing') + ns3_module_list_routing.register_types(module) + + try: + import ns3_module_list_routing__local + except ImportError: + pass + else: + ns3_module_list_routing__local.register_types(module) + + root_module.end_section('ns3_module_list_routing') root_module.begin_section('ns3_module_emu') ns3_module_emu.register_types(module) @@ -266,17 +271,17 @@ def register_types(module): ns3_module_bridge__local.register_types(module) root_module.end_section('ns3_module_bridge') - root_module.begin_section('ns3_module_global_routing') - ns3_module_global_routing.register_types(module) + root_module.begin_section('ns3_module_onoff') + ns3_module_onoff.register_types(module) try: - import ns3_module_global_routing__local + import ns3_module_onoff__local except ImportError: pass else: - ns3_module_global_routing__local.register_types(module) + ns3_module_onoff__local.register_types(module) - root_module.end_section('ns3_module_global_routing') + root_module.end_section('ns3_module_onoff') root_module.begin_section('ns3_module_udp_echo') ns3_module_udp_echo.register_types(module) @@ -288,28 +293,6 @@ def register_types(module): ns3_module_udp_echo__local.register_types(module) root_module.end_section('ns3_module_udp_echo') - root_module.begin_section('ns3_module_olsr') - ns3_module_olsr.register_types(module) - - try: - import ns3_module_olsr__local - except ImportError: - pass - else: - ns3_module_olsr__local.register_types(module) - - root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_radvd') - ns3_module_radvd.register_types(module) - - try: - import ns3_module_radvd__local - except ImportError: - pass - else: - ns3_module_radvd__local.register_types(module) - - root_module.end_section('ns3_module_radvd') root_module.begin_section('ns3_module_ping6') ns3_module_ping6.register_types(module) @@ -321,6 +304,61 @@ def register_types(module): ns3_module_ping6__local.register_types(module) root_module.end_section('ns3_module_ping6') + root_module.begin_section('ns3_module_nix_vector_routing') + ns3_module_nix_vector_routing.register_types(module) + + try: + import ns3_module_nix_vector_routing__local + except ImportError: + pass + else: + ns3_module_nix_vector_routing__local.register_types(module) + + root_module.end_section('ns3_module_nix_vector_routing') + root_module.begin_section('ns3_module_olsr') + ns3_module_olsr.register_types(module) + + try: + import ns3_module_olsr__local + except ImportError: + pass + else: + ns3_module_olsr__local.register_types(module) + + root_module.end_section('ns3_module_olsr') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_types(module) + + try: + import ns3_module_flow_monitor__local + except ImportError: + pass + else: + ns3_module_flow_monitor__local.register_types(module) + + root_module.end_section('ns3_module_flow_monitor') + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_types(module) + + try: + import ns3_module_radvd__local + except ImportError: + pass + else: + ns3_module_radvd__local.register_types(module) + + root_module.end_section('ns3_module_radvd') + root_module.begin_section('ns3_module_mesh') + ns3_module_mesh.register_types(module) + + try: + import ns3_module_mesh__local + except ImportError: + pass + else: + ns3_module_mesh__local.register_types(module) + + root_module.end_section('ns3_module_mesh') root_module.begin_section('ns3_module_helper') ns3_module_helper.register_types(module) @@ -332,8 +370,39 @@ def register_types(module): ns3_module_helper__local.register_types(module) root_module.end_section('ns3_module_helper') + root_module.begin_section('ns3_module_dot11s') + ns3_module_dot11s.register_types(module) + + try: + import ns3_module_dot11s__local + except ImportError: + pass + else: + ns3_module_dot11s__local.register_types(module) + + root_module.end_section('ns3_module_dot11s') + root_module.begin_section('ns3_module_flame') + ns3_module_flame.register_types(module) + + try: + import ns3_module_flame__local + except ImportError: + pass + else: + ns3_module_flame__local.register_types(module) + + root_module.end_section('ns3_module_flame') + ## animation-interface.h: ns3::AnimationInterface [class] + module.add_class('AnimationInterface') + ## point-to-point-dumbbell-helper.h: ns3::PointToPointDumbbellHelper [class] + module.add_class('PointToPointDumbbellHelper', allow_subclassing=False) + ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper [class] + module.add_class('PointToPointGridHelper', allow_subclassing=False) + ## node-location.h: ns3::NodeLocation [class] + module.add_class('NodeLocation', parent=root_module['ns3::Object']) module.add_container('std::vector< unsigned int >', 'unsigned int', container_type='vector') module.add_container('std::vector< bool >', 'bool', container_type='vector') + module.add_container('std::vector< unsigned long >', 'long unsigned int', container_type='vector') module.add_container('std::list< unsigned int >', 'unsigned int', container_type='list') module.add_container('std::list< std::pair< ns3::Ptr< ns3::Packet >, ns3::AmsduSubframeHeader > >', 'std::pair< ns3::Ptr< ns3::Packet >, ns3::AmsduSubframeHeader >', container_type='list') @@ -355,6 +424,18 @@ def register_types(module): register_types_ns3_addressUtils(nested_module) + ## Register a nested module for the namespace dot11s + + nested_module = module.add_cpp_namespace('dot11s') + register_types_ns3_dot11s(nested_module) + + + ## Register a nested module for the namespace flame + + nested_module = module.add_cpp_namespace('flame') + register_types_ns3_flame(nested_module) + + ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') @@ -380,6 +461,14 @@ def register_types_ns3_addressUtils(module): root_module = module.get_root() +def register_types_ns3_dot11s(module): + root_module = module.get_root() + + +def register_types_ns3_flame(module): + root_module = module.get_root() + + def register_types_ns3_internal(module): root_module = module.get_root() @@ -389,6 +478,10 @@ def register_types_ns3_olsr(module): def register_methods(root_module): + register_Ns3AnimationInterface_methods(root_module, root_module['ns3::AnimationInterface']) + register_Ns3PointToPointDumbbellHelper_methods(root_module, root_module['ns3::PointToPointDumbbellHelper']) + register_Ns3PointToPointGridHelper_methods(root_module, root_module['ns3::PointToPointGridHelper']) + register_Ns3NodeLocation_methods(root_module, root_module['ns3::NodeLocation']) root_module.begin_section('ns3_module_core') ns3_module_core.register_methods(root_module) @@ -433,17 +526,6 @@ def register_methods(root_module): ns3_module_common__local.register_methods(root_module) root_module.end_section('ns3_module_common') - root_module.begin_section('ns3_module_contrib') - ns3_module_contrib.register_methods(root_module) - - try: - import ns3_module_contrib__local - except ImportError: - pass - else: - ns3_module_contrib__local.register_methods(root_module) - - root_module.end_section('ns3_module_contrib') root_module.begin_section('ns3_module_node') ns3_module_node.register_methods(root_module) @@ -455,72 +537,17 @@ def register_methods(root_module): ns3_module_node__local.register_methods(root_module) root_module.end_section('ns3_module_node') - root_module.begin_section('ns3_module_tap_bridge') - ns3_module_tap_bridge.register_methods(root_module) + root_module.begin_section('ns3_module_contrib') + ns3_module_contrib.register_methods(root_module) try: - import ns3_module_tap_bridge__local + import ns3_module_contrib__local except ImportError: pass else: - ns3_module_tap_bridge__local.register_methods(root_module) + ns3_module_contrib__local.register_methods(root_module) - root_module.end_section('ns3_module_tap_bridge') - root_module.begin_section('ns3_module_v4ping') - ns3_module_v4ping.register_methods(root_module) - - try: - import ns3_module_v4ping__local - except ImportError: - pass - else: - ns3_module_v4ping__local.register_methods(root_module) - - root_module.end_section('ns3_module_v4ping') - root_module.begin_section('ns3_module_packet_sink') - ns3_module_packet_sink.register_methods(root_module) - - try: - import ns3_module_packet_sink__local - except ImportError: - pass - else: - ns3_module_packet_sink__local.register_methods(root_module) - - root_module.end_section('ns3_module_packet_sink') - root_module.begin_section('ns3_module_stats') - ns3_module_stats.register_methods(root_module) - - try: - import ns3_module_stats__local - except ImportError: - pass - else: - ns3_module_stats__local.register_methods(root_module) - - root_module.end_section('ns3_module_stats') - root_module.begin_section('ns3_module_onoff') - ns3_module_onoff.register_methods(root_module) - - try: - import ns3_module_onoff__local - except ImportError: - pass - else: - ns3_module_onoff__local.register_methods(root_module) - - root_module.end_section('ns3_module_onoff') - root_module.begin_section('ns3_module_internet_stack') - ns3_module_internet_stack.register_methods(root_module) - - try: - import ns3_module_internet_stack__local - except ImportError: - pass - else: - ns3_module_internet_stack__local.register_methods(root_module) - - root_module.end_section('ns3_module_internet_stack') + root_module.end_section('ns3_module_contrib') root_module.begin_section('ns3_module_point_to_point') ns3_module_point_to_point.register_methods(root_module) @@ -532,6 +559,28 @@ def register_methods(root_module): ns3_module_point_to_point__local.register_methods(root_module) root_module.end_section('ns3_module_point_to_point') + root_module.begin_section('ns3_module_internet_stack') + ns3_module_internet_stack.register_methods(root_module) + + try: + import ns3_module_internet_stack__local + except ImportError: + pass + else: + ns3_module_internet_stack__local.register_methods(root_module) + + root_module.end_section('ns3_module_internet_stack') + root_module.begin_section('ns3_module_tap_bridge') + ns3_module_tap_bridge.register_methods(root_module) + + try: + import ns3_module_tap_bridge__local + except ImportError: + pass + else: + ns3_module_tap_bridge__local.register_methods(root_module) + + root_module.end_section('ns3_module_tap_bridge') root_module.begin_section('ns3_module_csma') ns3_module_csma.register_methods(root_module) @@ -543,39 +592,6 @@ def register_methods(root_module): ns3_module_csma__local.register_methods(root_module) root_module.end_section('ns3_module_csma') - root_module.begin_section('ns3_module_list_routing') - ns3_module_list_routing.register_methods(root_module) - - try: - import ns3_module_list_routing__local - except ImportError: - pass - else: - ns3_module_list_routing__local.register_methods(root_module) - - root_module.end_section('ns3_module_list_routing') - root_module.begin_section('ns3_module_static_routing') - ns3_module_static_routing.register_methods(root_module) - - try: - import ns3_module_static_routing__local - except ImportError: - pass - else: - ns3_module_static_routing__local.register_methods(root_module) - - root_module.end_section('ns3_module_static_routing') - root_module.begin_section('ns3_module_virtual_net_device') - ns3_module_virtual_net_device.register_methods(root_module) - - try: - import ns3_module_virtual_net_device__local - except ImportError: - pass - else: - ns3_module_virtual_net_device__local.register_methods(root_module) - - root_module.end_section('ns3_module_virtual_net_device') root_module.begin_section('ns3_module_wifi') ns3_module_wifi.register_methods(root_module) @@ -587,6 +603,83 @@ def register_methods(root_module): ns3_module_wifi__local.register_methods(root_module) root_module.end_section('ns3_module_wifi') + root_module.begin_section('ns3_module_static_routing') + ns3_module_static_routing.register_methods(root_module) + + try: + import ns3_module_static_routing__local + except ImportError: + pass + else: + ns3_module_static_routing__local.register_methods(root_module) + + root_module.end_section('ns3_module_static_routing') + root_module.begin_section('ns3_module_v4ping') + ns3_module_v4ping.register_methods(root_module) + + try: + import ns3_module_v4ping__local + except ImportError: + pass + else: + ns3_module_v4ping__local.register_methods(root_module) + + root_module.end_section('ns3_module_v4ping') + root_module.begin_section('ns3_module_virtual_net_device') + ns3_module_virtual_net_device.register_methods(root_module) + + try: + import ns3_module_virtual_net_device__local + except ImportError: + pass + else: + ns3_module_virtual_net_device__local.register_methods(root_module) + + root_module.end_section('ns3_module_virtual_net_device') + root_module.begin_section('ns3_module_packet_sink') + ns3_module_packet_sink.register_methods(root_module) + + try: + import ns3_module_packet_sink__local + except ImportError: + pass + else: + ns3_module_packet_sink__local.register_methods(root_module) + + root_module.end_section('ns3_module_packet_sink') + root_module.begin_section('ns3_module_global_routing') + ns3_module_global_routing.register_methods(root_module) + + try: + import ns3_module_global_routing__local + except ImportError: + pass + else: + ns3_module_global_routing__local.register_methods(root_module) + + root_module.end_section('ns3_module_global_routing') + root_module.begin_section('ns3_module_stats') + ns3_module_stats.register_methods(root_module) + + try: + import ns3_module_stats__local + except ImportError: + pass + else: + ns3_module_stats__local.register_methods(root_module) + + root_module.end_section('ns3_module_stats') + root_module.begin_section('ns3_module_list_routing') + ns3_module_list_routing.register_methods(root_module) + + try: + import ns3_module_list_routing__local + except ImportError: + pass + else: + ns3_module_list_routing__local.register_methods(root_module) + + root_module.end_section('ns3_module_list_routing') root_module.begin_section('ns3_module_emu') ns3_module_emu.register_methods(root_module) @@ -609,17 +702,17 @@ def register_methods(root_module): ns3_module_bridge__local.register_methods(root_module) root_module.end_section('ns3_module_bridge') - root_module.begin_section('ns3_module_global_routing') - ns3_module_global_routing.register_methods(root_module) + root_module.begin_section('ns3_module_onoff') + ns3_module_onoff.register_methods(root_module) try: - import ns3_module_global_routing__local + import ns3_module_onoff__local except ImportError: pass else: - ns3_module_global_routing__local.register_methods(root_module) + ns3_module_onoff__local.register_methods(root_module) - root_module.end_section('ns3_module_global_routing') + root_module.end_section('ns3_module_onoff') root_module.begin_section('ns3_module_udp_echo') ns3_module_udp_echo.register_methods(root_module) @@ -631,28 +724,6 @@ def register_methods(root_module): ns3_module_udp_echo__local.register_methods(root_module) root_module.end_section('ns3_module_udp_echo') - root_module.begin_section('ns3_module_olsr') - ns3_module_olsr.register_methods(root_module) - - try: - import ns3_module_olsr__local - except ImportError: - pass - else: - ns3_module_olsr__local.register_methods(root_module) - - root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_radvd') - ns3_module_radvd.register_methods(root_module) - - try: - import ns3_module_radvd__local - except ImportError: - pass - else: - ns3_module_radvd__local.register_methods(root_module) - - root_module.end_section('ns3_module_radvd') root_module.begin_section('ns3_module_ping6') ns3_module_ping6.register_methods(root_module) @@ -664,6 +735,61 @@ def register_methods(root_module): ns3_module_ping6__local.register_methods(root_module) root_module.end_section('ns3_module_ping6') + root_module.begin_section('ns3_module_nix_vector_routing') + ns3_module_nix_vector_routing.register_methods(root_module) + + try: + import ns3_module_nix_vector_routing__local + except ImportError: + pass + else: + ns3_module_nix_vector_routing__local.register_methods(root_module) + + root_module.end_section('ns3_module_nix_vector_routing') + root_module.begin_section('ns3_module_olsr') + ns3_module_olsr.register_methods(root_module) + + try: + import ns3_module_olsr__local + except ImportError: + pass + else: + ns3_module_olsr__local.register_methods(root_module) + + root_module.end_section('ns3_module_olsr') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_methods(root_module) + + try: + import ns3_module_flow_monitor__local + except ImportError: + pass + else: + ns3_module_flow_monitor__local.register_methods(root_module) + + root_module.end_section('ns3_module_flow_monitor') + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_methods(root_module) + + try: + import ns3_module_radvd__local + except ImportError: + pass + else: + ns3_module_radvd__local.register_methods(root_module) + + root_module.end_section('ns3_module_radvd') + root_module.begin_section('ns3_module_mesh') + ns3_module_mesh.register_methods(root_module) + + try: + import ns3_module_mesh__local + except ImportError: + pass + else: + ns3_module_mesh__local.register_methods(root_module) + + root_module.end_section('ns3_module_mesh') root_module.begin_section('ns3_module_helper') ns3_module_helper.register_methods(root_module) @@ -675,6 +801,164 @@ def register_methods(root_module): ns3_module_helper__local.register_methods(root_module) root_module.end_section('ns3_module_helper') + root_module.begin_section('ns3_module_dot11s') + ns3_module_dot11s.register_methods(root_module) + + try: + import ns3_module_dot11s__local + except ImportError: + pass + else: + ns3_module_dot11s__local.register_methods(root_module) + + root_module.end_section('ns3_module_dot11s') + root_module.begin_section('ns3_module_flame') + ns3_module_flame.register_methods(root_module) + + try: + import ns3_module_flame__local + except ImportError: + pass + else: + ns3_module_flame__local.register_methods(root_module) + + root_module.end_section('ns3_module_flame') + return + +def register_Ns3AnimationInterface_methods(root_module, cls): + ## animation-interface.h: ns3::AnimationInterface::AnimationInterface(ns3::AnimationInterface const & arg0) [copy constructor] + cls.add_constructor([param('ns3::AnimationInterface const &', 'arg0')]) + ## animation-interface.h: ns3::AnimationInterface::AnimationInterface() [constructor] + cls.add_constructor([]) + ## animation-interface.h: bool ns3::AnimationInterface::SetInternalAnimation() [member function] + cls.add_method('SetInternalAnimation', + 'bool', + []) + ## animation-interface.h: bool ns3::AnimationInterface::SetOutputFile(std::string const & fn) [member function] + cls.add_method('SetOutputFile', + 'bool', + [param('std::string const &', 'fn')]) + ## animation-interface.h: bool ns3::AnimationInterface::SetServerPort(uint16_t port) [member function] + cls.add_method('SetServerPort', + 'bool', + [param('uint16_t', 'port')]) + ## animation-interface.h: void ns3::AnimationInterface::StartAnimation() [member function] + cls.add_method('StartAnimation', + 'void', + []) + ## animation-interface.h: void ns3::AnimationInterface::StopAnimation() [member function] + cls.add_method('StopAnimation', + 'void', + []) + return + +def register_Ns3PointToPointDumbbellHelper_methods(root_module, cls): + ## point-to-point-dumbbell-helper.h: ns3::PointToPointDumbbellHelper::PointToPointDumbbellHelper(ns3::PointToPointDumbbellHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointDumbbellHelper const &', 'arg0')]) + ## point-to-point-dumbbell-helper.h: ns3::PointToPointDumbbellHelper::PointToPointDumbbellHelper(uint32_t nLeftLeaf, ns3::PointToPointHelper & leftHelper, uint32_t nRightLeaf, ns3::PointToPointHelper & rightHelper, ns3::PointToPointHelper & bottleneckHelper) [constructor] + cls.add_constructor([param('uint32_t', 'nLeftLeaf'), param('ns3::PointToPointHelper &', 'leftHelper'), param('uint32_t', 'nRightLeaf'), param('ns3::PointToPointHelper &', 'rightHelper'), param('ns3::PointToPointHelper &', 'bottleneckHelper')]) + ## point-to-point-dumbbell-helper.h: void ns3::PointToPointDumbbellHelper::AssignAddresses(ns3::Ipv4AddressHelper leftIp, ns3::Ipv4AddressHelper rightIp, ns3::Ipv4AddressHelper routerIp) [member function] + cls.add_method('AssignAddresses', + 'void', + [param('ns3::Ipv4AddressHelper', 'leftIp'), param('ns3::Ipv4AddressHelper', 'rightIp'), param('ns3::Ipv4AddressHelper', 'routerIp')]) + ## point-to-point-dumbbell-helper.h: void ns3::PointToPointDumbbellHelper::BoundingBox(double arg0, double arg1, double arg2, double arg3) [member function] + cls.add_method('BoundingBox', + 'void', + [param('double', 'arg0'), param('double', 'arg1'), param('double', 'arg2'), param('double', 'arg3')]) + ## point-to-point-dumbbell-helper.h: ns3::Ptr ns3::PointToPointDumbbellHelper::GetLeft() const [member function] + cls.add_method('GetLeft', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ptr ns3::PointToPointDumbbellHelper::GetLeft(uint32_t arg0) const [member function] + cls.add_method('GetLeft', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ipv4Address ns3::PointToPointDumbbellHelper::GetLeftAddress(uint32_t arg0) const [member function] + cls.add_method('GetLeftAddress', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ptr ns3::PointToPointDumbbellHelper::GetRight() const [member function] + cls.add_method('GetRight', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ptr ns3::PointToPointDumbbellHelper::GetRight(uint32_t arg0) const [member function] + cls.add_method('GetRight', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-dumbbell-helper.h: ns3::Ipv4Address ns3::PointToPointDumbbellHelper::GetRightAddress(uint32_t arg0) const [member function] + cls.add_method('GetRightAddress', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-dumbbell-helper.h: void ns3::PointToPointDumbbellHelper::InstallStack(ns3::InternetStackHelper stack) [member function] + cls.add_method('InstallStack', + 'void', + [param('ns3::InternetStackHelper', 'stack')]) + ## point-to-point-dumbbell-helper.h: uint32_t ns3::PointToPointDumbbellHelper::LeftCount() const [member function] + cls.add_method('LeftCount', + 'uint32_t', + [], + is_const=True) + ## point-to-point-dumbbell-helper.h: uint32_t ns3::PointToPointDumbbellHelper::RightCount() const [member function] + cls.add_method('RightCount', + 'uint32_t', + [], + is_const=True) + return + +def register_Ns3PointToPointGridHelper_methods(root_module, cls): + ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper::PointToPointGridHelper(ns3::PointToPointGridHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointGridHelper const &', 'arg0')]) + ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper::PointToPointGridHelper(uint32_t nRows, uint32_t nCols, ns3::PointToPointHelper pointToPoint) [constructor] + cls.add_constructor([param('uint32_t', 'nRows'), param('uint32_t', 'nCols'), param('ns3::PointToPointHelper', 'pointToPoint')]) + ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper::PointToPointGridHelper(uint32_t nRows, uint32_t nCols, ns3::PointToPointHelper pointToPoint, uint16_t mpiSize) [constructor] + cls.add_constructor([param('uint32_t', 'nRows'), param('uint32_t', 'nCols'), param('ns3::PointToPointHelper', 'pointToPoint'), param('uint16_t', 'mpiSize')]) + ## point-to-point-grid-helper.h: void ns3::PointToPointGridHelper::AssignAddresses(ns3::Ipv4AddressHelper rowIp, ns3::Ipv4AddressHelper colIp) [member function] + cls.add_method('AssignAddresses', + 'void', + [param('ns3::Ipv4AddressHelper', 'rowIp'), param('ns3::Ipv4AddressHelper', 'colIp')]) + ## point-to-point-grid-helper.h: void ns3::PointToPointGridHelper::BoundingBox(double ulx, double uly, double lrx, double lry) [member function] + cls.add_method('BoundingBox', + 'void', + [param('double', 'ulx'), param('double', 'uly'), param('double', 'lrx'), param('double', 'lry')]) + ## point-to-point-grid-helper.h: ns3::Ipv4Address ns3::PointToPointGridHelper::GetAddress(uint32_t row, uint32_t col) [member function] + cls.add_method('GetAddress', + 'ns3::Ipv4Address', + [param('uint32_t', 'row'), param('uint32_t', 'col')]) + ## point-to-point-grid-helper.h: ns3::Ptr ns3::PointToPointGridHelper::GetNode(uint32_t row, uint32_t col) [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'row'), param('uint32_t', 'col')]) + ## point-to-point-grid-helper.h: void ns3::PointToPointGridHelper::InstallStack(ns3::InternetStackHelper stack) [member function] + cls.add_method('InstallStack', + 'void', + [param('ns3::InternetStackHelper', 'stack')]) + return + +def register_Ns3NodeLocation_methods(root_module, cls): + ## node-location.h: ns3::NodeLocation::NodeLocation(ns3::NodeLocation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::NodeLocation const &', 'arg0')]) + ## node-location.h: ns3::NodeLocation::NodeLocation() [constructor] + cls.add_constructor([]) + ## node-location.h: ns3::Vector ns3::NodeLocation::GetLocation() const [member function] + cls.add_method('GetLocation', + 'ns3::Vector', + [], + is_const=True) + ## node-location.h: static ns3::TypeId ns3::NodeLocation::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## node-location.h: void ns3::NodeLocation::SetLocation(ns3::Vector const & location) [member function] + cls.add_method('SetLocation', + 'void', + [param('ns3::Vector const &', 'location')]) return def register_functions(root_module): @@ -723,17 +1007,6 @@ def register_functions(root_module): ns3_module_common__local.register_functions(root_module) root_module.end_section('ns3_module_common') - root_module.begin_section('ns3_module_contrib') - ns3_module_contrib.register_functions(root_module) - - try: - import ns3_module_contrib__local - except ImportError: - pass - else: - ns3_module_contrib__local.register_functions(root_module) - - root_module.end_section('ns3_module_contrib') root_module.begin_section('ns3_module_node') ns3_module_node.register_functions(root_module) @@ -745,72 +1018,17 @@ def register_functions(root_module): ns3_module_node__local.register_functions(root_module) root_module.end_section('ns3_module_node') - root_module.begin_section('ns3_module_tap_bridge') - ns3_module_tap_bridge.register_functions(root_module) + root_module.begin_section('ns3_module_contrib') + ns3_module_contrib.register_functions(root_module) try: - import ns3_module_tap_bridge__local + import ns3_module_contrib__local except ImportError: pass else: - ns3_module_tap_bridge__local.register_functions(root_module) + ns3_module_contrib__local.register_functions(root_module) - root_module.end_section('ns3_module_tap_bridge') - root_module.begin_section('ns3_module_v4ping') - ns3_module_v4ping.register_functions(root_module) - - try: - import ns3_module_v4ping__local - except ImportError: - pass - else: - ns3_module_v4ping__local.register_functions(root_module) - - root_module.end_section('ns3_module_v4ping') - root_module.begin_section('ns3_module_packet_sink') - ns3_module_packet_sink.register_functions(root_module) - - try: - import ns3_module_packet_sink__local - except ImportError: - pass - else: - ns3_module_packet_sink__local.register_functions(root_module) - - root_module.end_section('ns3_module_packet_sink') - root_module.begin_section('ns3_module_stats') - ns3_module_stats.register_functions(root_module) - - try: - import ns3_module_stats__local - except ImportError: - pass - else: - ns3_module_stats__local.register_functions(root_module) - - root_module.end_section('ns3_module_stats') - root_module.begin_section('ns3_module_onoff') - ns3_module_onoff.register_functions(root_module) - - try: - import ns3_module_onoff__local - except ImportError: - pass - else: - ns3_module_onoff__local.register_functions(root_module) - - root_module.end_section('ns3_module_onoff') - root_module.begin_section('ns3_module_internet_stack') - ns3_module_internet_stack.register_functions(root_module) - - try: - import ns3_module_internet_stack__local - except ImportError: - pass - else: - ns3_module_internet_stack__local.register_functions(root_module) - - root_module.end_section('ns3_module_internet_stack') + root_module.end_section('ns3_module_contrib') root_module.begin_section('ns3_module_point_to_point') ns3_module_point_to_point.register_functions(root_module) @@ -822,6 +1040,28 @@ def register_functions(root_module): ns3_module_point_to_point__local.register_functions(root_module) root_module.end_section('ns3_module_point_to_point') + root_module.begin_section('ns3_module_internet_stack') + ns3_module_internet_stack.register_functions(root_module) + + try: + import ns3_module_internet_stack__local + except ImportError: + pass + else: + ns3_module_internet_stack__local.register_functions(root_module) + + root_module.end_section('ns3_module_internet_stack') + root_module.begin_section('ns3_module_tap_bridge') + ns3_module_tap_bridge.register_functions(root_module) + + try: + import ns3_module_tap_bridge__local + except ImportError: + pass + else: + ns3_module_tap_bridge__local.register_functions(root_module) + + root_module.end_section('ns3_module_tap_bridge') root_module.begin_section('ns3_module_csma') ns3_module_csma.register_functions(root_module) @@ -833,39 +1073,6 @@ def register_functions(root_module): ns3_module_csma__local.register_functions(root_module) root_module.end_section('ns3_module_csma') - root_module.begin_section('ns3_module_list_routing') - ns3_module_list_routing.register_functions(root_module) - - try: - import ns3_module_list_routing__local - except ImportError: - pass - else: - ns3_module_list_routing__local.register_functions(root_module) - - root_module.end_section('ns3_module_list_routing') - root_module.begin_section('ns3_module_static_routing') - ns3_module_static_routing.register_functions(root_module) - - try: - import ns3_module_static_routing__local - except ImportError: - pass - else: - ns3_module_static_routing__local.register_functions(root_module) - - root_module.end_section('ns3_module_static_routing') - root_module.begin_section('ns3_module_virtual_net_device') - ns3_module_virtual_net_device.register_functions(root_module) - - try: - import ns3_module_virtual_net_device__local - except ImportError: - pass - else: - ns3_module_virtual_net_device__local.register_functions(root_module) - - root_module.end_section('ns3_module_virtual_net_device') root_module.begin_section('ns3_module_wifi') ns3_module_wifi.register_functions(root_module) @@ -877,6 +1084,83 @@ def register_functions(root_module): ns3_module_wifi__local.register_functions(root_module) root_module.end_section('ns3_module_wifi') + root_module.begin_section('ns3_module_static_routing') + ns3_module_static_routing.register_functions(root_module) + + try: + import ns3_module_static_routing__local + except ImportError: + pass + else: + ns3_module_static_routing__local.register_functions(root_module) + + root_module.end_section('ns3_module_static_routing') + root_module.begin_section('ns3_module_v4ping') + ns3_module_v4ping.register_functions(root_module) + + try: + import ns3_module_v4ping__local + except ImportError: + pass + else: + ns3_module_v4ping__local.register_functions(root_module) + + root_module.end_section('ns3_module_v4ping') + root_module.begin_section('ns3_module_virtual_net_device') + ns3_module_virtual_net_device.register_functions(root_module) + + try: + import ns3_module_virtual_net_device__local + except ImportError: + pass + else: + ns3_module_virtual_net_device__local.register_functions(root_module) + + root_module.end_section('ns3_module_virtual_net_device') + root_module.begin_section('ns3_module_packet_sink') + ns3_module_packet_sink.register_functions(root_module) + + try: + import ns3_module_packet_sink__local + except ImportError: + pass + else: + ns3_module_packet_sink__local.register_functions(root_module) + + root_module.end_section('ns3_module_packet_sink') + root_module.begin_section('ns3_module_global_routing') + ns3_module_global_routing.register_functions(root_module) + + try: + import ns3_module_global_routing__local + except ImportError: + pass + else: + ns3_module_global_routing__local.register_functions(root_module) + + root_module.end_section('ns3_module_global_routing') + root_module.begin_section('ns3_module_stats') + ns3_module_stats.register_functions(root_module) + + try: + import ns3_module_stats__local + except ImportError: + pass + else: + ns3_module_stats__local.register_functions(root_module) + + root_module.end_section('ns3_module_stats') + root_module.begin_section('ns3_module_list_routing') + ns3_module_list_routing.register_functions(root_module) + + try: + import ns3_module_list_routing__local + except ImportError: + pass + else: + ns3_module_list_routing__local.register_functions(root_module) + + root_module.end_section('ns3_module_list_routing') root_module.begin_section('ns3_module_emu') ns3_module_emu.register_functions(root_module) @@ -899,17 +1183,17 @@ def register_functions(root_module): ns3_module_bridge__local.register_functions(root_module) root_module.end_section('ns3_module_bridge') - root_module.begin_section('ns3_module_global_routing') - ns3_module_global_routing.register_functions(root_module) + root_module.begin_section('ns3_module_onoff') + ns3_module_onoff.register_functions(root_module) try: - import ns3_module_global_routing__local + import ns3_module_onoff__local except ImportError: pass else: - ns3_module_global_routing__local.register_functions(root_module) + ns3_module_onoff__local.register_functions(root_module) - root_module.end_section('ns3_module_global_routing') + root_module.end_section('ns3_module_onoff') root_module.begin_section('ns3_module_udp_echo') ns3_module_udp_echo.register_functions(root_module) @@ -921,28 +1205,6 @@ def register_functions(root_module): ns3_module_udp_echo__local.register_functions(root_module) root_module.end_section('ns3_module_udp_echo') - root_module.begin_section('ns3_module_olsr') - ns3_module_olsr.register_functions(root_module) - - try: - import ns3_module_olsr__local - except ImportError: - pass - else: - ns3_module_olsr__local.register_functions(root_module) - - root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_radvd') - ns3_module_radvd.register_functions(root_module) - - try: - import ns3_module_radvd__local - except ImportError: - pass - else: - ns3_module_radvd__local.register_functions(root_module) - - root_module.end_section('ns3_module_radvd') root_module.begin_section('ns3_module_ping6') ns3_module_ping6.register_functions(root_module) @@ -954,6 +1216,61 @@ def register_functions(root_module): ns3_module_ping6__local.register_functions(root_module) root_module.end_section('ns3_module_ping6') + root_module.begin_section('ns3_module_nix_vector_routing') + ns3_module_nix_vector_routing.register_functions(root_module) + + try: + import ns3_module_nix_vector_routing__local + except ImportError: + pass + else: + ns3_module_nix_vector_routing__local.register_functions(root_module) + + root_module.end_section('ns3_module_nix_vector_routing') + root_module.begin_section('ns3_module_olsr') + ns3_module_olsr.register_functions(root_module) + + try: + import ns3_module_olsr__local + except ImportError: + pass + else: + ns3_module_olsr__local.register_functions(root_module) + + root_module.end_section('ns3_module_olsr') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_functions(root_module) + + try: + import ns3_module_flow_monitor__local + except ImportError: + pass + else: + ns3_module_flow_monitor__local.register_functions(root_module) + + root_module.end_section('ns3_module_flow_monitor') + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_functions(root_module) + + try: + import ns3_module_radvd__local + except ImportError: + pass + else: + ns3_module_radvd__local.register_functions(root_module) + + root_module.end_section('ns3_module_radvd') + root_module.begin_section('ns3_module_mesh') + ns3_module_mesh.register_functions(root_module) + + try: + import ns3_module_mesh__local + except ImportError: + pass + else: + ns3_module_mesh__local.register_functions(root_module) + + root_module.end_section('ns3_module_mesh') root_module.begin_section('ns3_module_helper') ns3_module_helper.register_functions(root_module) @@ -965,9 +1282,33 @@ def register_functions(root_module): ns3_module_helper__local.register_functions(root_module) root_module.end_section('ns3_module_helper') + root_module.begin_section('ns3_module_dot11s') + ns3_module_dot11s.register_functions(root_module) + + try: + import ns3_module_dot11s__local + except ImportError: + pass + else: + ns3_module_dot11s__local.register_functions(root_module) + + root_module.end_section('ns3_module_dot11s') + root_module.begin_section('ns3_module_flame') + ns3_module_flame.register_functions(root_module) + + try: + import ns3_module_flame__local + except ImportError: + pass + else: + ns3_module_flame__local.register_functions(root_module) + + root_module.end_section('ns3_module_flame') register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) + register_functions_ns3_dot11s(module.get_submodule('dot11s'), root_module) + register_functions_ns3_flame(module.get_submodule('flame'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) return @@ -981,6 +1322,12 @@ def register_functions_ns3_TimeStepPrecision(module, root_module): def register_functions_ns3_addressUtils(module, root_module): return +def register_functions_ns3_dot11s(module, root_module): + return + +def register_functions_ns3_flame(module, root_module): + return + def register_functions_ns3_internal(module, root_module): return diff --git a/bindings/python/ns3modulegen.py b/bindings/python/ns3modulegen.py index 50f6f2653..968bf649e 100755 --- a/bindings/python/ns3modulegen.py +++ b/bindings/python/ns3modulegen.py @@ -8,6 +8,8 @@ LOCAL_MODULES = [ import sys import os +sys.path.insert(0, sys.argv[2]) + from pybindgen import FileCodeSink, write_preamble from pybindgen.module import MultiSectionFactory import pybindgen.settings @@ -77,7 +79,7 @@ class MyMultiSectionFactory(MultiSectionFactory): def main(): - out = MyMultiSectionFactory(sys.argv[1], sys.argv[2:]) + out = MyMultiSectionFactory(sys.argv[1], sys.argv[3:]) root_module = module_init() root_module.add_include('"everything.h"') diff --git a/bindings/python/ns3modulescan.py b/bindings/python/ns3modulescan.py index a5be11284..eadf318cf 100644 --- a/bindings/python/ns3modulescan.py +++ b/bindings/python/ns3modulescan.py @@ -242,7 +242,7 @@ class MyPygenClassifier(PygenClassifier): return '__main__' -def ns3_module_scan(top_builddir, pygen_file_name, everything_h): +def ns3_module_scan(top_builddir, pygen_file_name, everything_h, cflags): ns3_modules = eval(sys.stdin.read()) @@ -275,7 +275,8 @@ def ns3_module_scan(top_builddir, pygen_file_name, everything_h): define_symbols={ #'NS3_ASSERT_ENABLE': None, #'NS3_LOG_ENABLE': None, - } + }, + cflags=('--gccxml-cxxflags %r' % (cflags,)) ) module_parser.parse_init([everything_h], @@ -301,5 +302,5 @@ def ns3_module_scan(top_builddir, pygen_file_name, everything_h): if __name__ == '__main__': - ns3_module_scan(sys.argv[1], sys.argv[3], sys.argv[2]) + ns3_module_scan(sys.argv[1], sys.argv[3], sys.argv[2], sys.argv[4]) diff --git a/bindings/python/wscript b/bindings/python/wscript index f6b50c1c6..94918f376 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -15,7 +15,7 @@ import Build import Utils ## https://launchpad.net/pybindgen/ -REQUIRED_PYBINDGEN_VERSION = (0, 11, 0, 697) +REQUIRED_PYBINDGEN_VERSION = (0, 12, 0, 700) REQUIRED_PYGCCXML_VERSION = (0, 9, 5) @@ -340,31 +340,54 @@ class python_scan_task(Task.TaskBase): """ after = 'gen_everything_h_task' before = 'cc cxx' - def __init__(self, curdirnode, env, bld): + color = "BLUE" + def __init__(self, curdirnode, env, bld, target, cflags): self.bld = bld super(python_scan_task, self).__init__(generator=self) self.curdirnode = curdirnode self.env = env + self.target = target + self.cflags = cflags def display(self): - return 'python-scan\n' + return 'python-scan-%s\n' % (self.target,) def run(self): - #print "Rescanning the python bindings..." + defsdir = os.path.join(self.curdirnode.abspath(), 'apidefs', self.target) + try: + os.mkdir(defsdir) + except OSError: + pass argv = [ self.env['PYTHON'], os.path.join(self.curdirnode.abspath(), 'ns3modulescan.py'), # scanning script self.curdirnode.find_dir('../..').abspath(self.env), # include path (where the ns3 include dir is) self.curdirnode.find_or_declare('everything.h').abspath(self.env), - os.path.join(self.curdirnode.abspath(), 'ns3modulegen_generated.py'), # output file + os.path.join(defsdir, 'ns3modulegen_generated.py'), # output file + self.cflags, ] scan = subprocess.Popen(argv, stdin=subprocess.PIPE) scan.stdin.write(repr(get_modules_and_headers(self.bld))) scan.stdin.close() retval = scan.wait() - print "Scan finished with exit code", retval - if retval: - return retval + return retval + +class python_scan_task_collector(Task.TaskBase): + """Tasks that waits for the python-scan-* tasks to complete and then signals WAF to exit + """ + after = 'python_scan_task' + before = 'cc cxx' + color = "BLUE" + def __init__(self, curdirnode, env, bld): + self.bld = bld + super(python_scan_task_collector, self).__init__(generator=self) + self.curdirnode = curdirnode + self.env = env + + def display(self): + return 'python-scan-collector\n' + + def run(self): # signal stop (we generated files into the source dir and WAF # can't cope with it, so we have to force the user to restart # WAF) @@ -387,42 +410,76 @@ def build(bld): if Options.options.python_scan: if not env['ENABLE_PYTHON_SCANNING']: raise Utils.WafError("Cannot re-scan python bindings: (py)gccxml not available") - python_scan_task(bld.path, env, bld) + scan_targets = [] + if sys.platform == 'cygwin': + scan_targets.append(('gcc-cygwin', '')) + else: + import struct + if struct.calcsize('I') == 4 and struct.calcsize('L') == 8 and struct.calcsize('P') == 8: + scan_targets.extend([('gcc-ILP32', '-m32'), ('gcc-LP64', '-m64')]) + elif struct.calcsize('I') == 4 and struct.calcsize('L') == 4 and struct.calcsize('P') == 4: + scan_targets.append(('gcc-ILP32', '')) + else: + raise Utils.WafError("Cannot scan python bindings for unsupported data model") + for target, cflags in scan_targets: + python_scan_task(bld.path, env, bld, target, cflags) + python_scan_task_collector(bld.path, env, bld) return - ## Get a list of scanned modules; the set of scanned modules - ## may be smaller than the set of all modules, in case a new - ## ns3 module is being developed which wasn't scanned yet. - scanned_modules = [] - for filename in os.listdir(curdir): - m = re.match(r"^ns3_module_(.+)\.py$", filename) - if m is None: - continue - name = m.group(1) - if name.endswith("__local"): - continue - scanned_modules.append(name) - if env['ENABLE_PYTHON_BINDINGS']: + if sys.platform == 'cygwin': + apidefs = 'gcc-cygwin' + else: + import struct + if struct.calcsize('I') == 4 and struct.calcsize('L') == 8 and struct.calcsize('P') == 8: + apidefs = 'gcc-LP64' + elif struct.calcsize('I') == 4 and struct.calcsize('L') == 4 and struct.calcsize('P') == 4: + apidefs = 'gcc-ILP32' + else: + print "Cannot build python bindings for unsupported data model" + return + #print "Will build python bindings for target:", apidefs + + ## Get a list of scanned modules; the set of scanned modules + ## may be smaller than the set of all modules, in case a new + ## ns3 module is being developed which wasn't scanned yet. + scanned_modules = [] + for filename in os.listdir(os.path.join(curdir, 'apidefs', apidefs)): + m = re.match(r"^ns3_module_(.+)\.py$", filename) + if m is None: + continue + name = m.group(1) + if name.endswith("__local"): + continue + scanned_modules.append(name) + + debug = ('PYBINDGEN_DEBUG' in os.environ) source = [ 'ns3modulegen.py', - 'ns3modulegen_generated.py', + 'apidefs/%s/ns3modulegen_generated.py' % (apidefs,), 'ns3modulegen_core_customizations.py', ] target = [ 'ns3module.cc', 'ns3module.h', - 'ns3modulegen.log', ] - argv = ['NS3_ENABLED_FEATURES=${FEATURES}', '${PYTHON}', '${SRC[0]}', '${TGT[0]}'] + if not debug: + target.append('ns3modulegen.log') + + argv = ['NS3_ENABLED_FEATURES=${FEATURES}', '${PYTHON}'] + if debug: + argv.extend(["-m", "pdb"]) + argv.extend(['${SRC[0]}', '${TGT[0]}', os.path.join(curdir, 'apidefs', apidefs)]) + argv.extend(get_modules_and_headers(bld).iterkeys()) for module in scanned_modules: - source.append("ns3_module_%s.py" % module) + source.append("apidefs/%s/ns3_module_%s.py" % (apidefs, module)) local = "ns3_module_%s__local.py" % module if os.path.exists(os.path.join(curdir, local)): source.append(local) - argv.extend(['2>', '${TGT[2]}']) # 2> ns3modulegen.log + if not debug: + argv.extend(['2>', '${TGT[2]}']) # 2> ns3modulegen.log for module in scanned_modules: target.append("ns3_module_%s.cc" % module) diff --git a/doc/MeshArchitecture.png b/doc/MeshArchitecture.png new file mode 100644 index 000000000..4be05d980 Binary files /dev/null and b/doc/MeshArchitecture.png differ diff --git a/doc/manual/Makefile b/doc/manual/Makefile index c8c46674c..2f27bfb86 100644 --- a/doc/manual/Makefile +++ b/doc/manual/Makefile @@ -54,20 +54,23 @@ CHAPTERS = \ %.png : %.dia; $(DIA) -t png $< -e $@ %.pdf : %.eps; $(EPSTOPDF) $< -o=$@ -all: $(IMAGES) manual.pdf manual.html manual/manual.html +all: $(IMAGES) version manual.pdf manual.html manual/manual.html -manual.pdf: $(IMAGES) $(CHAPTERS) +manual.pdf: version $(IMAGES) $(CHAPTERS) $(TEXI2PDF) manual.texi -manual.html: $(IMAGES) $(CHAPTERS) +manual.html: version $(IMAGES) $(CHAPTERS) $(TEXI2HTML) ${CSS} manual.texi -manual/manual.html: $(IMAGES) $(CHAPTERS) +manual/manual.html: version $(IMAGES) $(CHAPTERS) $(TEXI2HTML) ${CSS} ${SPLIT} manual.texi figures-clean: rm -rf $(IMAGES) +version: + echo -n "ns-" > VERSION-PREFIX; cat VERSION-PREFIX ../../VERSION > VERSION; rm -rf VERSION-PREFIX + clean: figures-clean - rm -rf manual.aux manual.cp manual.cps manual.fn manual.ky manual.pg - rm -rf manual.tp manual.vr manual.toc manual.log manual.pdf manual.html manual/ + rm -rf manual.aux manual.cp manual.cps manual.fn manual.ky manual.pg manual.tp + rm -rf manual.vr manual.toc manual.log manual.pdf manual.html manual/ VERSION diff --git a/doc/manual/callbacks.texi b/doc/manual/callbacks.texi index e34dea2ab..1abcedddc 100644 --- a/doc/manual/callbacks.texi +++ b/doc/manual/callbacks.texi @@ -8,7 +8,9 @@ it, and details on its implementation. @menu * Motivation:: +* Background:: * Using the Callback API:: +* Bound Callbacks:: * Callback locations in ns-3:: * Implementation details:: @end menu @@ -86,33 +88,234 @@ between TCP and IP: If the simulator has made assumptions, and hard coded into the code, that IP always talks to a transport protocol above, the user may be forced to hack the -system to get the desired interconnections. +system to get the desired interconnections, This is clearly not an +optimal way to design a generic simulator. -An alternative that provides this flexibility is to use a level of -indirection that is commonly known in programming as a callback. -A callback function is not invoked explicitly by the caller but is -rather delegated to another function that receives the callback -function's address and can call it. +@node Background +@section Background -You may be familiar with function pointers in C or C++; these can -be used to implement callbacks. For more information on introductory -callbacks, an online reference is: -@uref{http://www.inquiry.com/techtips/cpp_pro/10min/10min0300.asp,,Declaring Function Pointers and Implementing Callbacks} and -@uref{http://en.wikipedia.org/wiki/Callback_(computer_science),,Callback (computer science)-- Wikipedia}. +The basic mechanism that allows one to address the problem above is known as +a @emph{callback}. The ultimate goal is to allow one piece of code to call +a function (or method in C++) without any specific inter-module dependency. -The callback API in @command{ns-3} is designed to minimize the overall -coupling between various pieces of of the simulator -by making each module depend on the callback API -itself rather than depend on other modules. It acts as a sort of -third-party to which work is delegated and which forwards this -work to the proper target module. This callback API, being based -on C++ templates, -is type-safe; that is, it performs static type checks to enforce -proper signature compatibility between callers and callees. It -is therefore more type-safe to use than traditional function -pointers, but the syntax may look imposing at first. This section -is designed to walk you through the callback system so that you -can be comfortable using it in @command{ns-3}. +This ultimately means you need some kind of indirection -- you treat the address +of the called function as a variable. This variable is called a pointer-to-function +variable. The relationship between function and pointer-to-function pointer is +really no different that that of object and pointer-to-object. + +In C the canonical example of a pointer-to-function is a +pointer-to-function-returning-integer (PFI). For a PFI taking one int parameter, +this could be declared like, + +@verbatim + int (*pfi)(int arg) = 0; +@end verbatim + +What you get from this is a variable named simply ``pfi'' that is initialized +to the value 0. If you want to initialize this pointer to something meaningful, +you have to have a function with a matching signature. In this case, + +@verbatim + int MyFunction (int arg) {} +@end verbatim + +If you have this target, you can initialize the variable to point to your +function like, + +@verbatim + pfi = MyFunction; +@end verbatim + +You can then call MyFunction indirectly using the more suggestive form of +the call, + +@verbatim + int result = (*pfi) (1234); +@end verbatim + +This is suggestive since it looks like you are dereferencing the function +pointer just like you would dereference any pointer. Typically, however, +people take advantage of the fact that the compiler knows what is going on +and will just use a shorter form, + +@verbatim + int result = pfi (1234); +@end verbatim + +Notice that the function pointer obeys value semantics, so you can pass it +around like any other value. Typically, when you use an asynchronous interface +you will pass some entity like this to a function which will perform an action +and ``call back'' to let you know it completed. It calls back by following the +indirection and executing the provided function. + +In C++ you have the added complexity of objects. The analogy with the PFI +above means you have a pointer to a member function returning an int (PMI) +instead of the pointer to function returning an int (PFI). + +The declaration of the variable providing the indirection looks only slightly +different, + +@verbatim + int (MyClass::*pmi) (int arg) = 0; +@end verbatim + +This declares a variable named ``pmi'' just as the previous example declared a +variable named ``pfi.'' Since the will be to call a method of an instance of +a particular class, one must declare that method in a class. + +@verbatim + class MyClass { + public: + int MyMethod (int arg); + }; +@end verbatim + +Given this class declaration, one would then initialize that variable like this, + +@verbatim + pmi = &MyClass::MyMethod; +@end verbatim + +This assigns the address of the code implementing the method to the variable, +completing the indirection. In order to call a method, the code needs a ``this'' +pointer. This, in turn, means there must be an object of MyClass to refer to. +A simplistic example of this is just calling a method indirectly (think virtual +function). + +@verbatim + int (MyClass::*pmi) (int arg) = 0; // Declare a PMI + pmi = &MyClass::MyMethod; // Point at the implementation code + + MyClass myClass; // Need an instance of the class + (myClass.*pmi) (1234); // Call the method with an object ptr +@end verbatim + +Just like in the C example, you can use this in an asynchronous call to another +module which will ``call back'' using a method and an object pointer. The +straightforward extension one might consider is to pass a pointer to the object +and the PMI variable. The module would just do, + +@verbatim + (*objectPtr.*pmi) (1234); +@end verbatim + +to execute the callback on the desired object. + +One might ask at this time, ``what's the point''? The called module will have +to understand the concrete type of the calling object in order to properly make +the callback. Why not just accept this, pass the correctly typed object pointer +and do object->Method(1234) in the code instead of the callback? This is +precisely the problem described above. What is needed is a way to decouple the +calling function from the called class completely. This requirement led to the +development of the @emph{Functor}. + +A functor is the outgrowth of something invented in the 1960s called a closure. +It is basically just a packaged-up function call, possibly with some state. + +A functor has two parts, a specific part and a generic part, related through +inheritance. The calling code (the code that executes the callback) will execute +a generic overloaded @code{operator ()} of a generic functor to cause the callback +to be called. The called code (the code that wants to be called back) will have +to provide a specialized implementation of the @code{operator ()} that performs the +class-specific work that caused the close-coupling problem above. + +With the specific functor and its overloaded @code{operator ()} created, the called +code then gives the specialized code to the module that will execute the callback +(the calling code). + +The calling code will take a generic functor as a parameter, so an implicit cast +is done in the function call to convert the specific functor to a generic functor. +This means that the calling module just needs to understand the generic functor +type. It is decoupled from the calling code completely. + +The information one needs to make a specific functor is the object pointer and +the pointer-to-method address. + +The essence of what needs to happen is that the system declares a generic part +of the functor, + +@verbatim + template + class Functor + { + public: + virtual void operator() (T arg) = 0; + }; +@end verbatim + +The caller defines a specific part of the functor that really is just there to +implement the specific operator() method, + +@verbatim + template + class SpecificFunctor : public Functor + { + public: + SpecificFunctor(T* p, int (T::*_pmi)(ARG arg)) + { + m_p = p; + m_pmi = pmi; + } + + virtual int operator() (ARG arg) + { + (*m_p.*m_pmi)(arg); + } + private: + void (T::*m_pmi)(ARG arg); + T* m_p; + }; +@end verbatim + +@emph{N.B. The previous code is not real ns-3 code. It is simplistic example +code used only to illustrate the concepts involved and to help you understand +the system more. Do not expect to find this code anywhere in the ns-3 tree} + +Notice that there are two variables defined in the class above. The m_p +variable is the object pointer and m_pmi is the variable containing the +address of the function to execute. + +Notice that when @code{operator()} is called, it in turn calls the method provided +with the object pointer using the C++ PMI syntax. + +To use this, one could then declare some model code that takes a generic functor +as a parameter + +@verbatim + void LibraryFunction (Functor functor); +@end verbatim + +The code that will talk to the model would build a specific functor and pass it to +@code{LibraryFunction}, + +@verbatim + MyClass myClass; + SpecificFunctor functor (&myclass, MyClass::MyMethod); +@end verbatim + +When @code{LibraryFunction} is done, it executes the callback using the +@code{operator()} on the generic functor it was passed, and in this particular +case, provides the integer argument: + +@verbatim + void + LibraryFunction (Functor functor) + { + // Ececute the library function + functor(1234); + } +@end verbatim + +Notice that @code{LibraryFunction} is completely decoupled from the specific +type of the client. The connection is made through the Functor polymorphism. + +The Callback API in @command{ns-3} implements object-oriented callbacks using +the functor mechanism. This callback API, being based on C++ templates, is +type-safe; that is, it performs static type checks to enforce proper signature +compatibility between callers and callees. It is therefore more type-safe to +use than traditional function pointers, but the syntax may look imposing at +first. This section is designed to walk you through the Callback system so +that you can be comfortable using it in @command{ns-3}. @node Using the Callback API @section Using the Callback API @@ -132,44 +335,52 @@ This is best observed via walking through an example, based on @subsection Using the Callback API with static functions Consider a function: + @verbatim -static double -CbOne (double a, double b) -{ - std::cout << "invoke cbOne a=" << a << ", b=" << b << std::endl; - return a; -} + static double + CbOne (double a, double b) + { + std::cout << "invoke cbOne a=" << a << ", b=" << b << std::endl; + return a; + } @end verbatim Consider also the following main program snippet: + @verbatim -int main (int argc, char *argv[]) -{ - // return type: double - // first arg type: double - // second arg type: double - Callback one; -} + int main (int argc, char *argv[]) + { + // return type: double + // first arg type: double + // second arg type: double + Callback one; + } @end verbatim -This class template Callback implements what is known as the Functor -Design Pattern. It is used to declare the type of a callback. It contains -one mandatory argument (the return type of the function to be assigned -to this callback) and up to five optional arguments, which each specify -the type of the arguments (if your function has more than five arguments, -then this can be handled by extending the callback implementation). +This is an example of a C-style callback -- one which does not include or need +a @code{this} pointer. The funtion template @code{Callback} is esentially the +declaration of the variable containing the pointer-to-function. In the example +above, we explicitly showed a pointer to a function that returned an integer and +took a single integer as a parameter, The @code{Callback} template function is +a generic version of that -- it is used to declare the type of a callback. -So in the above, we have a declared a callback named "one" that will -eventually hold a function pointer. The function that it will hold -must return double and must support two double arguments. If one -tries to pass a function whose signature does not match the declared -callback, the compilation will fail. +The @code{Callback} template requires one mandatory argument (the return type +of the function to be assigned to this callback) and up to five optional +arguments, which each specify the type of the arguments (if your particular +callback function has more than five arguments, then this can be easily handled +by extending the callback implementation). + +So in the above example, we have a declared a callback named "one" that will +eventually hold a function pointer. The signature of the function that it will +hold must return double and must support two double arguments. If one tries +to pass a function whose signature does not match the declared callback, the +compilation will fail. + +Now, we need to tie together this callback instance and the actual target function +(CbOne). Notice above that CbOne has the same function signature types as the +callback-- this is important. We can pass in any such properly-typed function +to this callback. Let's look at this more closely: -Now, we need to tie together this callback instance and the actual -target function (CbOne). Notice above that CbOne has the same function -signature types as the callback-- this is important. We can -pass in any such properly-typed function to this callback. Let's -look at this more closely: @verbatim static double CbOne (double a, double b) {} ^ ^ ^ @@ -177,109 +388,199 @@ static double CbOne (double a, double b) {} | | | Callback one; @end verbatim -You can only bind a function to a callback if they have the matching -signature. The first template argument is the return type, and the -additional template arguments are the types of the arguments of -the function signature. -Now, let's bind our callback "one" to the function that matches its -signature: +You can only bind a function to a callback if they have the matching signature. +The first template argument is the return type, and the additional template +arguments are the types of the arguments of the function signature. + +Now, let's bind our callback "one" to the function that matches its signature: + @verbatim // build callback instance which points to cbOne function one = MakeCallback (&CbOne); @end verbatim -Then, later in the program, if the callback is to be used, it can be -used as follows: +This call to @code{MakeCallback} is, in essence, creating one of the specialized +functors mentioned above. The variable declared using the @code{Callback} +template function is going to be playing the part of the generic functor. The +assignment @code{one = MakeCallback (&CbOne)} is the cast that converts the +specialized functor known to the callee to a generic functor known to the caller. + +Then, later in the program, if the callback is needed, it can be used as follows: @verbatim -// this is not a null callback NS_ASSERT (!one.IsNull ()); + // invoke cbOne function through callback instance double retOne; retOne = one (10.0, 20.0); @end verbatim -The check @code{IsNull()} ensures that the callback is not null; that there -is a function to call behind this callback. Then, @code{one()} returns the -same result as if @code{CbOne()} had been called directly. - +The check for @code{IsNull()} ensures that the callback is not null -- that there +is a function to call behind this callback. Then, @code{one()} executes the +generic @code{operator()} which is really overloaded with a specific implementation +of @code{operator()} and returns the same result as if @code{CbOne()} had been +called directly. @subsection Using the Callback API with member functions -Generally, you will not be calling static functions but instead -public member functions of an object. In this case, an extra -argument is needed to the MakeCallback function, to tell the system -on which object the function should be invoked. Consider this example, -also from main-callback.cc: +Generally, you will not be calling static functions but instead public member +functions of an object. In this case, an extra argument is needed to the +MakeCallback function, to tell the system on which object the function should be +invoked. Consider this example, also from main-callback.cc: @verbatim -class MyCb { -public: - int CbTwo (double a) { - std::cout << "invoke cbTwo a=" << a << std::endl; - return -5; - } -}; + class MyCb { + public: + int CbTwo (double a) { + std::cout << "invoke cbTwo a=" << a << std::endl; + return -5; + } + }; -int main () -{ - ... - // return type: int - // first arg type: double - Callback two; - MyCb cb; - // build callback instance which points to MyCb::cbTwo - two = MakeCallback (&MyCb::CbTwo, &cb); - ... -} + int main () + { + ... + // return type: int + // first arg type: double + Callback two; + MyCb cb; + // build callback instance which points to MyCb::cbTwo + two = MakeCallback (&MyCb::CbTwo, &cb); + ... + } @end verbatim -Here, we pass a (raw) pointer to the @code{MakeCallback<>} function, -that says, when @code{two ()} is invoked, to call the @code{CbTwo} function -on the object pointed to by @code{&cb}. - -A variation of this is used when objects are referred to by ns-3 smart -pointers. The MakeCallback API takes a raw pointer, so we need to -call @code{PeekPointer ()} to obtain this raw pointer. So the example -above would look like: +Here, we pass an additional object pointer to the @code{MakeCallback<>} function. +Recall from the example above that @code{Operator()} will use the pointer to +member syntax when it executes on an object: @verbatim -class MyCb : public Object { -public: - int CbTwo (double a) { - std::cout << "invoke cbTwo a=" << a << std::endl; - return -5; - } -}; - -int main () -{ - ... - // return type: int - // first arg type: double - Callback two; - Ptr cb = CreateObject (); - // build callback instance which points to MyCb::cbTwo - two = MakeCallback (&MyCb::CbTwo, PeekPointer (cb)); - ... -} + virtual int operator() (ARG arg) + { + (*m_p.*m_pmi)(arg); + } @end verbatim +And so we needed to provide the two variables (@code{m_p} and @code{m_pmi}) when +we made the specific functor. The line, + +@verbatim + two = MakeCallback (&MyCb::CbTwo, &cb); +@end verbatim + +does precisely that. In this case, + +When @code{two ()} is invoked, + +@verbatim + int result = two (1.0); +@end verbatim + +I will result in a call the @code{CbTwo} member function (method) on the object +pointed to by @code{&cb}. + @subsection Building Null Callbacks It is possible for callbacks to be null; hence it may be wise to check before using them. There is a special construct for a null callback, which is preferable to simply passing "0" as an argument; it is the @code{MakeNullCallback<>} construct: + @verbatim two = MakeNullCallback (); - // invoking a null callback is just like - // invoking a null function pointer: - // it will crash at runtime. - //int retTwoNull = two (20.0); NS_ASSERT (two.IsNull ()); @end verbatim +Invoking a null callback is just like invoking a null function pointer: it will +crash at runtime. + +@node Bound Callbacks +@section Bound Callbacks + +A very useful extension to the functor concept is that of a Bound Callback. +Previously it was mentioned that closures were originally function calls +packaged up for later execution. Notice that in all of the Callback +descriptions above, there is no way to package up any parameters for use +later -- when the @code{Callback} is called via @code{operator()}. All of +the parameters are provided by the calling function. + +What if it is desired to allow the client function (the one that provides the +callback) to provide some of the parameters? Alexandrescu calls the process of +allowing a client to specify one of the parameters @emph{binding}. One of the +parameters of @code{operator()} has been bound (fixed) by the client. + +Some of our pcap tracing code provides a nice example of this. There is a +function that needs to be called whenever a packet is received. This function +calls an object that actually writes the packet to disk in the pcap file +format. The signature of one of these functions will be, + +@verbatim + static void SniffEvent (Ptr writer, Ptr packet); +@end verbatim + +The static keyword means this is a static function which does not need a +@code{this} pointer, so it will be using C-style callbacks. We don't want the +calling code to have to know about anything but the Packet. What we want there +is just a call that looks like, + +@verbatim + m_promiscSnifferTrace (m_currentPkt); +@end verbatim + +What we want to do is to @emph{bind} the @code{Ptr writer} to the +specific callback implementation when it is created and arrange for the +@code{operator()} of the Callback to provide that parameter for free. + +We provide the @code{MakeBoundCallback} template function for that purpose. It +takes the same parameters as the @code{MakeCallback} template function but also +takes the parameters to be bound. In the case of the example above, + +@verbatim + MakeBoundCallback (&CsmaHelper::SniffEvent, pcap)); +@end verbatim + +Will create a specific callback implementation that knows to add in the extra +bound arguments. Conceptually, it extends the specific functor described above +with one or more bound arguments + +@verbatim + template + class SpecificFunctor : public Functor + { + public: + SpecificFunctor(T* p, int (T::*_pmi)(ARG arg), BOUND_ARG boundArg) + { + m_p = p; + m_pmi = pmi; + m_boundArg = boundArg; + } + + virtual int operator() (ARG arg) + { + (*m_p.*m_pmi)(m_boundArg, arg); + } + private: + void (T::*m_pmi)(ARG arg); + T* m_p; + BOUND_ARG m_boundArg; + }; +@end verbatim + +You can see that when the specific functor is created, the bound argument is saved +in the functor / callback object itself. When the @code{operator()} is invoked with +the single parameter, as in + +@verbatim + m_promiscSnifferTrace (m_currentPkt); +@end verbatim + +the imlpementation of @code{operator()} adds the bound parameter into the actual +function call: + +@verbatim + (*m_p.*m_pmi)(m_boundArg, arg); +@end verbatim + @node Callback locations in ns-3 @section Callback locations in @command{ns-3} @@ -290,18 +591,18 @@ more visible ones to typical users: @subsection Layer-2/Layer-3 API @subsection Tracing subsystem @subsection Routing -Route Reply @node Implementation details @section Implementation details -This section is advanced explanation for C++ experts interested in -the implementation, and may be skipped by most users. +The code snippets above are simplistic and only designed to illustrate the mechanism +itself. The actual Callback code is quite complicated and very template-intense and +a deep understanding of the code is not required. If interested, expert users may +find the following useful: -This code was originally written based on the techniques described +The code was originally written based on the techniques described @uref{http://www.codeproject.com/cpp/TTLFunction.asp,,here}. -It was subsequently rewritten to follow the architecture -outlined in +It was subsequently rewritten to follow the architecture outlined in @uref{http://www.amazon.com/Modern-C\%2B\%2B-Design-Programming-Patterns/dp/0201704315/ref=pd_bbs_sr_1/102-0157303-1900156?ie=UTF8\&s=books\&qid=1187982662\&sr=1-1,,Modern C++ Design: Generic Programming and Design Patterns Applied-- Alexandrescu}, chapter 5, "Generalized Functors". This code uses: @@ -319,9 +620,7 @@ member functions. value semantics. @end itemize -This code most notably departs from the Alexandrescu -implementation in that it does not use type lists to specify -and pass around the types of the callback arguments. -Of course, it also does not use copy-destruction semantics -and relies on a reference list rather than autoPtr to hold -the pointer. +This code most notably departs from the Alexandrescu implementation in that it +does not use type lists to specify and pass around the types of the callback +arguments. Of course, it also does not use copy-destruction semantics and +relies on a reference list rather than autoPtr to hold the pointer. diff --git a/doc/manual/manual.texi b/doc/manual/manual.texi index ba1a18a59..2029549e3 100644 --- a/doc/manual/manual.texi +++ b/doc/manual/manual.texi @@ -56,6 +56,9 @@ along with this program. If not, see @uref{http://www.gnu.org/licenses/}. @title ns-3 Reference Manual @author ns-3 project @author feedback: ns-developers@@isi.edu + +@b{Simulator version: } +@include VERSION @today{} @c @page @@ -76,14 +79,18 @@ along with this program. If not, see @uref{http://www.gnu.org/licenses/}. For a pdf version of this manual, see @uref{http://www.nsnam.org/docs/manual.pdf}. +Simulator version: +@include VERSION + @insertcopying @end ifnottex @menu * Random variables:: * Callbacks:: -* Attributes:: * Object model:: +* Attributes:: +* Tracing:: * RealTime:: * Emulation:: * Packets:: @@ -100,8 +107,9 @@ see @uref{http://www.nsnam.org/docs/manual.pdf}. @include random.texi @include callbacks.texi -@include attributes.texi @include objects.texi +@include attributes.texi +@include tracing.texi @include realtime.texi @include emulation.texi @include packets.texi diff --git a/doc/manual/tracing.texi b/doc/manual/tracing.texi new file mode 100644 index 000000000..d98ff8fb5 --- /dev/null +++ b/doc/manual/tracing.texi @@ -0,0 +1,328 @@ +@node Tracing +@chapter Tracing + +The tracing subsystem is one of the most important mechansisms to understand in +@command{ns-3}. In most cases, @command{ns-3} users will have a brilliant idea +for some new and improved networking feature. In order to verify that this +idea works, the researcher will make changes to an existing system and then run +experiments to see how the new feature behaves by gathering some form of statistic +that captures the behavior of the feature. + +In other words, the whole point of running a simulation is to generate output for +further study. In @command{ns-3}, the subsystem that enables a researcher to do +this is the tracing subsystem. + +@menu +* Motivation:: +* Overview:: +* Using the Tracing API:: +* Implementation details:: +@end menu + +@node Motivation +@section Motivation + +There are many ways to get information out of a program. The most straightforward +way is to just directly print the information to the standard output, as in, + +@verbatim + #include + ... + int main () + { + ... + std::cout << ``The value of x is `` << x << std::endl; + ... + } +@end verbatim + +This is workable in small environments, but as your simulations get more and more +compliated, you end up with more and more prints and the task of parsing and +performing computations on the output begins to get harder and harder. + +Another thing to consider is that every time a new tidbit is needed, the software +core must be edited and another print introduced. There is no standardized way +to control all of this output, so the amount of output tends to grow without +bounds. Eventually, the bandwidth required for simply outputting this information +begins to limit the running time of the simulation. The output files grow to +enormous sizes and parsing them becomes a problem. + +@command{ns-3} provides a simple mechanism for logging and providing some control +over output via @emph{Log Components}, but the level of control is not very fine +grained at all. The logging module is a relatively blunt instrument. + +It is desirable to have a facility that allows one to reach into the core system +and only get the information required without having to change and recompile the +core system. Even better would be a system that notified the user when an item +of interest changed or an interesting event happened. + +The @command{ns-3} tracing system is designed to work along those lines and is +well-integrated with the Attribute and Config substems allowing for relatively +simple use scenarios. + +@node Overview +@section Overview + +The tracing subsystem relies heavily on the @code{ns-3} Callback and Attribute +mechanisms. You should read and understand the corresponding sections of the +manual before attempting to understand the tracing system. + +The ns-3 tracing system is built on the concepts of independent tracing sources +and tracing sinks; along with a uniform mechanism for connecting sources to sinks. + +Trace sources are entities that can signal events that happen in a simulation and +provide access to interesting underlying data. For example, a trace source could +indicate when a packet is received by a net device and provide access to the +packet contents for interested trace sinks. A trace source might also indicate +when an iteresting state change happens in a model. For example, the congestion +window of a TCP model is a prime candidate for a trace source. + +Trace sources are not useful by themselves; they must be connected to other pieces +of code that actually do something useful with the information provided by the source. +The entities that consume trace information are called trace sinks. Trace sources +are generators of events and trace sinks are consumers. + +This explicit division allows for large numbers of trace sources to be scattered +around the system in places which model authors believe might be useful. Unless +a user connects a trace sink to one of these sources, nothing is output. This +arrangement allows relatively unsophisticated users to attach new types of sinks +to existing tracing sources, without requiring editing and recompiling the core +or models of the simulator. + +There can be zero or more consumers of trace events generated by a trace source. +One can think of a trace source as a kind of point-to-multipoint information link. + +The ``transport protocol'' for this conceptual point-to-multipoint link as an +@code{ns-3} @code{Callback}. + +Recall from the Callback Section that callback facility is a way to allow two +modules in the system to communicate via function calls while at the same time +decoupling the calling function from the called class completely. This is the +same requirement as outlined above for the tracing system. + +Basically, a trace source @emph{is} a callback. When a trace sink expresses +interest in receiving trace events, it adds a callback to a list of callbacks +held by the trace source. When an interesting event happens, the trace source +invokes its @code{operator()} providing zero or more parameters. This tells +the source to go through its list of callbacks invoking each one in turn. In +this way, the parameter(s) are communicated to the trace sinks, which are just +functions. + +@subsection The Simplest Example + +It will be useful to go walk a quick example just to reinforce what we've said. + +@verbatim + #include ``ns3/object.h'' + #include ``ns3/uinteger.h'' + #include ``ns3/traced-value.h'' + #include ``ns3/trace-source-accessor.h'' + + #include + + using namespace ns3; +@end verbatim + +The first thing to do is include the required files. As mentioned above, the +trace system makes heavy use of the Object and Attribute systems. The first +two includes bring in the declarations for those systems. The file, +@code{traced-value.h} brings in the required declarations for tracing data +that obeys value semantics. + +In general, value semantics just means that you can pass the object around, +not an address. In order to use value semantics at all you have to have an +object with an associated copy constructor and assignment operator +available. We extend the requirements to talk about the set of operators +that are pre-defined for plain-old-data (POD) types. Operator=, operator++, +operator--, operator+, operator==, etc. + +What this all means is that you will be able to trace changes to an object +made using those operators. + +@verbatim + class MyObject : public Object + { + public: + static TypeId GetTypeId (void) + { + static TypeId tid = TypeId ("MyObject") + .SetParent (Object::GetTypeId ()) + .AddConstructor () + .AddTraceSource ("MyInteger", + "An integer value to trace.", + MakeTraceSourceAccessor (&MyObject::m_myInt)) + ; + return tid; + } + + MyObject () {} + TracedValue m_myInt; + }; +@end verbatim + +Since the tracing system is integrated with Attributes, and Attributes work +with Objects, there must be an @command{ns-3} @code{Object} for the trace source +to live in. The two important lines of code are the @code{.AddTraceSource} and +the @code{TracedValue} declaration. + +The @code{.AddTraceSource} provides the ``hooks'' used for connecting the trace +source to the outside world. The @code{TracedValue} declaration provides the +infrastructure that overloads the operators mentioned above and drives the callback +process. + +@verbatim + void + IntTrace (Int oldValue, Int newValue) + { + std::cout << ``Traced `` << oldValue << `` to `` << newValue << std::endl; + } +@end verbatim + +This is the definition of the trace sink. It corresponds directly to a callback +function. This function will be called whenever one of the operators of the +@code{TracedValue} is executed. + +@verbatim + int + main (int argc, char *argv[]) + { + Ptr myObject = CreateObject (); + + myObject->TraceConnectWithoutContext ("MyInt", MakeCallback(&IntTrace)); + + myObject->m_myInt = 1234; + } +@end verbatim + +In this snippet, the first thing that needs to be done is to create the object +in which the trace source lives. + +The next step, the @code{TraceConnectWithoutContext}, forms the connection +between the trace source and the trace sink. Notice the @code{MakeCallback} +template function. Recall from the Callback section that this creates the +specialized functor responsible for providing the overloaded @code{operator()} +used to ``fire'' the callback. The overloaded operators (++, --, etc.) will +use this @code{operator()} to actually invoke the callback. The +@code{TraceConnectWithoutContext}, takes a string parameter that provides +the name of the Attribute assigned to the trace source. Let's ignore the bit +about context for now since it is not important yet. + +Finally, the line, + +@verbatim + myObject->m_myInt = 1234; +@end verbatim + +should be interpreted as an invocation of @code{operator=} on the member +variable @code{m_myInt} with the integer @code{1234} passed as a parameter. +It turns out that this operator is defined (by @code{TracedValue}) to execute +a callback that returns void and takes two integer values as parameters -- +an old value and a new value for the integer in question. That is exactly +the function signature for the callback function we provided -- @code{IntTrace}. + +To summarize, a trace source is, in essence, a variable that holds a list of +callbacks. A trace sink is a function used as the target of a callback. The +Attribute and object type information systems are used to provide a way to +connect trace sources to trace sinks. The act of ``hitting'' a trace source +is executing an operator on the trace source which fires callbacks. This +results in the trace sink callbacks registering interest in the source being +called with the parameters provided by the source. + +@subsection Using the Config Subsystem to Connect to Trace Sources + +The @code{TraceConnectWithoutContext} call shown above in the simple example is +actually very rarely used in the system. More typically, the @code{Config} +subsystem is used to allow selecting a trace source in the system using what is +called a @emph{config path}. + +For example, one might find something that looks like the following in the system +(taken from @code{examples/tcp-large-transfer.cc}) + +@verbatim + void CwndTracer (uint32_t oldval, uint32_t newval) {} + + ... + + Config::ConnectWithoutContext ( + "/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow", + MakeCallback (&CwndTracer)); +@end verbatim + +This should look very familiar. It is the same thing as the previous example, +except that a static member function of class @code{Config} is being called instead +of a method on @code{Object}; and instead of an @code{Attribute} name, a path is +being provided. + +The first thing to do is to read the path backward. The last segment of the path +must be an @code{Attribute} of an @code{Object}. In fact, if you had a pointer to +the @code{Object} that has the ``CongestionWindow'' @code{Attribute} handy (call it +@code{theObject}), you could write this just like the previous example: + +@verbatim + void CwndTracer (uint32_t oldval, uint32_t newval) {} + + ... + + theObject->TraceConnectWithoutContext ("CongestionWindow", MakeCallback (&CwndTracer)); +@end verbatim + +It turns out that the code for @code{Config::ConnectWithoutContext} does exactly that. +This function takes a path that represents a chain of @code{Object} pointers and follows +them until it gets to the end of the path and interprets the last segment as an +@code{Attribute} on the last object. Let's walk through what happens. + +The leading ``/'' character in the path refers to a so-called namespace. One of the +predefined namespaces in the config system is ``NodeList'' which is a list of all of +the nodes in the simulation. Items in the list are referred to by indices into the +list, so ``/NodeList/0'' refers to the zeroth node in the list of nodes created by +the simulation. This node is actually a @code{Ptr} and so is a subclass of +an @code{ns3::Object}. + +As described in the Object Model section, @code{ns-3} supports an object aggregation +model. The next path segment begins with the ``$'' character which indicates a +@code{GetObject} call should be made looking for the type that follows. When a +node is initialized by an @code{InternetStackHelper} a number of interfaces are +aggregated to the node. One of these is the TCP level four protocol. The runtime +type of this protocol object is ``ns3::TcpL4Protocol''. When the @code{GetObject} +is executed, it returns a pointer to the object of this type. + +The @code{TcpL4Protocol} class defines an Attribute called ``SocketList'' which is +a list of sockets. Each socket is actually an @code{ns3::Object} with its own +@code{Attributes}. The items in the list of sockets are referred to by index just +as in the NodeList, so ``SocketList/0'' refers to the zeroth socket in the list +of sockets on the zeroth node in the NodeList -- the first node constructed in the +simulation. + +This socket, the type of which turns out to be an @code{ns3::TcpSocketImpl} defines +an attribute called ``CongestionWindow'' which is a @code{TracedValue}. +The @code{Config::ConnectWithoutContext} now does a, + +@verbatim + object->TraceConnectWithoutContext ("CongestionWindow", MakeCallback (&CwndTracer)); +@end verbatim + +using the object pointer from ``SocketList/0'' which makes the connection between +the trace source defined in the socket to the callback -- @code{CwndTracer}. + +Now, whenever a change is made to the @code{TracedValue} representing the +congestion window in the TCP socket, the registered callback will be executed and +the function @code{Cwndtracer} will be called printing out the old and new values +of the TCP congestion window. + +@node Using the Tracing API +@section Using the Tracing API + + There +are three levels of interaction with the tracing system: + +@itemize @bullet +@item Beginning user can easily control which objects are participating in tracing; +@item Intermediate users can extend the tracing system to modify the output format +generated or use existing trace sources in different ways, without modifying the +core of the simulator; +@item Advanced users can modify the simulator core to add new tracing sources and +sinks. +@end itemize + +@node Implementation details +@section Implementation details diff --git a/doc/testing/Makefile b/doc/testing/Makefile new file mode 100644 index 000000000..b533252ff --- /dev/null +++ b/doc/testing/Makefile @@ -0,0 +1,47 @@ +TEXI2HTML = texi2html +TEXI2PDF = texi2dvi --pdf +EPSTOPDF = epstopdf +DIA = dia +CONVERT = convert +CSS = --css-include=testing.css +SPLIT = --split section + +FIGURES = figures +VPATH = $(FIGURES) + +IMAGES_EPS = \ + +IMAGES_PNG = ${IMAGES_EPS:.eps=.png} +IMAGES_PDF = ${IMAGES_EPS:.eps=.pdf} + +IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF) + +CHAPTERS = \ + testing.texi \ + overview.texi \ + propagation-loss.texi \ + +%.eps : %.dia; $(DIA) -t eps $< -e $@ +%.png : %.dia; $(DIA) -t png $< -e $@ +%.pdf : %.eps; $(EPSTOPDF) $< -o=$@ + +all: $(IMAGES) version testing.pdf testing.html testing/testing.html + +testing.pdf: version $(IMAGES) $(CHAPTERS) + $(TEXI2PDF) testing.texi + +testing.html: version $(IMAGES) $(CHAPTERS) + $(TEXI2HTML) ${CSS} testing.texi + +testing/testing.html: version $(IMAGES) $(CHAPTERS) + $(TEXI2HTML) ${CSS} ${SPLIT} testing.texi + +figures-clean: + rm -rf $(IMAGES) + +version: + echo -n "ns-" > VERSION-PREFIX; cat VERSION-PREFIX ../../VERSION > VERSION; rm -rf VERSION-PREFIX + +clean: figures-clean + rm -rf testing.aux testing.cp testing.cps testing.fn testing.ky testing.pg + rm -rf testing.tp testing.vr testing.toc testing.log testing.pdf testing.html testing/ VERSION missfont.log diff --git a/doc/testing/background.texi b/doc/testing/background.texi new file mode 100644 index 000000000..6a23a23b0 --- /dev/null +++ b/doc/testing/background.texi @@ -0,0 +1,224 @@ +@c ======================================================================== +@c Background +@c ======================================================================== + +@node Background +@chapter Background + +@cartouche +@emph{This chapter may be skipped by readers familiar with the basics of +software testing.} +@end cartouche + +Writing defect-free software is a difficult proposition. There are many +dimensions to the problem and there is much confusion regarding what is +meant by different terms in different contexts. We have found it worthwhile +to spend a little time reviewing the subject and defining some terms. + +Software testing may be loosely defined as the process of executing a program +with the intent of finding errors. When one enters a discussion regarding +software testing, it quickly becomes apparent that there are many distinct +mind-sets with which one can approach the subject. + +For example, one could break the process into broad functional categories +like ``correctness testing,'' ``performance testing,'' ``robustness testing'' +and ``security testing.'' Another way to look at the problem is by life-cycle: +``requirements testing,'' ``design testing,'' ``acceptance testing,'' and +``maintenance testing.'' Yet another view is by the scope of the tested system. +In this case one may speak of ``unit testing,'' ``component testing,'' +``integration testing,'' and ``system testing.'' These terms are also not +standardized in any way, and so ``maintenance testing'' and ``regression +testing'' may be heard interchangeably. Additionally, these terms are often +misused. + +There are also a number of different philosophical approaches to software +testing. For example, some organizations advocate writing test programs +before actually imlementing the desired software, yielding ``test-driven +development.'' Some organizations advocate testing from a customer perspective +as soon as possible, following a parallel with the agile development process: +``test early and test often.'' This is sometimes called ``agile testing.'' It +seems that there is at least one approach to testing for every development +methodology. + +The @command{ns-3} project is not in the business of advocating for any one of +these processes, but the project as a whole has requirements that help inform +the test process. + +Like all major software products, @command{ns-3} has a number of qualities that +must be present for the product to succeed. From a testing perspective, some +of these qualities that must be addressed are that @command{ns-3} must be +``correct,'' ``robust,'' ``performant'' and ``maintainable.'' Ideally there +should be metrics for each of these dimensions that are checked by the tests +to identify when the product fails to meet its expectations / requirements. + +@node Correctness +@section Correctness + +The essential purpose of testing is to determine that a piece of software +behaves ``correctly.'' For @command{ns-3} this means that if we simulate +something, the simulation should faithfully represent some physical entity or +process to a specified accuracy and precision. + +It turns out that there are two perspectives from which one can view +correctness. Verifying that a particular model is implemented according +to its specification is generically called @emph{verification}. The process of +deciding that the model is correct for its intended use is generically called +@emph{validation}. + +@node ValidationAndVerification +@section Validation and Verification + +A computer model is a mathematical or logical representation of something. It +can represent a vehicle, an elephant (see +@uref{http://www.simutools.org,,David Harel's talk about modeling an +elephant at SIMUTools 2009}, or a networking card. Models can also represent +processes such as global warming, freeway traffic flow or a specification of a +networking protocol. Models can be completely faithful representations of a +logical process specification, but they necessarily can never completely +simulate a physical object or process. In most cases, a number of +simplifications are made to the model to make simulation computationally +tractable. + +Every model has a @emph{target system} that it is attempting to simulate. The +first step in creating a simulation model is to identify this target system and +the level of detail and accuracy that the simulation is desired to reproduce. +In the case of a logical process, the target system may be identified as ``TCP +as defined by RFC 793.'' In this case, it will probably be desirable to create +a model that completely and faithfully reproduces RFC 793. In the case of a +physical process this will not be possible. If, for example, you would like to +simulate a wireless networking card, you may determine that you need, ``an +accurate MAC-level implementation of the 802.11 specification and [...] a +not-so-slow PHY-level model of the 802.11a specification.'' + +Once this is done, one can develop an abstract model of the target system. This +is typically an exercise in managing the tradeoffs between complexity, resource +requiremens and accuracy. The process of developing an abstract model has been +called @emph{model qualification} in the literature. In the case of a TCP +protocol, this process results in a design for a collection of objects, +interactions and behaviors that will fully implement RFC 793 in @command{ns-3}. +In the case of the wireless card, this process results in a number of tradeoffs +to allow the physical layer to be simulated and the design of a network device +and channel for ns-3, along with the desired objects, interactions and behaviors. + +This abstract model is then developed into an @command{ns-3} model that +implements the abstract model as a computer program. The process of getting the +implementation to agree with the abstract model is called @emph{model +verification} in the literature. + +The process so far is open loop. What remains is to make a determination that a +given ns-3 model has some connection to some reality -- that a model is an +accurate representation of a real system, whether a logical process or a physical +entity. + +If one is going to use a simulation model to try and predict how some real +system is going to behave, there must be some reason to believe your results -- +i.e., can one trust that an inference made from the model translates into a +correct prediction for the real system. The process of getting the ns-3 model +behavior to agree with the desired target system behavior as defined by the model +qualification process is called @emph{model validation} in the literature. In the +case of a TCP implementation, you may want to compare the behavior of your ns-3 +TCP model to some reference implementation in order to validate your model. In +the case of a wireless physical layer simulation, you may want to compare the +behavior of your model to that of real hardware in a controlled setting, + +The @command{ns-3} testing environment provides tools to allow for both model +validation and testing, and encourages the publication of validation results. + +@node Robustness +@section Robustness + +Robustness is the quality of being able to withstand stresses, or changes in +environments, inputs or calculations, etc. A system or design is ``robust'' +if it can deal with such changes with minimal loss of functionality. + +This kind of testing is usually done with a particular focus. For example, the +system as a whole can be run on many different system configurations to +demonstrate that it can perform correctly in a large number of environments. + +The system can be also be stressed by operating close to or beyond capacity by +generating or simulating resource exhaustion of various kinds. This genre of +testing is called ``stress testing.'' + +The system and its components may be exposed to so-called ``clean tests'' that +demostrate a positive result -- that is that the system operates correctly in +response to a large variation of expected configurations. + +The system and its components may also be exposed to ``dirty tests'' which +provide inputs outside the expected range. For example, if a module expects a +zero-terminated string representation of an integer, a dirty test might provide +an unterminated string of random characters to verify that the system does not +crash as a result of this unexpected input. Unfortunately, detecting such +``dirty'' input and taking preventive measures to ensure the system does not +fail catastrophically can require a huge amount of development overhead. In +order to reduce development time, a decision was taken early on in the project +to minimize the amount of parameter validation and error handling in the +@command{ns-3} codebase. For this reason, we do not spend much time on dirty +testing -- it would just uncover the results of the design decision we know +we took. + +We do want to demonstrate that @command{ns-3} software does work across some set +of conditions. We borrow a couple of definitions to narrow this down a bit. +The @emph{domain of applicability} is a set of prescribed conditions for which +the model has been tested, compared against reality to the extent possible, and +judged suitable for use. The @emph{range of accuracy} is an agreement between +the computerized model and reality within a domain of applicability. + +The @command{ns-3} testing environment provides tools to allow for setting up +and running test environments over multiple systems (buildbot) and provides +classes to encourage clean tests to verify the operation of the system over the +expected ``domain of applicability'' and ``range of accuracy.'' + +@node Performant +@section Performant + +Okay, ``performant'' isn't a real English word. It is, however, a very concise +neologism that is quite often used to describe what we want @command{ns-3} to +be: powerful and fast enough to get the job done. + +This is really about the broad subject of software performance testing. One of +the key things that is done is to compare two systems to find which performs +better (cf benchmarks). This is used to demonstrate that, for example, +@code{ns-3} can perform a basic kind of simulation at least as fast as a +competing tool, or can be used to identify parts of the system that perform +badly. + +In the @code{ns-3} test framework, we provide support for timing various kinds +of tests. + +@node Maintainability +@section Maintainability + +A software product must be maintainable. This is, again, a very broad +statement, but a testing framework can help with the task. Once a model has +been developed, validated and verified, we can repeatedly execute the suite +of tests for the entire system to ensure that it remains valid and verified +over its lifetime. + +When a feature stops functioning as intended after some kind of change to the +system is integrated, it is called generically a @emph{regression}. +Originally the +term regression referred to a change that caused a previously fixed bug to +reappear, but the term has evolved to describe any kind of change that breaks +existing functionality. There are many kinds of regressions that may occur +in practice. + +A @emph{local regression} is one in which a change affects the changed component +directy. For example, if a component is modified to allocate and free memory +but stale pointers are used, the component itself fails. + +A @emph{remote regression} is one in which a change to one component breaks +functionality in another component. This reflects violation of an implied but +possibly unrecognized contract between components. + +An @emph{unmasked regression} is one that creates a situation where a previously +existing bug that had no affect is suddenly exposed in the system. This may +be as simple as exercising a code path for the first time. + +A @emph{performance regression} is one that causes the performance requirements +of the system to be violated. For example, doing some work in a low level +function that may be repeated large numbers of times may suddenly render the +system unusable from certain perspectives. + +The @command{ns-3} testing framework provides tools for automating the process +used to validate and verify the code in nightly test suites to help quickly +identify possible regressions. diff --git a/doc/testing/how-to-write-tests.texi b/doc/testing/how-to-write-tests.texi new file mode 100644 index 000000000..9fdc6ffe3 --- /dev/null +++ b/doc/testing/how-to-write-tests.texi @@ -0,0 +1,58 @@ +@c ======================================================================== +@c How to write tests +@c ======================================================================== + +@node How to write tests +@chapter How to write tests + +A primary goal of the ns-3 project is to help users to improve the +validity and credibility of their results. There are many elements +to obtaining valid models and simulations, and testing is a major +component. If you contribute models or examples to ns-3, you may +be asked to contribute test code. Models that you contribute will be +used for many years by other people, who probably have no idea upon +first glance whether the model is correct. The test code that you +write for your model will help to avoid future regressions in +the output and will aid future users in understanding the validity +and bounds of applicability of your models. + +There are many ways to test that a model is valid. In this chapter, +we hope to cover some common cases that can be used as a guide to +writing new tests. + +@section Sample TestSuite skeleton + +When starting from scratch (i.e. not adding a TestCase to an existing +TestSuite), these things need to be decided up front: + +@itemize @bullet +@item What the test suite will be called +@item What type of test it will be (Build Verification Test, Unit Test, +System Test, or Performance Test) +@item Where the test code will live (either in an existing ns-3 module or +separately in src/test/ directory). You will have to edit the wscript +file in that directory to compile your new code, if it is a new file. +@end itemize + +See the file @code{src/test/sample-test-suite.cc} and corresponding +wscript file in that directory for a simple example, and see the directories +under @code{src/test} for more complicated examples. + +@cartouche +@emph{The rest of this chapter remains to be written} +@end cartouche + +@section How to add an example program to the test suite + +@section Testing for boolean outcomes + +@section Testing outcomes when randomness is involved + +@section Testing output data against a known distribution + +@section Providing non-trivial input vectors of data + +@section Storing and referencing non-trivial output data + +@section Presenting your output test data + diff --git a/doc/testing/overview.texi b/doc/testing/overview.texi new file mode 100644 index 000000000..2b4b3bc70 --- /dev/null +++ b/doc/testing/overview.texi @@ -0,0 +1,23 @@ +@c ======================================================================== +@c Overview +@c ======================================================================== + +@node Overview +@chapter Overview + +This document is concerned with the testing and validation of @command{ns-3} +software. + +This document provides +@itemize @bullet +@item background about terminology and software testing (Chapter 2); +@item a description of the ns-3 testing framework (Chapter 3); +@item a guide to model developers or new model contributors for how to write tests (Chapter 4); +@item validation and verification results reported to date (Chapters 5-onward). +@end itemize + +In brief, the first three chapters should be read by ns developers and +contributors who need to understand how to contribute test code and +validated programs, and +the remainder of the document provides space for people to report on what +aspects of selected models have been validated. diff --git a/doc/testing/propagation-loss.texi b/doc/testing/propagation-loss.texi new file mode 100644 index 000000000..7d6d74bbd --- /dev/null +++ b/doc/testing/propagation-loss.texi @@ -0,0 +1,128 @@ +@node Propagation Loss Models +@chapter Propagation Loss Models +@anchor{chap:propagation-loss-models} + +This chapter describes validation of ns-3 propagation loss models. + +@section FriisPropagationLossModel + +@subsection Model reference + +From source: @uref{http://www.scribd.com/doc/6650712/Wireless-CommunicationsPrinciples-and-Practice-Theodore-S,, Wireless Communications-Principles and Practice ,Theodore S Rappaport pg. 71 } + +Given equation: +@smallformat +@verbatim +Pr = Pt*Gt*Gr*lmb^2/((4*pi)^2*d^2*L) + +Pt = 10^(17.0206/10)/10^3 = .05035702 +Pr = .05035702*.125^2/((4*pi)^2*d*1) = 4.98265e-6/d^2 + +bandwidth = 2.2*10^7 +m_noiseFigure = 5.01187 +noiseFloor = ((Thermal noise (K)* BOLTZMANN * bandwidth)* m_noiseFigure) +noiseFloor = ((290*1.3803*10^-23*2.2*10^7)*5.01187) = 4.41361e-13W +no interference, so SNR = Pr/4.41361e-13W + +Distance :: Pr :: SNR +100 4.98265e-10W 1128.93 +500 1.99306e-11W 45.1571 +1000 4.98265e-12W 11.2893 +2000 1.24566e-12W 2.82232 +3000 5.53628e-13W 1.25436 +4000 3.11416e-13W 0.70558 +5000 1.99306e-13W 0.451571 +6000 1.38407e-13W 0.313591 +@end verbatim +@end smallformat + +@subsection Validation test + +Test program available online at: @uref{http://xxx.xxx.com,,} + +Taken at default settings (packetSize = 1000, numPackets = 1, lambda = 0.125, 802.11b at 2.4GHz): +@smallformat +@verbatim +Distance :: Pr :: SNR +100 4.98265e-10W 1128.93 +500 1.99306e-11W 45.1571 +1000 4.98265e-12W 11.2893 +2000 1.24566e-12W 2.82232 +3000 5.53628e-13W 1.25436 +4000 3.11416e-13W 0.70558 +5000 1.99306e-13W 0.451571 +6000 1.38407e-13W 0.313591 +7000 1.01687e-13W 0.230393 +8000 7.78539e-14W 0.176395 +@end verbatim +@end smallformat + +@subsection Discussion + +As can be seen, the SNR outputted from the simulator, and the SNR computed from the source's equation are identical. + +@section LogDistancePropagationLossModel + +@subsection Model reference + +From source: @uref{http://www.plextek.co.uk/papers/aps2005mcw.pdf,, Urban Propagation Measurements and Statistical Path Loss Model at 3.5 GHz, Marcus C. Walden, Frank J. Rowsell} + +Given equation: +@smallformat +@verbatim +PL{dBm} = PL(d0) + 10*n*log(d/d0) + Xs + +PL(1) from friis at 2.4GHz: 40.045997dBm +PL{dBm} = 10*log(.050357/Pr) = 40.045997 + 10*n*log(d) + Xg +Pr = .050357/(10^((40.045997 + 10*n*log(d) + Xg)/10)) + +bandwidth = 2.2*10^7 +m_noiseFigure = 5.01187 +no interference, so SNR = Pr/4.41361e-13W +@end verbatim + +taking Xg to be constant at 0 to match ns-3 output: +@verbatim +Distance :: Pr :: SNR +10 4.98265e-9 11289.3 +20 6.22831e-10 1411.16 +40 7.78539e-11 176.407 +60 2.30678e-11 52.2652 +80 9.73173e-12 22.0494 +100 4.98265e-12 11.2893 +200 6.22831e-13 1.41116 +500 3.98612e-14 .090314 +1000 4.98265e-15 .011289 +@end verbatim +@end smallformat + +@subsection Validation test + +Test program available online at: @uref{http://xxx.xxx.com,,} + +Taken at default settings (packetSize = 1000, numPackets = 1, exponent = 3, reference loss = 46.6777, 802.11b at 2.4GHz) +@smallformat +@verbatim +Distance :: Pr :: snr +10 4.98471e-9 11293.9 +20 6.23089e-10 1411.74 +40 7.78861e-11 176.468 +60 2.30774e-11 52.2868 +80 9.72576e-12 22.0585 +100 4.98471e-12 11.2939 +200 6.23089e-13 1.41174 +500 3.98777e-14 0.0903516 +1000 4.98471e-15 0.0112939 +@end verbatim +@end smallformat + +@subsection Discussion +There is a ~.04% error between these results. I do not believe this is +due to rounding, as the results taken from the equation from the source +match exactly with the Friis results taken at one less power of ten. +(Friis and LogDistance can be modeled by Pt*Gt*Gr*lmb^2/((4*pi)^2*d^n*L), +where n is the exponent. n is 2 for Friis, and 3 for logDistance, which +accounts for the power of ten. ie: Friis at 100m is equivalent to LogDistance +at 10m.) Perhaps the ns-3 takes the random number into account despite +not being listed in the source. + diff --git a/doc/testing/random-variables.texi b/doc/testing/random-variables.texi new file mode 100644 index 000000000..cfbcc37c9 --- /dev/null +++ b/doc/testing/random-variables.texi @@ -0,0 +1,6 @@ +@node Random Variables +@chapter Random Variables + +@cartouche +@emph{Write me} +@end cartouche diff --git a/doc/testing/references.texi b/doc/testing/references.texi new file mode 100644 index 000000000..a562486d5 --- /dev/null +++ b/doc/testing/references.texi @@ -0,0 +1,9 @@ +@node References +@chapter References + +The following work about the validation of ns-3 models is published +elsewhere. + +@cartouche +@emph{Write me} +@end cartouche diff --git a/doc/testing/testing-framework.texi b/doc/testing/testing-framework.texi new file mode 100644 index 000000000..605aa173c --- /dev/null +++ b/doc/testing/testing-framework.texi @@ -0,0 +1,600 @@ +@c ======================================================================== +@c Testing framework +@c ======================================================================== + +@unnumbered Part I: Testing + +@node TestingFramework +@chapter Testing Framework + +ns-3 consists of a simulation core engine, a set of models, example programs, +and tests. Over time, new contributors contribute models, tests, and +examples. A Python test program @samp{test.py} serves as the test +execution manager; @code{test.py} can run test code and examples to +look for regressions, can output the results into a number of forms, and +can manage code coverage analysis tools. On top of this, we layer +@samp{Buildbots} that are automated build robots that perform +robustness testing by running the test framework on different systems +and with different configuration options. + +@cartouche +Insert figure showing the components here +@end cartouche + +@node BuildBots +@section Buildbots + +At the highest level of ns-3 testing are the buildbots (build robots). +If you are unfamiliar with +this system look at @uref{http://djmitche.github.com/buildbot/docs/0.7.11/}. +This is an open-source automated system that allows @command{ns-3} to be rebuilt +and tested each time something has changed. By running the buildbots on a number +of different systems we can ensure that @command{ns-3} builds and executes +properly on all of its supported systems. + +Users (and developers) typically will not interact with the buildbot system other +than to read its messages regarding test results. If a failure is detected in +one of the automated build and test jobs, the buildbot will send an email to the +@emph{ns-developers} mailing list. This email will look something like: + +@smallformat +@verbatim + The Buildbot has detected a new failure of osx-ppc-g++-4.2 on NsNam. + Full details are available at: + http://ns-regression.ee.washington.edu:8010/builders/osx-ppc-g%2B%2B-4.2/builds/0 + + Buildbot URL: http://ns-regression.ee.washington.edu:8010/ + + Buildslave for this Build: darwin-ppc + + Build Reason: The web-page 'force build' button was pressed by 'ww': ww + + Build Source Stamp: HEAD + Blamelist: + + BUILD FAILED: failed shell_5 shell_6 shell_7 shell_8 shell_9 shell_10 shell_11 shell_12 + + sincerely, + -The Buildbot +@end verbatim +@end smallformat + +In the full details URL shown in the email, one can search for the keyword +@code{failed} and select the @code{stdio} link for the corresponding step to see +the reason for the failure. + +The buildbot will do its job quietly if there are no errors, and the system will +undergo build and test cycles every day to verify that all is well. + +@node Testpy +@section Test.py +The buildbots use a Python program, @command{test.py}, that is reponsible for +running all of the tests and collecting the resulting reports into a human- +readable form. This program is also available for use by users and developers +as well. + +@command{test.py} is very flexible in allowing the user to specify the number +and kind of tests to run; and also the amount and kind of output to generate. + +By default, @command{test.py} will run all available tests and report status +back in a very concise form. Running the command, + +@verbatim + ./test.py +@end verbatim + +will result in a number of @code{PASS}, @code{FAIL}, @code{CRASH} or @code{SKIP} +indications followed by the kind of test that was run and its display name. + +@smallformat +@verbatim + Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + 'build' finished successfully (0.939s) + FAIL: TestSuite ns3-wifi-propagation-loss-models + PASS: TestSuite object-name-service + PASS: TestSuite pcap-file-object + PASS: TestSuite ns3-tcp-cwnd + ... + + PASS: TestSuite ns3-tcp-interoperability + PASS: Example csma-broadcast + PASS: Example csma-multicast +@end verbatim +@end smallformat + +This mode is indented to be used by users who are interested in determining if +their distribution is working correctly, and by developers who are interested +in determining if changes they have made have caused any regressions. + +If one specifies an optional output style, one can generate detailed descriptions +of the tests and status. Available styles are @command{text} and @command{HTML}. +The buildbots will select the HTML option to generate HTML test reports for the +nightly builds using, + +@verbatim + ./test.py --html=nightly.html +@end verbatim + +In this case, an HTML file named ``nightly.html'' would be created with a pretty +summary of the testing done. A ``human readable'' format is available for users +interested in the details. + +@verbatim + ./test.py --text=results.txt +@end verbatim + +In the example above, the test suite checking the @command{ns-3} wireless +device propagation loss models failed. By default no further information is +provided. + +To further explore the failure, @command{test.py} allows a single test suite +to be specified. Running the command, + +@verbatim + ./test.py --suite=ns3-wifi-propagation-loss-models +@end verbatim + +results in that single test suite being run. + +@verbatim + FAIL: TestSuite ns3-wifi-propagation-loss-models +@end verbatim + +To find detailed information regarding the failure, one must specify the kind +of output desired. For example, most people will probably be interested in +a text file: + +@verbatim + ./test.py --suite=ns3-wifi-propagation-loss-models --text=results.txt +@end verbatim + +This will result in that single test suite being run with the test status written to +the file ``results.txt''. + +You should find something similar to the following in that file: + +@smallformat +@verbatim +FAIL: Test Suite ``ns3-wifi-propagation-loss-models'' (real 0.02 user 0.01 system 0.00) + PASS: Test Case "Check ... Friis ... model ..." (real 0.01 user 0.00 system 0.00) + FAIL: Test Case "Check ... Log Distance ... model" (real 0.01 user 0.01 system 0.00) + Details: + Message: Got unexpected SNR value + Condition: [long description of what actually failed] + Actual: 176.395 + Limit: 176.407 +- 0.0005 + File: ../src/test/ns3wifi/propagation-loss-models-test-suite.cc + Line: 360 +@end verbatim +@end smallformat + +Notice that the Test Suite is composed of two Test Cases. The first test case +checked the Friis propagation loss model and passed. The second test case +failed checking the Log Distance propagation model. In this case, an SNR of +176.395 was found, and the test expected a value of 176.407 correct to three +decimal places. The file which implemented the failing test is listed as well +as the line of code which triggered the failure. + +If you desire, you could just as easily have written an HTML file using the +@code{--html} option as described above. + +Typically a user will run all tests at least once after downloading +@command{ns-3} to ensure that his or her environment has been built correctly +and is generating correct results according to the test suites. Developers +will typically run the test suites before and after making a change to ensure +that they have not introduced a regression with their changes. In this case, +developers may not want to run all tests, but only a subset. For example, +the developer might only want to run the unit tests periodically while making +changes to a repository. In this case, @code{test.py} can be told to constrain +the types of tests being run to a particular class of tests. The following +command will result in only the unit tests being run: + +@verbatim + ./test.py --constrain=unit +@end verbatim + +Similarly, the following command will result in only the example smoke tests +being run: + +@verbatim + ./test.py --constrain=unit +@end verbatim + +To see a quick list of the legal kinds of constraints, you can ask for them +to be listed. The following command + +@verbatim + ./test.py --kinds +@end verbatim + +will result in the following list being displayed: + +@smallformat +@verbatim + Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + 'build' finished successfully (0.939s)Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + bvt: Build Verification Tests (to see if build completed successfully) + unit: Unit Tests (within modules to check basic functionality) + system: System Tests (spans modules to check integration of modules) + example: Examples (to see if example programs run successfully) + performance: Performance Tests (check to see if the system is as fast as expected) +@end verbatim +@end smallformat + +This list is displayed in increasing order of complexity of the tests. Any of these +kinds of test can be provided as a constraint using the @code{--constraint} option. + +To see a quick list of all of the test suites available, you can ask for them +to be listed. The following command, + +@verbatim + ./test.py --list +@end verbatim + +will result in a list of the test suite being displayed, similar to : + +@smallformat +@verbatim + Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + 'build' finished successfully (0.939s) + ns3-wifi-propagation-loss-models + ns3-tcp-cwnd + ns3-tcp-interoperability + pcap-file-object + object-name-service + random-number-generators +@end verbatim +@end smallformat + +Any of these listed suites can be selected to be run by itself using the +@code{--suite} option as shown above. + +Similarly to test suites, one can run a single example program using the @code{--example} +option. + +@verbatim + ./test.py --example=udp-echo +@end verbatim + +results in that single example being run. + +@verbatim + PASS: Example udp-echo +@end verbatim + +Normally when example programs are executed, they write a large amount of trace +file data. This is normally saved to the base directory of the distribution +(e.g., /home/user/ns-3-dev). When @command{test.py} runs an example, it really +is completely unconcerned with the trace files. It just wants to to determine +if the example can be built and run without error. Since this is the case, the +trace files are written into a @code{/tmp/unchecked-traces} directory. If you +run the above example, you should be able to find the associated +@code{udp-echo.tr} and @code{udp-echo-n-1.pcap} files there. + +The list of available examples is defined by the contents of the ``examples'' +directory in the distribution. If you select an example for execution using +the @code{--example} option, @code{test.py} will not make any attempt to decide +if the example has been configured or not, it will just try to run it and +report the result of the attempt. + +When @command{test.py} runs, by default it will first ensure that the system has +been completely built. This can be defeated by selecting the @code{--nowaf} +option. + +@verbatim + ./test.py --list --nowaf +@end verbatim + +will result in a list of the currently built test suites being displayed, similar to : + +@verbatim + ns3-wifi-propagation-loss-models + ns3-tcp-cwnd + ns3-tcp-interoperability + pcap-file-object + object-name-service + random-number-generators +@end verbatim + +Note the absence of the @command{Waf} build messages. + +Finally, @code{test.py} provides a @command{--verbose} option which will print +large amounts of information about its progress. It is not expected that this +will be terribly useful for most users. + +@node TestTaxonomy +@section Test Taxonomy + +As mentioned above, tests are grouped into a number of broadly defined +classifications to allow users to selectively run tests to address the different +kinds of testing that need to be done. + +@itemize @bullet +@item Build Verification Tests +@item Unit Tests +@item System Tests +@item Examples +@item Performance Tests +@end itemize + +@node BuildVerificationTests +@subsection Build Verification Tests + +These are relatively simple tests that are built along with the distribution +and are used to make sure that the build is pretty much working. Our +current unit tests live in the source files of the code they test and are +built into the ns-3 modules; and so fit the description of BVTs. BVTs live +in the same source code that is built into the ns-3 code. Our current tests +are examples of this kind of test. + +@node UnitTests +@subsection Unit Tests + +Unit tests are more involved tests that go into detail to make sure that a +piece of code works as advertised in isolation. There is really no reason +for this kind of test to be built into an ns-3 module. It turns out, for +example, that the unit tests for the object name service are about the same +size as the object name service code itself. Unit tests are tests that +check a single bit of functionality that are not built into the ns-3 code, +but live in the same directory as the code it tests. It is possible that +these tests check integration of multiple implementation files in a module +as well. The file src/core/names-test-suite.cc is an example of this kind +of test. The file src/common/pcap-file-test-suite.cc is another example +that uses a known good pcap file as a test vector file. This file is stored +locally in the src/common directory. + +@node SystemTests +@subsection System Tests + +System tests are those that involve more than one module in the system. We +have lots of this kind of test running in our current regression framework, +but they are typically overloaded examples. We provide a new place +for this kind of test in the directory ``src/test''. The file +src/test/ns3tcp/ns3-interop-test-suite.cc is an example of this kind of +test. It uses NSC TCP to test the ns-3 TCP implementation. Often there +will be test vectors required for this kind of test, and they are stored in +the directory where the test lives. For example, +ns3tcp-interop-response-vectors.pcap is a file consisting of a number of TCP +headers that are used as the expected responses of the ns-3 TCP under test +to a stimulus generated by the NSC TCP which is used as a ``known good'' +implementation. + +@node Examples +@subsection Examples + +The examples are tested by the framework to make sure they built and will +run. Nothing is checked, and currently the pcap files are just written off +into /tmp to be discarded. If the examples run (don't crash) they pass this +smoke test. + +@node PerformanceTests +@subsection Performance Tests + +Performance tests are those which exercise a particular part of the system +and determine if the tests have executed to completion in a reasonable time. + +@node RunningTests +@section Running Tests + +Tests are typically run using the high level @code{test.py} program. They +can also be run ``manually'' using a low level test-runner executable directly +from @code{waf}. + +@node RunningTestsUnderTestRunnerExecutable +@section Running Tests Under the Test Runner Executable + +The test-runner is the bridge from generic Python code to @command{ns-3} code. +It is written in C++ and uses the automatic test discovery process in the +@command{ns-3} code to find and allow execution of all of the various tests. + +Although it may not be used directly very often, it is good to understand how +@code{test.py} actually runs the various tests. + +In order to execute the test-runner, you run it like any other ns-3 executable +-- using @code{waf}. To get a list of available options, you can type: + +@verbatim + ./waf --run "test-runner --help" +@end verbatim + +You should see something like the following: + +@smallformat +@verbatim + Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build' + 'build' finished successfully (0.353s) + --basedir=dir: Set the base directory (where to find src) to ``dir'' + --constrain=test-type: Constrain checks to test suites of type ``test-type'' + --help: Print this message + --kinds: List all of the available kinds of tests + --list: List all of the test suites (optionally constrained by test-type) + --out=file-name: Set the test status output file to ``file-name'' + --suite=suite-name: Run the test suite named ``suite-name'' + --verbose: Turn on messages in the run test suites +@end verbatim +@end smallformat + +There are a number of things available to you which will be familiar to you if +you have looked at @command{test.py}. This should be expected since the test- +runner is just an interface between @code{test.py} and @command{ns-3}. You +may notice that example-related commands are missing here. That is because +the examples are really not @command{ns-3} tests. @command{test.py} runs them +as if they were to present a unified testing environment, but they are really +completely different and not to be found here. + +One new option that appears here is the @code{--basedir} option. It turns out +that the tests may need to reference the source directory of the @code{ns-3} +distribution to find local data, so a base directory is always required to run +a test. To run one of the tests directly from the test-runner, you will need +to specify the test suite to run along with the base directory. So you could do, + +@verbatim + ./waf --run "test-runner --basedir=`pwd` --suite=pcap-file-object" +@end verbatim + +Note the ``backward'' quotation marks on the @code{pwd} command. This will run +the @code{pcap-file-object} test quietly. The only indication that +you will get that the test passed is the @emph{absence} of a message from +@code{waf} saying that the program returned something other than a zero +exit code. To get some output from the test, you need to specify an output +file to which the tests will write their XML status using the @code{--out} +option. You need to be careful interpreting the results because the test +suites will @emph{append} results onto this file. Try, + +@smallformat +@verbatim + ./waf --run "test-runner --basedir=`pwd` --suite=pcap-file-object --out=myfile.xml'' +@end verbatim +@end smallformat + +If you look at the file @code{myfile.xml} you should see something like, + +@smallformat +@verbatim + + pcap-file-object + + Check to see that PcapFile::Open with mode ``w'' works + PASS + real 0.00 user 0.00 system 0.00 + + + Check to see that PcapFile::Open with mode ``r'' works + PASS + real 0.00 user 0.00 system 0.00 + + + Check to see that PcapFile::Open with mode ``a'' works + PASS + real 0.00 user 0.00 system 0.00 + + + Check to see that PcapFileHeader is managed correctly + PASS + real 0.00 user 0.00 system 0.00 + + + Check to see that PcapRecordHeader is managed correctly + PASS + real 0.00 user 0.00 system 0.00 + + + Check to see that PcapFile can read out a known good pcap file + PASS + real 0.00 user 0.00 system 0.00 + + PASS + real 0.00 user 0.00 system 0.00 + +@end verbatim +@end smallformat + +If you are familiar with XML this should be fairly self-explanatory. It is +also not a complete XML file since test suites are designed to have their +output appended to a master XML status file as described in the @command{test.py} +section. + +@node ClassTestRunner +@section Class TestRunner + +The executables that run dedicated test programs use a TestRunner class. This +class provides for automatic test registration and listing, as well as a way to +execute the individual tests. Individual test suites use C++ global +constructors +to add themselves to a collection of test suites managed by the test runner. +The test runner is used to list all of the available tests and to select a test +to be run. This is a quite simple class that provides three static methods to +provide or Adding and Getting test suites to a collection of tests. See the +doxygen for class @code{ns3::TestRunner} for details. + +@node TestSuite +@section Test Suite + +All @command{ns-3} tests are classified into Test Suites and Test Cases. A +test suite is a collection of test cases that completely exercise a given kind +of functionality. As described above, test suites can be classified as, + +@itemize @bullet +@item Build Verification Tests +@item Unit Tests +@item System Tests +@item Examples +@item Performance Tests +@end itemize + +This classification is exported from the TestSuite class. This class is quite +simple, existing only as a place to export this type and to accumulate test +cases. From a user perspective, in order to create a new TestSuite in the +system one only has to define a new class that inherits from class @code{TestSuite} +and perform these two duties. + +The following code will define a new class that can be run by @code{test.py} +as a ``unit'' test with the display name, ``my-test-suite-name''. + +@verbatim + class MySuite : public TestSuite + { + public: + MyTestSuite (); + }; + + MyTestSuite::MyTestSuite () + : TestSuite ("my-test-suite-name", UNIT) + { + AddTestCase (new MyTestCase); + } + + MyTestSuite myTestSuite; +@end verbatim + +The base class takes care of all of the registration and reporting required to +be a good citizen in the test framework. + +@node TestCase +@section Test Case + +Individual tests are created using a TestCase class. Common models for the use +of a test case include "one test case per feature", and "one test case per method." +Mixtures of these models may be used. + +In order to create a new test case in the system, all one has to do is to inherit +from the @code{TestCase} base class, override the constructor to give the test +case a name and override the @code{DoRun} method to run the test. + +@verbatim +class MyTestCase : public TestCase +{ + MyTestCase (); + virtual bool DoRun (void); +}; + +MyTestCase::MyTestCase () + : TestCase ("Check some bit of functionality") +{ +} + +bool +MyTestCase::DoRun (void) +{ + NS_TEST_ASSERT_MSG_EQ (true, true, "Some failure message"); + return GetErrorStatus (); +} +@end verbatim + +@node Utilities +@section Utilities + +There are a number of utilities of various kinds that are also part of the +testing framework. Examples include a generalized pcap file useful for +storing test vectors; a generic container useful for transient storage of +test vectors during test execution; and tools for generating presentations +based on validation and verification testing results. + + + + + diff --git a/doc/testing/testing.css b/doc/testing/testing.css new file mode 100644 index 000000000..a7586ac83 --- /dev/null +++ b/doc/testing/testing.css @@ -0,0 +1,156 @@ +body { + font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif; + background: white; + color: black; + font-size: 11pt; +} + +h1, h2, h3, h4, h5, h6 { +# color: #990000; + color: #009999; +} + +pre { + font-size: 10pt; + background: #e0e0e0; + color: black; +} + +a:link, a:visited { + font-weight: normal; + text-decoration: none; + color: #0047b9; +} + +a:hover { + font-weight: normal; + text-decoration: underline; + color: #0047b9; +} + +img { + border: 0px; +} + +#main th { + font-size: 12pt; + background: #b0b0b0; +} + +.odd { + font-size: 12pt; + background: white; +} + +.even { + font-size: 12pt; + background: #e0e0e0; +} + +.answer { + font-size: large; + font-weight: bold; +} + +.answer p { + font-size: 12pt; + font-weight: normal; +} + +.answer ul { + font-size: 12pt; + font-weight: normal; +} + +#container { + position: absolute; + width: 100%; + height: 100%; + top: 0px; +} + +#feedback { + color: #b0b0b0; + font-size: 9pt; + font-style: italic; +} + +#header { + position: absolute; + margin: 0px; + top: 10px; + height:96px; + left: 175px; + right: 10em; + bottom: auto; + background: white; + clear: both; +} + +#middle { + position: absolute; + left: 0; + height: auto; + width: 100%; +} + +#main { + position: absolute; + top: 50px; + left: 175px; + right: 100px; + background: white; + padding: 0em 0em 0em 0em; +} + +#navbar { + position: absolute; + top: 75px; + left: 0em; + width: 146px; + padding: 0px; + margin: 0px; + font-size: 10pt; +} + +#navbar a:link, #navbar a:visited { + font-weight: normal; + text-decoration: none; + color: #0047b9; +} + +#navbar a:hover { + font-weight: normal; + text-decoration: underline; + color: #0047b9; +} + +#navbar dl { + width: 146px; + padding: 0; + margin: 0 0 10px 0px; + background: #99ffff url(images/box_bottom2.gif) no-repeat bottom left; +} + +#navbar dt { + padding: 6px 10px; + font-size: 100%; + font-weight: bold; + background: #009999; + margin: 0px; + border-bottom: 1px solid #fff; + color: white; + background: #009999 url(images/box_top2.gif) no-repeat top left; +} + +#navbar dd { + font-size: 100%; + margin: 0 0 0 0px; + padding: 6px 10px; + color: #0047b9; +} + +dd#selected { + background: #99ffff url(images/arrow.gif) no-repeat; + background-position: 4px 10px; +} diff --git a/doc/testing/testing.texi b/doc/testing/testing.texi new file mode 100644 index 000000000..0bd354cf0 --- /dev/null +++ b/doc/testing/testing.texi @@ -0,0 +1,111 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename ns-3-testing.info +@settitle ns-3 testing and validation +@c @setchapternewpage odd +@c %**end of header + +@ifinfo +Documentation for the @command{ns-3} project is available in +Doxygen, several documents, and the wiki: +@itemize @bullet +@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator +@item @uref{http://www.nsnam.org/tutorial/index.html,,ns-3 Tutorial} +@item @uref{http://www.nsnam.org/doc//index.html,,ns-3 Tutorial} +@item ns-3 Testing and Validation (this document) +@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki} +@end itemize + +This document is written in GNU Texinfo and is to be maintained in +revision control on the @command{ns-3} code server. Both PDF and HTML versions +should be available on the server. Changes to +the document should be discussed on the ns-developers@@isi.edu mailing list. +@end ifinfo + +@copying + +This is an @command{ns-3} reference manual. +Primary documentation for the @command{ns-3} project is available in +Doxygen, several documents, and the wiki: +@itemize @bullet +@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen}: Documentation of the public APIs of the simulator +@item @uref{http://www.nsnam.org/docs/tutorial/index.html,,ns-3 Tutorial} +@item @uref{http://www.nsnam.org/docs/manual/index.html,,ns-3 Manual} +@item ns-3 Testing and Validation (this document) +@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki} +@end itemize + +This document is written in GNU Texinfo and is to be maintained in +revision control on the @command{ns-3} code server. Both PDF and HTML +versions should be available on the server. Changes to +the document should be discussed on the ns-developers@@isi.edu mailing list. + +This software is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This software is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see @uref{http://www.gnu.org/licenses/}. +@end copying + +@titlepage +@title ns-3 Testing and Validation +@author ns-3 project +@author feedback: ns-developers@@isi.edu + +@b{Simulator version: } +@include VERSION +@today{} + +@c @page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@c So the toc is printed at the start. +@ifnottex +@anchor{Full Table of Contents} +@end ifnottex +@shortcontents + +@ifnottex +@node Top, Overview, Full Table of Contents +@top ns-3 Testing and Validation (html version) + +For a pdf version of this document, +see @uref{http://www.nsnam.org/docs/testing.pdf}. + +Simulator version: +@include VERSION + +@insertcopying +@end ifnottex + +@menu +* Overview:: +* Background:: +* TestingFramework:: +* How to write tests:: +* Random Variables:: +* Propagation Loss Models:: +* References:: +@end menu + +@include overview.texi +@include background.texi +@include testing-framework.texi +@include how-to-write-tests.texi +@include validation.texi +@include random-variables.texi +@include propagation-loss.texi +@include references.texi + +@printindex cp + +@bye diff --git a/doc/testing/validation.texi b/doc/testing/validation.texi new file mode 100644 index 000000000..31f2597ad --- /dev/null +++ b/doc/testing/validation.texi @@ -0,0 +1,8 @@ +@unnumbered Part II: Validation + +The goal of the remainder of this document is to list some validation +results for the models of ns-3. This extends beyond test code; for instance, +results that compare simulation results with actual field experiments or +with textbook results, or even with the results of other simulators, +are welcome here. If your validation results exist in another published +report or web location, please add a reference here. diff --git a/examples/mesh.cc b/examples/mesh.cc new file mode 100644 index 000000000..fa42ae62b --- /dev/null +++ b/examples/mesh.cc @@ -0,0 +1,251 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + * + * + * By default this script creates m_xSize * m_ySize square grid topology with + * IEEE802.11s stack installed at each node with peering management + * and HWMP protocol. + * The side of the square cell is defined by m_step parameter. + * When topology is created, UDP ping is installed to opposite corners + * by diagonals. packet size of the UDP ping and interval between two + * successive packets is configurable. + * + * m_xSize * step + * |<--------->| + * step + * |<--->| + * * --- * --- * <---Ping sink _ + * | \ | / | ^ + * | \ | / | | + * * --- * --- * m_ySize * step | + * | / | \ | | + * | / | \ | | + * * --- * --- * _ + * ^ Ping source + * + * See also MeshTest::Configure to read more about configurable + * parameters. + */ + + +#include "ns3/core-module.h" +#include "ns3/simulator-module.h" +#include "ns3/node-module.h" +#include "ns3/helper-module.h" +#include "ns3/global-routing-module.h" +#include "ns3/wifi-module.h" +#include "ns3/mesh-module.h" +#include "ns3/mobility-module.h" +#include "ns3/mesh-helper.h" + +#include +#include +#include + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("TestMeshScript"); +class MeshTest +{ + public: + /// Init test + MeshTest (); + /// Configure test from command line arguments + void Configure (int argc, char ** argv); + /// Run test + int Run (); + private: + int m_xSize; + int m_ySize; + double m_step; + double m_randomStart; + double m_totalTime; + double m_packetInterval; + uint16_t m_packetSize; + uint32_t m_nIfaces; + bool m_chan; + bool m_pcap; + std::string m_stack; + std::string m_root; + /// List of network nodes + NodeContainer nodes; + /// List of all mesh point devices + NetDeviceContainer meshDevices; + //Addresses of interfaces: + Ipv4InterfaceContainer interfaces; + // MeshHelper. Report is not static methods + MeshHelper mesh; + private: + /// Create nodes and setup their mobility + void CreateNodes (); + /// Install internet m_stack on nodes + void InstallInternetStack (); + /// Install applications + void InstallApplication (); + /// Print mesh devices diagnostics + void Report (); +}; +MeshTest::MeshTest () : + m_xSize (3), + m_ySize (3), + m_step (100.0), + m_randomStart (0.1), + m_totalTime (100.0), + m_packetInterval (0.1), + m_packetSize (1024), + m_nIfaces (1), + m_chan (true), + m_pcap (false), + m_stack ("ns3::Dot11sStack"), + m_root ("ff:ff:ff:ff:ff:ff") +{ +} +void +MeshTest::Configure (int argc, char *argv[]) +{ + CommandLine cmd; + cmd.AddValue ("x-size", "Number of nodes in a row grid. [6]", m_xSize); + cmd.AddValue ("y-size", "Number of rows in a grid. [6]", m_ySize); + cmd.AddValue ("step", "Size of edge in our grid, meters. [100 m]", m_step); + /* + * As soon as starting node means that it sends a beacon, + * simultaneous start is not good. + */ + cmd.AddValue ("start", "Maximum random start delay, seconds. [0.1 s]", m_randomStart); + cmd.AddValue ("time", "Simulation time, seconds [100 s]", m_totalTime); + cmd.AddValue ("packet-interval", "Interval between packets in UDP ping, seconds [0.001 s]", m_packetInterval); + cmd.AddValue ("packet-size", "Size of packets in UDP ping", m_packetSize); + cmd.AddValue ("interfaces", "Number of radio interfaces used by each mesh point. [1]", m_nIfaces); + cmd.AddValue ("channels", "Use different frequency channels for different interfaces. [0]", m_chan); + cmd.AddValue ("pcap", "Enable PCAP traces on interfaces. [0]", m_pcap); + cmd.AddValue ("stack", "Type of protocol stack. ns3::Dot11sStack by default", m_stack); + cmd.AddValue ("root", "Mac address of root mesh point in HWMP", m_root); + + cmd.Parse (argc, argv); + NS_LOG_DEBUG ("Grid:" << m_xSize << "*" << m_ySize); + NS_LOG_DEBUG ("Simulation time: " << m_totalTime << " s"); +} +void +MeshTest::CreateNodes () +{ + /* + * Create m_ySize*m_xSize stations to form a grid topology + */ + nodes.Create (m_ySize*m_xSize); + // Configure YansWifiChannel + YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); + YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); + wifiPhy.SetChannel (wifiChannel.Create ()); + /* + * Create mesh helper and set stack installer to it + * Stack installer creates all needed protocols and install them to + * mesh point device + */ + mesh = MeshHelper::Default (); + mesh.SetStackInstaller (m_stack, "Root", Mac48AddressValue (Mac48Address (m_root.c_str ()))); + if (m_chan) + { + mesh.SetSpreadInterfaceChannels (MeshHelper::SPREAD_CHANNELS); + } + else + { + mesh.SetSpreadInterfaceChannels (MeshHelper::ZERO_CHANNEL); + } + mesh.SetMacType ("RandomStart", TimeValue (Seconds(m_randomStart))); + // Set number of interfaces - default is single-interface mesh point + mesh.SetNumberOfInterfaces (m_nIfaces); + // Install protocols and return container if MeshPointDevices + meshDevices = mesh.Install (wifiPhy, nodes); + // Setup mobility - static grid topology + MobilityHelper mobility; + mobility.SetPositionAllocator ("ns3::GridPositionAllocator", + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (m_step), + "DeltaY", DoubleValue (m_step), + "GridWidth", UintegerValue (m_xSize), + "LayoutType", StringValue ("RowFirst")); + mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); + mobility.Install (nodes); + if (m_pcap) + wifiPhy.EnablePcapAll (std::string ("mp-")); +} +void +MeshTest::InstallInternetStack () +{ + InternetStackHelper internetStack; + internetStack.Install (nodes); + Ipv4AddressHelper address; + address.SetBase ("10.1.1.0", "255.255.255.0"); + interfaces = address.Assign (meshDevices); +} +void +MeshTest::InstallApplication () +{ + UdpEchoServerHelper echoServer (9); + ApplicationContainer serverApps = echoServer.Install (nodes.Get (0)); + serverApps.Start (Seconds (0.0)); + serverApps.Stop (Seconds (m_totalTime)); + UdpEchoClientHelper echoClient (interfaces.GetAddress (0), 9); + echoClient.SetAttribute ("MaxPackets", UintegerValue ((uint32_t)(m_totalTime*(1/m_packetInterval)))); + echoClient.SetAttribute ("Interval", TimeValue (Seconds (m_packetInterval))); + echoClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize)); + ApplicationContainer clientApps = echoClient.Install (nodes.Get (m_xSize*m_ySize-1)); + clientApps.Start (Seconds (0.0)); + clientApps.Stop (Seconds (m_totalTime)); +} +int +MeshTest::Run () +{ + CreateNodes (); + InstallInternetStack (); + InstallApplication (); + Simulator::Schedule (Seconds(m_totalTime), & MeshTest::Report, this); + Simulator::Stop (Seconds (m_totalTime)); + Simulator::Run (); + Simulator::Destroy (); + return 0; +} +void +MeshTest::Report () +{ + unsigned n (0); + for (NetDeviceContainer::Iterator i = meshDevices.Begin (); i != meshDevices.End (); ++i, ++n) + { + std::ostringstream os; + os << "mp-report-" << n << ".xml"; + std::cerr << "Printing mesh point device #" << n << " diagnostics to " << os.str () << "\n"; + std::ofstream of; + of.open (os.str().c_str()); + if (! of.is_open ()) + { + std::cerr << "Error: Can't open file " << os.str() << "\n"; + return; + } + mesh.Report (*i, of); + of.close (); + } +} +int +main (int argc, char *argv[]) +{ + MeshTest t; + t.Configure (argc, argv); + return t.Run(); +} diff --git a/examples/multi-rate-first.cc b/examples/multi-rate-first.cc deleted file mode 100644 index cf2beeef4..000000000 --- a/examples/multi-rate-first.cc +++ /dev/null @@ -1,398 +0,0 @@ -/** - * - * Instructions: - * ./waf --run multi-rate-first - * gnuplot multi-rate-first-scen*.plt - * - * Output: - * multi-rate-first-scen1.eps - * multi-rate-first-scen2.eps - * multi-rate-first-scen3.eps - * multi-rate-first-scen4.eps - * - * Side Note: It may take some time. - */ - -#include "ns3/core-module.h" -#include "ns3/common-module.h" -#include "ns3/node-module.h" -#include "ns3/helper-module.h" -#include "ns3/mobility-module.h" -#include "ns3/contrib-module.h" - -#include -#include - -NS_LOG_COMPONENT_DEFINE ("Main"); - -using namespace ns3; - -class Experiment -{ -public: - Experiment (); - Experiment (std::string name); - Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, - const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility, int positionStep); -private: - void ReceivePacket (Ptr socket); - void SetPosition (Ptr node, Vector position); - Vector GetPosition (Ptr node); - void AdvancePosition (Ptr node); - void BackTrackPosition (Ptr node); - void StationaryPosition (Ptr node); - void MultiPosition (Ptr node1, Ptr node2); - Ptr SetupPacketReceive (Ptr node); - - uint32_t m_bytesTotal; - Gnuplot2dDataset m_output; -}; - -Experiment::Experiment () -{} - -Experiment::Experiment (std::string name) - : m_output (name) -{ - m_output.SetStyle (Gnuplot2dDataset::LINES); -} - -void -Experiment::SetPosition (Ptr node, Vector position) -{ - Ptr mobility = node->GetObject (); - mobility->SetPosition (position); -} - -Vector -Experiment::GetPosition (Ptr node) -{ - Ptr mobility = node->GetObject (); - return mobility->GetPosition (); -} - -void -Experiment::AdvancePosition (Ptr node) -{ - Vector pos = GetPosition (node); - double mbs = ((m_bytesTotal * 8.0) / 1000000); - m_bytesTotal = 0; - m_output.Add ((Simulator::Now()).GetSeconds(), mbs); - pos.x += 1.0; - - if (pos.x >= 210.0) - { - return; - } - SetPosition (node, pos); - - //std::cout << "x="< node) -{ - Vector pos = GetPosition (node); - double mbs = ((m_bytesTotal * 8.0) / 1000000); - m_bytesTotal = 0; - m_output.Add ((Simulator::Now()).GetSeconds(), mbs); - pos.x -= 1.0; - - if (pos.x < 0) - { - return; - } - SetPosition (node, pos); - - //std::cout << "x="< node) -{ - double mbs = ((m_bytesTotal * 8.0) / 1000000); - m_bytesTotal = 0; - m_output.Add ((Simulator::Now()).GetSeconds(), mbs); - -} -void -Experiment::MultiPosition (Ptr n1, Ptr n2) -{ - Vector pos1 = GetPosition(n1); - Vector pos2 = GetPosition(n2); - double mbs = ((m_bytesTotal * 8.0) / 1000000); - m_bytesTotal = 0; - m_output.Add ((Simulator::Now()).GetSeconds(), mbs); - - if( pos1.x < 230) - { - pos1.x += 1.0; - SetPosition (n1, pos1); - } - if( pos2.x > 0) - { - pos2.x -= 1.0; - SetPosition (n2, pos2); - } -} - -void -Experiment::ReceivePacket (Ptr socket) -{ - Ptr packet; - while (packet = socket->Recv ()) - { - m_bytesTotal += packet->GetSize (); - } -} - -Ptr -Experiment::SetupPacketReceive (Ptr node) -{ - TypeId tid = TypeId::LookupByName ("ns3::PacketSocketFactory"); - Ptr sink = Socket::CreateSocket (node, tid); - sink->Bind (); - sink->SetRecvCallback (MakeCallback (&Experiment::ReceivePacket, this)); - - return sink; - -} - -Gnuplot2dDataset -Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, - const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility, int positionStep) -{ - m_bytesTotal = 0; - - NodeContainer c; - c.Create (2); - - PacketSocketHelper packetSocket; - packetSocket.Install (c); - - YansWifiPhyHelper phy = wifiPhy; - phy.SetChannel (wifiChannel.Create ()); - - NqosWifiMacHelper mac = wifiMac; - NetDeviceContainer devices = wifi.Install (phy, mac, c); - - mobility.Install (c); - - PacketSocketAddress socket; - socket.SetSingleDevice(devices.Get (0)->GetIfIndex ()); - socket.SetPhysicalAddress (devices.Get (1)->GetAddress ()); - socket.SetProtocol (1); - - OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket)); - onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (250))); - onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); - onoff.SetAttribute ("DataRate", DataRateValue (DataRate (60000000))); - onoff.SetAttribute ("PacketSize", UintegerValue (2000)); - - ApplicationContainer apps = onoff.Install (c.Get (0)); - apps.Start (Seconds (0.5)); - apps.Stop (Seconds (250.0)); - - - Ptr recvSink = SetupPacketReceive (c.Get (1)); - - if (positionStep == 1) - { - Simulator::Schedule (Seconds (1.5), &Experiment::AdvancePosition, this, c.Get (1)); - } - else if (positionStep == -1) - { - Simulator::Schedule (Seconds (1.5), &Experiment::BackTrackPosition, this, c.Get (1)); - } - else if (positionStep == 0) - { - for(int i = 1; i <= 210; i++) - { - Simulator::Schedule (Seconds (i), &Experiment::StationaryPosition, this, c.Get (1)); - } - } - else if (positionStep == 2) - { - for(int i = 1; i <= 210; i++) - { - Simulator::Schedule (Seconds (i), &Experiment::MultiPosition, this, c.Get(0), c.Get (1)); - } - } - - - Simulator::Run (); - Simulator::Destroy (); - - return m_output; -} - -int main (int argc, char *argv[]) -{ - std::ofstream outfile ("multi-rate-first-scen1.plt"); - std::ofstream outfile2 ("multi-rate-first-scen2.plt"); - std::ofstream outfile3 ("multi-rate-first-scen3.plt"); - std::ofstream outfile4 ("multi-rate-first-scen4.plt"); - - // disable fragmentation - Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200")); - Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200")); - - CommandLine cmd; - cmd.Parse (argc, argv); - - - MobilityHelper mobility; - Experiment experiment; - Gnuplot gnuplot; - int myPositionStep; - Ptr positionAlloc; - Gnuplot2dDataset dataset; - WifiHelper wifi = WifiHelper::Default (); - NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); - YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); - YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); - - // Scenario 1: two nodes within transmission range about 5 meters apart - // Fix a node stationary, move the second node away from it - - // moving forward - myPositionStep = 1; - - gnuplot = Gnuplot ("multi-rate-first-scen1.eps"); - - positionAlloc = CreateObject (); - positionAlloc->Add (Vector (0.0, 0.0, 0.0)); - positionAlloc->Add (Vector (5.0, 0.0, 0.0)); - mobility.SetPositionAllocator (positionAlloc); - mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); - - wifiMac.SetType ("ns3::AdhocWifiMac"); - wifi.SetStandard (WIFI_PHY_STANDARD_holland); - - experiment = Experiment ("minstrel"); - wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager"); - dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep); - gnuplot.AddDataset (dataset); - - experiment = Experiment ("ideal"); - wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep); - gnuplot.AddDataset (dataset); - - gnuplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\""); - gnuplot.SetLegend ("Time (Seconds)", "Throughput(Mbps)"); - gnuplot.SetExtra ("set xrange [0:250]"); - gnuplot.SetTitle ("Throughput vs Time"); - gnuplot.GenerateOutput (outfile); - outfile.close (); - - - // Scenario 2: two nodes out of transmission range about 230 meters apart - // Fix a node stationary, move the second node into transmission range - - // moving backward - myPositionStep = -1; - - gnuplot = Gnuplot ("multi-rate-first-scen2.eps"); - - positionAlloc = CreateObject (); - positionAlloc->Add (Vector (0.0, 0.0, 0.0)); - positionAlloc->Add (Vector (230.0, 0.0, 0.0)); - mobility.SetPositionAllocator (positionAlloc); - mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); - - wifiMac.SetType ("ns3::AdhocWifiMac"); - wifi.SetStandard (WIFI_PHY_STANDARD_holland); - - experiment = Experiment ("minstrel"); - wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager"); - dataset= experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep); - gnuplot.AddDataset (dataset); - - experiment = Experiment ("ideal"); - wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - dataset= experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep); - gnuplot.AddDataset (dataset); - - - gnuplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\""); - gnuplot.SetLegend ("Time (Seconds)", "Throughput(Mbps)"); - gnuplot.SetExtra ("set xrange [0:250]"); - gnuplot.SetTitle ("Throughput vs Time"); - gnuplot.GenerateOutput (outfile2); - outfile2.close (); - - - // Scenario 3: two nodes within transmission range 25 meters part - // Set both nodes stationary - // this is more like a sanity check - - // Set position stationary - myPositionStep = 0; - - gnuplot = Gnuplot ("multi-rate-first-scen3.eps"); - - positionAlloc = CreateObject (); - positionAlloc->Add (Vector (0.0, 0.0, 0.0)); - positionAlloc->Add (Vector (25.0, 0.0, 0.0)); - mobility.SetPositionAllocator (positionAlloc); - mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); - - wifiMac.SetType ("ns3::AdhocWifiMac"); - wifi.SetStandard (WIFI_PHY_STANDARD_holland); - - experiment = Experiment ("minstrel"); - wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager"); - dataset= experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep); - gnuplot.AddDataset (dataset); - - experiment = Experiment ("ideal"); - wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - dataset= experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep); - gnuplot.AddDataset (dataset); - - gnuplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\""); - gnuplot.SetLegend ("Time (Seconds)", "Throughput(Mbps)"); - gnuplot.SetExtra ("set xrange [0:250]"); - gnuplot.SetTitle ("Throughput vs Time"); - gnuplot.GenerateOutput (outfile3); - outfile3.close (); - - // Scenario 4: Two nodes in opposite direction about 230 meters apart - // moving into transmission range and out of transmission range - myPositionStep = 2; - - gnuplot = Gnuplot ("multi-rate-first-scen4.eps"); - - positionAlloc = CreateObject (); - // initial position of node 1 - positionAlloc->Add (Vector (0.0, 25.0, 0.0)); - // initial position of node 2 - positionAlloc->Add (Vector (230.0, 0.0, 0.0)); - mobility.SetPositionAllocator (positionAlloc); - mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); - - wifiMac.SetType ("ns3::AdhocWifiMac"); - wifi.SetStandard (WIFI_PHY_STANDARD_holland); - - experiment = Experiment ("minstrel"); - wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager"); - dataset= experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep); - gnuplot.AddDataset (dataset); - - experiment = Experiment ("ideal"); - wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - dataset= experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep); - gnuplot.AddDataset (dataset); - - gnuplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\""); - gnuplot.SetLegend ("Time (Seconds)", "Throughput(Mbps)"); - gnuplot.SetExtra ("set xrange [0:250]"); - gnuplot.SetTitle ("Throughput vs Time"); - gnuplot.GenerateOutput (outfile4); - outfile4.close (); - - - return 0; -} diff --git a/examples/multi-rate-second.cc b/examples/multi-rate-second.cc deleted file mode 100644 index 268516b0c..000000000 --- a/examples/multi-rate-second.cc +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Instructions: - * ./waf --run multi-rate-second - * gnuplot multi-rate-second.plt - * - * Output: multi-rate-second.eps - * - */ - -#include "ns3/core-module.h" -#include "ns3/common-module.h" -#include "ns3/node-module.h" -#include "ns3/helper-module.h" -#include "ns3/mobility-module.h" -#include "ns3/contrib-module.h" - -#include -#include -#include -#include - -NS_LOG_COMPONENT_DEFINE ("Main"); - -using namespace ns3; - -class Experiment -{ -public: - Experiment (); - Experiment (std::string name); - Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, - const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel); -private: - void ReceivePacket (Ptr socket); - void SetPosition (Ptr node, Vector position); - Vector GetPosition (Ptr node); - Ptr SetupPacketReceive (Ptr node); - void GenerateTraffic (Ptr socket, uint32_t pktSize, - uint32_t pktCount, Time pktInterval , Ptr node); - - uint32_t m_pktsTotal; - Gnuplot2dDataset m_output; - bool advanceStep; -}; - -Experiment::Experiment () -{ - advanceStep= true; -} - -Experiment::Experiment (std::string name) - : m_output (name) -{ - m_output.SetStyle (Gnuplot2dDataset::LINES); -} - -void -Experiment::SetPosition (Ptr node, Vector position) -{ - Ptr mobility = node->GetObject (); - mobility->SetPosition (position); -} - -Vector -Experiment::GetPosition (Ptr node) -{ - Ptr mobility = node->GetObject (); - return mobility->GetPosition (); -} - -void -Experiment::ReceivePacket (Ptr socket) -{ - Ptr packet; - while (packet = socket->Recv ()) - { - m_pktsTotal ++; - } -} - -Ptr -Experiment::SetupPacketReceive (Ptr node) -{ - TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); - Ptr sink = Socket::CreateSocket (node, tid); - InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80); - sink->Bind (local); - sink->SetRecvCallback (MakeCallback (&Experiment::ReceivePacket, this)); - return sink; -} - -void -Experiment::GenerateTraffic (Ptr socket, uint32_t pktSize, - uint32_t pktCount, Time pktInterval, Ptr node ) -{ - Vector pos = GetPosition(node); - - if (pktCount > 0) - { - ///To simulate nodes moving in and out of transmission constantly - if(pos.x <= 230 && advanceStep) - { - ///keep moving away - pos.x += .1; - SetPosition(node, pos); - } - else - { - if(pos.x < 150) - { - advanceStep=true; - } - else - { - advanceStep = false; - } - - ///moving back in - pos.x -= .1; - SetPosition(node, pos); - } - socket->Send (Create (pktSize)); - Simulator::Schedule (pktInterval, &Experiment::GenerateTraffic, this, - socket, pktSize,pktCount-1, pktInterval, node); - } - else - { - m_output.Add((Simulator::Now()).GetSeconds(), m_pktsTotal); - } -} - -Gnuplot2dDataset -Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, - const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel) -{ - m_pktsTotal = 0; - - NodeContainer c; - c.Create (2); - - YansWifiPhyHelper phy = wifiPhy; - phy.SetChannel (wifiChannel.Create ()); - - NqosWifiMacHelper mac = wifiMac; - NetDeviceContainer devices = wifi.Install (phy, mac, c); - - MobilityHelper mobility; - Ptr positionAlloc = CreateObject (); - positionAlloc->Add (Vector (0.0, 0.0, 0.0)); - positionAlloc->Add (Vector (5.0, 0.0, 0.0)); - mobility.SetPositionAllocator (positionAlloc); - mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); - mobility.Install (c); - - InternetStackHelper internet; - internet.Install (c); - - Ipv4AddressHelper ipv4; - NS_LOG_INFO ("Assign IP Addresses."); - ipv4.SetBase ("10.1.1.0", "255.255.255.0"); - Ipv4InterfaceContainer wifiNodesInterface = ipv4.Assign (devices); - - - Ptr recvSink = SetupPacketReceive (c.Get (0)); - - TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); - Ptr source = Socket::CreateSocket (c.Get (1), tid); - InetSocketAddress remote = InetSocketAddress (Ipv4Address ("255.255.255.255"), 80); - source->Connect (remote); - uint32_t packetSize = 1014; - uint32_t maxPacketCount = 1000; - Time interPacketInterval = Seconds (1.); - - Ptr n1 = c.Get(0); - Ptr ipv41 = n1->GetObject (); - // parameters for Ipv4::SetDown and SetUp - // The first ifIndex is 0 for loopback, then the first p2p is numbered 1, - // then the next p2p is numbered 2 - - double downTime = 0.0; - for (int i= 1; i <= 100; i++) - { - - Simulator::Schedule (Seconds (i), &Experiment::GenerateTraffic, - this, source, packetSize, maxPacketCount,interPacketInterval, c.Get(1)); - if ( i % 10 == 0 ) - { - ///bring a network interface down - Simulator::Schedule (Seconds (i+.1), &Ipv4::SetDown, ipv41, 1); - - //duration of the down time - downTime += .1; - - ///bring a network interface up - Simulator::Schedule (Seconds (i + downTime), &Ipv4::SetUp, ipv41, 1); - } - } - - Simulator::Run (); - Simulator::Destroy (); - - return m_output; -} - -int main (int argc, char *argv[]) -{ - std::ofstream outfile ("multi-rate-second.plt"); - - std::vector ratesControl; - ratesControl.push_back ("Minstrel"); - ratesControl.push_back ("Ideal"); - - std::vector wifiManager; - wifiManager.push_back("ns3::MinstrelWifiManager"); - wifiManager.push_back("ns3::IdealWifiManager"); - - // disable fragmentation - Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200")); - Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200")); - - CommandLine cmd; - cmd.Parse (argc, argv); - - Gnuplot gnuplot = Gnuplot ("multi-rate-second.eps"); - - for (uint32_t i = 0; i < ratesControl.size(); i++) - { - std::cout << ratesControl[i] << std::endl; - std::cout << wifiManager[i] << std::endl; - Gnuplot2dDataset dataset (ratesControl[i]); - dataset.SetStyle (Gnuplot2dDataset::LINES); - Experiment experiment; - - WifiHelper wifi; - NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); - YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); - YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); - - wifiMac.SetType ("ns3::AdhocWifiMac"); - - NS_LOG_DEBUG (ratesControl[i]); - - experiment = Experiment (ratesControl[i]); - wifi.SetStandard (WIFI_PHY_STANDARD_80211b); - wifi.SetRemoteStationManager (wifiManager[i]); - dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel); - gnuplot.AddDataset (dataset); - - } - gnuplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\""); - gnuplot.SetLegend ("Time ", "Number of packets received"); - gnuplot.SetExtra ("set xrange [1000:1100]"); - gnuplot.SetTitle ("Number of Packets Received vs Time"); - gnuplot.GenerateOutput (outfile); - outfile.close (); - - return 0; -} diff --git a/examples/multirate.cc b/examples/multirate.cc new file mode 100644 index 000000000..6bae09212 --- /dev/null +++ b/examples/multirate.cc @@ -0,0 +1,588 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Duy Nguyen + */ + +/** + * Scenarios: 100 nodes, multiple simultaneous flows, multi-hop ad hoc, routing, + * and mobility + * + * INSTRUCTIONS: + * + * To optimize build: + * ./waf -d optimized configure + * ./waf + * + * To compile: + * ./waf --run multirate + * + * To compile with commandline(useful for varying parameters or configurations): + * ./waf --run "scratch/multirate.cc --packetSize=2000 --totalTime=50" + * + * To turn on NS_LOG: + * export NS_LOG=multirate=level_all + * (can only view log if built with ./waf -d debug configure) + * + * To debug: + * ./waf --shell + * gdb ./build/debug/scratch/multirate + * + * To view pcap files: + * tcpdump -nn -tt -r filename.pcap + * + * To monitor the files + * tail -f filename.pcap + * + * Sidenote: Simulation might take sometime + */ + +#include "ns3/core-module.h" +#include "ns3/common-module.h" +#include "ns3/node-module.h" +#include "ns3/helper-module.h" +#include "ns3/mobility-module.h" +#include "ns3/contrib-module.h" +#include "ns3/random-variable.h" +#include "ns3/wifi-module.h" + +#include +#include + +NS_LOG_COMPONENT_DEFINE ("multirate"); + +using namespace ns3; + +class Experiment +{ +public: + + Experiment (); + Experiment (std::string name); + Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, + const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility); + + bool CommandSetup (int argc, char **argv); + bool IsRouting () { return (enableRouting == 1) ? 1:0; } + bool IsMobility () { return (enableMobility == 1) ? 1:0; } + + uint32_t GetScenario () {return scenario; } + + std::string GetRtsThreshold () { return rtsThreshold; } + std::string GetOutputFileName () { return outputFileName; } + std::string GetRateManager () { return rateManager; } + +private: + + Vector GetPosition (Ptr node); + Ptr SetupPacketReceive (Ptr node); + NodeContainer GenerateNeighbors(NodeContainer c, uint32_t senderId); + + void ApplicationSetup (Ptr client, Ptr server, double start, double stop); + void AssignNeighbors (NodeContainer c); + void SelectSrcDest (NodeContainer c); + void ReceivePacket (Ptr socket); + void CheckThroughput (); + void SendMultiDestinations (Ptr sender, NodeContainer c); + + Gnuplot2dDataset m_output; + + double totalTime; + + uint32_t bytesTotal; + uint32_t packetSize; + uint32_t gridSize; + uint32_t nodeDistance; + uint32_t port; + uint32_t expMean; + uint32_t scenario; + + bool enablePcap; + bool enableTracing; + bool enableFlowMon; + bool enableRouting; + bool enableMobility; + + NodeContainer containerA, containerB, containerC, containerD; + std::string rtsThreshold, rateManager, outputFileName; +}; + +Experiment::Experiment () +{} + +Experiment::Experiment (std::string name) : + m_output (name), + totalTime (50), //use shorter time for faster simulation + bytesTotal(0), + packetSize (2000), + gridSize (10), //10x10 grid for a total of 100 nodes + nodeDistance (30), + port (5000), + expMean (4), //flows being exponentially distributed + scenario (4), + enablePcap (false), // will flood the directory with *.pcap files + enableTracing (true), + enableFlowMon (true), + enableRouting (false), + enableMobility (false), + rtsThreshold ("2200"), //0 for enabling rts/cts + rateManager ("ns3::MinstrelWifiManager"), + outputFileName ("minstrel") +{ + m_output.SetStyle (Gnuplot2dDataset::LINES); +} + +Ptr +Experiment::SetupPacketReceive (Ptr node) +{ + TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); + Ptr sink = Socket::CreateSocket (node, tid); + InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), port); + sink->Bind (local); + sink->SetRecvCallback (MakeCallback (&Experiment::ReceivePacket, this)); + + return sink; +} + +void +Experiment::ReceivePacket (Ptr socket) +{ + Ptr packet; + while (packet = socket->Recv ()) + { + bytesTotal += packet->GetSize(); + } +} + +void +Experiment::CheckThroughput() +{ + double mbs = ((bytesTotal * 8.0) /1000000); + bytesTotal = 0; + m_output.Add ((Simulator::Now ()).GetSeconds (), mbs); + + Simulator::Schedule (Seconds (1.0), &Experiment::CheckThroughput, this); +} + +Vector +Experiment::GetPosition (Ptr node) +{ + Ptr mobility = node->GetObject (); + return mobility->GetPosition (); +} + +/** + * + * Take the grid map, divide it into 4 quadrants + * Assign all nodes from each quadrant to a specific container + * + */ +void +Experiment::AssignNeighbors (NodeContainer c) +{ + uint32_t totalNodes = c.GetN (); + for (uint32_t i=0; i< totalNodes; i++) + { + if ( (i % gridSize) <= (gridSize/2 - 1)) + { + //lower left quadrant + if ( i < totalNodes/2 ) + { + containerA.Add(c.Get(i)); + } + + //upper left quadrant + if ( i >= (uint32_t)(4*totalNodes)/10 ) + { + containerC.Add(c.Get(i)); + } + } + if ( (i % gridSize) >= (gridSize/2 - 1)) + { + //lower right quadrant + if ( i < totalNodes/2 ) + { + containerB.Add(c.Get(i)); + } + + //upper right quadrant + if ( i >= (uint32_t)(4*totalNodes)/10 ) + { + containerD.Add(c.Get(i)); + } + } + } +} + +/** + * Generate 1-hop and 2-hop neighbors of a node in grid topology + * + */ +NodeContainer +Experiment::GenerateNeighbors (NodeContainer c, uint32_t senderId) +{ + NodeContainer nc; + uint32_t limit = senderId + 2; + for (uint32_t i= senderId - 2; i <= limit; i++) + { + //must ensure the boundaries for other topologies + nc.Add(c.Get(i)); + nc.Add(c.Get(i + 10)); + nc.Add(c.Get(i + 20)); + nc.Add(c.Get(i - 10)); + nc.Add(c.Get(i - 20)); + } + return nc; +} + +/** + * Sources and destinations are randomly selected such that a node + * may be the source for multiple destinations and a node maybe a destination + * for multiple sources. + */ +void +Experiment::SelectSrcDest (NodeContainer c) +{ + uint32_t totalNodes = c.GetN(); + UniformVariable uvSrc (0, totalNodes/2 -1); + UniformVariable uvDest (totalNodes/2, totalNodes); + + for (uint32_t i=0; i < totalNodes/3; i++) + { + ApplicationSetup (c.Get(uvSrc.RandomVariable::GetInteger()), c.Get(uvDest.RandomVariable::GetInteger()) , 1, totalTime); + } +} + +/** + * + * A sender node will set up a flow to each of the its neighbors + * in its quadrant randomly. All the flows are exponentially distributed + * + */ +void +Experiment::SendMultiDestinations(Ptr sender, NodeContainer c) +{ + + // UniformVariable params: (Xrange, Yrange) + UniformVariable uv(0, c.GetN ()); + + // ExponentialVariable params: (mean, upperbound) + ExponentialVariable ev(expMean, totalTime); + + double start=1, stop=totalTime; + uint32_t destIndex; + + for (uint32_t i=0; i < c.GetN (); i++) + { + stop = start + ev.GetValue(); + NS_LOG_DEBUG("Start=" << start << " Stop=" << stop); + + do { + destIndex = (uint32_t) uv.GetValue(); + } while ( (c.Get(destIndex))->GetId () == sender->GetId ()); + + ApplicationSetup (sender, c.Get(destIndex) , start, stop); + + start = stop; + + if(start > totalTime) + { + break; + } + } +} + +void +Experiment::ApplicationSetup (Ptr client, Ptr server, double start, double stop) +{ + + Vector serverPos = GetPosition (server); + Vector clientPos = GetPosition (client); + + Ptr ipv4Server = server->GetObject(); + Ptr ipv4Client = client->GetObject(); + + Ipv4InterfaceAddress iaddrServer = ipv4Server->GetAddress(1,0); + Ipv4InterfaceAddress iaddrClient = ipv4Client->GetAddress(1,0); + + Ipv4Address ipv4AddrServer = iaddrServer.GetLocal (); + Ipv4Address ipv4AddrClient = iaddrClient.GetLocal (); + + NS_LOG_DEBUG("Set up Server Device " << (server->GetDevice(0))->GetAddress () + << " with ip " << ipv4AddrServer + << " position (" << serverPos.x << "," << serverPos.y << "," << serverPos.z << ")"); + + NS_LOG_DEBUG("Set up Client Device " << (client->GetDevice(0))->GetAddress () + << " with ip " << ipv4AddrClient + << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")" + << "\n"); + + + // Equipping the source node with OnOff Application used for sending + OnOffHelper onoff ("ns3::UdpSocketFactory", Address(InetSocketAddress(Ipv4Address("10.0.0.1"), port))); + onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); + onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); + onoff.SetAttribute ("DataRate", DataRateValue (DataRate (60000000))); + onoff.SetAttribute ("PacketSize", UintegerValue (packetSize)); + onoff.SetAttribute ("Remote", AddressValue(InetSocketAddress (ipv4AddrServer, port))); + + ApplicationContainer apps = onoff.Install (client); + apps.Start (Seconds (start)); + apps.Stop (Seconds (stop)); + +/* + // Select either Sink Method 1 or 2 for setting up sink + // one using a helper vs one without + // Sink: Method 1 + Address sinkAddr(InetSocketAddress (Ipv4Address::GetAny (), port)); + PacketSinkHelper sinkHelper ("ns3::UdpSocketFactory", sinkAddr); + ApplicationContainer sinkApp = sinkHelper.Install (server); + sinkApp.Start (Seconds (start)); + sinkApp.Stop (Seconds (stop)); +*/ + + // Sink: Method 2 + Ptr sink = SetupPacketReceive (server); + +} + +Gnuplot2dDataset +Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, + const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility) +{ + + + uint32_t nodeSize = gridSize*gridSize; + NodeContainer c; + c.Create (nodeSize); + + YansWifiPhyHelper phy = wifiPhy; + phy.SetChannel (wifiChannel.Create ()); + + NqosWifiMacHelper mac = wifiMac; + NetDeviceContainer devices = wifi.Install (phy, mac, c); + + + OlsrHelper olsr; + Ipv4StaticRoutingHelper staticRouting; + + Ipv4ListRoutingHelper list; + + if (enableRouting) + { + list.Add (staticRouting, 0); + list.Add (olsr, 10); + } + + InternetStackHelper internet; + + if (enableRouting) + { + internet.SetRoutingHelper(list); + } + internet.Install (c); + + + Ipv4AddressHelper address; + address.SetBase ("10.0.0.0", "255.255.255.0"); + + Ipv4InterfaceContainer ipInterfaces; + ipInterfaces = address.Assign(devices); + + MobilityHelper mobil= mobility; + mobil.SetPositionAllocator ("ns3::GridPositionAllocator", + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (nodeDistance), + "DeltaY", DoubleValue (nodeDistance), + "GridWidth", UintegerValue (gridSize), + "LayoutType", StringValue ("RowFirst")); + + mobil.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); + + if (enableMobility && enableRouting) + { + //Rectangle (xMin, xMax, yMin, yMax) + mobil.SetMobilityModel ("ns3::RandomDirection2dMobilityModel", + "Bounds", RectangleValue (Rectangle (0, 500, 0, 500)), + "Speed", RandomVariableValue (ConstantVariable (10)), + "Pause", RandomVariableValue (ConstantVariable (0.2))); + } + mobil.Install (c); + + +// NS_LOG_INFO ("Enabling global routing on all nodes"); +// Ipv4GlobalRoutingHelper::PopulateRoutingTables (); + + if ( scenario == 1 && enableRouting) + { + SelectSrcDest(c); + } + else if ( scenario == 2) + { + //All flows begin at the same time + for (uint32_t i = 0; i < nodeSize - 1; i = i+2) + { + ApplicationSetup (c.Get (i), c.Get (i+1), 1, totalTime); + } + } + else if ( scenario == 3) + { + AssignNeighbors(c); + //Note: these senders are hand-picked in order to ensure good coverage + //for 10x10 grid, basically one sender for each quadrant + //you might have to change these values for other grids + NS_LOG_DEBUG(">>>>>>>>>region A<<<<<<<<<"); + SendMultiDestinations(c.Get(22), containerA); + + NS_LOG_DEBUG(">>>>>>>>>region B<<<<<<<<<"); + SendMultiDestinations(c.Get(26), containerB); + + NS_LOG_DEBUG(">>>>>>>>>region C<<<<<<<<<"); + SendMultiDestinations(c.Get(72), containerC); + + NS_LOG_DEBUG(">>>>>>>>>region D<<<<<<<<<"); + SendMultiDestinations(c.Get(76), containerD); + } + else if ( scenario == 4) + { + //GenerateNeighbors(NodeContainer, uint32_t sender) + //Note: these senders are hand-picked in order to ensure good coverage + //you might have to change these values for other grids + NodeContainer c1, c2, c3, c4, c5, c6, c7, c8, c9; + + c1 = GenerateNeighbors(c, 22); + c2 = GenerateNeighbors(c, 24);; + c3 = GenerateNeighbors(c, 26);; + c4 = GenerateNeighbors(c, 42);; + c5 = GenerateNeighbors(c, 44);; + c6 = GenerateNeighbors(c, 46);; + c7 = GenerateNeighbors(c, 62);; + c8 = GenerateNeighbors(c, 64);; + c9 = GenerateNeighbors(c, 66);; + + SendMultiDestinations(c.Get(22), c1); + SendMultiDestinations(c.Get(24), c2); + SendMultiDestinations(c.Get(26), c3); + SendMultiDestinations(c.Get(42), c4); + SendMultiDestinations(c.Get(44), c5); + SendMultiDestinations(c.Get(46), c6); + SendMultiDestinations(c.Get(62), c7); + SendMultiDestinations(c.Get(64), c8); + SendMultiDestinations(c.Get(66), c9); + } + + CheckThroughput (); + + if (enablePcap) + { + phy.EnablePcapAll(GetOutputFileName()); + } + + if (enableTracing) + { + std::ofstream ascii; + ascii.open ((GetOutputFileName() + ".tr").c_str()); + phy.EnableAsciiAll (ascii); + } + + Ptr flowmon; + + if (enableFlowMon) + { + FlowMonitorHelper flowmonHelper; + flowmon = flowmonHelper.InstallAll (); + } + + Simulator::Stop (Seconds (totalTime)); + Simulator::Run (); + + if (enableFlowMon) + { + flowmon->SerializeToXmlFile ((GetOutputFileName() + ".flomon"), false, false); + } + + Simulator::Destroy (); + + return m_output; +} + +bool +Experiment::CommandSetup (int argc, char **argv) +{ + // for commandline input + CommandLine cmd; + cmd.AddValue ("packetSize", "packet size", packetSize); + cmd.AddValue ("totalTime", "simulation time", totalTime); + cmd.AddValue ("rtsThreshold", "rts threshold", rtsThreshold); + cmd.AddValue ("rateManager", "type of rate", rateManager); + cmd.AddValue ("outputFileName", "output filename", outputFileName); + cmd.AddValue ("enableRouting", "enable Routing", enableRouting); + cmd.AddValue ("enableMobility", "enable Mobility", enableMobility); + cmd.AddValue ("scenario", "scenario ", scenario); + + cmd.Parse (argc, argv); + return true; +} + +int main (int argc, char *argv[]) +{ + + Experiment experiment; + experiment = Experiment ("multirate"); + + //for commandline input + if (!experiment.CommandSetup(argc, argv)) + { + std::cout << "Configuration failed..." << std::endl; + exit(1); + } + + // disable fragmentation + // set value to 0 for enabling fragmentation + Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200")); + Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue (experiment.GetRtsThreshold())); + + std::ofstream outfile ((experiment.GetOutputFileName()+ ".plt").c_str()); + + MobilityHelper mobility; + Gnuplot gnuplot; + Gnuplot2dDataset dataset; + + WifiHelper wifi = WifiHelper::Default (); + NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); + YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); + YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); + Ssid ssid = Ssid ("Testbed"); + + wifiMac.SetType ("ns3::AdhocWifiMac", "Ssid", SsidValue(ssid)); + wifi.SetStandard (WIFI_PHY_STANDARD_holland); + wifi.SetRemoteStationManager (experiment.GetRateManager()); + + //printing out selection confirmation + std::cout << "Scenario: " << experiment.GetScenario () << std::endl; + std::cout << "Rts Threshold: " << experiment.GetRtsThreshold() << std::endl; + std::cout << "Name: " << experiment.GetOutputFileName() << std::endl; + std::cout << "Rate: " << experiment.GetRateManager() << std::endl; + std::cout << "Routing: " << experiment.IsRouting() << std::endl; + std::cout << "Mobility: " << experiment.IsMobility() << std::endl; + + dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility); + + gnuplot.AddDataset (dataset); + gnuplot.GenerateOutput (outfile); + + return 0; +} diff --git a/examples/nix-simple.cc b/examples/nix-simple.cc new file mode 100644 index 000000000..e22aca983 --- /dev/null +++ b/examples/nix-simple.cc @@ -0,0 +1,114 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ns3/core-module.h" +#include "ns3/simulator-module.h" +#include "ns3/node-module.h" +#include "ns3/helper-module.h" + +/* + * Simple point to point links: + * + * n0 -- n1 -- n2 -- n3 + * + * n0 has UdpEchoClient + * n3 has UdpEchoServer + * + * n0 IP: 10.1.1.1 + * n1 IP: 10.1.1.2, 10.1.2.1 + * n2 IP: 10.1.2.2, 10.1.3.1 + * n3 IP: 10.1.3.2 + * + */ + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("FirstScriptExample"); + + int +main (int argc, char *argv[]) +{ + LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); + LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); + + NodeContainer nodes12; + nodes12.Create (2); + + NodeContainer nodes23; + nodes23.Add (nodes12.Get (1)); + nodes23.Create (1); + + NodeContainer nodes34; + nodes34.Add(nodes23.Get (1)); + nodes34.Create (1); + + PointToPointHelper pointToPoint; + pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); + pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); + + NodeContainer allNodes = NodeContainer (nodes12, nodes23.Get (1), nodes34.Get (1)); + + // NixHelper to install nix-vector routing + // on all nodes + Ipv4NixVectorHelper nixRouting; + Ipv4StaticRoutingHelper staticRouting; + + Ipv4ListRoutingHelper list; + list.Add (staticRouting, 0); + list.Add (nixRouting, 10); + + InternetStackHelper stack; + stack.SetRoutingHelper (list); + stack.Install (allNodes); + + NetDeviceContainer devices12; + NetDeviceContainer devices23; + NetDeviceContainer devices34; + devices12 = pointToPoint.Install (nodes12); + devices23 = pointToPoint.Install (nodes23); + devices34 = pointToPoint.Install (nodes34); + + Ipv4AddressHelper address1; + address1.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4AddressHelper address2; + address2.SetBase ("10.1.2.0", "255.255.255.0"); + Ipv4AddressHelper address3; + address3.SetBase ("10.1.3.0", "255.255.255.0"); + + address1.Assign (devices12); + address2.Assign (devices23); + Ipv4InterfaceContainer interfaces = address3.Assign (devices34); + + UdpEchoServerHelper echoServer (9); + + ApplicationContainer serverApps = echoServer.Install (nodes34.Get (1)); + serverApps.Start (Seconds (1.0)); + serverApps.Stop (Seconds (10.0)); + + UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9); + echoClient.SetAttribute ("MaxPackets", UintegerValue (1)); + echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.))); + echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); + + ApplicationContainer clientApps = echoClient.Install (nodes12.Get (0)); + clientApps.Start (Seconds (2.0)); + clientApps.Stop (Seconds (10.0)); + + + Simulator::Run (); + Simulator::Destroy (); + return 0; +} diff --git a/examples/nms-p2p-nix.cc b/examples/nms-p2p-nix.cc new file mode 100644 index 000000000..6bf8fb137 --- /dev/null +++ b/examples/nms-p2p-nix.cc @@ -0,0 +1,458 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// DARPA NMS Campus Network Model +// +// - This topology replicates the original NMS Campus Network model +// with the exception of chord links (which were never utilized in the +// original model) +// - Link Bandwidths and Delays may not be the same as the original +// specifications +// +// (c)2009, GTech Systems, Inc. - Alfred Park + +// for timing functions +#include +#include +#include + +#include "ns3/core-module.h" +#include "ns3/simulator-module.h" +#include "ns3/node-module.h" +#include "ns3/helper-module.h" +#include "ns3/global-routing-module.h" +#include "ns3/onoff-application.h" +#include "ns3/packet-sink.h" +#include "ns3/point-to-point-net-device.h" +#include "ns3/simulator.h" + +using namespace std; +using namespace ns3; + +typedef struct timeval TIMER_TYPE; +#define TIMER_NOW(_t) gettimeofday(&_t,NULL); +#define TIMER_SECONDS(_t) ((double)(_t).tv_sec + (_t).tv_usec*1e-6) +#define TIMER_DIFF(_t1, _t2) (TIMER_SECONDS(_t1)-TIMER_SECONDS(_t2)) + +NS_LOG_COMPONENT_DEFINE ("CampusNetworkModel"); + +void Progress () +{ + Time now = Simulator::Now (); + Simulator::Schedule (Seconds (0.1), Progress); +} + +int +main (int argc, char *argv[]) +{ + //Config::SetDefault ("ns3::Simulator::SchedulerType", StringValue ("ns3::CalendarScheduler")); + TIMER_TYPE t0, t1, t2; + TIMER_NOW(t0); + cout << " ==== DARPA NMS CAMPUS NETWORK SIMULATION ====" << endl; + LogComponentEnable ("OnOffApplication", LOG_LEVEL_INFO); + + //RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + + int nCN = 2, nLANClients = 42; + bool nix = true; + + CommandLine cmd; + cmd.AddValue ("CN", "Number of total CNs [2]", nCN); + cmd.AddValue ("LAN", "Number of nodes per LAN [42]", nLANClients); + cmd.AddValue ("NIX", "Toggle nix-vector routing", nix); + cmd.Parse (argc,argv); + + if (nCN < 2) + { + cout << "Number of total CNs (" << nCN << ") lower than minimum of 2" + << endl; + return 1; + } + + cout << "Number of CNs: " << nCN << ", LAN nodes: " << nLANClients << endl; + + NodeContainer nodes_net0[nCN][3], nodes_net1[nCN][6], nodes_netLR[nCN], + nodes_net2[nCN][14], nodes_net2LAN[nCN][7][nLANClients], + nodes_net3[nCN][9], nodes_net3LAN[nCN][5][nLANClients]; + PointToPointHelper p2p_2gb200ms, p2p_1gb5ms, p2p_100mb1ms; + InternetStackHelper stack; + Ipv4InterfaceContainer ifs, ifs0[nCN][3], ifs1[nCN][6], ifs2[nCN][14], + ifs3[nCN][9], ifs2LAN[nCN][7][nLANClients], + ifs3LAN[nCN][5][nLANClients]; + Ipv4AddressHelper address; + std::ostringstream oss; + p2p_1gb5ms.SetDeviceAttribute ("DataRate", StringValue ("1Gbps")); + p2p_1gb5ms.SetChannelAttribute ("Delay", StringValue ("5ms")); + p2p_2gb200ms.SetDeviceAttribute ("DataRate", StringValue ("2Gbps")); + p2p_2gb200ms.SetChannelAttribute ("Delay", StringValue ("200ms")); + p2p_100mb1ms.SetDeviceAttribute ("DataRate", StringValue ("100Mbps")); + p2p_100mb1ms.SetChannelAttribute ("Delay", StringValue ("1ms")); + + // Setup NixVector Routing + Ipv4NixVectorHelper nixRouting; + Ipv4StaticRoutingHelper staticRouting; + + Ipv4ListRoutingHelper list; + list.Add (staticRouting, 0); + list.Add (nixRouting, 10); + + if (nix) + { + stack.SetRoutingHelper (list); + } + + // Create Campus Networks + for (int z = 0; z < nCN; ++z) + { + cout << "Creating Campus Network " << z << ":" << endl; + // Create Net0 + cout << " SubNet [ 0"; + for (int i = 0; i < 3; ++i) + { + nodes_net0[z][i].Create (1); + stack.Install (nodes_net0[z][i]); + } + nodes_net0[z][0].Add (nodes_net0[z][1].Get (0)); + nodes_net0[z][1].Add (nodes_net0[z][2].Get (0)); + nodes_net0[z][2].Add (nodes_net0[z][0].Get (0)); + NetDeviceContainer ndc0[3]; + for (int i = 0; i < 3; ++i) + { + ndc0[i] = p2p_1gb5ms.Install (nodes_net0[z][i]); + } + // Create Net1 + cout << " 1"; + for (int i = 0; i < 6; ++i) + { + nodes_net1[z][i].Create (1); + stack.Install (nodes_net1[z][i]); + } + nodes_net1[z][0].Add (nodes_net1[z][1].Get (0)); + nodes_net1[z][2].Add (nodes_net1[z][0].Get (0)); + nodes_net1[z][3].Add (nodes_net1[z][0].Get (0)); + nodes_net1[z][4].Add (nodes_net1[z][1].Get (0)); + nodes_net1[z][5].Add (nodes_net1[z][1].Get (0)); + NetDeviceContainer ndc1[6]; + for (int i = 0; i < 6; ++i) + { + if (i == 1) + { + continue; + } + ndc1[i] = p2p_1gb5ms.Install (nodes_net1[z][i]); + } + // Connect Net0 <-> Net1 + NodeContainer net0_1; + net0_1.Add (nodes_net0[z][2].Get (0)); + net0_1.Add (nodes_net1[z][0].Get (0)); + NetDeviceContainer ndc0_1; + ndc0_1 = p2p_1gb5ms.Install (net0_1); + oss.str(""); + oss << 10 + z << ".1.252.0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndc0_1); + // Create Net2 + cout << " 2"; + for (int i = 0; i < 14; ++i) + { + nodes_net2[z][i].Create (1); + stack.Install (nodes_net2[z][i]); + } + nodes_net2[z][0].Add (nodes_net2[z][1].Get (0)); + nodes_net2[z][2].Add (nodes_net2[z][0].Get (0)); + nodes_net2[z][1].Add (nodes_net2[z][3].Get (0)); + nodes_net2[z][3].Add (nodes_net2[z][2].Get (0)); + nodes_net2[z][4].Add (nodes_net2[z][2].Get (0)); + nodes_net2[z][5].Add (nodes_net2[z][3].Get (0)); + nodes_net2[z][6].Add (nodes_net2[z][5].Get (0)); + nodes_net2[z][7].Add (nodes_net2[z][2].Get (0)); + nodes_net2[z][8].Add (nodes_net2[z][3].Get (0)); + nodes_net2[z][9].Add (nodes_net2[z][4].Get (0)); + nodes_net2[z][10].Add (nodes_net2[z][5].Get (0)); + nodes_net2[z][11].Add (nodes_net2[z][6].Get (0)); + nodes_net2[z][12].Add (nodes_net2[z][6].Get (0)); + nodes_net2[z][13].Add (nodes_net2[z][6].Get (0)); + NetDeviceContainer ndc2[14]; + for (int i = 0; i < 14; ++i) + { + ndc2[i] = p2p_1gb5ms.Install (nodes_net2[z][i]); + } + NetDeviceContainer ndc2LAN[7][nLANClients]; + for (int i = 0; i < 7; ++i) + { + oss.str (""); + oss << 10 + z << ".4." << 15 + i << ".0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + for (int j = 0; j < nLANClients; ++j) + { + nodes_net2LAN[z][i][j].Create (1); + stack.Install (nodes_net2LAN[z][i][j]); + nodes_net2LAN[z][i][j].Add (nodes_net2[z][i+7].Get (0)); + ndc2LAN[i][j] = p2p_100mb1ms.Install (nodes_net2LAN[z][i][j]); + ifs2LAN[z][i][j] = address.Assign (ndc2LAN[i][j]); + } + } + // Create Net3 + cout << " 3 ]" << endl; + for (int i = 0; i < 9; ++i) + { + nodes_net3[z][i].Create (1); + stack.Install(nodes_net3[z][i]); + } + nodes_net3[z][0].Add (nodes_net3[z][1].Get (0)); + nodes_net3[z][1].Add (nodes_net3[z][2].Get (0)); + nodes_net3[z][2].Add (nodes_net3[z][3].Get (0)); + nodes_net3[z][3].Add (nodes_net3[z][1].Get (0)); + nodes_net3[z][4].Add (nodes_net3[z][0].Get (0)); + nodes_net3[z][5].Add (nodes_net3[z][0].Get (0)); + nodes_net3[z][6].Add (nodes_net3[z][2].Get (0)); + nodes_net3[z][7].Add (nodes_net3[z][3].Get (0)); + nodes_net3[z][8].Add (nodes_net3[z][3].Get (0)); + NetDeviceContainer ndc3[9]; + for (int i = 0; i < 9; ++i) + { + ndc3[i] = p2p_1gb5ms.Install (nodes_net3[z][i]); + } + NetDeviceContainer ndc3LAN[5][nLANClients]; + for (int i = 0; i < 5; ++i) + { + oss.str (""); + oss << 10 + z << ".5." << 10 + i << ".0"; + address.SetBase (oss.str ().c_str (), "255.255.255.255"); + for (int j = 0; j < nLANClients; ++j) + { + nodes_net3LAN[z][i][j].Create (1); + stack.Install (nodes_net3LAN[z][i][j]); + nodes_net3LAN[z][i][j].Add (nodes_net3[z][i+4].Get (0)); + ndc3LAN[i][j] = p2p_100mb1ms.Install (nodes_net3LAN[z][i][j]); + ifs3LAN[z][i][j] = address.Assign (ndc3LAN[i][j]); + } + } + cout << " Connecting Subnets..." << endl; + // Create Lone Routers (Node 4 & 5) + nodes_netLR[z].Create (2); + stack.Install (nodes_netLR[z]); + NetDeviceContainer ndcLR; + ndcLR = p2p_1gb5ms.Install (nodes_netLR[z]); + // Connect Net2/Net3 through Lone Routers to Net0 + NodeContainer net0_4, net0_5, net2_4a, net2_4b, net3_5a, net3_5b; + net0_4.Add (nodes_netLR[z].Get (0)); + net0_4.Add (nodes_net0[z][0].Get (0)); + net0_5.Add (nodes_netLR[z].Get (1)); + net0_5.Add (nodes_net0[z][1].Get (0)); + net2_4a.Add (nodes_netLR[z].Get (0)); + net2_4a.Add (nodes_net2[z][0].Get (0)); + net2_4b.Add (nodes_netLR[z].Get (1)); + net2_4b.Add (nodes_net2[z][1].Get (0)); + net3_5a.Add (nodes_netLR[z].Get (1)); + net3_5a.Add (nodes_net3[z][0].Get (0)); + net3_5b.Add (nodes_netLR[z].Get (1)); + net3_5b.Add (nodes_net3[z][1].Get (0)); + NetDeviceContainer ndc0_4, ndc0_5, ndc2_4a, ndc2_4b, ndc3_5a, ndc3_5b; + ndc0_4 = p2p_1gb5ms.Install (net0_4); + oss.str (""); + oss << 10 + z << ".1.253.0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndc0_4); + ndc0_5 = p2p_1gb5ms.Install (net0_5); + oss.str (""); + oss << 10 + z << ".1.254.0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndc0_5); + ndc2_4a = p2p_1gb5ms.Install (net2_4a); + oss.str (""); + oss << 10 + z << ".4.253.0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndc2_4a); + ndc2_4b = p2p_1gb5ms.Install (net2_4b); + oss.str (""); + oss << 10 + z << ".4.254.0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndc2_4b); + ndc3_5a = p2p_1gb5ms.Install (net3_5a); + oss.str (""); + oss << 10 + z << ".5.253.0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndc3_5a); + ndc3_5b = p2p_1gb5ms.Install (net3_5b); + oss.str (""); + oss << 10 + z << ".5.254.0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndc3_5b); + // Assign IP addresses + cout << " Assigning IP addresses..." << endl; + for (int i = 0; i < 3; ++i) + { + oss.str (""); + oss << 10 + z << ".1." << 1 + i << ".0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs0[z][i] = address.Assign (ndc0[i]); + } + for (int i = 0; i < 6; ++i) + { + if (i == 1) + { + continue; + } + oss.str (""); + oss << 10 + z << ".2." << 1 + i << ".0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs1[z][i] = address.Assign (ndc1[i]); + } + oss.str (""); + oss << 10 + z << ".3.1.0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndcLR); + for (int i = 0; i < 14; ++i) + { + oss.str (""); + oss << 10 + z << ".4." << 1 + i << ".0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs2[z][i] = address.Assign (ndc2[i]); + } + for (int i = 0; i < 9; ++i) + { + oss.str (""); + oss << 10 + z << ".5." << 1 + i << ".0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs3[z][i] = address.Assign (ndc3[i]); + } + } + // Create Ring Links + if (nCN > 1) + { + cout << "Forming Ring Topology..." << endl; + NodeContainer nodes_ring[nCN]; + for (int z = 0; z < nCN-1; ++z) + { + nodes_ring[z].Add (nodes_net0[z][0].Get (0)); + nodes_ring[z].Add (nodes_net0[z+1][0].Get (0)); + } + nodes_ring[nCN-1].Add (nodes_net0[nCN-1][0].Get (0)); + nodes_ring[nCN-1].Add (nodes_net0[0][0].Get (0)); + NetDeviceContainer ndc_ring[nCN]; + for (int z = 0; z < nCN; ++z) + { + ndc_ring[z] = p2p_2gb200ms.Install (nodes_ring[z]); + oss.str (""); + oss << "254.1." << z + 1 << ".0"; + address.SetBase (oss.str ().c_str (), "255.255.255.0"); + ifs = address.Assign (ndc_ring[z]); + } + } + + // Create Traffic Flows + cout << "Creating TCP Traffic Flows:" << endl; + Config::SetDefault ("ns3::OnOffApplication::MaxBytes", UintegerValue (500000)); + Config::SetDefault ("ns3::OnOffApplication::OnTime", + RandomVariableValue (ConstantVariable (1))); + Config::SetDefault ("ns3::OnOffApplication::OffTime", + RandomVariableValue (ConstantVariable (0))); + Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (512)); + + UniformVariable urng; + int r1; + double r2; + for (int z = 0; z < nCN; ++z) + { + int x = z + 1; + if (z == nCN - 1) + { + x = 0; + } + // Subnet 2 LANs + cout << " Campus Network " << z << " Flows [ Net2 "; + for (int i = 0; i < 7; ++i) + { + for (int j = 0; j < nLANClients; ++j) + { + // Sinks + PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", + InetSocketAddress (Ipv4Address::GetAny (), 9999)); + ApplicationContainer sinkApp = sinkHelper.Install ( + nodes_net2LAN[z][i][j].Get (0)); + sinkApp.Start (Seconds (100.0)); + // Sources + r1 = 2 + (int)(4 * urng.GetValue ()); + r2 = 100 + (10 * urng.GetValue ());; + OnOffHelper client ("ns3::TcpSocketFactory", Address ()); + AddressValue remoteAddress(InetSocketAddress ( + ifs2LAN[z][i][j].GetAddress (0), 9999)); + client.SetAttribute ("Remote", remoteAddress); + ApplicationContainer clientApp; + clientApp.Add (client.Install (nodes_net1[x][r1].Get (0))); + clientApp.Start (Seconds (r2)); + } + } + // Subnet 3 LANs + cout << "Net3 ]" << endl; + for (int i = 0; i < 5; ++i) + { + for (int j = 0; j < nLANClients; ++j) + { + // Sinks + PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", + InetSocketAddress (Ipv4Address::GetAny (), 9999)); + ApplicationContainer sinkApp = sinkHelper.Install ( + nodes_net3LAN[z][i][j].Get (0)); + sinkApp.Start (Seconds (100.0)); + // Sources + r1 = 2 + (int)(4 * urng.GetValue ()); + r2 = 100 + (10 * urng.GetValue ());; + OnOffHelper client ("ns3::TcpSocketFactory", Address ()); + AddressValue remoteAddress (InetSocketAddress ( + ifs2LAN[z][i][j].GetAddress (0), 9999)); + client.SetAttribute ("Remote", remoteAddress); + ApplicationContainer clientApp; + clientApp.Add (client.Install (nodes_net1[x][r1].Get (0))); + clientApp.Start (Seconds (r2)); + } + } + } + + cout << "Created " << NodeList::GetNNodes () << " nodes." << endl; + TIMER_TYPE routingStart; + TIMER_NOW (routingStart); + + if (nix) + { + // Calculate routing tables + cout << "Using Nix-vectors..." << endl; + } + else + { + // Calculate routing tables + cout << "Populating Global Static Routing Tables..." << endl; + Ipv4GlobalRoutingHelper::PopulateRoutingTables (); + } + + TIMER_TYPE routingEnd; + TIMER_NOW (routingEnd); + cout << "Routing tables population took " + << TIMER_DIFF (routingEnd, routingStart) << endl; +#if 0 + std::ofstream ascii; + ascii.open("nms_p2p_nix.tr"); + PointToPointHelper::EnableAsciiAll(ascii); + CsmaHelper::EnableAsciiAll(ascii); +#endif + +#if 0 + PointToPointHelper::EnablePcapAll("nms_p2p"); + CsmaHelper::EnablePcapAll("nms_csma"); +#endif + + Simulator::ScheduleNow (Progress); + cout << "Running simulator..." << endl; + TIMER_NOW (t1); + Simulator::Stop (Seconds (200.0)); + Simulator::Run (); + TIMER_NOW (t2); + cout << "Simulator finished." << endl; + Simulator::Destroy (); + + double d1 = TIMER_DIFF (t1, t0), d2 = TIMER_DIFF (t2, t1); + cout << "-----" << endl << "Runtime Stats:" << endl; + cout << "Simulator init time: " << d1 << endl; + cout << "Simulator run time: " << d2 << endl; + cout << "Total elapsed time: " << d1+d2 << endl; + return 0; +} diff --git a/examples/simple-global-routing.cc b/examples/simple-global-routing.cc index af541d997..a75fa6111 100644 --- a/examples/simple-global-routing.cc +++ b/examples/simple-global-routing.cc @@ -69,6 +69,8 @@ main (int argc, char *argv[]) // Allow the user to override any of the defaults and the above // DefaultValue::Bind ()s at run-time, via command-line arguments CommandLine cmd; + bool enableFlowMonitor = false; + cmd.AddValue("EnableMonitor", "Enable Flow Monitor", enableFlowMonitor); cmd.Parse (argc, argv); // Here, we will explicitly create four nodes. In more sophisticated @@ -148,10 +150,24 @@ main (int argc, char *argv[]) PointToPointHelper::EnablePcapAll ("simple-global-routing"); PointToPointHelper::EnableAsciiAll (ascii); + // Flow Monitor + Ptr flowmon; + if (enableFlowMonitor) + { + FlowMonitorHelper flowmonHelper; + flowmon = flowmonHelper.InstallAll (); + } + NS_LOG_INFO ("Run Simulation."); + Simulator::Stop (Seconds (11)); Simulator::Run (); - Simulator::Destroy (); NS_LOG_INFO ("Done."); + if (enableFlowMonitor) + { + flowmon->SerializeToXmlFile ("simple-global-routing.flowmon", false, false); + } + + Simulator::Destroy (); return 0; } diff --git a/examples/wifi-ap.cc b/examples/wifi-ap.cc index f7f169ab8..f84395fa4 100644 --- a/examples/wifi-ap.cc +++ b/examples/wifi-ap.cc @@ -62,6 +62,9 @@ PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::Sta { std::cout << " state="; switch (state) { + case WifiPhy::SWITCHING: + std::cout << "switchng"; + break; case WifiPhy::TX: std::cout << "tx "; break; diff --git a/examples/wifi-olsr-flowmon.py b/examples/wifi-olsr-flowmon.py new file mode 100644 index 000000000..c5c11e223 --- /dev/null +++ b/examples/wifi-olsr-flowmon.py @@ -0,0 +1,171 @@ +# -*- Mode: Python; -*- +# Copyright (c) 2009 INESC Porto +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Authors: Gustavo Carneiro + +import sys +import ns3 + +DISTANCE = 150 # (m) +NUM_NODES_SIDE = 3 + +def main(argv): + + cmd = ns3.CommandLine() + + cmd.NumNodesSide = None + cmd.AddValue("NumNodesSide", "Grid side number of nodes (total number of nodes will be this number squared)") + + cmd.Results = None + cmd.AddValue("Results", "Write XML results to file") + + cmd.Plot = None + cmd.AddValue("Plot", "Plot the results using the matplotlib python module") + + cmd.Parse(argv) + + wifi = ns3.WifiHelper.Default() + wifiMac = ns3.NqosWifiMacHelper.Default() + wifiPhy = ns3.YansWifiPhyHelper.Default() + wifiChannel = ns3.YansWifiChannelHelper.Default() + wifiPhy.SetChannel(wifiChannel.Create()) + ssid = ns3.Ssid("wifi-default") + wifi.SetRemoteStationManager("ns3::ArfWifiManager") + wifiMac.SetType ("ns3::AdhocWifiMac", "Ssid", ns3.SsidValue(ssid)) + + internet = ns3.InternetStackHelper() + list_routing = ns3.Ipv4ListRoutingHelper() + olsr_routing = ns3.OlsrHelper() + static_routing = ns3.Ipv4StaticRoutingHelper() + list_routing.Add(static_routing, 0) + list_routing.Add(olsr_routing, 100) + internet.SetRoutingHelper(list_routing) + + ipv4Addresses = ns3.Ipv4AddressHelper() + ipv4Addresses.SetBase(ns3.Ipv4Address("10.0.0.0"), ns3.Ipv4Mask("255.255.255.0")) + + port = 9 # Discard port(RFC 863) + onOffHelper = ns3.OnOffHelper("ns3::UdpSocketFactory", + ns3.Address(ns3.InetSocketAddress(ns3.Ipv4Address("10.0.0.1"), port))) + onOffHelper.SetAttribute("DataRate", ns3.DataRateValue(ns3.DataRate("100kbps"))) + onOffHelper.SetAttribute("OnTime", ns3.RandomVariableValue(ns3.ConstantVariable(1))) + onOffHelper.SetAttribute("OffTime", ns3.RandomVariableValue(ns3.ConstantVariable(0))) + + addresses = [] + nodes = [] + + if cmd.NumNodesSide is None: + num_nodes_side = NUM_NODES_SIDE + else: + num_nodes_side = int(cmd.NumNodesSide) + + for xi in range(num_nodes_side): + for yi in range(num_nodes_side): + + node = ns3.Node() + nodes.append(node) + + internet.Install(ns3.NodeContainer(node)) + + mobility = ns3.ConstantPositionMobilityModel() + mobility.SetPosition(ns3.Vector(xi*DISTANCE, yi*DISTANCE, 0)) + node.AggregateObject(mobility) + + devices = wifi.Install(wifiPhy, wifiMac, node) + ipv4_interfaces = ipv4Addresses.Assign(devices) + addresses.append(ipv4_interfaces.GetAddress(0)) + + for i, node in enumerate(nodes): + destaddr = addresses[(len(addresses) - 1 - i) % len(addresses)] + #print i, destaddr + onOffHelper.SetAttribute("Remote", ns3.AddressValue(ns3.InetSocketAddress(destaddr, port))) + app = onOffHelper.Install(ns3.NodeContainer(node)) + app.Start(ns3.Seconds(ns3.UniformVariable(20, 30).GetValue())) + + #internet.EnablePcapAll("wifi-olsr") + flowmon_helper = ns3.FlowMonitorHelper() + #flowmon_helper.SetMonitorAttribute("StartTime", ns3.TimeValue(ns3.Seconds(31))) + monitor = flowmon_helper.InstallAll() + monitor.SetAttribute("DelayBinWidth", ns3.DoubleValue(0.001)) + monitor.SetAttribute("JitterBinWidth", ns3.DoubleValue(0.001)) + monitor.SetAttribute("PacketSizeBinWidth", ns3.DoubleValue(20)) + + ns3.Simulator.Stop(ns3.Seconds(44.0)) + ns3.Simulator.Run() + + def print_stats(os, st): + print >> os, " Tx Bytes: ", st.txBytes + print >> os, " Rx Bytes: ", st.rxBytes + print >> os, " Tx Packets: ", st.txPackets + print >> os, " Rx Packets: ", st.rxPackets + print >> os, " Lost Packets: ", st.lostPackets + if st.rxPackets > 0: + print >> os, " Mean{Delay}: ", (st.delaySum.GetSeconds() / st.rxPackets) + print >> os, " Mean{Jitter}: ", (st.jitterSum.GetSeconds() / (st.rxPackets-1)) + print >> os, " Mean{Hop Count}: ", float(st.timesForwarded) / st.rxPackets + 1 + + if 0: + print >> os, "Delay Histogram" + for i in range(st.delayHistogram.GetNBins () ): + print >> os, " ",i,"(", st.delayHistogram.GetBinStart (i), "-", \ + st.delayHistogram.GetBinEnd (i), "): ", st.delayHistogram.GetBinCount (i) + print >> os, "Jitter Histogram" + for i in range(st.jitterHistogram.GetNBins () ): + print >> os, " ",i,"(", st.jitterHistogram.GetBinStart (i), "-", \ + st.jitterHistogram.GetBinEnd (i), "): ", st.jitterHistogram.GetBinCount (i) + print >> os, "PacketSize Histogram" + for i in range(st.packetSizeHistogram.GetNBins () ): + print >> os, " ",i,"(", st.packetSizeHistogram.GetBinStart (i), "-", \ + st.packetSizeHistogram.GetBinEnd (i), "): ", st.packetSizeHistogram.GetBinCount (i) + + for reason, drops in enumerate(st.packetsDropped): + print " Packets dropped by reason %i: %i" % (reason, drops) + #for reason, drops in enumerate(st.bytesDropped): + # print "Bytes dropped by reason %i: %i" % (reason, drops) + + monitor.CheckForLostPackets() + classifier = flowmon_helper.GetClassifier() + + if cmd.Results is None: + for flow_id, flow_stats in monitor.GetFlowStats(): + t = classifier.FindFlow(flow_id) + proto = {6: 'TCP', 17: 'UDP'} [t.protocol] + print "FlowID: %i (%s %s/%s --> %s/%i)" % \ + (flow_id, proto, t.sourceAddress, t.sourcePort, t.destinationAddress, t.destinationPort) + print_stats(sys.stdout, flow_stats) + else: + print monitor.SerializeToXmlFile(cmd.Results, True, True) + + + if cmd.Plot is not None: + import pylab + delays = [] + for flow_id, flow_stats in monitor.GetFlowStats(): + tupl = classifier.FindFlow(flow_id) + if tupl.protocol == 17 and tupl.sourcePort == 698: + continue + delays.append(flow_stats.delaySum.GetSeconds() / flow_stats.rxPackets) + pylab.hist(delays, 20) + pylab.xlabel("Delay (s)") + pylab.ylabel("Number of Flows") + pylab.show() + + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) + diff --git a/examples/wscript b/examples/wscript index 9d720d13b..db562a9dc 100644 --- a/examples/wscript +++ b/examples/wscript @@ -99,6 +99,14 @@ def build(bld): ['point-to-point', 'internet-stack', 'olsr']) obj.source = 'simple-point-to-point-olsr.cc' + obj = bld.create_ns3_program('nix-simple', + ['point-to-point', 'internet-stack', 'nix-vector-routing']) + obj.source = 'nix-simple.cc' + + obj = bld.create_ns3_program('nms-p2p-nix', + ['point-to-point', 'internet-stack', 'nix-vector-routing']) + obj.source = 'nms-p2p-nix.cc' + obj = bld.create_ns3_program('tcp-large-transfer', ['point-to-point', 'internet-stack']) obj.source = 'tcp-large-transfer.cc' @@ -135,6 +143,10 @@ def build(bld): ['core', 'simulator', 'mobility', 'wifi']) obj.source = 'wifi-ap.cc' + obj = bld.create_ns3_program('mesh', + ['core', 'simulator', 'mobility', 'wifi', 'mesh']) + obj.source = 'mesh.cc' + bld.add_subdirs('stats') obj = bld.create_ns3_program('wifi-wired-bridging', @@ -191,10 +203,6 @@ def build(bld): ['core', 'simulator', 'mobility', 'wifi']) obj.source = 'simple-wifi-frame-aggregation.cc' - obj = bld.create_ns3_program('multi-rate-first', + obj = bld.create_ns3_program('multirate', ['core', 'simulator', 'mobility', 'wifi']) - obj.source = 'multi-rate-first.cc' - - obj = bld.create_ns3_program('multi-rate-second', - ['core', 'simulator', 'mobility', 'wifi']) - obj.source = 'multi-rate-second.cc' + obj.source = 'multirate.cc' diff --git a/regression.py b/regression.py index 2261ee04b..f502aa982 100644 --- a/regression.py +++ b/regression.py @@ -112,7 +112,7 @@ class regression_test_task(Task.TaskBase): if not reason_cannot_run: pyscript = getattr(mod, "pyscript", None) if pyscript: - Options.options.compile_targets += ',ns3module' + Options.options.compile_targets += ',ns3module,pybindgen-command' else: program = getattr(mod, "program", short_name) Options.options.compile_targets += ',' + program diff --git a/samples/main-random-topology.cc b/samples/main-random-topology.cc index 4c7e7b512..62e2d5fbb 100644 --- a/samples/main-random-topology.cc +++ b/samples/main-random-topology.cc @@ -32,7 +32,7 @@ int main (int argc, char *argv[]) mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); mobility.Install (c); - Config::Connect ("/NodeList/*/$ns3::MobilityModelNotifier/CourseChange", + Config::Connect ("/NodeList/*/$ns3::MobilityModel/CourseChange", MakeCallback (&CourseChange)); Simulator::Stop (Seconds (100.0)); diff --git a/samples/main-test.cc b/samples/main-test.cc deleted file mode 100644 index b765ffa42..000000000 --- a/samples/main-test.cc +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ - -#include "ns3/test.h" - -using namespace ns3; - -#ifdef RUN_SELF_TESTS - -// declare subclass of base class Test -class MyTest : public Test { -public: - MyTest (bool ok); - virtual ~MyTest (); - virtual bool RunTests (void); -private: - bool m_ok; -}; - -// implement MyTest -MyTest::MyTest (bool ok) - : Test ("My"), - m_ok (ok) -{} -MyTest::~MyTest () -{} -bool -MyTest::RunTests (void) -{ - return m_ok; -} - -// instantiate MyTest once -static MyTest g_my_test = MyTest (true); - -#endif /* RUN_SELF_TESTS */ - -int main (int argc, char *argv[]) -{ - // run tests - TestManager::EnableVerbose (); - TestManager::RunTests (); - return 0; -} diff --git a/samples/wscript b/samples/wscript index c7f9e9a81..075cff512 100644 --- a/samples/wscript +++ b/samples/wscript @@ -22,9 +22,6 @@ def build(bld): obj = bld.create_ns3_program('main-packet-tag', ['common', 'simulator']) obj.source = 'main-packet-tag.cc' - obj = bld.create_ns3_program('main-test') - obj.source = 'main-test.cc' - if bld.env['ENABLE_THREADING'] and bld.env["ENABLE_REAL_TIME"]: obj = bld.create_ns3_program('main-test-sync') obj.source = 'main-test-sync.cc' @@ -53,4 +50,3 @@ def build(bld): ['core', 'simulator', 'mobility', 'wifi']) obj.source = 'main-ns2-mob.cc' - diff --git a/src/applications/radvd/radvd-interface.h b/src/applications/radvd/radvd-interface.h index fe1d275aa..a53175cef 100644 --- a/src/applications/radvd/radvd-interface.h +++ b/src/applications/radvd/radvd-interface.h @@ -81,7 +81,7 @@ class RadvdInterface : public RefCountBase /** * \brief Set send advert flag. - * \return sendAdvert value + * \param sendAdvert value */ void SetSendAdvert (bool sendAdvert); diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 2f1e61838..adb2804b4 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -75,11 +75,7 @@ struct BufferData { */ uint8_t m_data[1]; }; -class BufferDataList : public std::vector -{ -public: - ~BufferDataList (); -}; +typedef std::vector BufferDataList; static struct BufferData *BufferAllocate (uint32_t reqSize); @@ -91,39 +87,69 @@ static void BufferDeallocate (struct BufferData *data); namespace ns3 { #ifdef BUFFER_HEURISTICS +/* The following macros are pretty evil but they are needed to allow us to + * keep track of 3 possible states for the g_freeList variable: + * - uninitialized means that no one has created a buffer yet + * so no one has created the associated free list (it is created + * on-demand when the first buffer is created) + * - initialized means that the free list exists and is valid + * - destroyed means that the static destructors of this compilation unit + * have run so, the free list has been cleared from its content + * The key is that in destroyed state, we are careful not re-create it + * which is a typical weakness of lazy evaluation schemes which use + * '0' as a special value to indicate both un-initialized and destroyed. + * Note that it is important to use '0' as the marker for un-initialized state + * because the variable holding this state information is initialized to zero + * which the compiler assigns to zero-memory which is initialized to _zero_ + * before the constructors run so this ensures perfect handling of crazy + * constructor orderings. + */ +#define MAGIC_DESTROYED (~(long) 0) +#define IS_UNINITIALIZED(x) (x == (BufferDataList*)0) +#define IS_DESTROYED(x) (x == (BufferDataList*)MAGIC_DESTROYED) +#define IS_INITIALIZED(x) (!IS_UNINITIALIZED(x) && !IS_DESTROYED(x)) +#define DESTROYED ((BufferDataList*)MAGIC_DESTROYED) +#define UNINITIALIZED ((BufferDataList*)0) static uint32_t g_recommendedStart = 0; static uint64_t g_nAddNoRealloc = 0; static uint64_t g_nAddRealloc = 0; -static BufferDataList g_freeList; +static BufferDataList *g_freeList = 0; static uint32_t g_maxSize = 0; static uint64_t g_nAllocs = 0; static uint64_t g_nCreates = 0; #endif /* BUFFER_HEURISTICS */ -BufferDataList::~BufferDataList () -{ +static struct LocalStaticDestructor { + LocalStaticDestructor(void) + { #ifdef PRINT_STATS #ifdef BUFFER_HEURISTICS - double efficiency; - efficiency = g_nAllocs; - efficiency /= g_nCreates; - std::cout <<"buffer free list efficiency="< + */ + +#include "ns3/log.h" + +#include "nix-vector.h" + +NS_LOG_COMPONENT_DEFINE ("NixVector"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (NixVector); + +typedef std::vector NixBits_t; + +NixVector::NixVector () + : m_nixVector (0), + m_used (0), + m_currentVectorBitSize (0), + m_totalBitSize (0) +{ + NS_LOG_FUNCTION_NOARGS (); + + m_nixVector.push_back (0); +} + +NixVector::~NixVector () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +Ptr +NixVector::Copy (void) const +{ + // we need to invoke the copy constructor directly + // rather than calling Create because the copy constructor + // is private. + return Ptr (new NixVector (*this), false); +} + +NixVector::NixVector (const NixVector &o) + : m_nixVector (o.m_nixVector), + m_used (o.m_used), + m_currentVectorBitSize (o.m_currentVectorBitSize), + m_totalBitSize (o.m_totalBitSize) +{} + +NixVector & +NixVector::operator = (const NixVector &o) +{ + if (this == &o) + { + return *this; + } + m_nixVector = o.m_nixVector; + m_used = o.m_used; + m_currentVectorBitSize = o.m_currentVectorBitSize; + m_totalBitSize = o.m_totalBitSize; + return *this; +} + +TypeId +NixVector::GetTypeId(void) +{ + static TypeId tid = TypeId ("ns3::NixVector") + .SetParent () + .AddConstructor () + ; + + return tid; +} + +std::ostream & operator << (std::ostream &os, const NixVector &nix) +{ + nix.DumpNixVector (os); + return os; +} + +void +NixVector::AddNeighborIndex (uint32_t newBits, uint32_t numberOfBits) +{ + NS_LOG_FUNCTION_NOARGS (); + + if (numberOfBits > 32) + { + NS_FATAL_ERROR ("Can't add more than 32 bits to a nix-vector at one time"); + } + + // Check to see if the number + // of new bits forces the creation of + // a new entry into the NixVector vector + // i.e., we will overflow int o.w. + if (m_currentVectorBitSize + numberOfBits > 32) + { + if (m_currentVectorBitSize == 32) + { + // can't add any more to this vector, so + // start a new one + m_nixVector.push_back(newBits); + + // also reset number of bits in + // m_currentVectorBitSize + // because we are working with a new + // entry in the vector + m_currentVectorBitSize = numberOfBits; + m_totalBitSize += numberOfBits; + } + else + { + // Put what we can in the remaining portion of the + // vector entry + uint32_t tempBits = newBits; + tempBits = newBits << m_currentVectorBitSize; + tempBits |= m_nixVector.back (); + m_nixVector.back () = tempBits; + + // Now start a new vector entry + // and push the remaining bits + // there + newBits = newBits >> (32 - m_currentVectorBitSize); + m_nixVector.push_back (newBits); + + // also reset number of bits in + // m_currentVectorBitSize + // because we are working with a new + // entry in the vector + m_currentVectorBitSize = (numberOfBits - (32 - m_currentVectorBitSize)); + m_totalBitSize += numberOfBits; + } + } + else + { + // Shift over the newbits by the + // number of current bits. This allows + // us to logically OR with the present + // NixVector, resulting in the new + // NixVector + newBits = newBits << m_currentVectorBitSize; + newBits |= m_nixVector.back (); + + // Now insert the new NixVector and + // increment number of bits for + // m_currentVectorBitSize and m_totalBitSize + // accordingly + m_nixVector.back () = newBits; + m_currentVectorBitSize += numberOfBits; + m_totalBitSize += numberOfBits; + } +} + +uint32_t +NixVector::ExtractNeighborIndex (uint32_t numberOfBits) +{ + NS_LOG_FUNCTION_NOARGS (); + + if (numberOfBits > 32) + { + NS_FATAL_ERROR ("Can't extract more than 32 bits to a nix-vector at one time"); + } + + uint32_t vectorIndex = 0; + uint32_t extractedBits = 0; + uint32_t totalRemainingBits = GetRemainingBits (); + + if (numberOfBits > totalRemainingBits) + { + NS_FATAL_ERROR ("You've tried to extract too many bits of the Nix-vector, " << this << ". NumberBits: " + << numberOfBits << " Remaining: " << totalRemainingBits); + } + + if (numberOfBits <= 0) + { + NS_FATAL_ERROR ("You've specified a number of bits for Nix-vector <= 0!"); + } + + // First determine where in the NixVector + // vector we need to extract which depends + // on the number of used bits and the total + // number of bits + vectorIndex = ((totalRemainingBits-1) / 32); + + // Next, determine if this extraction will + // span multiple vector entries + if (vectorIndex > 0) // we could span more than one + { + if ((numberOfBits-1) > ((totalRemainingBits-1) % 32)) // we do span more than one + { + extractedBits = m_nixVector.at (vectorIndex) << (32 - (totalRemainingBits % 32)); + extractedBits = extractedBits >> ((32 - (totalRemainingBits % 32)) + - (numberOfBits - (totalRemainingBits % 32))); + extractedBits |= (m_nixVector.at (vectorIndex-1) + >> (32 - (numberOfBits - (totalRemainingBits % 32)))); + m_used += numberOfBits; + return extractedBits; + } + } + + // we don't span more than one + extractedBits = m_nixVector.at (vectorIndex) << (32 - (totalRemainingBits % 32)); + extractedBits = extractedBits >> (32 - (numberOfBits)); + m_used += numberOfBits; + return extractedBits; +} + +uint32_t +NixVector::GetSerializedSize (void) const +{ + uint32_t totalSizeInBytes; + totalSizeInBytes = sizeof (m_used) + sizeof (m_currentVectorBitSize) + + sizeof (m_totalBitSize) + (4 * m_nixVector.size ()); + + // add four to this to account + // for the nix-vector length + // entry + return totalSizeInBytes+4; +} + +void +NixVector::Serialize (Buffer::Iterator i, uint32_t size) const +{ + uint32_t bytesWritten = 0; + + i.WriteU32 (size); + bytesWritten += 4; + + i.WriteU32 (m_used); + bytesWritten += 4; + + i.WriteU32 (m_currentVectorBitSize); + bytesWritten += 4; + + i.WriteU32 (m_totalBitSize); + bytesWritten += 4; + + for (uint32_t j = 0; j < m_nixVector.size (); j++) + { + i.WriteU32 (m_nixVector.at(j)); + bytesWritten += 4; + } + + NS_ASSERT (bytesWritten == size); +} + +uint32_t +NixVector::Deserialize (Buffer::Iterator i) +{ + NS_LOG_FUNCTION (this); + uint32_t totalSize = i.ReadU32 (); + uint32_t size = totalSize; + size -= 4; + + NS_ASSERT (size >= 4); + m_used = i.ReadU32 (); + size -=4; + + NS_ASSERT (size >= 4); + m_currentVectorBitSize = i.ReadU32 (); + size -=4; + + NS_ASSERT (size >= 4); + m_totalBitSize = i.ReadU32 (); + size -=4; + + // make sure the nix-vector + // is empty + m_nixVector.clear (); + while (size > 0) + { + NS_ASSERT (size >= 4); + m_nixVector.push_back (i.ReadU32 ()); + size -=4; + } + + NS_ASSERT (size == 0); + return totalSize; +} + +void +NixVector::DumpNixVector (std::ostream &os) const +{ + NS_LOG_FUNCTION_NOARGS (); + uint32_t i = m_nixVector.size (); + std::vector::const_reverse_iterator rIter; + for (rIter = m_nixVector.rbegin (); rIter != m_nixVector.rend (); rIter++) + { + uint32_t numBits = BitCount (*rIter); + + // all this work just to get the nix + // vector to print out neat + + // if it's not the first entry in the vector, + // we may have to add some zeros and fill + // out the vector + if (m_totalBitSize > ((sizeof (uint32_t)*8) * i)) + { + PrintDec2BinNixFill (*rIter,numBits,os); + } + else if (m_totalBitSize%32 == 0) + { + PrintDec2BinNix (*rIter,32,os); + } + else + { + PrintDec2BinNix (*rIter,m_totalBitSize%32,os); + } + + i--; + + if (i > 0) + { + os << "--"; + } + } +} + +uint32_t +NixVector::GetRemainingBits (void) +{ + NS_LOG_FUNCTION_NOARGS (); + + return (m_totalBitSize - m_used); +} + +uint32_t +NixVector::BitCount (uint32_t numberOfNeighbors) const +{ + NS_LOG_FUNCTION_NOARGS (); + + // Given the numberOfNeighbors, return the number + // of bits needed (essentially, log2(numberOfNeighbors-1) + uint32_t bitCount = 0; + + if (numberOfNeighbors < 2) + { + return 1; + } + else + { + for (numberOfNeighbors -= 1; numberOfNeighbors != 0; numberOfNeighbors >>= 1) + { + bitCount++; + } + return bitCount; + } +} + +void +NixVector::PrintDec2BinNix (uint32_t decimalNum, uint32_t bitCount, std::ostream &os) const +{ + if(decimalNum == 0) + { + for (; bitCount > 0; bitCount--) + { + os << 0; + } + return; + } + if(decimalNum == 1) + { + for (; bitCount > 1; bitCount--) + { + os << 0; + } + os << 1; + } + else + { + PrintDec2BinNix (decimalNum / 2,bitCount-1, os); + os << decimalNum % 2; + } +} + +void +NixVector::PrintDec2BinNixFill (uint32_t decimalNum, uint32_t bitCount, std::ostream &os) const +{ + if(decimalNum == 0) + { + os << 0; + return; + } + if(decimalNum == 1) + { + // check to see if we need to + // print out some zeros at the + // beginning of the nix vector + if ((uint32_t)(sizeof (uint32_t)*8) > bitCount) + { + for (uint32_t i = ((sizeof (uint32_t)*8)-bitCount); i > 0; i--) + { + os << 0; + } + } + os << 1; + } + else + { + PrintDec2BinNixFill (decimalNum / 2, bitCount, os); + os << decimalNum % 2; + } +} + +} // namespace ns3 diff --git a/src/common/nix-vector.h b/src/common/nix-vector.h new file mode 100644 index 000000000..fced817a8 --- /dev/null +++ b/src/common/nix-vector.h @@ -0,0 +1,166 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 The Georgia Institute of Technology + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Josh Pelkey + */ + +#ifndef __NIX_VECTOR_H__ +#define __NIX_VECTOR_H__ + +#include "ns3/object.h" +#include "ns3/buffer.h" + +namespace ns3 { + +/** + * \ingroup packet + * + * \brief Neighbor-index data structure for nix-vector routing + * + * This data structure holds a vector of "neighbor-indexes" for + * a simulation specific routing protocol, nix-vector routing. + * Theses neighbor-indexes correspond to the net-device which a + * node should use to route a packet. A nix-vector is built + * (or fetched from a cache) on-demand. The nix-vector is + * transmitted with the packet, and along each hop of the + * route, the current node extracts the appropriate + * neighbor-index and routes the packet. + * + * \internal + * The implementation of NixVector uses a vector to store + * the neighbor-indexes. Each entry in the vector is 32 + * bits long and can store multiple neighbor-indexes. A + * fair amount of bit manipulation is used to store these + * neighbor-indexes efficiently. A vector is used so that + * the nix-vector can grow arbitraily if the topoplogy and + * route requires a large number of neighbor-indexes. + * + * As the nix-vector travels along the route, an internal + * private member variable keeps track of how many bits + * have been used. At a particular node, the nix-vector + * is used to return the next neighbor-index. This + * neighbor-index is used to determine which net-device + * to use. The number of bits used would then be + * incremented accordingly, and the packet would be + * routed. + */ + +class NixVector : public Object +{ + public: + NixVector (); + NixVector (const NixVector &o); + ~NixVector (); + Ptr Copy (void) const; + NixVector &operator = (const NixVector &o); + static TypeId GetTypeId (void); + /** + * \param newBits the neighbor-index to be added to the vector + * \param numberOfBits the number of bits that newBits contains + * + * Adds the neighbor index to the vector using a fair amount of + * bit manipulation to pack everything in efficiently. + * + * Note: This function assumes that the number of bits to be added + * is always less than or equal to 32, ie., you can only span one + * entry of a nix-vector at a time. This is reasonable, since 32 + * bits gives you 2^32 possible neighbors. + */ + void AddNeighborIndex (uint32_t newBits, uint32_t numberOfBits); + /** + * \return the neighbor index + * + * \param numberOfBits the number of bits to extract from the vector + * + * Extracts the number of bits specified from + * the vector and returns the value extracted + * + * Note: This function assumes that the number of bits to be extracted + * is always less than or equal to 32, ie., you can only span one + * entry of a nix-vector at a time. This is reasonable, since 32 + * bits gives you 2^32 possible neighbors. + */ + uint32_t ExtractNeighborIndex (uint32_t numberOfBits); + /** + * \return number of bits remaining in the + * nix-vector (ie m_total - m_used) + */ + uint32_t GetRemainingBits (void); + /** + * \return the number of bytes required for serialization + */ + uint32_t GetSerializedSize (void) const; + /** + * \param i Buffer iterator for writing + * + * \param size number of bytes to write + */ + void Serialize (Buffer::Iterator i, uint32_t size) const; + /** + * \return the number of bytes deserialized + * + * \param i Buffer iterator for reading + */ + uint32_t Deserialize (Buffer::Iterator i); + /** + * \return number of bits of numberOfNeighbors + * + * \param numberOfNeighbors the total number of neighbors + * + * This function is used to determine the number of bits of + * numberOfNeighbors so that this value can be passed in to + * AddNeighborIndex or ExtractNeighborIndex. + */ + uint32_t BitCount (uint32_t numberOfNeighbors) const; + /* for printing of nix-vector */ + void DumpNixVector (std::ostream &os) const; + /* for printing of nix-vector */ + friend std::ostream & operator <<( std::ostream &outs, const NixVector &nix); + + + private: + typedef std::vector NixBits_t; + + /* the actual nix-vector */ + NixBits_t m_nixVector; + + /* for tracking where we are + * in the nix-vector + */ + uint32_t m_used; + + /* for tracking how many bits we + * have used in the current vector + * entry. need this in order to + * expand the vector passed 32bits + */ + uint32_t m_currentVectorBitSize; + + /* a counter of how total bits are in + * the nix-vector + */ + uint32_t m_totalBitSize; + + /* internal for pretty printing of nix-vector */ + void PrintDec2BinNixFill (uint32_t, uint32_t, std::ostream &os) const; + + /* internal for pretty printing of nix-vector */ + void PrintDec2BinNix (uint32_t, uint32_t, std::ostream &os) const; +}; +} // namespace ns3 + +#endif diff --git a/src/common/packet.cc b/src/common/packet.cc index 13c024675..d90056d5a 100644 --- a/src/common/packet.cc +++ b/src/common/packet.cc @@ -138,6 +138,7 @@ Packet::Packet () m_byteTagList (), m_packetTagList (), m_metadata (m_globalUid, 0), + m_nixVector (0), m_refCount (1) { m_globalUid++; @@ -149,7 +150,10 @@ Packet::Packet (const Packet &o) m_packetTagList (o.m_packetTagList), m_metadata (o.m_metadata), m_refCount (1) -{} +{ + o.m_nixVector ? m_nixVector = o.m_nixVector->Copy () + : m_nixVector = 0; +} Packet & Packet::operator = (const Packet &o) @@ -162,6 +166,8 @@ Packet::operator = (const Packet &o) m_byteTagList = o.m_byteTagList; m_packetTagList = o.m_packetTagList; m_metadata = o.m_metadata; + o.m_nixVector ? m_nixVector = o.m_nixVector->Copy () + : m_nixVector = 0; return *this; } @@ -170,6 +176,7 @@ Packet::Packet (uint32_t size) m_byteTagList (), m_packetTagList (), m_metadata (m_globalUid, size), + m_nixVector (0), m_refCount (1) { m_globalUid++; @@ -179,6 +186,7 @@ Packet::Packet (uint8_t const*buffer, uint32_t size) m_byteTagList (), m_packetTagList (), m_metadata (m_globalUid, size), + m_nixVector (0), m_refCount (1) { m_globalUid++; @@ -193,6 +201,7 @@ Packet::Packet (const Buffer &buffer, const ByteTagList &byteTagList, m_byteTagList (byteTagList), m_packetTagList (packetTagList), m_metadata (metadata), + m_nixVector (0), m_refCount (1) {} @@ -209,6 +218,18 @@ Packet::CreateFragment (uint32_t start, uint32_t length) const return Ptr (new Packet (buffer, m_byteTagList, m_packetTagList, metadata), false); } +void +Packet::SetNixVector (Ptr nixVector) +{ + m_nixVector = nixVector; +} + +Ptr +Packet::GetNixVector (void) const +{ + return m_nixVector; +} + uint32_t Packet::GetSize (void) const { @@ -677,7 +698,6 @@ Packet::GetPacketTagIterator (void) const return PacketTagIterator (m_packetTagList.Head ()); } - std::ostream& operator<< (std::ostream& os, const Packet &packet) { packet.Print (os); diff --git a/src/common/packet.h b/src/common/packet.h index a272eb2f6..835c8bbfd 100644 --- a/src/common/packet.h +++ b/src/common/packet.h @@ -28,6 +28,7 @@ #include "tag.h" #include "byte-tag-list.h" #include "packet-tag-list.h" +#include "nix-vector.h" #include "ns3/callback.h" #include "ns3/assert.h" #include "ns3/ptr.h" @@ -520,6 +521,15 @@ public: */ PacketTagIterator GetPacketTagIterator (void) const; + /* Note: These functions support a temporary solution + * to a specific problem in this generic class, i.e. + * how to associate something specific like nix-vector + * with a packet. This design methodology + * should _not_ be followed, and is only here as an + * impetus to fix this general issue. */ + void SetNixVector (Ptr); + Ptr GetNixVector (void) const; + private: Packet (const Buffer &buffer, const ByteTagList &byteTagList, const PacketTagList &packetTagList, const PacketMetadata &metadata); @@ -527,6 +537,10 @@ private: ByteTagList m_byteTagList; PacketTagList m_packetTagList; PacketMetadata m_metadata; + + /* Please see comments above about nix-vector */ + Ptr m_nixVector; + mutable uint32_t m_refCount; static uint32_t m_globalUid; }; diff --git a/src/common/pcap-file-test-suite.cc b/src/common/pcap-file-test-suite.cc new file mode 100644 index 000000000..c96f7135a --- /dev/null +++ b/src/common/pcap-file-test-suite.cc @@ -0,0 +1,965 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include + +#include "ns3/test.h" +#include "ns3/pcap-file.h" + +using namespace ns3; + +// =========================================================================== +// Some utility functions for the tests. +// =========================================================================== + +uint16_t +Swap (uint16_t val) +{ + return ((val >> 8) & 0x00ff) | ((val << 8) & 0xff00); +} + +uint32_t +Swap (uint32_t val) +{ + return ((val >> 24) & 0x000000ff) | ((val >> 8) & 0x0000ff00) | ((val << 8) & 0x00ff0000) | ((val << 24) & 0xff000000); +} + +bool +CheckFileExists (std::string filename) +{ + FILE * p = fopen (filename.c_str (), "rb"); + if (p == 0) + { + return false; + } + + fclose (p); + return true; +} + + +bool +CheckFileLength (std::string filename, uint64_t sizeExpected) +{ + FILE * p = fopen (filename.c_str (), "rb"); + if (p == 0) + { + return false; + } + + fseek (p, 0, SEEK_END); + + uint64_t sizeActual = ftell (p); + fclose (p); + + return sizeActual == sizeExpected; +} + +// =========================================================================== +// Test case to make sure that the Pcap File Object can do its most basic job +// and create an empty pcap file. +// =========================================================================== +class WriteModeCreateTestCase : public TestCase +{ +public: + WriteModeCreateTestCase (); + virtual ~WriteModeCreateTestCase (); + +private: + virtual void DoSetup (void); + virtual bool DoRun (void); + virtual void DoTeardown (void); + + std::string m_testFilename; +}; + +WriteModeCreateTestCase::WriteModeCreateTestCase () + : TestCase ("Check to see that PcapFile::Open with mode \"w\" works") +{ +} + +WriteModeCreateTestCase::~WriteModeCreateTestCase () +{ +} + +void +WriteModeCreateTestCase::DoSetup (void) +{ + std::stringstream filename; + uint32_t n = rand (); + filename << n; + m_testFilename = "/tmp/" + filename.str () + ".pcap"; +} + +void +WriteModeCreateTestCase::DoTeardown (void) +{ + remove (m_testFilename.c_str ()); +} + +bool +WriteModeCreateTestCase::DoRun (void) +{ + PcapFile f; + + // + // Opening a new file in write mode should result in an empty file of the + // given name. + // + bool err = f.Open (m_testFilename, "w"); + + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + f.Close (); + + NS_TEST_ASSERT_MSG_EQ (CheckFileExists (m_testFilename), true, + "Open (" << m_testFilename << ", \"w\") does not create file"); + NS_TEST_ASSERT_MSG_EQ (CheckFileLength (m_testFilename, 0), true, + "Open (" << m_testFilename << ", \"w\") does not result in an empty file"); + + // + // Calling Init() on a file created with "w" should result in a file just + // long enough to contain the pcap file header. + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + + err = f.Init (1234, 5678, 7); + NS_TEST_ASSERT_MSG_EQ (err, false, "Init (1234, 5678, 7) returns error"); + + f.Close (); + + NS_TEST_ASSERT_MSG_EQ (CheckFileLength (m_testFilename, 24), true, + "Init () does not result in a file with a pcap file header"); + + // + // Opening an existing file in write mode should result in that file being + // emptied. + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + + f.Close (); + + NS_TEST_ASSERT_MSG_EQ (CheckFileLength (m_testFilename, 0), true, + "Open (" << m_testFilename << ", \"w\") does not result in an empty file"); + + // + // Initialize the file again. + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, + "Open (" << m_testFilename << ", \"w\") returns error"); + + err = f.Init (1234, 5678, 7); + NS_TEST_ASSERT_MSG_EQ (err, false, "Init (1234, 5678, 7) returns error"); + + // + // Now we should be able to write to it since it was opened in "w" mode. + // This is just a permissions check so we don't actually look at the + // data. + // + uint8_t buffer[128]; + err = f.Write (0, 0, buffer, 128); + NS_TEST_ASSERT_MSG_EQ (err, false, "Write (write-only-file " << m_testFilename << ") returns error"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Pcap File Object can open an existing pcap +// file. +// =========================================================================== +class ReadModeCreateTestCase : public TestCase +{ +public: + ReadModeCreateTestCase (); + virtual ~ReadModeCreateTestCase (); + +private: + virtual void DoSetup (void); + virtual bool DoRun (void); + virtual void DoTeardown (void); + + std::string m_testFilename; +}; + +ReadModeCreateTestCase::ReadModeCreateTestCase () + : TestCase ("Check to see that PcapFile::Open with mode \"r\" works") +{ +} + +ReadModeCreateTestCase::~ReadModeCreateTestCase () +{ +} + +void +ReadModeCreateTestCase::DoSetup (void) +{ + std::stringstream filename; + uint32_t n = rand (); + filename << n; + m_testFilename = "/tmp/" + filename.str () + ".pcap"; +} + +void +ReadModeCreateTestCase::DoTeardown (void) +{ + remove (m_testFilename.c_str ()); +} + +bool +ReadModeCreateTestCase::DoRun (void) +{ + PcapFile f; + + // + // Opening a non-existing file in read mode should result in an error. + // + bool err = f.Open (m_testFilename, "r"); + NS_TEST_ASSERT_MSG_EQ (err, true, "Open (non-existing-filename " << m_testFilename << ", \"r\") does not return error"); + + NS_TEST_ASSERT_MSG_EQ (CheckFileExists (m_testFilename), false, + "Open (" << m_testFilename << ", \"r\") unexpectedly created a file"); + + // + // Okay, now create an uninitialized file using previously tested operations + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (filename, \"w\") returns error"); + f.Close (); + + // + // Opening this file should result in an error since it has no pcap file header. + // + err = f.Open (m_testFilename, "r"); + NS_TEST_ASSERT_MSG_EQ (err, true, "Open (non-initialized-filename " << m_testFilename << ", \"r\") does not return error"); + + // + // Okay, now open that non-initialized file in write mode and initialize it + // Note that we open it in write mode to initialize it. + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + + err = f.Init (1234, 5678, 7); + NS_TEST_ASSERT_MSG_EQ (err, false, "Init (1234, 5678, 7) returns error"); + f.Close (); + + // + // Opening this file should now work since it has a pcap file header. + // + err = f.Open (m_testFilename, "r"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (initialized-filename " << m_testFilename << ", \"r\") returns error"); + + // + // Now we should not be able to write to it since it was opened in "r" mode + // even if it has been initialized.. + // + uint8_t buffer[128]; + err = f.Write (0, 0, buffer, 128); + NS_TEST_ASSERT_MSG_EQ (err, true, "Write (read-only-file " << m_testFilename << ") does not return error"); + + f.Close (); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Pcap File Object can open an existing pcap +// file for appending. +// =========================================================================== +class AppendModeCreateTestCase : public TestCase +{ +public: + AppendModeCreateTestCase (); + virtual ~AppendModeCreateTestCase (); + +private: + virtual void DoSetup (void); + virtual bool DoRun (void); + virtual void DoTeardown (void); + + std::string m_testFilename; +}; + +AppendModeCreateTestCase::AppendModeCreateTestCase () + : TestCase ("Check to see that PcapFile::Open with mode \"a\" works") +{ +} + +AppendModeCreateTestCase::~AppendModeCreateTestCase () +{ +} + +void +AppendModeCreateTestCase::DoSetup (void) +{ + std::stringstream filename; + uint32_t n = rand (); + filename << n; + m_testFilename = "/tmp/" + filename.str () + ".pcap"; +} + +void +AppendModeCreateTestCase::DoTeardown (void) +{ + remove (m_testFilename.c_str ()); +} + +bool +AppendModeCreateTestCase::DoRun (void) +{ + PcapFile f; + + // + // Opening a non-existing file in append mode should result in an error. + // + bool err = f.Open (m_testFilename, "a"); + NS_TEST_ASSERT_MSG_EQ (err, true, "Open (non-existing-filename " << m_testFilename << ", \"a\") does not return error"); + f.Close (); + + NS_TEST_ASSERT_MSG_EQ (CheckFileExists (m_testFilename), false, + "Open (" << m_testFilename << ", \"a\") unexpectedly created a file"); + + // + // Okay, now create an uninitialized file using previously tested operations + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + f.Close (); + + // + // Opening this file should result in an error since it has no pcap file header. + // + err = f.Open (m_testFilename, "a"); + NS_TEST_ASSERT_MSG_EQ (err, true, "Open (non-initialized-filename " << m_testFilename << ", \"a\") does not return error"); + + // + // Okay, now open that non-initialized file in write mode and initialize it. + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (non-initialized-filename " << m_testFilename << ", \"w\") returns error"); + + err = f.Init (1234, 5678, 7); + NS_TEST_ASSERT_MSG_EQ (err, false, "Init (1234, 5678, 7) returns error"); + f.Close (); + + // + // Opening this file should now work since it has a pcap file header. + // + err = f.Open (m_testFilename, "a"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (initialized-filename " << m_testFilename << ", \"r\") returns error"); + + // + // We should be able to write to it since it was opened in "a" mode. + // + uint8_t buffer[128]; + err = f.Write (0, 0, buffer, 128); + NS_TEST_ASSERT_MSG_EQ (err, false, "Write (append-mode-file " << m_testFilename << ") returns error"); + + f.Close (); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Pcap File Object can write out correct pcap +// file headers in both endian cases, and then read them in correctly. +// =========================================================================== +class FileHeaderTestCase : public TestCase +{ +public: + FileHeaderTestCase (); + virtual ~FileHeaderTestCase (); + +private: + virtual void DoSetup (void); + virtual bool DoRun (void); + virtual void DoTeardown (void); + + std::string m_testFilename; +}; + +FileHeaderTestCase::FileHeaderTestCase () + : TestCase ("Check to see that PcapFileHeader is managed correctly") +{ +} + +FileHeaderTestCase::~FileHeaderTestCase () +{ +} + +void +FileHeaderTestCase::DoSetup (void) +{ + std::stringstream filename; + uint32_t n = rand (); + filename << n; + m_testFilename = "/tmp/" + filename.str () + ".pcap"; +} + +void +FileHeaderTestCase::DoTeardown (void) +{ + remove (m_testFilename.c_str ()); +} + +bool +FileHeaderTestCase::DoRun (void) +{ + PcapFile f; + + // + // Create an uninitialized file using previously tested operations + // + bool err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + + // + // Initialize the pcap file header. + // + err = f.Init (1234, 5678, 7); + NS_TEST_ASSERT_MSG_EQ (err, false, + "Init (1234, 5678, 7) returns error"); + f.Close (); + + // + // Take a look and see what was done to the file + // + FILE *p = fopen (m_testFilename.c_str (), "r+b"); + NS_TEST_ASSERT_MSG_NE (p, 0, "fopen(" << m_testFilename << ") should have been able to open a correctly created pcap file"); + + uint32_t val32; + uint16_t val16; + + size_t result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() magic number"); + NS_TEST_ASSERT_MSG_EQ (val32, 0xa1b2c3d4, "Magic number written incorrectly"); + + result = fread (&val16, sizeof(val16), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() version major"); + NS_TEST_ASSERT_MSG_EQ (val16, 2, "Version major written incorrectly"); + + result = fread (&val16, sizeof(val16), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() version minor"); + NS_TEST_ASSERT_MSG_EQ (val16, 4, "Version minor written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() time zone correction"); + NS_TEST_ASSERT_MSG_EQ (val32, 7, "Version minor written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() sig figs"); + NS_TEST_ASSERT_MSG_EQ (val32, 0, "Sig figs written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() snap length"); + NS_TEST_ASSERT_MSG_EQ (val32, 5678, "Snap length written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() data link type"); + NS_TEST_ASSERT_MSG_EQ (val32, 1234, "Data length type written incorrectly"); + + fclose (p); + p = 0; + + // + // We wrote a native-endian file out correctly, now let's see if we can read + // it back in correctly. + // + err = f.Open (m_testFilename, "r"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (existing-initialized-file " << m_testFilename << ", \"r\") returns error"); + + NS_TEST_ASSERT_MSG_EQ (f.GetMagic (), 0xa1b2c3d4, "Read back magic number incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetVersionMajor (), 2, "Read back version major incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetVersionMinor (), 4, "Read back version minor incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetTimeZoneOffset (), 7, "Read back time zone offset incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetSigFigs (), 0, "Read back sig figs incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetSnapLen (), 5678, "Read back snap len incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetDataLinkType (), 1234, "Read back data link type incorrectly"); + + // + // Re-open the file to erase its contents. + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + + // + // Initialize the pcap file header, turning on swap mode manually to force + // the pcap file header to be written out in foreign-endian form, whichever + // endian-ness that might be. + // + err = f.Init (1234, 5678, 7, true); + NS_TEST_ASSERT_MSG_EQ (err, false, "Init (1234, 5678, 7) returns error"); + f.Close (); + + // + // Take a look and see what was done to the file. Everything should now + // appear byte-swapped. + // + p = fopen (m_testFilename.c_str (), "r+b"); + NS_TEST_ASSERT_MSG_NE (p, 0, "fopen(" << m_testFilename << ") should have been able to open a correctly created pcap file"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() magic number"); + NS_TEST_ASSERT_MSG_EQ (val32, Swap(uint32_t (0xa1b2c3d4)), "Magic number written incorrectly"); + + result = fread (&val16, sizeof(val16), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() version major"); + NS_TEST_ASSERT_MSG_EQ (val16, Swap(uint16_t (2)), "Version major written incorrectly"); + + result = fread (&val16, sizeof(val16), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() version minor"); + NS_TEST_ASSERT_MSG_EQ (val16, Swap(uint16_t (4)), "Version minor written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() time zone correction"); + NS_TEST_ASSERT_MSG_EQ (val32, Swap(uint32_t (7)), "Version minor written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() sig figs"); + NS_TEST_ASSERT_MSG_EQ (val32, 0, "Sig figs written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() snap length"); + NS_TEST_ASSERT_MSG_EQ (val32, Swap(uint32_t (5678)), "Snap length written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() data link type"); + NS_TEST_ASSERT_MSG_EQ (val32, Swap(uint32_t (1234)), "Data length type written incorrectly"); + + fclose (p); + p = 0; + + // + // We wrote an opposite-endian file out correctly, now let's see if we can read + // it back in correctly. + // + err = f.Open (m_testFilename, "r"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (existing-initialized-file " << m_testFilename << ", \"r\") returns error"); + + NS_TEST_ASSERT_MSG_EQ (f.GetSwapMode (), true, "Byte-swapped file not correctly indicated"); + + NS_TEST_ASSERT_MSG_EQ (f.GetMagic (), 0xa1b2c3d4, "Read back magic number incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetVersionMajor (), 2, "Read back version major incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetVersionMinor (), 4, "Read back version minor incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetTimeZoneOffset (), 7, "Read back time zone offset incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetSigFigs (), 0, "Read back sig figs incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetSnapLen (), 5678, "Read back snap len incorrectly"); + NS_TEST_ASSERT_MSG_EQ (f.GetDataLinkType (), 1234, "Read back data link type incorrectly"); + + f.Close (); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Pcap File Object can write pcap packet +// records in both endian cases, and then read them in correctly. +// =========================================================================== +class RecordHeaderTestCase : public TestCase +{ +public: + RecordHeaderTestCase (); + virtual ~RecordHeaderTestCase (); + +private: + virtual void DoSetup (void); + virtual bool DoRun (void); + virtual void DoTeardown (void); + + std::string m_testFilename; +}; + +RecordHeaderTestCase::RecordHeaderTestCase () + : TestCase ("Check to see that PcapRecordHeader is managed correctly") +{ +} + +RecordHeaderTestCase::~RecordHeaderTestCase () +{ +} + +void +RecordHeaderTestCase::DoSetup (void) +{ + std::stringstream filename; + uint32_t n = rand (); + filename << n; + m_testFilename = "/tmp/" + filename.str () + ".pcap"; +} + +void +RecordHeaderTestCase::DoTeardown (void) +{ + remove (m_testFilename.c_str ()); +} + +bool +RecordHeaderTestCase::DoRun (void) +{ + PcapFile f; + + // + // Create an uninitialized file using previously tested operations + // + bool err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + + // + // Initialize the pcap file header. + // + err = f.Init (37, 43, -7); + NS_TEST_ASSERT_MSG_EQ (err, false, "Init (37, 43, -7) returns error"); + + // + // Initialize a buffer with a counting pattern to check the data later. + // + uint8_t bufferOut[128]; + for (uint32_t i = 0; i < 128; ++i) + { + bufferOut[i] = i; + } + + // + // Now we should be able to write a packet to it since it was opened in "w" + // mode. The packet data written should be limited to 43 bytes in length + // by the Init() call above. + // + err = f.Write (1234, 5678, bufferOut, 128); + NS_TEST_ASSERT_MSG_EQ (err, false, "Write (write-only-file " << m_testFilename << ") returns error"); + f.Close (); + + // + // Let's peek into the file and see what actually went out for that + // packet. + // + FILE *p = fopen (m_testFilename.c_str (), "r+b"); + NS_TEST_ASSERT_MSG_NE (p, 0, "fopen() should have been able to open a correctly created pcap file"); + + // + // A pcap file header takes up 24 bytes, a pcap record header takes up 16 bytes + // and we wrote in 43 bytes, so the file must be 83 bytes long. Let's just + // double check that this is exactly what happened. + // + fseek (p, 0, SEEK_END); + uint64_t size = ftell (p); + NS_TEST_ASSERT_MSG_EQ (size, 83, "Pcap file with one 43 byte packet is incorrect size"); + + // + // A pcap file header takes up 24 bytes, so we should see a pcap record header + // starting there in the file. We've tested this all before so we just assume + // it's all right and just seek to just past that point.. + // + fseek (p, 24, SEEK_SET); + + uint32_t val32; + + size_t result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() seconds timestamp"); + NS_TEST_ASSERT_MSG_EQ (val32, 1234, "Seconds timestamp written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() microseconds timestamp"); + NS_TEST_ASSERT_MSG_EQ (val32, 5678, "Microseconds timestamp written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() included length"); + NS_TEST_ASSERT_MSG_EQ (val32, 43, "Included length written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() actual length"); + NS_TEST_ASSERT_MSG_EQ (val32, 128, "Actual length written incorrectly"); + + // + // Take a look and see what went out into the file. The packet data + // should be unchanged (unswapped). + // + uint8_t bufferIn[128]; + + result = fread (bufferIn, 1, 43, p); + NS_TEST_ASSERT_MSG_EQ (result, 43, "Unable to fread() packet data of expected length"); + + for (uint32_t i = 0; i < 43; ++i) + { + NS_TEST_ASSERT_MSG_EQ (bufferIn[i], bufferOut[i], "Incorrect packet data written"); + } + + fclose (p); + p = 0; + + // + // Let's see if the PcapFile object can figure out how to do the same thing + // correctly read in a packet. + // + err = f.Open (m_testFilename, "r"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"r\") of existing good file returns error"); + + uint32_t tsSec, tsUsec, inclLen, origLen, readLen; + + err = f.Read (bufferIn, sizeof(bufferIn), tsSec, tsUsec, inclLen, origLen, readLen); + NS_TEST_ASSERT_MSG_EQ (err, false, "Read() of known good packet returns error"); + NS_TEST_ASSERT_MSG_EQ (tsSec, 1234, "Incorrectly read seconds timestap from known good packet"); + NS_TEST_ASSERT_MSG_EQ (tsUsec, 5678, "Incorrectly read microseconds timestap from known good packet"); + NS_TEST_ASSERT_MSG_EQ (inclLen, 43, "Incorrectly read included length from known good packet"); + NS_TEST_ASSERT_MSG_EQ (origLen, 128, "Incorrectly read original length from known good packet"); + NS_TEST_ASSERT_MSG_EQ (readLen, 43, "Incorrectly constructed actual read length from known good packet given buffer size"); + + // + // Did the data come back correctly? + // + for (uint32_t i = 0; i < 43; ++i) + { + NS_TEST_ASSERT_MSG_EQ (bufferIn[i], bufferOut[i], "Incorrect packet data read from known good packet"); + } + + // + // We have to check to make sure that the pcap record header is swapped + // correctly. Open the file in write mode to clear the data. + // + err = f.Open (m_testFilename, "w"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"w\") returns error"); + + // + // Initialize the pcap file header, forcing the object into swap mode. + // + err = f.Init (37, 43, -7, true); + NS_TEST_ASSERT_MSG_EQ (err, false, "Init (37, 43, -7) returns error"); + + // + // Now we should be able to write a packet to it since it was opened in "w" + // mode. The packet data written should be limited to 43 bytes in length + // by the Init() call above. + // + err = f.Write (1234, 5678, bufferOut, 128); + NS_TEST_ASSERT_MSG_EQ (err, false, "Write (write-only-file " << m_testFilename << ") returns error"); + f.Close (); + + // + // Let's peek into the file and see what actually went out for that + // packet. + // + p = fopen (m_testFilename.c_str (), "r+b"); + NS_TEST_ASSERT_MSG_NE (p, 0, "fopen() should have been able to open a correctly created pcap file"); + + // + // A pcap file header takes up 24 bytes, a pcap record header takes up 16 bytes + // and we wrote in 43 bytes, so the file must be 83 bytes long. Let's just + // double check that this is exactly what happened. + // + fseek (p, 0, SEEK_END); + size = ftell (p); + NS_TEST_ASSERT_MSG_EQ (size, 83, "Pcap file with one 43 byte packet is incorrect size"); + + // + // A pcap file header takes up 24 bytes, so we should see a pcap record header + // starting there in the file. We've tested this all before so we just assume + // it's all right and just seek past it. + // + fseek (p, 24, SEEK_SET); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() seconds timestamp"); + NS_TEST_ASSERT_MSG_EQ (val32, Swap (uint32_t (1234)), "Swapped seconds timestamp written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() microseconds timestamp"); + NS_TEST_ASSERT_MSG_EQ (val32, Swap (uint32_t (5678)), "Swapped microseconds timestamp written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() included length"); + NS_TEST_ASSERT_MSG_EQ (val32, Swap (uint32_t (43)), "Swapped included length written incorrectly"); + + result = fread (&val32, sizeof(val32), 1, p); + NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() actual length"); + NS_TEST_ASSERT_MSG_EQ (val32, Swap (uint32_t (128)), "Swapped Actual length written incorrectly"); + + // + // Take a look and see what went out into the file. The packet data + // should be unchanged (unswapped). + // + result = fread (bufferIn, 1, 43, p); + NS_TEST_ASSERT_MSG_EQ (result, 43, "Unable to fread() packet data of expected length"); + + for (uint32_t i = 0; i < 43; ++i) + { + NS_TEST_ASSERT_MSG_EQ (bufferIn[i], bufferOut[i], "Incorrect packet data written"); + } + + fclose (p); + p = 0; + + // + // Let's see if the PcapFile object can figure out how to do the same thing and + // correctly read in a packet. The record header info should come back to us + // swapped back into correct form. + // + err = f.Open (m_testFilename, "r"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << m_testFilename << ", \"r\") of existing good file returns error"); + + err = f.Read (bufferIn, sizeof(bufferIn), tsSec, tsUsec, inclLen, origLen, readLen); + NS_TEST_ASSERT_MSG_EQ (err, false, "Read() of known good packet returns error"); + NS_TEST_ASSERT_MSG_EQ (tsSec, 1234, "Incorrectly read seconds timestap from known good packet"); + NS_TEST_ASSERT_MSG_EQ (tsUsec, 5678, "Incorrectly read microseconds timestap from known good packet"); + NS_TEST_ASSERT_MSG_EQ (inclLen, 43, "Incorrectly read included length from known good packet"); + NS_TEST_ASSERT_MSG_EQ (origLen, 128, "Incorrectly read original length from known good packet"); + NS_TEST_ASSERT_MSG_EQ (readLen, 43, "Incorrectly constructed actual read length from known good packet given buffer size"); + + // + // Did the data come back correctly (unchanged / unswapped)? + // + for (uint32_t i = 0; i < 43; ++i) + { + NS_TEST_ASSERT_MSG_EQ (bufferIn[i], bufferOut[i], "Incorrect packet data read from known good packet"); + } + + f.Close (); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Pcap File Object can read out the contents +// of a known good pcap file. +// =========================================================================== +class ReadFileTestCase : public TestCase +{ +public: + ReadFileTestCase (); + virtual ~ReadFileTestCase (); + +private: + virtual void DoSetup (void); + virtual bool DoRun (void); + virtual void DoTeardown (void); + + std::string m_testFilename; +}; + +ReadFileTestCase::ReadFileTestCase () + : TestCase ("Check to see that PcapFile can read out a known good pcap file") +{ +} + +ReadFileTestCase::~ReadFileTestCase () +{ +} + +void +ReadFileTestCase::DoSetup (void) +{ +} + +void +ReadFileTestCase::DoTeardown (void) +{ +} + +const uint32_t N_KNOWN_PACKETS = 6; +const uint32_t N_PACKET_BYTES = 16; + +typedef struct PACKET_ENTRY { + uint32_t tsSec; + uint32_t tsUsec; + uint32_t inclLen; + uint32_t origLen; + uint16_t data[N_PACKET_BYTES]; +} PacketEntry; + +PacketEntry knownPackets[] = { + {2, 3696, 46, 46, {0x0001, 0x0800, 0x0604, 0x0001, 0x0000, 0x0000, 0x0003, 0x0a01, + 0x0201, 0xffff, 0xffff, 0xffff, 0x0a01, 0x0204, 0x0000, 0x0000}}, + {2, 3707, 46, 46, {0x0001, 0x0800, 0x0604, 0x0002, 0x0000, 0x0000, 0x0006, 0x0a01, + 0x0204, 0x0000, 0x0000, 0x0003, 0x0a01, 0x0201, 0x0000, 0x0000}}, + {2, 3801, 1070, 1070, {0x4500, 0x041c, 0x0000, 0x0000, 0x3f11, 0x0000, 0x0a01, 0x0101, + 0x0a01, 0x0204, 0xc001, 0x0009, 0x0408, 0x0000, 0x0000, 0x0000}}, + {2, 3811, 46, 46, {0x0001, 0x0800, 0x0604, 0x0001, 0x0000, 0x0000, 0x0006, 0x0a01, + 0x0204, 0xffff, 0xffff, 0xffff, 0x0a01, 0x0201, 0x0000, 0x0000}}, + {2, 3822, 46, 46, {0x0001, 0x0800, 0x0604, 0x0002, 0x0000, 0x0000, 0x0003, 0x0a01, + 0x0201, 0x0000, 0x0000, 0x0006, 0x0a01, 0x0204, 0x0000, 0x0000}}, + {2, 3915, 1070, 1070, {0x4500, 0x041c, 0x0000, 0x0000, 0x4011, 0x0000, 0x0a01, 0x0204, + 0x0a01, 0x0101, 0x0009, 0xc001, 0x0408, 0x0000, 0x0000, 0x0000}} +}; + + +bool +ReadFileTestCase::DoRun (void) +{ + PcapFile f; + + // + // + std::string filename = NS_TEST_SOURCEDIR + "known.pcap"; + bool err = f.Open (filename, "r"); + NS_TEST_ASSERT_MSG_EQ (err, false, "Open (" << filename << ", \"w\") returns error"); + + // + // We are going to read out the file header and all of the packets to make + // sure that we read what we know, a priori, to be there. + // + // The packet data was gotten using "tcpdump -nn -tt -r known.pcap -x" + // and the timestamp and first 32 bytes of the resulting dump were + // duplicated in the structure above. + // + uint8_t data[N_PACKET_BYTES]; + uint32_t tsSec, tsUsec, inclLen, origLen, readLen; + + PacketEntry *p = knownPackets; + + for (uint32_t i = 0; i < N_KNOWN_PACKETS; ++i, ++p) + { + err = f.Read (data, sizeof(data), tsSec, tsUsec, inclLen, origLen, readLen); + NS_TEST_ASSERT_MSG_EQ (err, false, "Read() of known good pcap file returns error"); + NS_TEST_ASSERT_MSG_EQ (tsSec, p->tsSec, "Incorrectly read seconds timestap from known good pcap file"); + NS_TEST_ASSERT_MSG_EQ (tsUsec, p->tsUsec, "Incorrectly read microseconds timestap from known good pcap file"); + NS_TEST_ASSERT_MSG_EQ (inclLen, p->inclLen, "Incorrectly read included length from known good packet"); + NS_TEST_ASSERT_MSG_EQ (origLen, p->origLen, "Incorrectly read original length from known good packet"); + NS_TEST_ASSERT_MSG_EQ (readLen, N_PACKET_BYTES, "Incorrect actual read length from known good packet given buffer size"); + } + + // + // The file should now be at EOF since we've read all of the packets. + // Another packet read should return an error. + // + err = f.Read (data, 1, tsSec, tsUsec, inclLen, origLen, readLen); + NS_TEST_ASSERT_MSG_EQ (err, true, "Read() of known good pcap file at EOF does not return error"); + + f.Close (); + + return false; +} + +class PcapFileTestSuite : public TestSuite +{ +public: + PcapFileTestSuite (); +}; + +PcapFileTestSuite::PcapFileTestSuite () + : TestSuite ("pcap-file-object", UNIT) +{ + AddTestCase (new WriteModeCreateTestCase); + AddTestCase (new ReadModeCreateTestCase); + AddTestCase (new AppendModeCreateTestCase); + AddTestCase (new FileHeaderTestCase); + AddTestCase (new RecordHeaderTestCase); + AddTestCase (new ReadFileTestCase); +} + +PcapFileTestSuite pcapFileTestSuite; diff --git a/src/common/pcap-file.cc b/src/common/pcap-file.cc new file mode 100644 index 000000000..c652d9808 --- /dev/null +++ b/src/common/pcap-file.cc @@ -0,0 +1,519 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include + +#include "pcap-file.h" + +// +// This file is used as part of the ns-3 test framework, so please refrain from +// adding any ns-3 specific constructs such as Packet to this file. +// +namespace ns3 { + +const uint32_t MAGIC = 0xa1b2c3d4; /**< Magic number identifying standard pcap file format */ +const uint32_t SWAPPED_MAGIC = 0xd4c3b2a1; /**< Looks this way if byte swapping is required */ + +const uint32_t NS_MAGIC = 0xa1b23cd4; /**< Magic number identifying nanosec resolution pcap file format */ +const uint32_t NS_SWAPPED_MAGIC = 0xd43cb2a1; /**< Looks this way if byte swapping is required */ + +const uint16_t VERSION_MAJOR = 2; /**< Major version of supported pcap file format */ +const uint16_t VERSION_MINOR = 4; /**< Minor version of supported pcap file format */ +const int32_t SIGFIGS_DEFAULT = 0; /**< Significant figures for timestamps (libpcap doesn't even bother) */ + +PcapFile::PcapFile () + : m_filename (""), + m_filePtr (0), + m_haveFileHeader (false), + m_swapMode (false) +{ +} + +PcapFile::~PcapFile () +{ + Close (); +} + +void +PcapFile::Close (void) +{ + if (m_filePtr) + { + fclose (m_filePtr); + } + m_filePtr = 0; + m_filename = ""; + m_haveFileHeader = false; +} + +uint32_t +PcapFile::GetMagic (void) +{ + return m_fileHeader.m_magicNumber; +} + +uint16_t +PcapFile::GetVersionMajor (void) +{ + return m_fileHeader.m_versionMajor; +} + +uint16_t +PcapFile::GetVersionMinor (void) +{ + return m_fileHeader.m_versionMinor; +} + +int32_t +PcapFile::GetTimeZoneOffset (void) +{ + return m_fileHeader.m_zone; +} + +uint32_t +PcapFile::GetSigFigs (void) +{ + return m_fileHeader.m_sigFigs; +} + +uint32_t +PcapFile::GetSnapLen (void) +{ + return m_fileHeader.m_snapLen; +} + +uint32_t +PcapFile::GetDataLinkType (void) +{ + return m_fileHeader.m_type; +} + +bool +PcapFile::GetSwapMode (void) +{ + return m_swapMode; +} + +uint8_t +PcapFile::Swap (uint8_t val) +{ + return val; +} + +uint16_t +PcapFile::Swap (uint16_t val) +{ + return ((val >> 8) & 0x00ff) | ((val << 8) & 0xff00); +} + +uint32_t +PcapFile::Swap (uint32_t val) +{ + return ((val >> 24) & 0x000000ff) | ((val >> 8) & 0x0000ff00) | ((val << 8) & 0x00ff0000) | ((val << 24) & 0xff000000); +} + +void +PcapFile::Swap (PcapFileHeader *from, PcapFileHeader *to) +{ + to->m_magicNumber = Swap (from->m_magicNumber); + to->m_versionMajor = Swap (from->m_versionMajor); + to->m_versionMinor = Swap (from->m_versionMinor); + to->m_zone = Swap (uint32_t(from->m_zone)); + to->m_sigFigs = Swap (from->m_sigFigs); + to->m_snapLen = Swap (from->m_snapLen); + to->m_type = Swap (from->m_type); +} + +void +PcapFile::Swap (PcapRecordHeader *from, PcapRecordHeader *to) +{ + to->m_tsSec = Swap (from->m_tsSec); + to->m_tsUsec = Swap (from->m_tsUsec); + to->m_inclLen = Swap (from->m_inclLen); + to->m_origLen = Swap (from->m_origLen); +} + +bool +PcapFile::WriteFileHeader (void) +{ + // + // If we're initializing the file, we need to write the pcap file header + // at the start of the file. + // + int result = fseek (m_filePtr, 0, SEEK_SET); + if (result) + { + return true; + } + + // + // We have the ability to write out the pcap file header in a foreign endian + // format, so we need a temp place to swap on the way out. + // + PcapFileHeader header; + + // + // the pointer headerOut selects either the swapped or non-swapped version of + // the pcap file header. + // + PcapFileHeader *headerOut = 0; + + if (m_swapMode == false) + { + headerOut = &m_fileHeader; + } + else + { + Swap (&m_fileHeader, &header); + headerOut = &header; + } + + // + // Watch out for memory alignment differences between machines, so write + // them all individually. + // + result = 0; + + result |= (fwrite (&headerOut->m_magicNumber, sizeof(headerOut->m_magicNumber), 1, m_filePtr) != 1); + result |= (fwrite (&headerOut->m_versionMajor, sizeof(headerOut->m_versionMajor), 1, m_filePtr) != 1); + result |= (fwrite (&headerOut->m_versionMinor, sizeof(headerOut->m_versionMinor), 1, m_filePtr) != 1); + result |= (fwrite (&headerOut->m_zone, sizeof(headerOut->m_zone), 1, m_filePtr) != 1); + result |= (fwrite (&headerOut->m_sigFigs, sizeof(headerOut->m_sigFigs), 1, m_filePtr) != 1); + result |= (fwrite (&headerOut->m_snapLen, sizeof(headerOut->m_snapLen), 1, m_filePtr) != 1); + result |= (fwrite (&headerOut->m_type, sizeof(headerOut->m_type), 1, m_filePtr) != 1); + + // + // If any of the fwrites above did not succeed in writinging the correct + // number of objects, result will be nonzero and will indicate an error. + // + return result != 0; +} + +bool +PcapFile::ReadAndVerifyFileHeader (void) +{ + // + // Pcap file header is always at the start of the file + // + int result = fseek (m_filePtr, 0, SEEK_SET); + if (result) + { + return true; + } + + // + // Watch out for memory alignment differences between machines, so read + // them all individually. + // + result = 0; + + result |= (fread (&m_fileHeader.m_magicNumber, sizeof(m_fileHeader.m_magicNumber), 1, m_filePtr) != 1); + result |= (fread (&m_fileHeader.m_versionMajor, sizeof(m_fileHeader.m_versionMajor), 1, m_filePtr) != 1); + result |= (fread (&m_fileHeader.m_versionMinor, sizeof(m_fileHeader.m_versionMinor), 1, m_filePtr) != 1); + result |= (fread (&m_fileHeader.m_zone, sizeof(m_fileHeader.m_zone), 1, m_filePtr) != 1); + result |= (fread (&m_fileHeader.m_sigFigs, sizeof(m_fileHeader.m_sigFigs), 1, m_filePtr) != 1); + result |= (fread (&m_fileHeader.m_snapLen, sizeof(m_fileHeader.m_snapLen), 1, m_filePtr) != 1); + result |= (fread (&m_fileHeader.m_type, sizeof(m_fileHeader.m_type), 1, m_filePtr) != 1); + + // + // If any of the freads above did not succeed in reading the correct number of + // objects, result will be nonzero. + // + if (result) + { + return true; + } + + // + // There are four possible magic numbers that can be there. Normal and byte + // swapped versions of the standard magic number, and normal and byte swapped + // versions of the magic number indicating nanosecond resolution timestamps. + // + if (m_fileHeader.m_magicNumber != MAGIC && m_fileHeader.m_magicNumber != SWAPPED_MAGIC && + m_fileHeader.m_magicNumber != NS_MAGIC && m_fileHeader.m_magicNumber != NS_SWAPPED_MAGIC) + { + return true; + } + + // + // If the magic number is swapped, then we can assume that everything else we read + // is swapped. + // + m_swapMode = (m_fileHeader.m_magicNumber == SWAPPED_MAGIC || m_fileHeader.m_magicNumber == NS_SWAPPED_MAGIC) ? true : false; + + if (m_swapMode) + { + Swap (&m_fileHeader, &m_fileHeader); + } + + // + // We only deal with one version of the pcap file format. + // + if (m_fileHeader.m_versionMajor != VERSION_MAJOR || m_fileHeader.m_versionMinor != VERSION_MINOR) + { + return true; + } + + // + // A quick test of reasonablness for the time zone offset corresponding to + // a real place on the planet. + // + if (m_fileHeader.m_zone < -12 || m_fileHeader.m_zone > 12) + { + return true; + } + + m_haveFileHeader = true; + return false; +} + +bool +PcapFile::Open (std::string const &filename, std::string const &mode) +{ + // + // If opening a new file, implicit close of any existing file required. + // + Close (); + + // + // All pcap files are binary files, so we just do this automatically. + // + std::string realMode = mode + "b"; + + // + // Our modes may be subtly different from the standard fopen semantics since + // we need to have a pcap file header to succeed in some cases; so we need + // to process different modes according to our own definitions of the modes. + // + // In the case of read modes, we must read, check and save the pcap file + // header as well as just opening the file. + // + // In the case of write modes, we just pass the call on through to the + // library. + // + // In the case of append modes, we change the semantics to require the + // given file to exist. We can't just create a file since we can't make up + // a pcap file header on our own. + // + if (realMode == "rb" || realMode == "r+b") + { + m_filePtr = fopen (filename.c_str (), realMode.c_str ()); + if (m_filePtr == 0) + { + return true; + } + m_filename = filename; + return ReadAndVerifyFileHeader (); + } + else if (realMode == "wb" || realMode == "w+b") + { + m_filePtr = fopen (filename.c_str (), realMode.c_str ()); + if (m_filePtr) + { + m_filename = filename; + return false; + } + else + { + return true; + } + } + else if (realMode == "ab" || realMode == "a+b") + { + // + // Remember that semantics for append are different here. We never create + // a file since we can't make up a pcap file header. We first have to + // open the file in read-only mode and check to see that it exists and + // read the file header. If this all works out, then we can go ahead and + // open the file in append mode and seek to the end (imlicitly). + // + m_filePtr = fopen (filename.c_str (), "rb"); + if (m_filePtr == 0) + { + return true; + } + + bool result = ReadAndVerifyFileHeader (); + if (result == true) + { + Close (); + return true; + } + + // + // We have a properly initialized file and have the pcap file header + // loaded and checked. This means that the file meets all of the + // critera for opening in append mode, but the file is in read-only mode + // now -- we must close it and open it in the correct mode. + // + fclose (m_filePtr); + m_filePtr = 0; + + m_filePtr = fopen (filename.c_str (), realMode.c_str ()); + if (m_filePtr == 0) + { + return true; + } + + m_filename = filename; + return false; + } + else + { + return true; + } +} + +bool +PcapFile::Init (uint32_t dataLinkType, uint32_t snapLen, int32_t timeZoneCorrection, bool swapMode) +{ + // + // Initialize the in-memory file header. + // + m_fileHeader.m_magicNumber = MAGIC; + m_fileHeader.m_versionMajor = VERSION_MAJOR; + m_fileHeader.m_versionMinor = VERSION_MINOR; + m_fileHeader.m_zone = timeZoneCorrection; + m_fileHeader.m_sigFigs = 0; + m_fileHeader.m_snapLen = snapLen; + m_fileHeader.m_type = dataLinkType; + + m_haveFileHeader = true; + m_swapMode = swapMode; + + return WriteFileHeader (); +} + +bool +PcapFile::Write (uint32_t tsSec, uint32_t tsUsec, uint8_t const * const data, uint32_t totalLen) +{ + if (m_haveFileHeader == false) + { + return true; + } + + uint32_t inclLen = totalLen > m_fileHeader.m_snapLen ? m_fileHeader.m_snapLen : totalLen; + + PcapRecordHeader header; + header.m_tsSec = tsSec; + header.m_tsUsec = tsUsec; + header.m_inclLen = inclLen; + header.m_origLen = totalLen; + + if (m_swapMode) + { + Swap (&header, &header); + } + + // + // Watch out for memory alignment differences between machines, so write + // them all individually. + // + uint32_t result = 0; + + result |= (fwrite (&header.m_tsSec, sizeof(header.m_tsSec), 1, m_filePtr) != 1); + result |= (fwrite (&header.m_tsUsec, sizeof(header.m_tsUsec), 1, m_filePtr) != 1); + result |= (fwrite (&header.m_inclLen, sizeof(header.m_inclLen), 1, m_filePtr) != 1); + result |= (fwrite (&header.m_origLen, sizeof(header.m_origLen), 1, m_filePtr) != 1); + + result |= fwrite (data, 1, inclLen, m_filePtr) != inclLen; + + return result != 0; +} + +bool +PcapFile::Read ( + uint8_t * const data, + uint32_t maxBytes, + uint32_t &tsSec, + uint32_t &tsUsec, + uint32_t &inclLen, + uint32_t &origLen, + uint32_t &readLen) +{ + if (m_haveFileHeader == false) + { + return true; + } + + PcapRecordHeader header; + + // + // Watch out for memory alignment differences between machines, so read + // them all individually. + // + uint32_t result = 0; + + result |= (fread (&header.m_tsSec, sizeof(header.m_tsSec), 1, m_filePtr) != 1); + result |= (fread (&header.m_tsUsec, sizeof(header.m_tsUsec), 1, m_filePtr) != 1); + result |= (fread (&header.m_inclLen, sizeof(header.m_inclLen), 1, m_filePtr) != 1); + result |= (fread (&header.m_origLen, sizeof(header.m_origLen), 1, m_filePtr) != 1); + + // + // If any of the freads above did not succeed in reading the correct number of + // objects, result will be nonzero. + // + if (result) + { + return true; + } + + if (m_swapMode) + { + Swap (&header, &header); + } + + tsSec = header.m_tsSec; + tsUsec = header.m_tsUsec; + inclLen = header.m_inclLen; + origLen = header.m_origLen; + + // + // We don't always want to force the client to keep a maximum length buffer + // around so we allow her to specify a minimum number of bytes to read. + // Usually 64 bytes is enough information to print all of the headers, so + // it isn't typically necessary to read all thousand bytes of an echo packet, + // for example, to figure out what is going on. + // + readLen = maxBytes < header.m_inclLen ? maxBytes : header.m_inclLen; + result = fread (data, 1, readLen, m_filePtr) != readLen; + if (result) + { + return result; + } + + // + // To keep the file pointer pointed in the right place, however, we always + // need to account for the entire packet as stored originally. + // + if (readLen < header.m_inclLen) + { + uint64_t pos = ftell (m_filePtr); + int result = fseek (m_filePtr, pos + header.m_inclLen - readLen, SEEK_SET); + if (result) + { + return true; + } + } + + return false; +} + +} //namespace ns3 diff --git a/src/common/pcap-file.h b/src/common/pcap-file.h new file mode 100644 index 000000000..2e9fe03e7 --- /dev/null +++ b/src/common/pcap-file.h @@ -0,0 +1,194 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PCAP_FILE_H +#define PCAP_FILE_H + +#include +#include + +namespace ns3 { + +/* + * A class representing a pcap file. This allows easy creation, writing and + * reading of files composed of stored packets; which may be viewed using + * standard tools. + */ + +class PcapFile +{ +public: + static const int32_t ZONE_DEFAULT = 0; /**< Time zone offset for current location */ + static const uint32_t SNAPLEN_DEFAULT = 65535; /**< Default value for maximum octets to save per packet */ + +public: + PcapFile (); + ~PcapFile (); + + /** + * Create a new pcap file or open an existing pcap file. Semantics are + * similar to the C standard library function \c fopen, but differ in that + * positions in the file are based on packets not characters. For example + * if the file is opened for reading, the file position indicator (seek + * position) points to the beginning of the first packet in the file, not + * zero (which would point to the start of the pcap header). + * + * Possible modes are: + * + * \verbatim + * "r": Open a file for reading. The file must exist. The pcap header + * is assumed to exist in the file and will be read and checked. + * The file seek position indicator is set to point to the first + * packet on exit. + * + * "w": Create an empty file for writing. If a file with the same name + * already exists its content is erased and the file is treated as a + * new empty pcap file. The file is assumed not to have a pcap + * header and the caller is responsible for calling Init before saving + * any packet data. The file seek position indicator is set to point + * to the beginning of the file on exit since there will be no pcap + * header. + * + * "a": Append to an existing file. This mode allows for adding packet data + * to the end of an existing pcap file. The file must exist and have a + * valid pcap header written (N.B. this is different from standard fopen + * semantics). The file seek position indicator is set to point + * to the end of the file on exit. + * + * "r+": Open a file for update -- both reading and writing. The file must + * exist. The pcap header is assumed to have been written to the + * file and will be read and checked. The file seek position indicator + * is set to point to the first packet on exit. + * + * "w+": Create an empty file for both reading and writing. If a file with + * the same name already exists, its content is erased and the file is + * treated as a new empty pcap file. Since this new file will not have + * a pcap header, the caller is responsible for calling Init before + * saving any packet data. On exit, the file seek position indicator is + * set to point to the beginning of the file. + * + * "a+" Open a file for reading and appending. The file must exist and have a + * valid pcap header written (N.B. this is different from standard fopen + * semantics). The file seek position indicator is set to point + * to the end of the file on exit. Existing content is preserved. + * \endverbatim + * + * Since a pcap file is always a binary file, the file type is automatically + * selected as a binary file. For example, providing a mode string "a+" + * results in the underlying OS file being opened in "a+b" mode. + * + * \param filename String containing the name of the file. + * + * \param mode String containing the access mode for the file. + * + * \returns Error indication that should be interpreted as, "did an error + * happen"? That is, the method returns false if the open succeeds, true + * otherwise. The errno variable will be set by the OS to to provide a + * more descriptive failure indication. + */ + bool Open (std::string const &filename, std::string const &mode); + + void Close (void); + + /** + * Initialize the pcap file associated with this object. This file must have + * been previously opened with write permissions. + * + * \param dataLinkType A data link type as defined in the pcap library. If + * you want to make resulting pcap files visible in existing tools, the + * data link type must match existing definitions, such as PCAP_ETHERNET, + * PCAP_PPP, PCAP_80211, etc. If you are storing different kinds of packet + * data, such as naked TCP headers, you are at liberty to locally define your + * own data link types. According to the pcap-linktype man page, "well-known" + * pcap linktypes range from 0 to 177. If you use a large random number for + * your type, chances are small for a collision. + * + * \param snapLen An optional maximum size for packets written to the file. + * Defaults to 65535. If packets exceed this length they are truncated. + * + * \param timeZoneCorrection An integer describing the offset of your local + * time zone from UTC/GMT. For example, Pacific Standard Time in the US is + * GMT-8, so one would enter -8 for that correction. Defaults to 0 (UTC). + * + * \returns false if the open succeeds, true otherwise. + * + * \warning Calling this method on an existing file will result in the loss + * any existing data. + */ + bool Init (uint32_t dataLinkType, + uint32_t snapLen = SNAPLEN_DEFAULT, + int32_t timeZoneCorrection = ZONE_DEFAULT, + bool swapMode = false); + + bool Write (uint32_t tsSec, uint32_t tsUsec, uint8_t const * const data, uint32_t totalLen); + + bool Read (uint8_t * const data, + uint32_t maxBytes, + uint32_t &tsSec, + uint32_t &tsUsec, + uint32_t &inclLen, + uint32_t &origLen, + uint32_t &readLen); + + bool GetSwapMode (void); + + uint32_t GetMagic (void); + uint16_t GetVersionMajor (void); + uint16_t GetVersionMinor (void); + int32_t GetTimeZoneOffset (void); + uint32_t GetSigFigs (void); + uint32_t GetSnapLen (void); + uint32_t GetDataLinkType (void); + +private: + typedef struct { + uint32_t m_magicNumber; /**< Magic number identifying this as a pcap file */ + uint16_t m_versionMajor; /**< Major version identifying the version of pcap used in this file */ + uint16_t m_versionMinor; /**< Minor version identifying the version of pcap used in this file */ + int32_t m_zone; /**< Time zone correction to be applied to timestamps of packets */ + uint32_t m_sigFigs; /**< Unused by pretty much everybody */ + uint32_t m_snapLen; /**< Maximum length of packet data stored in records */ + uint32_t m_type; /**< Data link type of packet data */ + } PcapFileHeader; + + typedef struct { + uint32_t m_tsSec; /**< seconds part of timestamp */ + uint32_t m_tsUsec; /**< microseconds part of timestamp (nsecs for PCAP_NSEC_MAGIC) */ + uint32_t m_inclLen; /**< number of octets of packet saved in file */ + uint32_t m_origLen; /**< actual length of original packet */ + } PcapRecordHeader; + + uint8_t Swap (uint8_t val); + uint16_t Swap (uint16_t val); + uint32_t Swap (uint32_t val); + void Swap (PcapFileHeader *from, PcapFileHeader *to); + void Swap (PcapRecordHeader *from, PcapRecordHeader *to); + + bool WriteFileHeader (void); + bool ReadAndVerifyFileHeader (void); + + std::string m_filename; + FILE *m_filePtr; + PcapFileHeader m_fileHeader; + bool m_haveFileHeader; + bool m_swapMode; +}; + +}//namespace ns3 + +#endif /* PCAP_FILE_H */ diff --git a/src/common/trailer.h b/src/common/trailer.h index c3840021b..7ab54aecd 100644 --- a/src/common/trailer.h +++ b/src/common/trailer.h @@ -79,6 +79,7 @@ public: */ virtual uint32_t Deserialize (Buffer::Iterator end) = 0; /** + * \param os output stream * This method is used by Packet::Print to print the * content of a trailer as ascii data to a c++ output stream. * Although the trailer is free to format its output as it diff --git a/src/common/wscript b/src/common/wscript index 2ca057376..0e3b20c46 100644 --- a/src/common/wscript +++ b/src/common/wscript @@ -17,7 +17,10 @@ def build(bld): 'byte-tag-list.cc', 'tag-buffer.cc', 'packet-tag-list.cc', + 'nix-vector.cc', 'ascii-writer.cc', + 'pcap-file.cc', + 'pcap-file-test-suite.cc', ] headers = bld.new_task_gen('ns3header') @@ -36,6 +39,8 @@ def build(bld): 'byte-tag-list.h', 'tag-buffer.h', 'packet-tag-list.h', + 'nix-vector.h', 'ascii-writer.h', 'sgi-hashmap.h', + 'pcap-file.h', ] diff --git a/src/contrib/flow-monitor/design.txt b/src/contrib/flow-monitor/design.txt new file mode 100644 index 000000000..1d711342b --- /dev/null +++ b/src/contrib/flow-monitor/design.txt @@ -0,0 +1,43 @@ + +* One FlowMonitor per simulation + +* One FlowClassifier per simulation + - Assigns integer simulation unique identifiers to each flow + - Contains a classification method that maps parameters + (e.g. packets or packet headers) to the corresponding flow + identifier; + - FlowClassifier is abstract, needs a concrete subclass + > Ipv4FlowClassifier + +* Typically (but not necessarily) one FlowProbe node + - Is responsible for acquiring the packet data + - Works with FlowClassifier + - FlowProbe is abstract, needs a concrete subclass + > Ipv4FlowProbe + - Ipv4FlowProbe needs a matching classifier, Ipv4FlowClassifier + +* One ProbeFlowStats object per simulation flow per FlowProbe + - Indexed by the FlowId + - Bytes + - Packets + - Delay from first probe until the packet is received in this probe + +* One EndToEndFlowStats object per flow per FlowMonitor + - Lost packets + - Lost bytes + - Bytes + - Packets + - End-to-end delays + + + + +TODO: + + 1. Configurable time when to start/stop monitor. ***DONE*** + 2. Possibly, detect packet losses also via "drop" trace sources + 3. FlowMonitor::FlowStats: add time duration metrics: first flow timestamp, last flow timestamp + > to calculate bitrates... ***DONE*** + 4. Measure delay jitter + 5. Histogram for delays/jitters/packet sizes + diff --git a/src/contrib/flow-monitor/flow-classifier.cc b/src/contrib/flow-monitor/flow-classifier.cc new file mode 100644 index 000000000..fb184101f --- /dev/null +++ b/src/contrib/flow-monitor/flow-classifier.cc @@ -0,0 +1,40 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#include "flow-classifier.h" + +namespace ns3 { + +FlowClassifier::FlowClassifier () + : + m_lastNewFlowId (0) +{ +} + + +FlowId +FlowClassifier::GetNewFlowId () +{ + return ++m_lastNewFlowId; +} + + +} // namespace ns3 + diff --git a/src/contrib/flow-monitor/flow-classifier.h b/src/contrib/flow-monitor/flow-classifier.h new file mode 100644 index 000000000..fca1c865c --- /dev/null +++ b/src/contrib/flow-monitor/flow-classifier.h @@ -0,0 +1,61 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#ifndef __FLOW_CLASSIFIER_H__ +#define __FLOW_CLASSIFIER_H__ + +#include "ns3/ref-count-base.h" +#include + +namespace ns3 { + +typedef uint32_t FlowId; +typedef uint32_t FlowPacketId; + +/// provides a method to translate raw packet data into abstract +/// ``flow identifier'' and ``packet identifier'' parameters. These +/// identifiers are unsigned 32-bit integers that uniquely identify a +/// flow and a packet within that flow, respectively, for the whole +/// simulation, regardless of the point in which the packet was +/// captured. These abstract identifiers are used in the +/// communication between FlowProbe and FlowMonitor, and all collected +/// statistics reference only those abstract identifiers in order to +/// keep the core architecture generic and not tied down to any +/// particular flow capture method or classification system. +class FlowClassifier : public RefCountBase +{ + FlowId m_lastNewFlowId; + +public: + + FlowClassifier (); + + virtual void SerializeToXmlStream (std::ostream &os, int indent) const = 0; + +protected: + FlowId GetNewFlowId (); + +}; + + +} // namespace ns3 + +#endif + diff --git a/src/contrib/flow-monitor/flow-monitor.cc b/src/contrib/flow-monitor/flow-monitor.cc new file mode 100644 index 000000000..9a6536f25 --- /dev/null +++ b/src/contrib/flow-monitor/flow-monitor.cc @@ -0,0 +1,468 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#include "flow-monitor.h" +#include "ns3/simulator.h" +#include "ns3/log.h" +#include "ns3/double.h" +#include +#include + +#define INDENT(level) for (int __xpto = 0; __xpto < level; __xpto++) os << ' '; + +#define PERIODIC_CHECK_INTERVAL (Seconds (1)) + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("FlowMonitor"); + +NS_OBJECT_ENSURE_REGISTERED (FlowMonitor); + + +TypeId +FlowMonitor::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::FlowMonitor") + .SetParent () + .AddConstructor () + .AddAttribute ("MaxPerHopDelay", ("The maximum per-hop delay that should be considered. " + "Packets still not received after this delay are to be considered lost."), + TimeValue (Seconds (10.0)), + MakeTimeAccessor (&FlowMonitor::m_maxPerHopDelay), + MakeTimeChecker ()) + .AddAttribute ("StartTime", ("The time when the monitoring starts."), + TimeValue (Seconds (0.0)), + MakeTimeAccessor (&FlowMonitor::Start), + MakeTimeChecker ()) + .AddAttribute ("DelayBinWidth", ("The width used in the delay histogram."), + DoubleValue (0.001), + MakeDoubleAccessor (&FlowMonitor::m_delayBinWidth), + MakeDoubleChecker ()) + .AddAttribute ("JitterBinWidth", ("The width used in the jitter histogram."), + DoubleValue (0.001), + MakeDoubleAccessor (&FlowMonitor::m_jitterBinWidth), + MakeDoubleChecker ()) + .AddAttribute ("PacketSizeBinWidth", ("The width used in the packetSize histogram."), + DoubleValue (20), + MakeDoubleAccessor (&FlowMonitor::m_packetSizeBinWidth), + MakeDoubleChecker ()) + ; + return tid; +} + +TypeId +FlowMonitor::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} + +FlowMonitor::FlowMonitor () + : m_enabled (false) +{ + // m_histogramBinWidth=DEFAULT_BIN_WIDTH; +} + + +inline FlowMonitor::FlowStats& +FlowMonitor::GetStatsForFlow (FlowId flowId) +{ + std::map::iterator iter; + iter = m_flowStats.find (flowId); + if (iter == m_flowStats.end ()) + { + FlowMonitor::FlowStats &ref = m_flowStats[flowId]; + ref.delaySum = Seconds (0); + ref.jitterSum = Seconds (0); + ref.lastDelay = Seconds (0); + ref.txBytes = 0; + ref.rxBytes = 0; + ref.txPackets = 0; + ref.rxPackets = 0; + ref.lostPackets = 0; + ref.timesForwarded = 0; + ref.delayHistogram.SetDefaultBinWidth (m_delayBinWidth); + ref.jitterHistogram.SetDefaultBinWidth (m_jitterBinWidth); + ref.packetSizeHistogram.SetDefaultBinWidth (m_packetSizeBinWidth); + return ref; + } + else + { + return iter->second; + } +} + + +void +FlowMonitor::ReportFirstTx (Ptr probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize) +{ + if (!m_enabled) + { + return; + } + Time now = Simulator::Now (); + TrackedPacket &tracked = m_trackedPackets[std::make_pair (flowId, packetId)]; + tracked.firstSeenTime = now; + tracked.lastSeenTime = tracked.firstSeenTime; + tracked.timesForwarded = 0; + NS_LOG_DEBUG ("ReportFirstTx: adding tracked packet (flowId=" << flowId << ", packetId=" << packetId + << ")."); + + probe->AddPacketStats (flowId, packetSize, Seconds (0)); + + FlowStats &stats = GetStatsForFlow (flowId); + stats.txBytes += packetSize; + stats.txPackets++; + if (stats.txPackets == 1) + { + stats.timeFirstTxPacket = now; + } + stats.timeLastTxPacket = now; +} + + +void +FlowMonitor::ReportForwarding (Ptr probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize) +{ + if (!m_enabled) + { + return; + } + std::pair key (flowId, packetId); + TrackedPacketMap::iterator tracked = m_trackedPackets.find (key); + if (tracked == m_trackedPackets.end ()) + { + NS_LOG_WARN ("Received packet forward report (flowId=" << flowId << ", packetId=" << packetId + << ") but not known to be transmitted."); + return; + } + + tracked->second.timesForwarded++; + tracked->second.lastSeenTime = Simulator::Now (); + + Time delay = (Simulator::Now () - tracked->second.firstSeenTime); + probe->AddPacketStats (flowId, packetSize, delay); +} + + +void +FlowMonitor::ReportLastRx (Ptr probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize) +{ + if (!m_enabled) + { + return; + } + TrackedPacketMap::iterator tracked = m_trackedPackets.find (std::make_pair (flowId, packetId)); + if (tracked == m_trackedPackets.end ()) + { + NS_LOG_WARN ("Received packet last-tx report (flowId=" << flowId << ", packetId=" << packetId + << ") but not known to be transmitted."); + return; + } + + Time now = Simulator::Now (); + Time delay = (now - tracked->second.firstSeenTime); + probe->AddPacketStats (flowId, packetSize, delay); + + FlowStats &stats = GetStatsForFlow (flowId); + stats.delaySum += delay; + stats.delayHistogram.AddValue (delay.GetSeconds ()); + if (stats.rxPackets > 0 ) + { + Time jitter = stats.lastDelay - delay; + if (jitter > Seconds (0)) + { + stats.jitterSum += jitter; + stats.jitterHistogram.AddValue (jitter.GetSeconds ()); + } + else + { + stats.jitterSum -= jitter; + stats.jitterHistogram.AddValue (-jitter.GetSeconds()); + } + } + stats.lastDelay = delay; + + stats.rxBytes += packetSize; + stats.packetSizeHistogram.AddValue ((double) packetSize); + stats.rxPackets++; + if (stats.rxPackets == 1) + { + stats.timeFirstRxPacket = now; + } + stats.timeLastRxPacket = now; + stats.timesForwarded += tracked->second.timesForwarded; + + NS_LOG_DEBUG ("ReportLastTx: removing tracked packet (flowId=" + << flowId << ", packetId=" << packetId << ")."); + + m_trackedPackets.erase (tracked); // we don't need to track this packet anymore +} + +void +FlowMonitor::ReportDrop (Ptr probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize, + uint32_t reasonCode) +{ + if (!m_enabled) + { + return; + } + + probe->AddPacketDropStats (flowId, packetSize, reasonCode); + + FlowStats &stats = GetStatsForFlow (flowId); + stats.lostPackets++; + if (stats.packetsDropped.size () < reasonCode + 1) + { + stats.packetsDropped.resize (reasonCode + 1, 0); + stats.bytesDropped.resize (reasonCode + 1, 0); + } + ++stats.packetsDropped[reasonCode]; + stats.bytesDropped[reasonCode] += packetSize; + NS_LOG_DEBUG ("++stats.packetsDropped[" << reasonCode<< "]; // becomes: " << stats.packetsDropped[reasonCode]); + + TrackedPacketMap::iterator tracked = m_trackedPackets.find (std::make_pair (flowId, packetId)); + if (tracked != m_trackedPackets.end ()) + { + // we don't need to track this packet anymore + // FIXME: this will not necessarily be true with broadcast/multicast + NS_LOG_DEBUG ("ReportDrop: removing tracked packet (flowId=" + << flowId << ", packetId=" << packetId << ")."); + m_trackedPackets.erase (tracked); + } +} + +std::map +FlowMonitor::GetFlowStats () const +{ + return m_flowStats; +} + + +void +FlowMonitor::CheckForLostPackets (Time maxDelay) +{ + Time now = Simulator::Now (); + + for (TrackedPacketMap::iterator iter = m_trackedPackets.begin (); + iter != m_trackedPackets.end (); ) + { + if (now - iter->second.lastSeenTime >= maxDelay) + { + // packet is considered lost, add it to the loss statistics + std::map::iterator + flow = m_flowStats.find (iter->first.first); + NS_ASSERT (flow != m_flowStats.end ()); + flow->second.lostPackets++; + + // we won't track it anymore + m_trackedPackets.erase (iter++); + } + else + { + iter++; + } + } +} + +void +FlowMonitor::CheckForLostPackets () +{ + CheckForLostPackets (m_maxPerHopDelay); +} + +void +FlowMonitor::PeriodicCheckForLostPackets () +{ + CheckForLostPackets (); + Simulator::Schedule (PERIODIC_CHECK_INTERVAL, &FlowMonitor::PeriodicCheckForLostPackets, this); +} + +void +FlowMonitor::NotifyConstructionCompleted () +{ + Object::NotifyConstructionCompleted (); + Simulator::Schedule (PERIODIC_CHECK_INTERVAL, &FlowMonitor::PeriodicCheckForLostPackets, this); +} + +void +FlowMonitor::AddProbe (Ptr probe) +{ + m_flowProbes.push_back (probe); +} + +std::vector< Ptr > +FlowMonitor::GetAllProbes () const +{ + return m_flowProbes; +} + + +void +FlowMonitor::Start (const Time &time) +{ + if (m_enabled) + { + return; + } + Simulator::Cancel (m_startEvent); + m_startEvent = Simulator::Schedule (time, &FlowMonitor::StartRightNow, Ptr (this)); +} + +void +FlowMonitor::Stop (const Time &time) +{ + if (!m_enabled) + { + return; + } + Simulator::Cancel (m_stopEvent); + m_stopEvent = Simulator::Schedule (time, &FlowMonitor::StopRightNow, Ptr (this)); +} + + +void +FlowMonitor::StartRightNow () +{ + if (m_enabled) + { + return; + } + m_enabled = true; +} + + +void +FlowMonitor::StopRightNow () +{ + if (!m_enabled) + { + return; + } + m_enabled = false; + CheckForLostPackets (); +} + +void +FlowMonitor::SetFlowClassifier (Ptr classifier) +{ + m_classifier = classifier; +} + +void +FlowMonitor::SerializeToXmlStream (std::ostream &os, int indent, bool enableHistograms, bool enableProbes) +{ + CheckForLostPackets (); + + INDENT(indent); os << "\n"; + indent += 2; + INDENT(indent); os << "\n"; + indent += 2; + for (std::map::const_iterator flowI = m_flowStats.begin (); + flowI != m_flowStats.end (); flowI++) + { + + INDENT(indent); +#define ATTRIB(name) << " "#name"=\"" << flowI->second.name << "\"" + os << "first << "\"" + ATTRIB(timeFirstTxPacket) + ATTRIB(timeFirstRxPacket) + ATTRIB(timeLastTxPacket) + ATTRIB(timeLastRxPacket) + ATTRIB(delaySum) + ATTRIB(jitterSum) + ATTRIB(lastDelay) + ATTRIB(txBytes) + ATTRIB(rxBytes) + ATTRIB(txPackets) + ATTRIB(rxPackets) + ATTRIB(lostPackets) + ATTRIB(timesForwarded) + << ">\n"; +#undef ATTRIB + + + indent += 2; + for (uint32_t reasonCode = 0; reasonCode < flowI->second.packetsDropped.size (); reasonCode++) + { + INDENT(indent); + os << "second.packetsDropped[reasonCode] + << "\" />\n"; + } + for (uint32_t reasonCode = 0; reasonCode < flowI->second.bytesDropped.size (); reasonCode++) + { + INDENT(indent); + os << "second.bytesDropped[reasonCode] + << "\" />\n"; + } + if (enableHistograms) + { + flowI->second.delayHistogram.SerializeToXmlStream (os, indent, "delayHistogram"); + flowI->second.jitterHistogram.SerializeToXmlStream (os, indent, "jitterHistogram"); + flowI->second.packetSizeHistogram.SerializeToXmlStream (os, indent, "packetSizeHistogram"); + } + indent -= 2; + + INDENT(indent); os << "\n"; + } + indent -= 2; + INDENT(indent); os << "\n"; + + m_classifier->SerializeToXmlStream (os, indent); + + if (enableProbes) + { + INDENT(indent); os << "\n"; + indent += 2; + for (uint32_t i = 0; i < m_flowProbes.size (); i++) + { + m_flowProbes[i]->SerializeToXmlStream (os, indent, i); + } + indent -= 2; + INDENT(indent); os << "\n"; + } + + indent -= 2; + INDENT(indent); os << "\n"; +} + + +std::string +FlowMonitor::SerializeToXmlString (int indent, bool enableHistograms, bool enableProbes) +{ + std::ostringstream os; + SerializeToXmlStream (os, indent, enableHistograms, enableProbes); + return os.str (); +} + + +void +FlowMonitor::SerializeToXmlFile (std::string fileName, bool enableHistograms, bool enableProbes) +{ + std::ofstream os (fileName.c_str (), std::ios::out|std::ios::binary); + os << "\n"; + SerializeToXmlStream (os, 0, enableHistograms, enableProbes); + os.close (); +} + + +} // namespace ns3 + diff --git a/src/contrib/flow-monitor/flow-monitor.h b/src/contrib/flow-monitor/flow-monitor.h new file mode 100644 index 000000000..7f8096219 --- /dev/null +++ b/src/contrib/flow-monitor/flow-monitor.h @@ -0,0 +1,244 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#ifndef __FLOW_MONITOR_H__ +#define __FLOW_MONITOR_H__ + +#include +#include + +#include "ns3/ptr.h" +#include "ns3/object.h" +#include "ns3/flow-probe.h" +#include "ns3/flow-classifier.h" +#include "ns3/histogram.h" +#include "ns3/nstime.h" +#include "ns3/event-id.h" + +namespace ns3 { + +/// \brief An object that monitors and reports back packet flows observed during a simulation +/// +/// The FlowMonitor class is responsible forcoordinating efforts +/// regarding probes, and collects end-to-end flowstatistics. +class FlowMonitor : public Object +{ +public: + + /// \brief Structure that represents the measured metrics of an individual packet flow + struct FlowStats + { + /// Contains the absolute time when the first packet in the flow + /// was transmitted, i.e. the time when the flow transmission + /// starts + Time timeFirstTxPacket; + + /// Contains the absolute time when the first packet in the flow + /// was received by an end node, i.e. the time when the flow + /// reception starts + Time timeFirstRxPacket; + + /// Contains the absolute time when the last packet in the flow + /// was transmitted, i.e. the time when the flow transmission + /// ends + Time timeLastTxPacket; + + /// Contains the absolute time when the last packet in the flow + /// was received, i.e. the time when the flow reception ends + Time timeLastRxPacket; + + /// Contains the sum of all end-to-end delays for all received + /// packets of the flow. + Time delaySum; // delayCount == rxPackets + + /// Contains the sum of all end-to-end delay jitter (delay + /// variation) values for all received packets of the flow. Here + /// we define _jitter_ of a packet as the delay variation + /// relatively to the last packet of the stream, + /// i.e. \f$Jitter\left\{P_N\right\} = \left|Delay\left\{P_N\right\} - Delay\left\{P_{N-1}\right\}\right|\f$. + /// This definition is in accordance with the Type-P-One-way-ipdv + /// as defined in IETF RFC 3393. + Time jitterSum; // jitterCount == rxPackets - 1 + + Time lastDelay; + + /// Total number of transmitted bytes for the flow + uint64_t txBytes; + /// Total number of received bytes for the flow + uint64_t rxBytes; + /// Total number of transmitted packets for the flow + uint32_t txPackets; + /// Total number of received packets for the flow + uint32_t rxPackets; + + /// Total number of packets that are assumed to be lost, + /// i.e. those that were transmitted but have not been reportedly + /// received or forwarded for a long time. By default, packets + /// missing for a period of over 10 seconds are assumed to be + /// lost, although this value can be easily configured in runtime + uint32_t lostPackets; + + /// Contains the number of times a packet has been reportedly + /// forwarded, summed for all received packets in the flow + uint32_t timesForwarded; + + /// Histogram of the packet delays + Histogram delayHistogram; + /// Histogram of the packet jitters + Histogram jitterHistogram; + /// Histogram of the packet sizes + Histogram packetSizeHistogram; + + /// This attribute also tracks the number of lost packets and + /// bytes, but discriminates the losses by a _reason code_. This + /// reason code is usually an enumeration defined by the concrete + /// FlowProbe class, and for each reason code there may be a + /// vector entry indexed by that code and whose value is the + /// number of packets or bytes lost due to this reason. For + /// instance, in the Ipv4FlowProbe case the following reasons are + /// currently defined: DROP_NO_ROUTE (no IPv4 route found for a + /// packet), DROP_TTL_EXPIRE (a packet was dropped due to an IPv4 + /// TTL field decremented and reaching zero), and + /// DROP_BAD_CHECKSUM (a packet had bad IPv4 header checksum and + /// had to be dropped). + std::vector packetsDropped; // packetsDropped[reasonCode] => number of dropped packets + + /// This attribute also tracks the number of lost bytes. See also + /// comment in attribute packetsDropped. + std::vector bytesDropped; // bytesDropped[reasonCode] => number of dropped bytes + }; + + // --- basic methods --- + static TypeId GetTypeId (); + TypeId GetInstanceTypeId () const; + FlowMonitor (); + + /// Set the FlowClassifier to be used by the flow monitor. + void SetFlowClassifier (Ptr classifier); + + /// Set the time, counting from the current time, from which to start monitoring flows + void Start (const Time &time); + /// Set the time, counting from the current time, from which to stop monitoring flows + void Stop (const Time &time); + /// Begin monitoring flows *right now* + void StartRightNow (); + /// End monitoring flows *right now* + void StopRightNow (); + + // --- methods to be used by the FlowMonitorProbe's only --- + /// Register a new FlowProbe that will begin monitoring and report + /// events to this monitor. This method is normally only used by + /// FlowProbe implementations. + void AddProbe (Ptr probe); + + /// FlowProbe implementations are supposed to call this method to + /// report that a new packet was transmitted (but keep in mind the + /// distinction between a new packet entering the system and a + /// packet that is already known and is only being forwarded). + void ReportFirstTx (Ptr probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize); + /// FlowProbe implementations are supposed to call this method to + /// report that a known packet is being forwarded. + void ReportForwarding (Ptr probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize); + /// FlowProbe implementations are supposed to call this method to + /// report that a known packet is being received. + void ReportLastRx (Ptr probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize); + /// FlowProbe implementations are supposed to call this method to + /// report that a known packet is being dropped due to some reason. + void ReportDrop (Ptr probe, FlowId flowId, FlowPacketId packetId, + uint32_t packetSize, uint32_t reasonCode); + + /// Check right now for packets that appear to be lost + void CheckForLostPackets (); + + /// Check right now for packets that appear to be lost, considering + /// packets as lost if not seen in the network for a time larger + /// than maxDelay + void CheckForLostPackets (Time maxDelay); + + // --- methods to get the results --- + /// Retrieve all collected the flow statistics. Note, if the + /// FlowMonitor has not stopped monitoring yet, you should call + /// CheckForLostPackets() to make sure all possibly lost packets are + /// accounted for. + std::map GetFlowStats () const; + + /// Get a list of all FlowProbe's associated with this FlowMonitor + std::vector< Ptr > GetAllProbes () const; + + /// Serializes the results to an std::ostream in XML format + /// \param os the output stream + /// \param indent number of spaces to use as base indentation level + /// \param enableHistograms if true, include also the histograms in the output + /// \param enableProbes if true, include also the per-probe/flow pair statistics in the output + void SerializeToXmlStream (std::ostream &os, int indent, bool enableHistograms, bool enableProbes); + /// Same as SerializeToXmlStream, but returns the output as a std::string + /// \param indent number of spaces to use as base indentation level + /// \param enableHistograms if true, include also the histograms in the output + /// \param enableProbes if true, include also the per-probe/flow pair statistics in the output + /// \return the XML output as string + std::string SerializeToXmlString (int indent, bool enableHistograms, bool enableProbes); + /// Same as SerializeToXmlStream, but writes to a file instead + /// \param fileName name or path of the output file that will be created + /// \param enableHistograms if true, include also the histograms in the output + /// \param enableProbes if true, include also the per-probe/flow pair statistics in the output + void SerializeToXmlFile (std::string fileName, bool enableHistograms, bool enableProbes); + + +protected: + + virtual void NotifyConstructionCompleted (); + +private: + + struct TrackedPacket + { + Time firstSeenTime; // absolute time when the packet was first seen by a probe + Time lastSeenTime; // absolute time when the packet was last seen by a probe + uint32_t timesForwarded; // number of times the packet was reportedly forwarded + }; + + // FlowId --> FlowStats + std::map m_flowStats; + + // (FlowId,PacketId) --> TrackedPacket + typedef std::map< std::pair, TrackedPacket> TrackedPacketMap; + TrackedPacketMap m_trackedPackets; + Time m_maxPerHopDelay; + std::vector< Ptr > m_flowProbes; + + // note: this is needed only for serialization + Ptr m_classifier; + + EventId m_startEvent; + EventId m_stopEvent; + bool m_enabled; + double m_delayBinWidth; + double m_jitterBinWidth; + double m_packetSizeBinWidth; + + FlowStats& GetStatsForFlow (FlowId flowId); + void PeriodicCheckForLostPackets (); +}; + + +} // namespace ns3 + +#endif + diff --git a/src/contrib/flow-monitor/flow-probe.cc b/src/contrib/flow-monitor/flow-probe.cc new file mode 100644 index 000000000..e58058942 --- /dev/null +++ b/src/contrib/flow-monitor/flow-probe.cc @@ -0,0 +1,111 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#include "ns3/flow-probe.h" +#include "ns3/flow-monitor.h" + +namespace ns3 { + + +FlowProbe::~FlowProbe () +{ +} + + +FlowProbe::FlowProbe (Ptr flowMonitor) + : m_flowMonitor (flowMonitor) +{ + m_flowMonitor->AddProbe (this); +} + +void +FlowProbe::AddPacketStats (FlowId flowId, uint32_t packetSize, Time delayFromFirstProbe) +{ + FlowStats &flow = m_stats[flowId]; + flow.delayFromFirstProbeSum += delayFromFirstProbe; + flow.bytes += packetSize; + ++flow.packets; +} + +void +FlowProbe::AddPacketDropStats (FlowId flowId, uint32_t packetSize, uint32_t reasonCode) +{ + FlowStats &flow = m_stats[flowId]; + + if (flow.packetsDropped.size () < reasonCode + 1) + { + flow.packetsDropped.resize (reasonCode + 1, 0); + flow.bytesDropped.resize (reasonCode + 1, 0); + } + ++flow.packetsDropped[reasonCode]; + flow.bytesDropped[reasonCode] += packetSize; +} + +FlowProbe::Stats +FlowProbe::GetStats () const +{ + return m_stats; +} + +void +FlowProbe::SerializeToXmlStream (std::ostream &os, int indent, uint32_t index) const +{ + #define INDENT(level) for (int __xpto = 0; __xpto < level; __xpto++) os << ' '; + + INDENT(indent); os << "\n"; + + indent += 2; + + for (Stats::const_iterator iter = m_stats.begin (); iter != m_stats.end (); iter++) + { + INDENT(indent); + os << "first << "\"" + << " packets=\"" << iter->second.packets << "\"" + << " bytes=\"" << iter->second.bytes << "\"" + << " delayFromFirstProbeSum=\"" << iter->second.delayFromFirstProbeSum << "\"" + << " >\n"; + indent += 2; + for (uint32_t reasonCode = 0; reasonCode < iter->second.packetsDropped.size (); reasonCode++) + { + INDENT(indent); + os << "second.packetsDropped[reasonCode] + << "\" />\n"; + } + for (uint32_t reasonCode = 0; reasonCode < iter->second.bytesDropped.size (); reasonCode++) + { + INDENT(indent); + os << "second.bytesDropped[reasonCode] + << "\" />\n"; + } + indent -= 2; + INDENT(indent); os << "\n"; + } + indent -= 2; + INDENT(indent); os << "\n"; +} + + + +} // namespace ns3 + + diff --git a/src/contrib/flow-monitor/flow-probe.h b/src/contrib/flow-monitor/flow-probe.h new file mode 100644 index 000000000..f5857a0e6 --- /dev/null +++ b/src/contrib/flow-monitor/flow-probe.h @@ -0,0 +1,87 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#ifndef __FLOW_PROBE_H__ +#define __FLOW_PROBE_H__ + +#include +#include + +#include "ns3/ref-count-base.h" +#include "ns3/flow-classifier.h" +#include "ns3/nstime.h" + +namespace ns3 { + +class FlowMonitor; + +/// The FlowProbe class is responsible for listening for packet events +/// in a specific point of the simulated space, report those events to +/// the global FlowMonitor, and collect its own flow statistics +/// regarding only the packets that pass through that probe. +class FlowProbe : public RefCountBase +{ +protected: + + FlowProbe (Ptr flowMonitor); + +public: + ~FlowProbe (); + + struct FlowStats + { + FlowStats () : delayFromFirstProbeSum (Seconds (0)), bytes (0), packets (0) {} + + /// packetsDropped[reasonCode] => number of dropped packets + std::vector packetsDropped; + /// bytesDropped[reasonCode] => number of dropped bytes + std::vector bytesDropped; + /// divide by 'Scalar (packets)' to get the average delay from the + /// first (entry) probe up to this one (partial delay) + Time delayFromFirstProbeSum; + /// Number of bytes seen of this flow + uint64_t bytes; + /// Number of packets seen of this flow + uint32_t packets; + }; + + typedef std::map Stats; + + void AddPacketStats (FlowId flowId, uint32_t packetSize, Time delayFromFirstProbe); + void AddPacketDropStats (FlowId flowId, uint32_t packetSize, uint32_t reasonCode); + + /// Get the partial flow statistics stored in this probe. With this + /// information you can, for example, find out what is the delay + /// from the first probe to this one. + Stats GetStats () const; + + void SerializeToXmlStream (std::ostream &os, int indent, uint32_t index) const; + +protected: + Ptr m_flowMonitor; + Stats m_stats; + +}; + + +} // namespace ns3 + +#endif + diff --git a/src/contrib/flow-monitor/histogram.cc b/src/contrib/flow-monitor/histogram.cc new file mode 100644 index 000000000..e3c822a52 --- /dev/null +++ b/src/contrib/flow-monitor/histogram.cc @@ -0,0 +1,212 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Pedro Fortuna +// + +#include +#include "histogram.h" +#include "ns3/simulator.h" +#include "ns3/log.h" + +#define DEFAULT_BIN_WIDTH 1 +// #define RESERVED_BINS_INC 10 + + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("Histogram"); + +// uint32_t +// Histogram::GetSize () const +// { +// return m_histogram.size (); +// } + +uint32_t +Histogram::GetNBins () const +{ + return m_histogram.size (); +} + +double +Histogram::GetBinStart (uint32_t index) +{ + return index*m_binWidth; +} + +double +Histogram::GetBinEnd (uint32_t index) +{ + return (index + 1) * m_binWidth; +} + +double +Histogram::GetBinWidth (uint32_t index) const +{ + return m_binWidth; +} + +void +Histogram::SetDefaultBinWidth (double binWidth) +{ + NS_ASSERT (m_histogram.size () == 0); //we can only change the bin width if no values were added + m_binWidth = binWidth; +} + +uint32_t +Histogram::GetBinCount (uint32_t index) +{ + NS_ASSERT (index < m_histogram.size ()); + return m_histogram[index]; +} + +void +Histogram::AddValue (double value) +{ + uint32_t index = (uint32_t)floor (value/m_binWidth); + + //check if we need to resize the vector + NS_LOG_DEBUG ("AddValue: index=" << index << ", m_histogram.size()=" << m_histogram.size ()); + + if (index >= m_histogram.size ()) + { + m_histogram.resize (index + 1, 0); + } + m_histogram[index]++; +} + +Histogram::Histogram (double binWidth) +{ + m_binWidth = binWidth; +} + +Histogram::Histogram () +{ + Histogram (DEFAULT_BIN_WIDTH); +} + + +void +Histogram::SerializeToXmlStream (std::ostream &os, int indent, std::string elementName) const +{ +#define INDENT(level) for (int __xpto = 0; __xpto < level; __xpto++) os << ' '; + + INDENT(indent); os << "<" << elementName // << " binWidth=\"" << m_binWidth << "\"" + << " nBins=\"" << m_histogram.size () << "\"" + << " >\n"; + indent += 2; + +#if 1 // two alternative forms of representing bin data, one more verbose than the other one + for (uint32_t index = 0; index < m_histogram.size (); index++) + { + if (m_histogram[index]) + { + INDENT(indent); + os << "\n"; + } + } +#else + INDENT(indent + 2); + for (uint32_t index = 0; index < m_histogram.size (); index++) + { + if (index > 0) + { + os << " "; + } + os << m_histogram[index]; + } + os << "\n"; +#endif + indent -= 2; + INDENT(indent); os << "\n"; +#undef INDENT +} + + + + +} // namespace ns3 + + +#ifdef RUN_SELF_TESTS + +#include "ns3/test.h" + +namespace ns3 { + +class HistogramTest : public ns3::Test { +private: +public: + HistogramTest (); + virtual bool RunTests (void); + + +}; + +HistogramTest::HistogramTest () + : ns3::Test ("Histogram") +{} + + +bool +HistogramTest::RunTests (void) +{ + bool result = true; + + Histogram h0(3.5); + // Testing floating-point bin widths + { + for (int i=1; i<= 10; i++) h0.AddValue(3.4); + for (int i=1; i<= 5; i++) h0.AddValue(3.6); + + NS_TEST_ASSERT_EQUAL (h0.GetBinWidth (0), 3.5); + NS_TEST_ASSERT_EQUAL (h0.GetNBins (), 2); + NS_TEST_ASSERT_EQUAL (h0.GetBinStart(1), 3.5); + NS_TEST_ASSERT_EQUAL (h0.GetBinCount(0), 10); + NS_TEST_ASSERT_EQUAL (h0.GetBinCount(1), 5); + } + + { + // Testing bin expansion + h0.AddValue(74.3); + + NS_TEST_ASSERT_EQUAL (h0.GetNBins (), 22); + + /*for (uint32_t i=0; i < h0.GetSize () ; i++) + { + std::cout << i << ") BinStart:" << h0.GetBinStart (i) << " BinEnd:" << ((double) h0.GetBinStart (i) + h0.GetBinWidth (i)) << " BinCount: " << h0.GetBinCount (i) << std::endl; + }*/ + + NS_TEST_ASSERT_EQUAL (h0.GetBinCount (21), 1); + } + + return result; +} + +static HistogramTest gHistogramTest; + +}; // namespace + + +#endif /* RUN_SELF_TESTS */ + diff --git a/src/contrib/flow-monitor/histogram.h b/src/contrib/flow-monitor/histogram.h new file mode 100644 index 000000000..6772e1675 --- /dev/null +++ b/src/contrib/flow-monitor/histogram.h @@ -0,0 +1,64 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Pedro Fortuna +// + +#ifndef __NS3_HISTOGRAM_H__ +#define __NS3_HISTOGRAM_H__ + +#include +#include +#include + +namespace ns3 { + +class Histogram +{ +public: + + // --- basic methods --- + Histogram (double binWidth); + Histogram (); + + // Methods for Getting the Histogram Results + uint32_t GetNBins () const; + double GetBinStart (uint32_t index); + double GetBinEnd (uint32_t index); + double GetBinWidth (uint32_t index) const; + void SetDefaultBinWidth (double binWidth); + uint32_t GetBinCount (uint32_t index); + + // Method for adding values + void AddValue (double value); + + + void SerializeToXmlStream (std::ostream &os, int indent, std::string elementName) const; + + // TODO: add method(s) to estimate N, µ, and s² from the histogram, + // see http://www.dspguide.com/ch2/4.htm + +private: + std::vector m_histogram; + double m_binWidth; +}; + + +} // namespace ns3 + +#endif + diff --git a/src/contrib/flow-monitor/ipv4-flow-classifier.cc b/src/contrib/flow-monitor/ipv4-flow-classifier.cc new file mode 100644 index 000000000..e0692bf21 --- /dev/null +++ b/src/contrib/flow-monitor/ipv4-flow-classifier.cc @@ -0,0 +1,203 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#include "ns3/packet.h" + +#include "ipv4-flow-classifier.h" +#include "ns3/udp-header.h" +#include "ns3/tcp-header.h" + +namespace ns3 { + +/* see http://www.iana.org/assignments/protocol-numbers */ +const uint8_t TCP_PROT_NUMBER = 6; +const uint8_t UDP_PROT_NUMBER = 17; + + + +bool operator < (const Ipv4FlowClassifier::FiveTuple &t1, + const Ipv4FlowClassifier::FiveTuple &t2) +{ + if (t1.sourceAddress < t2.sourceAddress) + { + return true; + } + if (t1.sourceAddress != t2.sourceAddress) + { + return false; + } + + if (t1.destinationAddress < t2.destinationAddress) + { + return true; + } + if (t1.destinationAddress != t2.destinationAddress) + { + return false; + } + + if (t1.protocol < t2.protocol) + { + return true; + } + if (t1.protocol != t2.protocol) + { + return false; + } + + if (t1.sourcePort < t2.sourcePort) + { + return true; + } + if (t1.sourcePort != t2.sourcePort) + { + return false; + } + + if (t1.destinationPort < t2.destinationPort) + { + return true; + } + if (t1.destinationPort != t2.destinationPort) + { + return false; + } + + return false; +} + +bool operator == (const Ipv4FlowClassifier::FiveTuple &t1, + const Ipv4FlowClassifier::FiveTuple &t2) +{ + return (t1.sourceAddress == t2.sourceAddress && + t1.destinationAddress == t2.destinationAddress && + t1.protocol == t2.protocol && + t1.sourcePort == t2.sourcePort && + t1.destinationPort == t2.destinationPort); +} + + + +Ipv4FlowClassifier::Ipv4FlowClassifier () +{ +} + +bool +Ipv4FlowClassifier::Classify (const Ipv4Header &ipHeader, Ptr ipPayload, + uint32_t *out_flowId, uint32_t *out_packetId) +{ + if (ipHeader.GetDestination () == Ipv4Address::GetBroadcast ()) + { + // we are not prepared to handle broadcast yet + return false; + } + + FiveTuple tuple; + tuple.sourceAddress = ipHeader.GetSource (); + tuple.destinationAddress = ipHeader.GetDestination (); + tuple.protocol = ipHeader.GetProtocol (); + + switch (tuple.protocol) + { + case UDP_PROT_NUMBER: + { + UdpHeader udpHeader; + ipPayload->PeekHeader (udpHeader); + tuple.sourcePort = udpHeader.GetSourcePort (); + tuple.destinationPort = udpHeader.GetDestinationPort (); + } + break; + + case TCP_PROT_NUMBER: + { + TcpHeader tcpHeader; + ipPayload->PeekHeader (tcpHeader); + tuple.sourcePort = tcpHeader.GetSourcePort (); + tuple.destinationPort = tcpHeader.GetDestinationPort (); + } + break; + + default: + return false; + } + + // try to insert the tuple, but check if it already exists + std::pair::iterator, bool> insert + = m_flowMap.insert (std::pair (tuple, 0)); + + // if the insertion succeeded, we need to assign this tuple a new flow identifier + if (insert.second) + { + insert.first->second = GetNewFlowId (); + } + + *out_flowId = insert.first->second; + *out_packetId = ipHeader.GetIdentification (); + + return true; +} + + +Ipv4FlowClassifier::FiveTuple +Ipv4FlowClassifier::FindFlow (FlowId flowId) const +{ + for (std::map::const_iterator + iter = m_flowMap.begin (); iter != m_flowMap.end (); iter++) + { + if (iter->second == flowId) + { + return iter->first; + } + } + NS_FATAL_ERROR ("Could not find the flow with ID " << flowId); + FiveTuple retval = { Ipv4Address::GetZero (), Ipv4Address::GetZero (), 0, 0, 0 }; + return retval; +} + +void +Ipv4FlowClassifier::SerializeToXmlStream (std::ostream &os, int indent) const +{ +#define INDENT(level) for (int __xpto = 0; __xpto < level; __xpto++) os << ' '; + + INDENT(indent); os << "\n"; + + indent += 2; + for (std::map::const_iterator + iter = m_flowMap.begin (); iter != m_flowMap.end (); iter++) + { + INDENT(indent); + os << "second << "\"" + << " sourceAddress=\"" << iter->first.sourceAddress << "\"" + << " destinationAddress=\"" << iter->first.destinationAddress << "\"" + << " protocol=\"" << int(iter->first.protocol) << "\"" + << " sourcePort=\"" << iter->first.sourcePort << "\"" + << " destinationPort=\"" << iter->first.destinationPort << "\"" + << " />\n"; + } + + indent -= 2; + INDENT(indent); os << "\n"; + +#undef INDENT +} + + +} // namespace ns3 + diff --git a/src/contrib/flow-monitor/ipv4-flow-classifier.h b/src/contrib/flow-monitor/ipv4-flow-classifier.h new file mode 100644 index 000000000..5dca4c59e --- /dev/null +++ b/src/contrib/flow-monitor/ipv4-flow-classifier.h @@ -0,0 +1,78 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#ifndef __IPV4_FLOW_CLASSIFIER_H__ +#define __IPV4_FLOW_CLASSIFIER_H__ + +#include +#include + +#include "ns3/ipv4-header.h" +#include "ns3/flow-classifier.h" + +namespace ns3 { + +class Packet; + +/// Classifies packets by looking at their IP and TCP/UDP headers. +/// From these packet headers, a tuple (source-ip, destination-ip, +/// protocol, source-port, destination-port) is created, and a unique +/// flow identifier is assigned for each different tuple combination +class Ipv4FlowClassifier : public FlowClassifier +{ +public: + + struct FiveTuple + { + Ipv4Address sourceAddress; + Ipv4Address destinationAddress; + uint8_t protocol; + uint16_t sourcePort; + uint16_t destinationPort; + }; + + Ipv4FlowClassifier (); + + /// \brief try to classify the packet into flow-id and packet-id + /// \return true if the packet was classified, false if not (i.e. it + /// does not appear to be part of a flow). + bool Classify (const Ipv4Header &ipHeader, Ptr ipPayload, + uint32_t *out_flowId, uint32_t *out_packetId); + + /// Searches for the FiveTuple corresponding to the given flowId + FiveTuple FindFlow (FlowId flowId) const; + + virtual void SerializeToXmlStream (std::ostream &os, int indent) const; + +private: + + std::map m_flowMap; + +}; + + +bool operator < (const Ipv4FlowClassifier::FiveTuple &t1, const Ipv4FlowClassifier::FiveTuple &t2); +bool operator == (const Ipv4FlowClassifier::FiveTuple &t1, const Ipv4FlowClassifier::FiveTuple &t2); + + +} // namespace ns3 + +#endif + diff --git a/src/contrib/flow-monitor/ipv4-flow-probe.cc b/src/contrib/flow-monitor/ipv4-flow-probe.cc new file mode 100644 index 000000000..1139641ec --- /dev/null +++ b/src/contrib/flow-monitor/ipv4-flow-probe.cc @@ -0,0 +1,178 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#include "ns3/ipv4-flow-probe.h" +#include "ns3/ipv4-flow-classifier.h" +#include "ns3/node.h" +#include "ns3/packet.h" +#include "ns3/flow-monitor.h" +#include "ns3/log.h" +#include "ns3/pointer.h" + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("Ipv4FlowProbe"); + + +Ipv4FlowProbe::~Ipv4FlowProbe () +{ +} + + +Ipv4FlowProbe::Ipv4FlowProbe (Ptr monitor, + Ptr classifier, + Ptr node) + : FlowProbe (monitor), + m_classifier (classifier) +{ + NS_LOG_FUNCTION (this << node->GetId ()); + + Ptr ipv4 = node->GetObject (); + + if (!ipv4->TraceConnectWithoutContext ("SendOutgoing", + MakeCallback (&Ipv4FlowProbe::SendOutgoingLogger, Ptr (this)))) + { + NS_FATAL_ERROR ("trace fail"); + } + if (!ipv4->TraceConnectWithoutContext ("UnicastForward", + MakeCallback (&Ipv4FlowProbe::ForwardLogger, Ptr (this)))) + { + NS_FATAL_ERROR ("trace fail"); + } + if (!ipv4->TraceConnectWithoutContext ("LocalDeliver", + MakeCallback (&Ipv4FlowProbe::ForwardUpLogger, Ptr (this)))) + { + NS_FATAL_ERROR ("trace fail"); + } + + if (!ipv4->TraceConnectWithoutContext ("Drop", + MakeCallback (&Ipv4FlowProbe::DropLogger, Ptr (this)))) + { + NS_FATAL_ERROR ("trace fail"); + } +} + +void +Ipv4FlowProbe::SendOutgoingLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface) +{ + FlowId flowId; + FlowPacketId packetId; + + if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) + { + uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); + NS_LOG_DEBUG ("ReportFirstTx ("<ReportFirstTx (this, flowId, packetId, size); + } +} + +void +Ipv4FlowProbe::ForwardLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface) +{ + FlowId flowId; + FlowPacketId packetId; + + if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) + { + uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); + NS_LOG_DEBUG ("ReportForwarding ("<ReportForwarding (this, flowId, packetId, size); + } + +} + +void +Ipv4FlowProbe::ForwardUpLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface) +{ + FlowId flowId; + FlowPacketId packetId; + + if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) + { + uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); + NS_LOG_DEBUG ("ReportLastRx ("<ReportLastRx (this, flowId, packetId, size); + } +} + +void +Ipv4FlowProbe::DropLogger (const Ipv4Header &ipHeader, Ptr ipPayload, + Ipv4L3Protocol::DropReason reason, uint32_t ifIndex) +{ +#if 0 + switch (reason) + { + case Ipv4L3Protocol::DROP_NO_ROUTE: + break; + + case Ipv4L3Protocol::DROP_TTL_EXPIRED: + case Ipv4L3Protocol::DROP_BAD_CHECKSUM: + Ipv4Address addri = m_ipv4->GetAddress (ifIndex); + Ipv4Mask maski = m_ipv4->GetNetworkMask (ifIndex); + Ipv4Address bcast = addri.GetSubnetDirectedBroadcast (maski); + if (ipHeader.GetDestination () == bcast) // we don't want broadcast packets + { + return; + } + } +#endif + + FlowId flowId; + FlowPacketId packetId; + + if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) + { + uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); + NS_LOG_DEBUG ("Drop ("<ReportDrop (this, flowId, packetId, size, myReason); + } +} + + + +} // namespace ns3 + + diff --git a/src/contrib/flow-monitor/ipv4-flow-probe.h b/src/contrib/flow-monitor/ipv4-flow-probe.h new file mode 100644 index 000000000..686516002 --- /dev/null +++ b/src/contrib/flow-monitor/ipv4-flow-probe.h @@ -0,0 +1,75 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#ifndef __IPV4_FLOW_PROBE_H__ +#define __IPV4_FLOW_PROBE_H__ + +#include "ns3/flow-probe.h" +#include "ns3/ipv4-flow-classifier.h" +#include "ns3/ipv4-l3-protocol.h" + +namespace ns3 { + +class FlowMonitor; +class Node; + +/// \brief Class that monitors flows at the IPv4 layer of a Node +/// +/// For each node in the simulation, one instance of the class +/// Ipv4FlowProbe is created to monitor that node. Ipv4FlowProbe +/// accomplishes this by connecting callbacks to trace sources in the +/// Ipv4L3Protocol interface of the node. +class Ipv4FlowProbe : public FlowProbe +{ + +public: + Ipv4FlowProbe (Ptr monitor, Ptr classifier, Ptr node); + ~Ipv4FlowProbe (); + + /// \brief enumeration of possible reasons why a packet may be dropped + enum DropReason + { + /// Packet dropped due to missing route to the destination + DROP_NO_ROUTE = 0, + /// Packet dropped due to TTL decremented to zero during IPv4 forwarding + DROP_TTL_EXPIRE, + /// Packet dropped due to invalid checksum in the IPv4 header + DROP_BAD_CHECKSUM, + + // DROP_QUEUE, // TODO: this is not easy to do + DROP_INVALID_REASON, + }; + +private: + + void SendOutgoingLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface); + void ForwardLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface); + void ForwardUpLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface); + void DropLogger (const Ipv4Header &ipHeader, Ptr ipPayload, + Ipv4L3Protocol::DropReason reason, uint32_t ifIndex); + + Ptr m_classifier; +}; + + +} // namespace ns3 + +#endif + diff --git a/src/contrib/flow-monitor/waf b/src/contrib/flow-monitor/waf new file mode 100755 index 000000000..51f099826 --- /dev/null +++ b/src/contrib/flow-monitor/waf @@ -0,0 +1,2 @@ +#! /bin/sh +exec "`dirname "$0"`"/../../../waf "$@" diff --git a/src/contrib/flow-monitor/wscript b/src/contrib/flow-monitor/wscript new file mode 100644 index 000000000..71872a8da --- /dev/null +++ b/src/contrib/flow-monitor/wscript @@ -0,0 +1,23 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + obj = bld.create_ns3_module('flow-monitor', ['internet-stack']) + obj.source = [ + 'flow-monitor.cc', + 'flow-classifier.cc', + 'flow-probe.cc', + 'ipv4-flow-classifier.cc', + 'ipv4-flow-probe.cc', + 'histogram.cc', + ] + headers = bld.new_task_gen('ns3header') + headers.module = 'flow-monitor' + headers.source = [ + 'flow-monitor.h', + 'flow-probe.h', + 'flow-classifier.h', + 'ipv4-flow-classifier.h', + 'ipv4-flow-probe.h', + 'histogram.h', + ] + diff --git a/src/contrib/net-anim/animation-interface.cc b/src/contrib/net-anim/animation-interface.cc new file mode 100644 index 000000000..3b80ce8e5 --- /dev/null +++ b/src/contrib/net-anim/animation-interface.cc @@ -0,0 +1,193 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: George F. Riley + */ + +// Interface between ns3 and the network animator + +#include +#include + +// Socket related includes +#include +#include + +// ns3 includes +#include "ns3/animation-interface.h" +#include "ns3/channel.h" +#include "ns3/config.h" +#include "ns3/node.h" +#include "ns3/node-location.h" +#include "ns3/packet.h" +#include "ns3/simulator.h" + +using namespace std; + +NS_LOG_COMPONENT_DEFINE ("AnimationInterface"); + +namespace ns3 { + +AnimationInterface::AnimationInterface () + : m_fHandle (STDOUT_FILENO), m_model (0) +{ +} + +bool AnimationInterface::SetOutputFile (const std::string& fn) +{ + FILE* f = fopen (fn.c_str (), "w"); + if (!f) + { + return false; // Can't open + } + m_fHandle = fileno (f); // Set the file handle + return true; +} + +bool AnimationInterface::SetServerPort (uint16_t port) +{ + int s = socket (AF_INET, SOCK_STREAM, 0); + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_port = htons (port); + addr.sin_addr.s_addr = htonl (INADDR_ANY); + if (bind (s, (struct sockaddr*)&addr, sizeof (addr)) < 0) + { + NS_LOG_WARN ("Can't bind to port " << port << ", exiting."); + return false; + } + listen (s, 1); + NS_LOG_INFO ("Waiting for animator connection"); + // Now wait for the animator to connect in + m_fHandle = accept (s, 0, 0); + NS_LOG_INFO ("Got animator connection from remote"); + // set the linger socket option + int t = 1; + setsockopt (s, SOL_SOCKET, SO_LINGER, &t, sizeof(t)); + return true; +} + +bool AnimationInterface::SetInternalAnimation () +{ + return false; // Not implemented yet +} + +void AnimationInterface::StartAnimation () +{ + // Dump the topology + for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); ++i) + { + Ptr n = *i; + Ptr loc = n->GetObject (); + if (loc) + { + // Location exists, dump it + Vector v = loc->GetLocation (); + ostringstream oss; + oss << "0.0 N " << n->GetId () + << " " << v.x << " " << v.y << endl; + WriteN (m_fHandle, oss.str ().c_str (), oss.str ().length ()); + } + } + // Now dump the p2p links + for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End(); ++i) + { + Ptr n = *i; + uint32_t n1Id = n->GetId (); + uint32_t nDev = n->GetNDevices (); // Number of devices + for (uint32_t i = 0; i < nDev; ++i) + { + Ptr dev = n->GetDevice (i); + Ptr ch = dev->GetChannel (); + if (!ch) + { + continue; // No channel, can't be p2p device + } + string channelType = ch->GetInstanceTypeId ().GetName (); + if (channelType == string ("ns3::PointToPointChannel")) + { // Since these are duplex links, we only need to dump + // if srcid < dstid + uint32_t nChDev = ch->GetNDevices (); + for (uint32_t j = 0; j < nChDev; ++j) + { + Ptr chDev = ch->GetDevice (j); + uint32_t n2Id = chDev->GetNode ()->GetId (); + if (n1Id < n2Id) + { // ouptut the p2p link + ostringstream oss; + oss << "0.0 L " << n1Id << " " << n2Id << endl; + WriteN (m_fHandle, oss.str ().c_str (), + oss.str ().length ()); + } + } + } + else + { + NS_FATAL_ERROR ("Net animation currently only supports point-to-point links."); + } + } + } + + // Connect the callback for packet tx events + Config::Connect ("/NodeList/*/DeviceList/*/TxRxPointToPoint", + MakeCallback (&AnimationInterface::DevTxTrace, this)); +} + +void AnimationInterface::StopAnimation () +{ + if (m_fHandle > 0) + { + close (m_fHandle); + } +} + + +// Private methods +int AnimationInterface::WriteN (int h, const char* data, uint32_t count) +{ // Write count bytes to h from data + uint32_t nLeft = count; + const char* p = data; + uint32_t written = 0; + + while (nLeft) + { + int n = write (h, p, nLeft); + if (n <= 0) + { + return written; + } + written += n; + nLeft -= n; + p += n; + } + return written; +} + +void AnimationInterface::DevTxTrace (std::string context, Ptr p, + Ptr tx, Ptr rx, + Time txTime, Time rxTime) +{ + Time now = Simulator::Now (); + ostringstream oss; + oss << now.GetSeconds() << " P " + << tx->GetNode ()->GetId () << " " + << rx->GetNode ()->GetId () << " " + << (now + txTime).GetSeconds () << " " // last bit tx time + << (now + rxTime - txTime).GetSeconds() << " " // first bit rx time + << (now + rxTime).GetSeconds () << endl; // last bit rx time + WriteN (m_fHandle, oss.str ().c_str (), oss.str ().length ()); +} + +} // namespace ns3 diff --git a/src/contrib/net-anim/animation-interface.h b/src/contrib/net-anim/animation-interface.h new file mode 100644 index 000000000..9ba6ca685 --- /dev/null +++ b/src/contrib/net-anim/animation-interface.h @@ -0,0 +1,120 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: George F. Riley + */ + +// Interface between ns3 and the network animator + +#ifndef __ANIMATION_INTERFACE__H__ +#define __ANIMATION_INTERFACE__H__ + +#include + +#include "ns3/ptr.h" +#include "ns3/net-device.h" +#include "ns3/nstime.h" +#include "ns3/log.h" +#include "ns3/node-list.h" + + +namespace ns3 { +class NetModel; + +/** + * \brief Interface to network animator + * + * Provides functions that facilitate communications with an + * external or internal network animator. + */ +class AnimationInterface +{ +public: +/** + * @brief Construct the animator interface. No arguments needed. + */ + AnimationInterface (); +/** + * @brief Specify that animation commands are to be written + * to the specified output file. + * + * This call is used to write the animation information to a text + * file that can later be used as input to the network animator tool. + * + * @param fn The name of the output file. + * @returns true if successful open. + */ + bool SetOutputFile (const std::string& fn); + +/** + * @brief Specify that animation commands are to be written to + * a socket. + * + * This call is used to set the ns3 process in server mode, waiting + * for a TCP connection from the animator. This call will not + * return until the animator connects in, or if the bind to the + * specified port fails. + * + * @param port Port number to bind to. + * @returns true if connection created, false if bind failed. + */ + bool SetServerPort (uint16_t port); + +/** + * @brief Specify that animation window is to be created as part + * of the ns3 process. + * + * This call is used to set the ns3 animator internal to the + * current process. This will fail if the ns3 library was built + * without the QT4 developer packages. + * + * @returns true if animation started, false if failed. + */ + bool SetInternalAnimation (); + +/** + * @brief Writes the topology information and sets up the appropriate + * animation packet tx callback + * + * Writes the topology information to the appropriate output, depending + * on prior calls to SetOutputFile, SetServerPort, or SetInternalAnimation. + * Then creates the callbacks needed for the animator to start processing + * packets. + * + */ + void StartAnimation (); + +/** + * @brief Closes the interface to the animator. + * + */ + void StopAnimation (); + + +private: + // Packet tx animation callback + void DevTxTrace (std::string context, Ptr p, + Ptr tx, Ptr rx, + Time txTime, Time rxTime); + // Write specified amount of data to the specified handle + int WriteN (int, const char*, uint32_t); +private: + int m_fHandle; // File handle for output (-1 if none) + NetModel* m_model; // If non nil, points to the internal network model + // for the interlan animator +}; +} +#endif + diff --git a/src/contrib/net-anim/node-location.cc b/src/contrib/net-anim/node-location.cc new file mode 100644 index 000000000..add805142 --- /dev/null +++ b/src/contrib/net-anim/node-location.cc @@ -0,0 +1,56 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 Georgia Institute of Technology + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: George Riley + */ + +#include "node-location.h" + +namespace ns3 { + +TypeId +NodeLocation::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::NodeLocation") + .SetParent () + .AddAttribute ("Position", "The current position of the mobility model.", + TypeId::ATTR_SET | TypeId::ATTR_GET, + VectorValue (Vector (0.0, 0.0, 0.0)), + MakeVectorAccessor (&NodeLocation::SetLocation, + &NodeLocation::GetLocation), + MakeVectorChecker ()) + ; + return tid; +} + +NodeLocation::NodeLocation () +{} + +NodeLocation::~NodeLocation () +{} + +Vector NodeLocation::GetLocation (void) const +{ + return m_location; +} + +void NodeLocation::SetLocation (const Vector &location) +{ + m_location = location; +} + +} // namespace ns3 diff --git a/src/contrib/net-anim/node-location.h b/src/contrib/net-anim/node-location.h new file mode 100644 index 000000000..6119f92e4 --- /dev/null +++ b/src/contrib/net-anim/node-location.h @@ -0,0 +1,61 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 Georgia Institute of Technology + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: George Riley + */ +#ifndef __NODE_LOCATION_H__ +#define __NODE_LOCATION_H__ + +#include "ns3/object.h" +#include "ns3/traced-callback.h" +#include "ns3/vector.h" + +namespace ns3 { + +/** + * \brief Keep track of the current location of an object + * + * This can be used anytime a logical node location is needed + * (as opposed to a physical location used by the wireless PHY + * layer to calculate path loss). One potential use of + * this is by the animator to determine where to position the + * node icon on the animation display. Location units are + * arbitrary and dimensionless. In the case of use by the + * animator they dimensions are in pixels. + */ +class NodeLocation : public Object +{ +public: + static TypeId GetTypeId (void); + NodeLocation (); + virtual ~NodeLocation (); + + /** + * \returns the current location + */ + Vector GetLocation (void) const; + /** + * \param location the location to set. + */ + void SetLocation (const Vector &location); +private: + Vector m_location; +}; + +}; // namespace ns3 + +#endif /* __NODE_LOCATION_H__ */ diff --git a/src/contrib/net-anim/point-to-point-dumbbell-helper.cc b/src/contrib/net-anim/point-to-point-dumbbell-helper.cc new file mode 100644 index 000000000..43fddf35f --- /dev/null +++ b/src/contrib/net-anim/point-to-point-dumbbell-helper.cc @@ -0,0 +1,253 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: George F. Riley + */ + +// Implement an object to create a dumbbell topology. + +#include +#include + +// Socket related includes +#include +#include + +// ns3 includes +#include "ns3/animation-interface.h" +#include "ns3/point-to-point-dumbbell-helper.h" +#include "ns3/node-location.h" + +#include "ns3/node-list.h" +#include "ns3/point-to-point-net-device.h" +#include "ns3/vector.h" + +using namespace std; + +NS_LOG_COMPONENT_DEFINE("PointToPointDumbbellHelper"); + +namespace ns3 { + +PointToPointDumbbellHelper::PointToPointDumbbellHelper (uint32_t nLeftLeaf, + PointToPointHelper& leftHelper, + uint32_t nRightLeaf, + PointToPointHelper& rightHelper, + PointToPointHelper& bottleneckHelper) +{ + // Create the bottleneck routers + m_routers.Create (2); + // Create the leaf nodes + m_leftLeaf.Create (nLeftLeaf); + m_rightLeaf.Create (nRightLeaf); + + // Add the link connecting routers + m_routerDevices = bottleneckHelper.Install (m_routers); + // Add the left side links + for (uint32_t i = 0; i < nLeftLeaf; ++i) + { + NetDeviceContainer c = leftHelper.Install (m_routers.Get (0), + m_leftLeaf.Get (i)); + m_leftRouterDevices.Add (c.Get (0)); + m_leftLeafDevices.Add (c.Get(1)); + } + // Add the right side links + for (uint32_t i = 0; i < nRightLeaf; ++i) + { + NetDeviceContainer c = rightHelper.Install (m_routers.Get (1), + m_rightLeaf.Get (i)); + m_rightRouterDevices.Add (c.Get (0)); + m_rightLeafDevices.Add (c.Get (1)); + } +} + +Ptr PointToPointDumbbellHelper::GetLeft () const +{ // Get the left side bottleneck router + return m_routers.Get (0); +} + +Ptr PointToPointDumbbellHelper::GetLeft (uint32_t i) const +{ // Get the i'th left side leaf + return m_leftLeaf.Get (i); +} + +Ptr PointToPointDumbbellHelper::GetRight () const +{ // Get the right side bottleneck router + return m_routers.Get (1); +} + +Ptr PointToPointDumbbellHelper::GetRight (uint32_t i) const +{ // Get the i'th right side leaf + return m_rightLeaf.Get (i); +} + +Ipv4Address PointToPointDumbbellHelper::GetLeftAddress (uint32_t i) const +{ + return m_leftLeafInterfaces.GetAddress (i); +} + +Ipv4Address PointToPointDumbbellHelper::GetRightAddress (uint32_t i) const +{ + return m_rightLeafInterfaces.GetAddress (i); +} + +uint32_t PointToPointDumbbellHelper::LeftCount () const +{ // Number of left side nodes + return m_leftLeaf.GetN (); +} + +uint32_t PointToPointDumbbellHelper::RightCount () const +{ // Number of right side nodes + return m_rightLeaf.GetN (); +} + +void PointToPointDumbbellHelper::InstallStack (InternetStackHelper stack) +{ + stack.Install (m_routers); + stack.Install (m_leftLeaf); + stack.Install (m_rightLeaf); +} + +void PointToPointDumbbellHelper::AssignAddresses (Ipv4AddressHelper leftIp, + Ipv4AddressHelper rightIp, + Ipv4AddressHelper routerIp) +{ + // Assign the router network + m_routerInterfaces = routerIp.Assign (m_routerDevices); + // Assign to left side + for (uint32_t i = 0; i < LeftCount (); ++i) + { + NetDeviceContainer ndc; + ndc.Add (m_leftLeafDevices.Get (i)); + ndc.Add (m_leftRouterDevices.Get (i)); + Ipv4InterfaceContainer ifc = leftIp.Assign(ndc); + m_leftLeafInterfaces.Add (ifc.Get (0)); + m_leftRouterInterfaces.Add (ifc.Get (1)); + leftIp.NewNetwork (); + } + // Assign to right size + for (uint32_t i = 0; i < RightCount (); ++i) + { + NetDeviceContainer ndc; + ndc.Add (m_rightLeafDevices.Get (i)); + ndc.Add (m_rightRouterDevices.Get (i)); + Ipv4InterfaceContainer ifc = rightIp.Assign (ndc); + m_rightLeafInterfaces.Add (ifc.Get (0)); + m_rightRouterInterfaces.Add (ifc.Get (1)); + rightIp.NewNetwork (); + } +} + + +void PointToPointDumbbellHelper::BoundingBox (double ulx, double uly, // Upper left x/y + double lrx, double lry) // Lower right y +{ + double xDist = lrx - ulx; + double yDist = lry - uly; + double xAdder = xDist / 3.0; + double thetaL = M_PI / (LeftCount () + 1.0); + double thetaR = M_PI / (RightCount () + 1.0); + + // Place the left router + Ptr lr = GetLeft (); + Ptr loc = lr->GetObject (); + if (loc == 0) + { + loc = CreateObject (); + lr->AggregateObject (loc); + } + Vector lrl (ulx + xAdder, uly + yDist/2.0, 0); + loc->SetLocation (lrl); + + // Place the right router + Ptr rr = GetRight (); + loc = rr->GetObject (); + if (loc == 0) + { + loc = CreateObject (); + rr->AggregateObject (loc); + } + Vector rrl (ulx + xAdder * 2, uly + yDist/2.0, 0); // Right router location + loc->SetLocation (rrl); + + // Place the left leaf nodes + double theta = -M_PI_2 + thetaL; + for (uint32_t l = 0; l < LeftCount (); ++l) + { + // Make them in a circular pattern to make all line lengths the same + // Special case when theta = 0, to be sure we get a straight line + if ((LeftCount () % 2) == 1) + { // Count is odd, see if we are in middle + if (l == (LeftCount () / 2)) + { + theta = 0.0; + } + } + Ptr ln = GetLeft (l); + loc = ln->GetObject (); + if (loc == 0) + { + loc = CreateObject (); + ln->AggregateObject (loc); + } + Vector lnl (lrl.x - cos (theta) * xAdder, + lrl.y + sin (theta) * xAdder, 0); // Left Node Location + // Insure did not exceed bounding box + if (lnl.y < uly) + { + lnl.y = uly; // Set to upper right y + } + if (lnl.y > lry) + { + lnl.y = lry; // Set to lower right y + } + loc->SetLocation (lnl); + theta += thetaL; + } + // Place the right nodes + theta = -M_PI_2 + thetaR; + for (uint32_t r = 0; r < RightCount (); ++r) + { + // Special case when theta = 0, to be sure we get a straight line + if ((RightCount () % 2) == 1) + { // Count is odd, see if we are in middle + if (r == (RightCount () / 2)) + { + theta = 0.0; + } + } + Ptr rn = GetRight (r); + loc = rn->GetObject (); + if (loc == 0) + { + loc = CreateObject (); + rn->AggregateObject (loc); + } + Vector rnl (rrl.x + cos (theta) * xAdder, // Right node location + rrl.y + sin (theta) * xAdder, 0); + // Insure did not exceed bounding box + if (rnl.y < uly) + { + rnl.y = uly; // Set to upper right y + } + if (rnl.y > lry) + { + rnl.y = lry; // Set to lower right y + } + loc->SetLocation (rnl); + theta += thetaR; + } +} + +} // namespace ns3 diff --git a/src/contrib/net-anim/point-to-point-dumbbell-helper.h b/src/contrib/net-anim/point-to-point-dumbbell-helper.h new file mode 100644 index 000000000..c54caaeaf --- /dev/null +++ b/src/contrib/net-anim/point-to-point-dumbbell-helper.h @@ -0,0 +1,77 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: George F. Riley + */ + +// Define an object to create a dumbbell topology. + +#ifndef __POINT_TO_POINT_DUMBBELL_HELPER_H__ +#define __POINT_TO_POINT_DUMBBELL_HELPER_H__ + +#include + +#include "point-to-point-helper.h" +#include "ipv4-address-helper.h" +#include "internet-stack-helper.h" +#include "ipv4-interface-container.h" + +namespace ns3 { + +class PointToPointDumbbellHelper +{ +public: + PointToPointDumbbellHelper (uint32_t nLeftLeaf, // Number of left size leaf nodes + PointToPointHelper& leftHelper, + uint32_t nRightLeaf, // Number of right side leaf nodes + PointToPointHelper& rightHelper, + PointToPointHelper& bottleneckHelper); +public: + Ptr GetLeft () const; // Get the left side bottleneck router + Ptr GetLeft (uint32_t) const; // Get the i'th left side leaf + Ptr GetRight () const; // Get the right side bottleneck router + Ptr GetRight (uint32_t) const; // Get the i'th right side leaf + Ipv4Address GetLeftAddress (uint32_t) const; // Get left leaf address + Ipv4Address GetRightAddress (uint32_t) const; // Get right leaf address + uint32_t LeftCount () const; // Number of left side nodes + uint32_t RightCount () const; // Number of right side nodes + void InstallStack (InternetStackHelper stack); + void AssignAddresses (Ipv4AddressHelper leftIp, + Ipv4AddressHelper rightIp, + Ipv4AddressHelper routerIp); + // Add locations in the specified bounding box + // Arguments are uppler left x, upper left y, lower right x, lower right y + void BoundingBox (double, double, double, double); + +private: + NodeContainer m_leftLeaf; + NetDeviceContainer m_leftLeafDevices; + NodeContainer m_rightLeaf; + NetDeviceContainer m_rightLeafDevices; + NodeContainer m_routers; + NetDeviceContainer m_routerDevices; // just two connecting the routers + // Device containers for the router devices connecting to the leaf devices + NetDeviceContainer m_leftRouterDevices; + NetDeviceContainer m_rightRouterDevices; + Ipv4InterfaceContainer m_leftLeafInterfaces; + Ipv4InterfaceContainer m_leftRouterInterfaces; + Ipv4InterfaceContainer m_rightLeafInterfaces; + Ipv4InterfaceContainer m_rightRouterInterfaces; + Ipv4InterfaceContainer m_routerInterfaces; +}; +} +#endif + + diff --git a/src/contrib/net-anim/point-to-point-grid-helper.cc b/src/contrib/net-anim/point-to-point-grid-helper.cc new file mode 100644 index 000000000..511f83687 --- /dev/null +++ b/src/contrib/net-anim/point-to-point-grid-helper.cc @@ -0,0 +1,240 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Josh Pelkey + */ + +#include "ns3/point-to-point-grid-helper.h" +#include "ns3/animation-interface.h" +#include "ns3/internet-stack-helper.h" +#include "ns3/point-to-point-helper.h" +#include "ns3/node-location.h" +#include "ns3/string.h" +#include "ns3/vector.h" +#include "ns3/log.h" + +#ifdef NS3_MPI +#include +#endif + +NS_LOG_COMPONENT_DEFINE("PointToPointGridHelper"); + +namespace ns3 { + +PointToPointGridHelper::PointToPointGridHelper (uint32_t nRows, + uint32_t nCols, + PointToPointHelper pointToPoint) + : m_xSize (nCols), m_ySize (nRows) +{ + InternetStackHelper stack; + + for (uint32_t y = 0; y < nRows; ++y) + { + NodeContainer rowNodes; + NetDeviceContainer rowDevices; + NetDeviceContainer colDevices; + + for (uint32_t x = 0; x < nCols; ++x) + { + rowNodes.Create(1); + + // install p2p links across the row + if (x > 0) + { + rowDevices.Add (pointToPoint. + Install (rowNodes.Get (x-1), rowNodes.Get (x))); + } + + // install vertical p2p links + if (y > 0) + { + colDevices.Add(pointToPoint. + Install ((m_nodes.at (y-1)).Get (x), rowNodes.Get (x))); + } + } + + m_nodes.push_back(rowNodes); + m_rowDevices.push_back (rowDevices); + + if (y > 0) + m_colDevices.push_back (colDevices); + } +} + +PointToPointGridHelper::PointToPointGridHelper (uint32_t nRows, + uint32_t nCols, PointToPointHelper pointToPoint, + uint16_t mpiSize) + : m_xSize (nCols), m_ySize (nRows) +{ +#ifdef NS3_MPI + for (uint32_t y = 0; y < nRows; ++y) + { + NodeContainer rowNodes; + NetDeviceContainer rowDevices; + NetDeviceContainer colDevices; + + for (uint32_t x = 0; x < nCols; ++x) + { + Ptr node = CreateObject (); + // keep it simple for now, and + // split this up on to two + // processors + if (x > xSize/2) + { + node->SetSystemId(1); + } + else + { + node->SetSystemId(0); + } + rowNodes.Add (node); + + // install p2p links across the row + if (x > 0) + { + rowDevices.Add (pointToPoint. + Install (rowNodes.Get (x-1), rowNodes.Get (x))); + } + + // install vertical p2p links + if (y > 0) + { + colDevices.Add(pointToPoint. + Install ((m_nodes.at (y-1)).Get (x), rowNodes.Get (x))); + } + } + + m_nodes.push_back(rowNodes); + m_rowDevices.push_back (rowDevices); + + if (y > 0) + { + m_colDevices.push_back (colDevices); + } + } +#else + NS_FATAL_ERROR ("Can't use distributed simulator without MPI compiled in"); +#endif +} + +void +PointToPointGridHelper::InstallStack (InternetStackHelper stack) +{ + for (uint32_t i = 0; i < m_nodes.size (); ++i) + { + NodeContainer rowNodes = m_nodes[i]; + for (uint32_t j = 0; j < rowNodes.GetN (); ++j) + { + stack.Install (rowNodes.Get (j)); + } + } +} + +void +PointToPointGridHelper::AssignAddresses (Ipv4AddressHelper rowIp, Ipv4AddressHelper colIp) +{ + // Assign addresses to all row devices in the grid. + // These devices are stored in a vector. Each row + // of the grid has all the row devices in one entry + // of the vector. These entries come in pairs. + for (uint32_t i = 0; i < m_rowDevices.size (); ++i) + { + Ipv4InterfaceContainer rowInterfaces; + NetDeviceContainer rowContainer = m_rowDevices[i]; + for (uint32_t j = 0; j < rowContainer.GetN (); j+=2) + { + rowInterfaces.Add (rowIp.Assign (rowContainer.Get (j))); + rowInterfaces.Add (rowIp.Assign (rowContainer.Get (j+1))); + rowIp.NewNetwork (); + } + m_rowInterfaces.push_back (rowInterfaces); + } + + // Assign addresses to all col devices in the grid. + // These devices are stored in a vector. Each col + // of the grid has all the col devices in one entry + // of the vector. These entries come in pairs. + for (uint32_t i = 0; i < m_colDevices.size (); ++i) + { + Ipv4InterfaceContainer colInterfaces; + NetDeviceContainer colContainer = m_colDevices[i]; + for (uint32_t j = 0; j < colContainer.GetN (); j+=2) + { + colInterfaces.Add (colIp.Assign (colContainer.Get (j))); + colInterfaces.Add (colIp.Assign (colContainer.Get (j+1))); + colIp.NewNetwork (); + } + m_colInterfaces.push_back (colInterfaces); + } +} + +void +PointToPointGridHelper::BoundingBox (double ulx, double uly, + double lrx, double lry) +{ + double xDist = lrx - ulx; + double yDist = lry - uly; + + double xAdder = xDist / m_xSize; + double yAdder = yDist / m_ySize; + double yLoc = yDist / 2; + for (uint32_t i = 0; i < m_ySize; ++i) + { + double xLoc = xDist / 2; + for (uint32_t j = 0; j < m_xSize; ++j) + { + Ptr node = GetNode (i, j); + Ptr loc = node->GetObject (); + if (loc ==0) + { + loc = CreateObject (); + node->AggregateObject (loc); + } + Vector locVec (xLoc, yLoc, 0); + loc->SetLocation (locVec); + + xLoc += xAdder; + } + yLoc += yAdder; + } +} + +Ptr +PointToPointGridHelper::GetNode (uint32_t row, uint32_t col) +{ + return (m_nodes.at (row)).Get (col); +} + +Ipv4Address +PointToPointGridHelper::GetAddress (uint32_t row, uint32_t col) +{ + // Right now this just gets one of the addresses of the + // specified node. The exact device can't be specified. + // If you picture the grid, the address returned is the + // address of the left (row) device of all nodes, with + // the exception of the left-most nodes in the grid; + // in which case the right (row) device address is + // returned + if (col == 0) + { + return (m_rowInterfaces.at (row)).GetAddress (0); + } + else + { + return (m_rowInterfaces.at (row)).GetAddress ((2*col)-1); + } +} + +} // namespace ns3 diff --git a/src/contrib/net-anim/point-to-point-grid-helper.h b/src/contrib/net-anim/point-to-point-grid-helper.h new file mode 100644 index 000000000..1f2781391 --- /dev/null +++ b/src/contrib/net-anim/point-to-point-grid-helper.h @@ -0,0 +1,58 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Josh Pelkey + */ + +#ifndef __POINT_TO_POINT_GRID_HELPER_H__ +#define __POINT_TO_POINT_GRID_HELPER_H__ + +#include + +#include "internet-stack-helper.h" +#include "point-to-point-helper.h" +#include "ipv4-address-helper.h" +#include "ipv4-interface-container.h" +#include "net-device-container.h" + +namespace ns3 { + +class PointToPointGridHelper +{ + public: + PointToPointGridHelper (uint32_t nRows, uint32_t nCols, PointToPointHelper pointToPoint); + PointToPointGridHelper (uint32_t nRows, uint32_t nCols, PointToPointHelper pointToPoint, uint16_t mpiSize); + + Ptr GetNode (uint32_t row, uint32_t col); + Ipv4Address GetAddress (uint32_t row, uint32_t col); + + void InstallStack (InternetStackHelper stack); + void AssignAddresses (Ipv4AddressHelper rowIp, Ipv4AddressHelper colIp); + void BoundingBox (double ulx, double uly, double lrx, double lry); + + private: + uint32_t m_xSize; + uint32_t m_ySize; + std::vector m_rowDevices; + std::vector m_colDevices; + std::vector m_rowInterfaces; + std::vector m_colInterfaces; + std::vector m_nodes; + +}; + +} // namespace ns3 + +#endif /* GRID_HELPER_H */ diff --git a/src/contrib/net-anim/test-dumbbell.cc b/src/contrib/net-anim/test-dumbbell.cc new file mode 100644 index 000000000..8267e6a49 --- /dev/null +++ b/src/contrib/net-anim/test-dumbbell.cc @@ -0,0 +1,119 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: George F. Riley + */ + +#include + +#include "ns3/core-module.h" +#include "ns3/simulator-module.h" +#include "ns3/node-module.h" +#include "ns3/helper-module.h" +#include "ns3/net-anim-module.h" + +using namespace ns3; + +int main (int argc, char *argv[]) +{ + Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (512)); + Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("500kb/s")); + + uint32_t nLeftLeaf = 5; + uint32_t nRightLeaf = 5; + uint32_t nLeaf = 0; // If non-zero, number of both left and right + uint16_t port = 0; // If non zero, port to bind to for anim connection + std::string animFile; // Name of file for animation output + + CommandLine cmd; + cmd.AddValue ("nLeftLeaf", "Number of left side leaf nodes", nLeftLeaf); + cmd.AddValue ("nRightLeaf","Number of right side leaf nodes", nRightLeaf); + cmd.AddValue ("nLeaf", "Number of left and right side leaf nodes", nLeaf); + cmd.AddValue ("port", "Port Number for Remote Animation", port); + cmd.AddValue ("animFile", "File Name for Animation Output", animFile); + + cmd.Parse (argc,argv); + if (nLeaf > 0) + { + nLeftLeaf = nLeaf; + nRightLeaf = nLeaf; + } + + // Create the point-to-point link helpers + PointToPointHelper pointToPointRouter; + pointToPointRouter.SetDeviceAttribute ("DataRate", StringValue ("10Mbps")); + pointToPointRouter.SetChannelAttribute ("Delay", StringValue ("1ms")); + PointToPointHelper pointToPointLeaf; + pointToPointLeaf.SetDeviceAttribute ("DataRate", StringValue ("10Mbps")); + pointToPointLeaf.SetChannelAttribute ("Delay", StringValue ("1ms")); + + PointToPointDumbbellHelper d(nLeftLeaf, pointToPointLeaf, + nRightLeaf, pointToPointLeaf, + pointToPointRouter); + + // Install Stack + InternetStackHelper stack; + d.InstallStack (stack); + + // Assign IP Addresses + d.AssignAddresses(Ipv4AddressHelper("10.1.1.0", "255.255.255.0"), + Ipv4AddressHelper("10.2.1.0", "255.255.255.0"), + Ipv4AddressHelper("10.3.1.0", "255.255.255.0")); + + // Install on/off app on all right side nodes + OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ()); + clientHelper.SetAttribute + ("OnTime", RandomVariableValue (UniformVariable (0, 1))); + clientHelper.SetAttribute + ("OffTime", RandomVariableValue (UniformVariable (0, 1))); + ApplicationContainer clientApps; + + for (uint32_t i = 0; i < d.RightCount(); ++i) + { + // Create an on/off app sending packets to the same leaf right side + AddressValue remoteAddress(InetSocketAddress(d.GetLeftAddress(i), 1000)); + clientHelper.SetAttribute("Remote", remoteAddress); + clientApps.Add(clientHelper.Install(d.GetRight(i))); + } + + clientApps.Start (Seconds (0.0)); + clientApps.Stop (Seconds (10.0)); + + // Set the bounding box for animation + d.BoundingBox(1, 1, 10, 10); + + // Create the animation object and configure for specified output + AnimationInterface anim; + if (port > 0) + { + anim.SetServerPort(port); + } + else if (!animFile.empty()) + { + anim.SetOutputFile(animFile); + } + anim.StartAnimation(); + + // Set up the acutal simulation + Ipv4GlobalRoutingHelper::PopulateRoutingTables (); + + std::cout << "Running the simulation" << std::endl; + Simulator::Run (); + std::cout << "Destroying the simulation" << std::endl; + Simulator::Destroy (); + std::cout << "Stopping the animation" << std::endl; + anim.StopAnimation(); + return 0; +} diff --git a/src/contrib/net-anim/test-grid.cc b/src/contrib/net-anim/test-grid.cc new file mode 100644 index 000000000..a97747e8a --- /dev/null +++ b/src/contrib/net-anim/test-grid.cc @@ -0,0 +1,109 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Josh Pelkey + */ + +#include + +#include "ns3/core-module.h" +#include "ns3/simulator-module.h" +#include "ns3/node-module.h" +#include "ns3/helper-module.h" +#include "ns3/net-anim-module.h" + +using namespace ns3; + +int main (int argc, char *argv[]) +{ + Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (512)); + Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("500kb/s")); + + uint32_t xSize = 5; + uint32_t ySize = 5; + uint16_t port = 0; + std::string animFile; + + CommandLine cmd; + cmd.AddValue ("xSize", "Number of rows of nodes", xSize); + cmd.AddValue ("ySize", "Number of columns of nodes", ySize); + cmd.AddValue ("port", "Port Number for Remote Animation", port); + cmd.AddValue ("animFile", "File Name for Animation Output", animFile); + + cmd.Parse (argc,argv); + if (xSize < 1) + NS_FATAL_ERROR ("Need more nodes for grid."); + if (ySize < 1) + NS_FATAL_ERROR ("Need more nodes for grid."); + if (xSize < 2 && ySize < 2) + NS_FATAL_ERROR ("Need more nodes for grid."); + + PointToPointHelper pointToPoint; + pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); + pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); + + // Create Grid + PointToPointGridHelper grid (xSize, ySize, pointToPoint); + + // Install stack on Grid + InternetStackHelper stack; + grid.InstallStack (stack); + + // Assign Addresses to Grid + grid.AssignAddresses (Ipv4AddressHelper("10.1.1.0", "255.255.255.0"), + Ipv4AddressHelper("10.2.1.0", "255.255.255.0")); + + + OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ()); + clientHelper.SetAttribute + ("OnTime", RandomVariableValue (ConstantVariable (1))); + clientHelper.SetAttribute + ("OffTime", RandomVariableValue (ConstantVariable (0))); + ApplicationContainer clientApps; + + // Create an on/off app sending packets + AddressValue remoteAddress(InetSocketAddress(grid.GetAddress (xSize-1,ySize-1), 1000)); + clientHelper.SetAttribute("Remote", remoteAddress); + clientApps.Add(clientHelper.Install(grid.GetNode (0,0))); + + clientApps.Start (Seconds (0.0)); + clientApps.Stop (Seconds (1.5)); + + // Set the bounding box for animation + grid.BoundingBox(1, 1, 10, 10); + + // Create the animation object and configure for specified output + AnimationInterface anim; + if (port > 0) + { + anim.SetServerPort(port); + } + else if (!animFile.empty()) + { + anim.SetOutputFile(animFile); + } + anim.StartAnimation(); + + // Set up the actual simulation + Ipv4GlobalRoutingHelper::PopulateRoutingTables (); + + std::cout << "Running the simulation" << std::endl; + Simulator::Run (); + std::cout << "Destroying the simulation" << std::endl; + Simulator::Destroy (); + std::cout << "Stopping the animation" << std::endl; + anim.StopAnimation(); + return 0; +} diff --git a/src/contrib/net-anim/wscript b/src/contrib/net-anim/wscript new file mode 100644 index 000000000..0e0c8dd30 --- /dev/null +++ b/src/contrib/net-anim/wscript @@ -0,0 +1,25 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + obj = bld.create_ns3_module('net-anim') + obj.source = [ + 'point-to-point-dumbbell-helper.cc', + 'point-to-point-grid-helper.cc', + 'animation-interface.cc', + 'node-location.cc' + ] + + headers = bld.new_task_gen('ns3header') + headers.module = 'net-anim' + headers.source = [ + 'point-to-point-dumbbell-helper.h', + 'point-to-point-grid-helper.h', + 'animation-interface.h', + 'node-location.h' + ] + + obj = bld.create_ns3_program('test-dumbbell', ['net-anim', 'point-to-point', 'internet-stack']) + obj.source = 'test-dumbbell.cc' + + obj = bld.create_ns3_program('test-grid', ['net-anim', 'point-to-point', 'internet-stack']) + obj.source = 'test-grid.cc' diff --git a/src/core/attribute-test-suite.cc b/src/core/attribute-test-suite.cc new file mode 100644 index 000000000..e240f2753 --- /dev/null +++ b/src/core/attribute-test-suite.cc @@ -0,0 +1,1175 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "test.h" +#include "object.h" +#include "boolean.h" +#include "integer.h" +#include "uinteger.h" +#include "enum.h" +#include "string.h" +#include "random-variable.h" +#include "double.h" +#include "object-vector.h" +#include "traced-value.h" +#include "callback.h" +#include "trace-source-accessor.h" +#include "pointer.h" + +namespace ns3 { + +class ValueClassTest +{ +public: + ValueClassTest () {} +private: + int m_v; +}; +bool operator != (const ValueClassTest &a, const ValueClassTest &b) +{ + return true; +} +std::ostream & operator << (std::ostream &os, ValueClassTest v) +{ + return os; +} +std::istream & operator >> (std::istream &is, ValueClassTest &v) +{ + return is; +} +ATTRIBUTE_HELPER_HEADER (ValueClassTest); +ATTRIBUTE_HELPER_CPP (ValueClassTest); + +class Derived : public Object +{ +public: + static TypeId GetTypeId (void) { + static TypeId tid = TypeId ("Derived") + .SetParent () + ; + return tid; + } +}; + +class AttributeObjectTest : public Object +{ +public: + enum Test_e { + TEST_A, + TEST_B, + TEST_C + }; + static TypeId GetTypeId (void) { + static TypeId tid = TypeId ("ns3::AttributeObjectTest") + .SetParent () + .HideFromDocumentation () + .AddAttribute ("TestBoolName", "help text", + BooleanValue (false), + MakeBooleanAccessor (&AttributeObjectTest::m_boolTest), + MakeBooleanChecker ()) + .AddAttribute ("TestBoolA", "help text", + BooleanValue (false), + MakeBooleanAccessor (&AttributeObjectTest::DoSetTestB, + &AttributeObjectTest::DoGetTestB), + MakeBooleanChecker ()) + .AddAttribute ("TestInt16", "help text", + IntegerValue (-2), + MakeIntegerAccessor (&AttributeObjectTest::m_int16), + MakeIntegerChecker ()) + .AddAttribute ("TestInt16WithBounds", "help text", + IntegerValue (-2), + MakeIntegerAccessor (&AttributeObjectTest::m_int16WithBounds), + MakeIntegerChecker (-5, 10)) + .AddAttribute ("TestInt16SetGet", "help text", + IntegerValue (6), + MakeIntegerAccessor (&AttributeObjectTest::DoSetInt16, + &AttributeObjectTest::DoGetInt16), + MakeIntegerChecker ()) + .AddAttribute ("TestUint8", "help text", + UintegerValue (1), + MakeUintegerAccessor (&AttributeObjectTest::m_uint8), + MakeUintegerChecker ()) + .AddAttribute ("TestEnum", "help text", + EnumValue (TEST_A), + MakeEnumAccessor (&AttributeObjectTest::m_enum), + MakeEnumChecker (TEST_A, "TestA", + TEST_B, "TestB", + TEST_C, "TestC")) + .AddAttribute ("TestRandom", "help text", + RandomVariableValue (ConstantVariable (1.0)), + MakeRandomVariableAccessor (&AttributeObjectTest::m_random), + MakeRandomVariableChecker ()) + .AddAttribute ("TestFloat", "help text", + DoubleValue (-1.1), + MakeDoubleAccessor (&AttributeObjectTest::m_float), + MakeDoubleChecker ()) + .AddAttribute ("TestVector1", "help text", + ObjectVectorValue (), + MakeObjectVectorAccessor (&AttributeObjectTest::m_vector1), + MakeObjectVectorChecker ()) + .AddAttribute ("TestVector2", "help text", + ObjectVectorValue (), + MakeObjectVectorAccessor (&AttributeObjectTest::DoGetVectorN, + &AttributeObjectTest::DoGetVector), + MakeObjectVectorChecker ()) + .AddAttribute ("IntegerTraceSource1", "help text", + IntegerValue (-2), + MakeIntegerAccessor (&AttributeObjectTest::m_intSrc1), + MakeIntegerChecker ()) + .AddAttribute ("IntegerTraceSource2", "help text", + IntegerValue (-2), + MakeIntegerAccessor (&AttributeObjectTest::DoSetIntSrc, + &AttributeObjectTest::DoGetIntSrc), + MakeIntegerChecker ()) + .AddAttribute ("ValueClassSource", "help text", + ValueClassTestValue (ValueClassTest ()), + MakeValueClassTestAccessor (&AttributeObjectTest::m_valueSrc), + MakeValueClassTestChecker ()) + .AddTraceSource ("Source1", "help test", + MakeTraceSourceAccessor (&AttributeObjectTest::m_intSrc1)) + .AddTraceSource ("Source2", "help text", + MakeTraceSourceAccessor (&AttributeObjectTest::m_cb)) + .AddTraceSource ("ValueSource", "help text", + MakeTraceSourceAccessor (&AttributeObjectTest::m_valueSrc)) + .AddAttribute ("Pointer", "help text", + PointerValue (), + MakePointerAccessor (&AttributeObjectTest::m_ptr), + MakePointerChecker ()) + .AddAttribute ("Callback", "help text", + CallbackValue (), + MakeCallbackAccessor (&AttributeObjectTest::m_cbValue), + MakeCallbackChecker ()) + ; + + return tid; + } + + void AddToVector1 (void) {m_vector1.push_back (CreateObject ());} + void AddToVector2 (void) {m_vector2.push_back (CreateObject ());} + void InvokeCb (double a, int b, float c) {m_cb (a,b,c);} + + void InvokeCbValue (int8_t a) + { + if (!m_cbValue.IsNull ()) { + m_cbValue (a); + } + } + +private: + void DoSetTestB (bool v) {m_boolTestA = v;} + bool DoGetTestB (void) const {return m_boolTestA;} + int16_t DoGetInt16 (void) const {return m_int16SetGet;} + void DoSetInt16 (int16_t v) {m_int16SetGet = v;} + uint32_t DoGetVectorN (void) const {return m_vector2.size ();} + Ptr DoGetVector (uint32_t i) const {return m_vector2[i];} + bool DoSetIntSrc (int8_t v) {m_intSrc2 = v; return true;} + int8_t DoGetIntSrc (void) const {return m_intSrc2;} + + bool m_boolTestA; + bool m_boolTest; + int16_t m_int16; + int16_t m_int16WithBounds; + int16_t m_int16SetGet; + uint8_t m_uint8; + float m_float; + enum Test_e m_enum; + RandomVariable m_random; + std::vector > m_vector1; + std::vector > m_vector2; + Callback m_cbValue; + TracedValue m_intSrc1; + TracedValue m_intSrc2; + TracedCallback m_cb; + TracedValue m_valueSrc; + Ptr m_ptr; +}; + +NS_OBJECT_ENSURE_REGISTERED (AttributeObjectTest); + +// =========================================================================== +// Test case template used for generic Attribute Value types -- used to make +// sure that Attributes work as expected. +// =========================================================================== +template +class AttributeTestCase : public TestCase +{ +public: + AttributeTestCase (std::string description); + virtual ~AttributeTestCase (); + +private: + virtual bool DoRun (void); + + bool CheckGetCodePaths (Ptr p, std::string attributeName, std::string expectedString, T expectedValue); +}; + +template +AttributeTestCase::AttributeTestCase (std::string description) + : TestCase (description) +{ +} + +template +AttributeTestCase::~AttributeTestCase () +{ +} + +template bool +AttributeTestCase::CheckGetCodePaths ( + Ptr p, + std::string attributeName, + std::string expectedString, + T expectedValue) +{ + StringValue stringValue; + T actualValue; + + // + // Get an Attribute value through its StringValue representation. + // + bool ok = p->GetAttributeFailSafe (attributeName.c_str (), stringValue); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not GetAttributeFailSafe() " << attributeName << " from Object"); + NS_TEST_ASSERT_MSG_EQ (stringValue.Get (), expectedString, "Got unexpected StringValue representation"); + + // + // Get the existing boolean value through its particular type representation. + // + ok = p->GetAttributeFailSafe (attributeName.c_str (), actualValue); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not GetAttributeFailSafe() " << attributeName << " from Object"); + NS_TEST_ASSERT_MSG_EQ (actualValue.Get (), expectedValue.Get (), "Got unexpected Value from Object"); + + return GetErrorStatus (); +} + +// =========================================================================== +// The actual Attribute type test cases are specialized for each Attribute type +// =========================================================================== +template <> bool +AttributeTestCase::DoRun (void) +{ + AttributeList attrs; + Ptr p; + bool ok; + + // + // Test setting a boolean via string representation using AttributeList. + // + ok = attrs.SetFailSafe ("ns3::AttributeObjectTest::TestBoolName", StringValue ("false")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetFailSafe() \"ns3::AttributeObjectTest::TestBoolName\" into AttributeList"); + + // + // Create an object using that attribute list (which should therefore have the + // boolean from above set to false. + // + p = CreateObjectWithAttributes (attrs); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObjectWithAttributes"); + + ok = CheckGetCodePaths (p, "TestBoolName", "false", BooleanValue (false)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly from CreateObjectWithAttributes"); + + // + // Set the default value of the BooleanValue and create an object. The new + // default value should stick. + // + AttributeList::GetGlobal ()->SetFailSafe ("ns3::AttributeObjectTest::TestBoolName", StringValue ("true")); + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + ok = CheckGetCodePaths (p, "TestBoolName", "true", BooleanValue (true)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by default value"); + + // + // Set the default value of the BooleanValue the other way and create an object. + // The new default value should stick. + // + AttributeList::GetGlobal ()->SetFailSafe ("ns3::AttributeObjectTest::TestBoolName", StringValue ("false")); + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + ok = CheckGetCodePaths (p, "TestBoolName", "false", BooleanValue (false)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not et properly by default value"); + + // + // Set the BooleanValue Attribute to true via SetAttributeFailSafe path. + // + ok = p->SetAttributeFailSafe("TestBoolName", StringValue ("true")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() \"TestBoolName\" to true"); + + ok = CheckGetCodePaths (p, "TestBoolName", "true", BooleanValue (true)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via StringValue"); + + // + // Set the BooleanValue to false via SetAttributeFailSafe path. + // + ok = p->SetAttributeFailSafe("TestBoolName", StringValue ("false")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() \"TestBoolName\" to false"); + + ok = CheckGetCodePaths (p, "TestBoolName", "false", BooleanValue (false)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via StringValue"); + + // + // Create an object using individually provided StringValue Attribute. + // + p = CreateObjectWithAttributes ("TestBoolName", StringValue ("true")); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObjectWithAttributes"); + + ok = CheckGetCodePaths (p, "TestBoolName", "true", BooleanValue (true)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by CreateObjectWithAttributes() with StringValue"); + + // + // Create an object using individually provided BooleanValue Attribute. + // + p = CreateObjectWithAttributes ("TestBoolName", BooleanValue (false)); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObjectWithAttributes"); + + ok = CheckGetCodePaths (p, "TestBoolName", "false", BooleanValue (false)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by CreateObjectWithAttributes() with BooleanValue"); + + // + // The previous object-based tests checked access directly. Now check through + // setter and getter. The code here looks the same, but the underlying + // attribute is declared differently in the object. First make sure we can set + // to true. + // + ok = p->SetAttributeFailSafe("TestBoolA", StringValue ("true")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a boolean value to true"); + + ok = CheckGetCodePaths (p, "TestBoolA", "true", BooleanValue (true)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() (getter/setter) via StringValue"); + + // + // Now Set the BooleanValue to false via the setter. + // + ok = p->SetAttributeFailSafe("TestBoolA", StringValue ("false")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a boolean value to false"); + + ok = CheckGetCodePaths (p, "TestBoolA", "false", BooleanValue (false)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() (getter/setter) via StringValue"); + + return GetErrorStatus (); +} + +template <> bool +AttributeTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // When the object is first created, the Attribute should have the default + // value. + // + ok = CheckGetCodePaths (p, "TestInt16", "-2", IntegerValue (-2)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by default value"); + + // + // Set the Attribute to a negative value through a StringValue. + // + ok = p->SetAttributeFailSafe("TestInt16", StringValue ("-5")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via StringValue to -5"); + + ok = CheckGetCodePaths (p, "TestInt16", "-5", IntegerValue (-5)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via StringValue"); + + // + // Set the Attribute to a positive value through a StringValue. + // + ok = p->SetAttributeFailSafe("TestInt16", StringValue ("+2")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via StringValue to +2"); + + ok = CheckGetCodePaths (p, "TestInt16", "2", IntegerValue (2)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via StringValue"); + + // + // Set the Attribute to the most negative value of the signed 16-bit range. + // + ok = p->SetAttributeFailSafe("TestInt16", StringValue ("-32768")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via StringValue to -32768"); + + ok = CheckGetCodePaths (p, "TestInt16", "-32768", IntegerValue (-32768)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() (most negative) via StringValue"); + + // + // Try to set the Attribute past the most negative value of the signed 16-bit + // range and make sure the underlying attribute is unchanged. + // + ok = p->SetAttributeFailSafe("TestInt16", StringValue ("-32769")); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via StringValue to -32769"); + + ok = CheckGetCodePaths (p, "TestInt16", "-32768", IntegerValue (-32768)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Error in SetAttributeFailSafe() but value changes"); + + // + // Set the Attribute to the most positive value of the signed 16-bit range. + // + ok = p->SetAttributeFailSafe("TestInt16", StringValue ("32767")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via StringValue to 32767"); + + ok = CheckGetCodePaths (p, "TestInt16", "32767", IntegerValue (32767)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() (most positive) via StringValue"); + + // + // Try to set the Attribute past the most positive value of the signed 16-bit + // range and make sure the underlying attribute is unchanged. + // + ok = p->SetAttributeFailSafe("TestInt16", StringValue ("32768")); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via StringValue to 32768"); + + ok = CheckGetCodePaths (p, "TestInt16", "32767", IntegerValue (32767)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Error in SetAttributeFailSafe() but value changes"); + + // + // Attributes can have limits other than the intrinsic limits of the + // underlying data types. These limits are specified in the Object. + // + ok = p->SetAttributeFailSafe("TestInt16WithBounds", IntegerValue (10)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to 10"); + + ok = CheckGetCodePaths (p, "TestInt16WithBounds", "10", IntegerValue (10)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() (positive limit) via StringValue"); + + // + // Set the Attribute past the positive limit. + // + ok = p->SetAttributeFailSafe("TestInt16WithBounds", IntegerValue (11)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via IntegerValue to 11"); + + ok = CheckGetCodePaths (p, "TestInt16WithBounds", "10", IntegerValue (10)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Error in SetAttributeFailSafe() but value changes"); + + // + // Set the Attribute at the negative limit. + // + ok = p->SetAttributeFailSafe("TestInt16WithBounds", IntegerValue (-5)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to -5"); + + ok = CheckGetCodePaths (p, "TestInt16WithBounds", "-5", IntegerValue (-5)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() (negative limit) via StringValue"); + + // + // Set the Attribute past the negative limit. + // + ok = p->SetAttributeFailSafe("TestInt16WithBounds", IntegerValue (-6)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via IntegerValue to -6"); + + ok = CheckGetCodePaths (p, "TestInt16WithBounds", "-5", IntegerValue (-5)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Error in SetAttributeFailSafe() but value changes"); + + return GetErrorStatus (); +} + +template <> bool +AttributeTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // When the object is first created, the Attribute should have the default + // value. + // + ok = CheckGetCodePaths (p, "TestUint8", "1", UintegerValue (1)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by default value");; + + // + // Set the Attribute to zero. + // + ok = p->SetAttributeFailSafe("TestUint8", UintegerValue (0)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() to 0"); + + ok = CheckGetCodePaths (p, "TestUint8", "0", UintegerValue (0)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via StringValue"); + + // + // Set the Attribute to the most positive value of the unsigned 8-bit range. + // + ok = p->SetAttributeFailSafe("TestUint8", UintegerValue (255)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() to 255"); + + ok = CheckGetCodePaths (p, "TestUint8", "255", UintegerValue (255)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() (positive limit) via UintegerValue"); + + // + // Try and set the Attribute past the most positive value of the unsigned + // 8-bit range. + // + ok = p->SetAttributeFailSafe("TestUint8", UintegerValue (256)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() to 256"); + + ok = CheckGetCodePaths (p, "TestUint8", "255", UintegerValue (255)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Error in SetAttributeFailSafe() but value changes"); + + // + // Set the Attribute to the most positive value of the unsigned 8-bit range + // through a StringValue. + // + ok = p->SetAttributeFailSafe("TestUint8", StringValue ("255")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via StringValue to 255"); + + ok = CheckGetCodePaths (p, "TestUint8", "255", UintegerValue (255)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via StringValue"); + + // + // Try and set the Attribute past the most positive value of the unsigned + // 8-bit range through a StringValue. + // + ok = p->SetAttributeFailSafe("TestUint8", StringValue ("256")); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via StringValue to 256"); + + ok = CheckGetCodePaths (p, "TestUint8", "255", UintegerValue (255)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Error in SetAttributeFailSafe() but value changes"); + + // + // Try to set the Attribute to a negative StringValue. + // + ok = p->SetAttributeFailSafe("TestUint8", StringValue ("-1")); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via StringValue to -1"); + + return GetErrorStatus (); +} + +template <> bool +AttributeTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // When the object is first created, the Attribute should have the default + // value. + // + ok = CheckGetCodePaths (p, "TestFloat", "-1.1", DoubleValue ((float)-1.1)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by default value"); + + // + // Set the Attribute. + // + ok = p->SetAttributeFailSafe("TestFloat", DoubleValue ((float)2.3)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() to 2.3"); + + ok = CheckGetCodePaths (p, "TestFloat", "2.3", DoubleValue ((float)2.3)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via DoubleValue"); + + return GetErrorStatus (); +} + +template <> bool +AttributeTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // When the object is first created, the Attribute should have the default + // value. + // + ok = CheckGetCodePaths (p, "TestEnum", "TestA", EnumValue (AttributeObjectTest::TEST_A)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by default value"); + + // + // Set the Attribute using the EnumValue type. + // + ok = p->SetAttributeFailSafe("TestEnum", EnumValue (AttributeObjectTest::TEST_C)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() to TEST_C"); + + ok = CheckGetCodePaths (p, "TestEnum", "TestC", EnumValue (AttributeObjectTest::TEST_C)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via EnumValue"); + + // + // Set the Attribute using the StringValue type. + // + ok = p->SetAttributeFailSafe("TestEnum", StringValue ("TestB")); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() to TEST_B"); + + ok = CheckGetCodePaths (p, "TestEnum", "TestB", EnumValue (AttributeObjectTest::TEST_B)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Attribute not set properly by SetAttributeFailSafe() via StringValue"); + + // + // Try to set the Attribute to a bogus enum using the StringValue type and + // make sure the underlying value doesn't change. + // + ok = p->SetAttributeFailSafe("TestEnum", StringValue ("TestD")); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() to TEST_D"); // + + ok = CheckGetCodePaths (p, "TestEnum", "TestB", EnumValue (AttributeObjectTest::TEST_B)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Error in SetAttributeFailSafe() but value changes"); + + // + // Try to set the Attribute to a bogus enum using an integer implicit conversion + // and make sure the underlying value doesn't change. + // + ok = p->SetAttributeFailSafe("TestEnum", EnumValue (5)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() to 5"); + + ok = CheckGetCodePaths (p, "TestEnum", "TestB", EnumValue (AttributeObjectTest::TEST_B)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Error in SetAttributeFailSafe() but value changes"); + + return GetErrorStatus (); +} + +template <> bool +AttributeTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // Try to set a UniformVariable + // + ok = p->SetAttributeFailSafe("TestRandom", RandomVariableValue (UniformVariable (0., 1.))); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a UniformVariable"); + + // + // Try to set a ConstantVariable + // + ok = p->SetAttributeFailSafe("TestRandom", RandomVariableValue (ConstantVariable (10.))); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a UniformVariable"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test case for Object Vector Attributes. Generic nature is pretty much lost +// here, so we just break the class out. +// =========================================================================== +class ObjectVectorAttributeTestCase : public TestCase +{ +public: + ObjectVectorAttributeTestCase (std::string description); + virtual ~ObjectVectorAttributeTestCase () {} + +private: + virtual bool DoRun (void); +}; + +ObjectVectorAttributeTestCase::ObjectVectorAttributeTestCase (std::string description) + : TestCase (description) +{ +} + +bool +ObjectVectorAttributeTestCase::DoRun (void) +{ + Ptr p; + ObjectVectorValue vector; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // When the object is first created, the Attribute should have no items in + // the vector. + // + p->GetAttribute ("TestVector1", vector); + NS_TEST_ASSERT_MSG_EQ (vector.GetN (), 0, "Initial count of ObjectVectorValue \"TestVector1\" should be zero"); + + // + // Adding to the attribute shouldn't affect the value we already have. + // + p->AddToVector1 (); + NS_TEST_ASSERT_MSG_EQ (vector.GetN (), 0, "Initial count of ObjectVectorValue \"TestVector1\" should still be zero"); + + // + // Getting the attribute again should update the value. + // + p->GetAttribute ("TestVector1", vector); + NS_TEST_ASSERT_MSG_EQ (vector.GetN (), 1, "ObjectVectorValue \"TestVector1\" should be incremented"); + + // + // Get the Object pointer from the value. + // + Ptr a = vector.Get (0); + NS_TEST_ASSERT_MSG_NE (a, 0, "Ptr from VectorValue \"TestVector1\" is zero"); + + // + // Adding to the attribute shouldn't affect the value we already have. + // + p->AddToVector1 (); + NS_TEST_ASSERT_MSG_EQ (vector.GetN (), 1, "Count of ObjectVectorValue \"TestVector1\" should still be one"); + + // + // Getting the attribute again should update the value. + // + p->GetAttribute ("TestVector1", vector); + NS_TEST_ASSERT_MSG_EQ (vector.GetN (), 2, "ObjectVectorValue \"TestVector1\" should be incremented"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Trace sources with value semantics can be used like Attributes. Make sure +// we can use them that way. +// =========================================================================== +class IntegerTraceSourceAttributeTestCase : public TestCase +{ +public: + IntegerTraceSourceAttributeTestCase (std::string description); + virtual ~IntegerTraceSourceAttributeTestCase () {} + +private: + virtual bool DoRun (void); +}; + +IntegerTraceSourceAttributeTestCase::IntegerTraceSourceAttributeTestCase (std::string description) + : TestCase (description) +{ +} + +bool +IntegerTraceSourceAttributeTestCase::DoRun (void) +{ + Ptr p; + IntegerValue iv; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // When the object is first created, the Attribute should have the default + // value. + // + p->GetAttribute ("IntegerTraceSource1", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -2, "Attribute not set properly by default value"); + + // + // Set the Attribute to a positive value through an IntegerValue. + // + ok = p->SetAttributeFailSafe("IntegerTraceSource1", IntegerValue (5)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to 5"); + + p->GetAttribute ("IntegerTraceSource1", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 5, "Attribute not set properly by SetAttributeFailSafe() via IntegerValue"); + + // + // Limits should work. + // + ok = p->SetAttributeFailSafe("IntegerTraceSource1", IntegerValue (127)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to 127"); + + ok = p->SetAttributeFailSafe("IntegerTraceSource1", IntegerValue (128)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via IntegerValue to 128"); + + ok = p->SetAttributeFailSafe("IntegerTraceSource1", IntegerValue (-128)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to -128"); + + ok = p->SetAttributeFailSafe("IntegerTraceSource1", IntegerValue (-129)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via IntegerValue to -129"); + + // + // When the object is first created, the Attribute should have the default + // value. + // + p->GetAttribute ("IntegerTraceSource2", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -2, "Attribute not set properly by default value"); + + // + // Set the Attribute to a positive value through an IntegerValue. + // + ok = p->SetAttributeFailSafe("IntegerTraceSource2", IntegerValue (5)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to 5"); + + p->GetAttribute ("IntegerTraceSource2", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 5, "Attribute not set properly by SetAttributeFailSafe() via IntegerValue"); + + // + // Limits should work. + // + ok = p->SetAttributeFailSafe("IntegerTraceSource2", IntegerValue (127)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to 127"); + + ok = p->SetAttributeFailSafe("IntegerTraceSource2", IntegerValue (128)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via IntegerValue to 128"); + + ok = p->SetAttributeFailSafe("IntegerTraceSource2", IntegerValue (-128)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to -128"); + + ok = p->SetAttributeFailSafe("IntegerTraceSource2", IntegerValue (-129)); + NS_TEST_ASSERT_MSG_EQ (ok, false, "Unexpectedly could SetAttributeFailSafe() via IntegerValue to -129"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Trace sources used like Attributes must also work as trace sources. Make +// sure we can use them that way. +// =========================================================================== +class IntegerTraceSourceTestCase : public TestCase +{ +public: + IntegerTraceSourceTestCase (std::string description); + virtual ~IntegerTraceSourceTestCase () {} + +private: + virtual bool DoRun (void); + + void NotifySource1 (int8_t old, int8_t n) {m_got1 = n;} + int64_t m_got1; +}; + +IntegerTraceSourceTestCase::IntegerTraceSourceTestCase (std::string description) + : TestCase (description) +{ +} + +bool +IntegerTraceSourceTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // Check to make sure changing an Attibute value triggers a trace callback + // that sets a member variable. + // + m_got1 = 1234; + + ok = p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (-1)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to -1"); + + // + // Source1 is declared as a TraceSourceAccessor to m_intSrc1. This m_intSrc1 + // is also declared as an Integer Attribute. We just checked to make sure we + // could set it using an IntegerValue through its IntegerTraceSource1 "persona." + // We should also be able to hook a trace source to the underlying variable. + // + ok = p->TraceConnectWithoutContext ("Source1", MakeCallback (&IntegerTraceSourceTestCase::NotifySource1, this)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not TraceConnectWithoutContext() \"Source1\" to NodifySource1()"); + + // + // When we set the IntegerValue that now underlies both the Integer Attribute + // and the trace source, the trace should fire and call NotifySource1 which + // will set m_got1 to the new value. + // + ok = p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (0)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to 0"); + + NS_TEST_ASSERT_MSG_EQ (m_got1, 0, "Hitting a TracedValue does not cause trace callback to be called"); + + // + // Now disconnect from the trace source and ensure that the trace callback + // is not called if the trace source is hit. + // + ok = p->TraceDisconnectWithoutContext ("Source1", MakeCallback (&IntegerTraceSourceTestCase::NotifySource1, this)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not TraceConnectWithoutContext() \"Source1\" to NodifySource1()"); + + ok = p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (1)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() via IntegerValue to 1"); + + NS_TEST_ASSERT_MSG_EQ (m_got1, 0, "Hitting a TracedValue after disconnect still causes callback"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Trace sources used like Attributes must also work as trace sources. Make +// sure we can use them that way. +// =========================================================================== +class TracedCallbackTestCase : public TestCase +{ +public: + TracedCallbackTestCase (std::string description); + virtual ~TracedCallbackTestCase () {} + +private: + virtual bool DoRun (void); + + void NotifySource2 (double a, int b, float c) {m_got2 = a;} + + double m_got2; +}; + +TracedCallbackTestCase::TracedCallbackTestCase (std::string description) + : TestCase (description) +{ +} + +bool +TracedCallbackTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // Initialize the + // + m_got2 = 4.3; + + // + // Invoke the callback that lies at the heart of this test. We have a + // method InvokeCb() that just executes m_cb(). The variable m_cb is + // declared as a TracedCallback. This kind of beast + // is like a callback but can call a list of targets. This list should + // be empty so nothing should happen now. Specifically, m_got2 shouldn't + // have changed. + // + p->InvokeCb (1.0, -5, 0.0); + NS_TEST_ASSERT_MSG_EQ (m_got2, 4.3, "Invoking a newly created TracedCallback results in an unexpected callback"); + + // + // Now, wire the TracedCallback up to a trace sink. This sink will just set + // m_got2 to the first argument. + // + ok = p->TraceConnectWithoutContext ("Source2", MakeCallback (&TracedCallbackTestCase::NotifySource2, this)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not TraceConnectWithoutContext() to NotifySource2"); + + // + // Now if we invoke the callback, the trace source should fire and m_got2 + // should be set in the trace sink. + // + p->InvokeCb (1.0, -5, 0.0); + NS_TEST_ASSERT_MSG_EQ (m_got2, 1.0, "Invoking TracedCallback does not result in trace callback"); + + // + // Now, disconnect the trace sink and see what happens when we invoke the + // callback again. Of course, the trace should not happen and m_got2 + // should remain unchanged. + // + ok = p->TraceDisconnectWithoutContext ("Source2", MakeCallback (&TracedCallbackTestCase::NotifySource2, this)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not TraceDisconnectWithoutContext() from NotifySource2"); + + p->InvokeCb (-1.0, -5, 0.0); + NS_TEST_ASSERT_MSG_EQ (m_got2, 1.0, "Invoking disconnected TracedCallback unexpectedly results in trace callback"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Smart pointers (Ptr) are central to our architecture, so they must work as +// attributes. +// =========================================================================== +class PointerAttributeTestCase : public TestCase +{ +public: + PointerAttributeTestCase (std::string description); + virtual ~PointerAttributeTestCase () {} + +private: + virtual bool DoRun (void); + + void NotifySource2 (double a, int b, float c) {m_got2 = a;} + + double m_got2; +}; + +PointerAttributeTestCase::PointerAttributeTestCase (std::string description) + : TestCase (description) +{ +} + +bool +PointerAttributeTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // We have declared a PointerValue Attribute named "Pointer" with a pointer + // checker of type Derived. This means that we should be able to pull out + // a Ptr with the initial value (which is 0). + // + PointerValue ptr; + p->GetAttribute ("Pointer", ptr); + Ptr derived = ptr.Get (); + NS_TEST_ASSERT_MSG_EQ (derived, 0, "Unexpectedly found non-null pointer in newly initialized PointerValue Attribute"); + + // + // Now, lets create an Object of type Derived and set the local Ptr to point + // to that object. We can then set the PointerValue Attribute to that Ptr. + // + derived = Create (); + ok = p->SetAttributeFailSafe("Pointer", PointerValue (derived)); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a PointerValue of the correct type"); + + // + // Pull the value back out of the Attribute and make sure it points to the + // correct object. + // + p->GetAttribute ("Pointer", ptr); + Ptr stored = ptr.Get (); + NS_TEST_ASSERT_MSG_EQ (stored, derived, "Retreived Attribute does not match stored PointerValue"); + + // + // We should be able to use the Attribute Get() just like GetObject, + // So see if we can get a Ptr out of the Ptr we stored. + // This should be a pointer to the same physical memory since its the + // same object. + // + p->GetAttribute ("Pointer", ptr); + Ptr storedBase = ptr.Get (); + NS_TEST_ASSERT_MSG_EQ (storedBase, stored, "Retreived Ptr does not match stored Ptr"); + + // + // If we try to Get() something that is unrelated to what we stored, we should + // retrieve a 0. + // + p->GetAttribute ("Pointer", ptr); + Ptr x = ptr.Get (); + NS_TEST_ASSERT_MSG_EQ (x, 0, "Unexpectedly retreived unrelated Ptr from stored Ptr"); + + // + // We should be able to create the object From a list of attributes. + // + p = CreateObjectWithAttributes ("Pointer", PointerValue (Create ())); + NS_TEST_ASSERT_MSG_NE (p, 0, "Could not create Object with PointerValue Attribute in Attribute List"); + + derived = 0; + p->GetAttribute ("Pointer", ptr); + derived = ptr.Get (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Retrieved zero PointerValue Attribute after initializing to non-zero Ptr"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test the Attributes of type CallbackVale. +// =========================================================================== +class CallbackValueTestCase : public TestCase +{ +public: + CallbackValueTestCase (std::string description); + virtual ~CallbackValueTestCase () {} + + void InvokeCbValue (int8_t a) + { + if (!m_cbValue.IsNull ()) { + m_cbValue (a); + } + } + +private: + virtual bool DoRun (void); + + Callback m_cbValue; + + void NotifyCallbackValue (int8_t a) {m_gotCbValue = a;} + + int16_t m_gotCbValue; +}; + +CallbackValueTestCase::CallbackValueTestCase (std::string description) + : TestCase (description) +{ +} + +bool +CallbackValueTestCase::DoRun (void) +{ + Ptr p; + bool ok; + + p = CreateObject (); + NS_TEST_ASSERT_MSG_NE (p, 0, "Unable to CreateObject"); + + // + // The member variable m_cbValue is declared as a Callback. The + // Attibute named "Callback" also points to m_cbValue and allows us to set the + // callback using that Attribute. + // + // NotifyCallbackValue is going to be the target of the callback and will just set + // m_gotCbValue to its single parameter. This will be the parameter from the + // callback invocation. The method InvokeCbValue() just invokes the m_cbValue + // callback if it is non-null. + // + m_gotCbValue = 1; + + // + // If we invoke the callback (which has not been set) nothing should happen. + // Further, nothing should happen when we initialize the callback (it shouldn't + // accidentally fire). + // + p->InvokeCbValue (2); + CallbackValue cbValue = MakeCallback (&CallbackValueTestCase::NotifyCallbackValue, this); + + NS_TEST_ASSERT_MSG_EQ (m_gotCbValue, 1, "Callback unexpectedly fired"); + + ok = p->SetAttributeFailSafe ("Callback", cbValue); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a CallbackValue"); + + // + // Now that the callback has been set, invoking it should set m_gotCbValue. + // + p->InvokeCbValue (2); + NS_TEST_ASSERT_MSG_EQ (m_gotCbValue, 2, "Callback Attribute set by CallbackValue did not fire"); + + ok = p->SetAttributeFailSafe ("Callback", CallbackValue (MakeNullCallback ())); + NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a null CallbackValue"); + + // + // If the callback has been set to a null callback, it should no longer fire. + // + p->InvokeCbValue (3); + NS_TEST_ASSERT_MSG_EQ (m_gotCbValue, 2, "Callback Attribute set to null callback unexpectedly fired"); + + return GetErrorStatus (); +} + +// =========================================================================== +// The Test Suite that glues all of the Test Cases together. +// =========================================================================== +class AttributesTestSuite : public TestSuite +{ +public: + AttributesTestSuite (); +}; + +AttributesTestSuite::AttributesTestSuite () + : TestSuite ("attributes", UNIT) +{ + AddTestCase (new AttributeTestCase ("Check Attributes of type BooleanValue")); + AddTestCase (new AttributeTestCase ("Check Attributes of type IntegerValue")); + AddTestCase (new AttributeTestCase ("Check Attributes of type UintegerValue")); + AddTestCase (new AttributeTestCase ("Check Attributes of type DoubleValue")); + AddTestCase (new AttributeTestCase ("Check Attributes of type EnumValue")); + AddTestCase (new AttributeTestCase ("Check Attributes of type RandomVariableValue")); + AddTestCase (new ObjectVectorAttributeTestCase ("Check Attributes of type ObjectVectorValue")); + AddTestCase (new IntegerTraceSourceAttributeTestCase ("Ensure TracedValue can be set like IntegerValue")); + AddTestCase (new IntegerTraceSourceTestCase ("Ensure TracedValue also works as trace source")); + AddTestCase (new TracedCallbackTestCase ("Ensure TracedCallback works as trace source")); + AddTestCase (new PointerAttributeTestCase ("Check Attributes of type PointerValue")); + AddTestCase (new CallbackValueTestCase ("Check Attributes of type CallbackValue")); +} + +AttributesTestSuite attributesTestSuite; + +} // namespace ns3 diff --git a/src/core/attribute-test.cc b/src/core/attribute-test.cc deleted file mode 100644 index 46adf84d4..000000000 --- a/src/core/attribute-test.cc +++ /dev/null @@ -1,537 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2008 INRIA - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Authors: Mathieu Lacage - */ -#ifdef RUN_SELF_TESTS -#include "test.h" -#include "object.h" -#include "boolean.h" -#include "integer.h" -#include "uinteger.h" -#include "enum.h" -#include "string.h" -#include "random-variable.h" -#include "double.h" -#include "object-vector.h" -#include "traced-value.h" -#include "callback.h" -#include "trace-source-accessor.h" -#include "pointer.h" - -namespace ns3 { - -class ValueClassTest -{ -public: - ValueClassTest () {} -private: - int m_v; -}; -bool operator != (const ValueClassTest &a, const ValueClassTest &b) -{ - return true; -} -std::ostream & operator << (std::ostream &os, ValueClassTest v) -{ - return os; -} -std::istream & operator >> (std::istream &is, ValueClassTest &v) -{ - return is; -} -ATTRIBUTE_HELPER_HEADER (ValueClassTest); -ATTRIBUTE_HELPER_CPP (ValueClassTest); - -class AttributeTest : public Test -{ -public: - AttributeTest (); - virtual bool RunTests (void); -private: - void NotifySource1 (int8_t old, int8_t n) { - m_got1 = n; - } - void NotifySource2 (double a, int b, float c) { - m_got2 = a; - } - void NotifySourceValue (ValueClassTest old, ValueClassTest n) { - m_gotValue = n; - } - void NotifyCallbackValue (int8_t a) { - m_gotCbValue = a; - } - int64_t m_got1; - double m_got2; - ValueClassTest m_gotValue; - int16_t m_gotCbValue; -}; - -class Derived : public Object -{ -public: - static TypeId GetTypeId (void) { - static TypeId tid = TypeId ("Derived") - .SetParent () - ; - return tid; - } -}; - -class AttributeObjectTest : public Object -{ -public: - enum Test_e { - TEST_A, - TEST_B, - TEST_C - }; - static TypeId GetTypeId (void) { - static TypeId tid = TypeId ("ns3::AttributeObjectTest") - .SetParent () - .HideFromDocumentation () - .AddAttribute ("TestBoolName", "help text", - BooleanValue (false), - MakeBooleanAccessor (&AttributeObjectTest::m_boolTest), - MakeBooleanChecker ()) - .AddAttribute ("TestBoolA", "help text", - BooleanValue (false), - MakeBooleanAccessor (&AttributeObjectTest::DoSetTestB, - &AttributeObjectTest::DoGetTestB), - MakeBooleanChecker ()) - .AddAttribute ("TestInt16", "help text", - IntegerValue (-2), - MakeIntegerAccessor (&AttributeObjectTest::m_int16), - MakeIntegerChecker ()) - .AddAttribute ("TestInt16WithBounds", "help text", - IntegerValue (-2), - MakeIntegerAccessor (&AttributeObjectTest::m_int16WithBounds), - MakeIntegerChecker (-5, 10)) - .AddAttribute ("TestInt16SetGet", "help text", - IntegerValue (6), - MakeIntegerAccessor (&AttributeObjectTest::DoSetInt16, - &AttributeObjectTest::DoGetInt16), - MakeIntegerChecker ()) - .AddAttribute ("TestUint8", "help text", - UintegerValue (1), - MakeUintegerAccessor (&AttributeObjectTest::m_uint8), - MakeUintegerChecker ()) - .AddAttribute ("TestEnum", "help text", - EnumValue (TEST_A), - MakeEnumAccessor (&AttributeObjectTest::m_enum), - MakeEnumChecker (TEST_A, "TestA", - TEST_B, "TestB", - TEST_C, "TestC")) - .AddAttribute ("TestRandom", "help text", - RandomVariableValue (ConstantVariable (1.0)), - MakeRandomVariableAccessor (&AttributeObjectTest::m_random), - MakeRandomVariableChecker ()) - .AddAttribute ("TestFloat", "help text", - DoubleValue (-1.1), - MakeDoubleAccessor (&AttributeObjectTest::m_float), - MakeDoubleChecker ()) - .AddAttribute ("TestVector1", "help text", - ObjectVectorValue (), - MakeObjectVectorAccessor (&AttributeObjectTest::m_vector1), - MakeObjectVectorChecker ()) - .AddAttribute ("TestVector2", "help text", - ObjectVectorValue (), - MakeObjectVectorAccessor (&AttributeObjectTest::DoGetVectorN, - &AttributeObjectTest::DoGetVector), - MakeObjectVectorChecker ()) - .AddAttribute ("IntegerTraceSource1", "help text", - IntegerValue (-2), - MakeIntegerAccessor (&AttributeObjectTest::m_intSrc1), - MakeIntegerChecker ()) - .AddAttribute ("IntegerTraceSource2", "help text", - IntegerValue (-2), - MakeIntegerAccessor (&AttributeObjectTest::DoSetIntSrc, - &AttributeObjectTest::DoGetIntSrc), - MakeIntegerChecker ()) - .AddAttribute ("ValueClassSource", "help text", - ValueClassTestValue (ValueClassTest ()), - MakeValueClassTestAccessor (&AttributeObjectTest::m_valueSrc), - MakeValueClassTestChecker ()) - .AddTraceSource ("Source1", "help test", - MakeTraceSourceAccessor (&AttributeObjectTest::m_intSrc1)) - .AddTraceSource ("Source2", "help text", - MakeTraceSourceAccessor (&AttributeObjectTest::m_cb)) - .AddTraceSource ("ValueSource", "help text", - MakeTraceSourceAccessor (&AttributeObjectTest::m_valueSrc)) - .AddAttribute ("Pointer", "help text", - PointerValue (), - MakePointerAccessor (&AttributeObjectTest::m_ptr), - MakePointerChecker ()) - .AddAttribute ("Callback", "help text", - CallbackValue (), - MakeCallbackAccessor (&AttributeObjectTest::m_cbValue), - MakeCallbackChecker ()) - ; - - return tid; - } - - void AddToVector1 (void) { - m_vector1.push_back (CreateObject ()); - } - void AddToVector2 (void) { - m_vector2.push_back (CreateObject ()); - } - - void InvokeCb (double a, int b, float c) { - m_cb (a,b,c); - } - - void InvokeCbValue (int8_t a) { - if (!m_cbValue.IsNull ()) - { - m_cbValue (a); - } - } - -private: - void DoSetTestB (bool v) { - m_boolTestA = v; - } - bool DoGetTestB (void) const { - return m_boolTestA; - } - int16_t DoGetInt16 (void) const { - return m_int16SetGet; - } - void DoSetInt16 (int16_t v) { - m_int16SetGet = v; - } - uint32_t DoGetVectorN (void) const { - return m_vector2.size (); - } - Ptr DoGetVector (uint32_t i) const { - return m_vector2[i]; - } - bool DoSetIntSrc (int8_t v) { - m_intSrc2 = v; - return true; - } - int8_t DoGetIntSrc (void) const { - return m_intSrc2; - } - bool m_boolTestA; - bool m_boolTest; - int16_t m_int16; - int16_t m_int16WithBounds; - int16_t m_int16SetGet; - uint8_t m_uint8; - float m_float; - enum Test_e m_enum; - RandomVariable m_random; - std::vector > m_vector1; - std::vector > m_vector2; - Callback m_cbValue; - TracedValue m_intSrc1; - TracedValue m_intSrc2; - TracedCallback m_cb; - TracedValue m_valueSrc; - Ptr m_ptr; -}; - - -#define CHECK_GET_STR(p,name,value) \ - { \ - std::string expected = value; \ - StringValue got; \ - bool ok = p->GetAttributeFailSafe (name, got); \ - NS_TEST_ASSERT (ok); \ - NS_TEST_ASSERT_EQUAL (got.Get (), expected); \ - } -#define CHECK_GET_PARAM(p,name,type,value) \ - { \ - const type expected = value; \ - type got; \ - bool ok = p->GetAttributeFailSafe (name, got); \ - NS_TEST_ASSERT (ok); \ - NS_TEST_ASSERT_EQUAL (got.Get (), expected.Get ()); \ - } - -NS_OBJECT_ENSURE_REGISTERED (AttributeObjectTest); - -AttributeTest::AttributeTest () - : Test ("Attribute") -{} -bool -AttributeTest::RunTests (void) -{ - bool result = true; - - AttributeList params; - Ptr p; - NS_TEST_ASSERT (params.SetFailSafe ("ns3::AttributeObjectTest::TestBoolName", StringValue ("false"))); - p = CreateObjectWithAttributes (params); - CHECK_GET_STR (p, "TestBoolName", "false"); - CHECK_GET_PARAM (p, "TestBoolName", BooleanValue, false); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestBoolName", StringValue ("true"))); - CHECK_GET_STR (p, "TestBoolName", "true"); - CHECK_GET_PARAM (p, "TestBoolName", BooleanValue, true); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestBoolName", BooleanValue (false))); - CHECK_GET_STR (p, "TestBoolName", "false"); - CHECK_GET_PARAM (p, "TestBoolName", BooleanValue, false); - - p = CreateObjectWithAttributes ("TestBoolName", StringValue ("true")); - CHECK_GET_STR (p, "TestBoolName", "true"); - CHECK_GET_PARAM (p, "TestBoolName", BooleanValue, true); - - p = CreateObjectWithAttributes ("TestBoolName", BooleanValue (true)); - CHECK_GET_STR (p, "TestBoolName", "true"); - CHECK_GET_PARAM (p, "TestBoolName", BooleanValue, true); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestBoolA", StringValue ("false"))); - CHECK_GET_STR (p, "TestBoolA", "false"); - CHECK_GET_PARAM (p, "TestBoolA", BooleanValue, false); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestBoolA", StringValue ("true"))); - CHECK_GET_STR (p, "TestBoolA", "true"); - CHECK_GET_PARAM (p, "TestBoolA", BooleanValue, true); - - - CHECK_GET_STR (p, "TestInt16", "-2"); - CHECK_GET_PARAM (p, "TestInt16", IntegerValue, -2); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestInt16", StringValue ("-5"))); - CHECK_GET_STR (p, "TestInt16", "-5"); - CHECK_GET_PARAM (p, "TestInt16", IntegerValue, -5); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestInt16", IntegerValue (+2))); - CHECK_GET_STR (p, "TestInt16", "2"); - CHECK_GET_PARAM (p, "TestInt16", IntegerValue, +2); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestInt16", IntegerValue (-32768))); - CHECK_GET_STR (p, "TestInt16", "-32768"); - CHECK_GET_PARAM (p, "TestInt16", IntegerValue, -32768); - - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestInt16", IntegerValue (-32769))); - CHECK_GET_STR (p, "TestInt16", "-32768"); - CHECK_GET_PARAM (p, "TestInt16", IntegerValue, -32768); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestInt16", IntegerValue (32767))); - CHECK_GET_STR (p, "TestInt16", "32767"); - CHECK_GET_PARAM (p, "TestInt16", IntegerValue, 32767); - - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestInt16", IntegerValue (32768))); - CHECK_GET_STR (p, "TestInt16", "32767"); - CHECK_GET_PARAM (p, "TestInt16", IntegerValue, 32767); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestInt16WithBounds", IntegerValue (10))); - CHECK_GET_STR (p, "TestInt16WithBounds", "10"); - CHECK_GET_PARAM (p, "TestInt16WithBounds", IntegerValue, 10); - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestInt16WithBounds", IntegerValue (11))); - CHECK_GET_STR (p, "TestInt16WithBounds", "10"); - CHECK_GET_PARAM (p, "TestInt16WithBounds", IntegerValue, 10); - - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestInt16WithBounds", IntegerValue (-5))); - CHECK_GET_STR (p, "TestInt16WithBounds", "-5"); - CHECK_GET_PARAM (p, "TestInt16WithBounds", IntegerValue, -5); - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestInt16WithBounds", IntegerValue (-6))); - CHECK_GET_STR (p, "TestInt16WithBounds", "-5"); - CHECK_GET_PARAM (p, "TestInt16WithBounds", IntegerValue, -5); - - CHECK_GET_STR (p, "TestInt16SetGet", "6"); - CHECK_GET_PARAM (p, "TestInt16SetGet", IntegerValue, 6); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestInt16SetGet", IntegerValue (0))); - CHECK_GET_STR (p, "TestInt16SetGet", "0"); - CHECK_GET_PARAM (p, "TestInt16SetGet", IntegerValue, 0); - - CHECK_GET_STR (p, "TestUint8", "1"); - CHECK_GET_PARAM (p, "TestUint8", UintegerValue, 1); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestUint8", UintegerValue (0))); - CHECK_GET_STR (p, "TestUint8", "0"); - CHECK_GET_PARAM (p, "TestUint8", UintegerValue, 0); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestUint8", UintegerValue (255))); - CHECK_GET_STR (p, "TestUint8", "255"); - CHECK_GET_PARAM (p, "TestUint8", UintegerValue, 255); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestUint8", StringValue ("255"))); - CHECK_GET_STR (p, "TestUint8", "255"); - CHECK_GET_PARAM (p, "TestUint8", UintegerValue, 255); - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestUint8", StringValue ("256"))); - CHECK_GET_STR (p, "TestUint8", "255"); - CHECK_GET_PARAM (p, "TestUint8", UintegerValue, 255); - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestUint8", StringValue ("-1"))); - CHECK_GET_STR (p, "TestUint8", "255"); - CHECK_GET_PARAM (p, "TestUint8", UintegerValue, 255); - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestUint8", UintegerValue ((uint64_t)-1))); - CHECK_GET_STR (p, "TestUint8", "255"); - CHECK_GET_PARAM (p, "TestUint8", UintegerValue, 255); - - CHECK_GET_STR (p, "TestFloat", "-1.1"); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestFloat", DoubleValue ((float)+2.3))); - CHECK_GET_PARAM (p, "TestFloat", DoubleValue, (float)+2.3); - - CHECK_GET_STR (p, "TestEnum", "TestA"); - CHECK_GET_PARAM (p, "TestEnum", EnumValue, AttributeObjectTest::TEST_A); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestEnum", EnumValue (AttributeObjectTest::TEST_C))); - CHECK_GET_STR (p, "TestEnum", "TestC"); - CHECK_GET_PARAM (p, "TestEnum", EnumValue, AttributeObjectTest::TEST_C); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestEnum", StringValue ("TestB"))); - CHECK_GET_STR (p, "TestEnum", "TestB"); - CHECK_GET_PARAM (p, "TestEnum", EnumValue, AttributeObjectTest::TEST_B); - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestEnum", StringValue ("TestD"))); - CHECK_GET_STR (p, "TestEnum", "TestB"); - CHECK_GET_PARAM (p, "TestEnum", EnumValue, AttributeObjectTest::TEST_B); - NS_TEST_ASSERT (!p->SetAttributeFailSafe("TestEnum", EnumValue (5))); - CHECK_GET_STR (p, "TestEnum", "TestB"); - CHECK_GET_PARAM (p, "TestEnum", EnumValue, AttributeObjectTest::TEST_B); - - RandomVariableValue ran; - p->GetAttribute ("TestRandom", ran); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestRandom", RandomVariableValue (UniformVariable (0.0, 1.0)))); - NS_TEST_ASSERT (p->SetAttributeFailSafe("TestRandom", RandomVariableValue (ConstantVariable (10.0)))); - - { - ObjectVectorValue vector; - p->GetAttribute ("TestVector1", vector); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 0); - p->AddToVector1 (); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 0); - p->GetAttribute ("TestVector1", vector); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 1); - Ptr a = vector.Get (0); - NS_TEST_ASSERT_UNEQUAL (a, 0); - p->AddToVector1 (); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 1); - p->GetAttribute ("TestVector1", vector); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 2); - } - - { - ObjectVectorValue vector; - p->GetAttribute ("TestVector2", vector); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 0); - p->AddToVector2 (); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 0); - p->GetAttribute ("TestVector2", vector); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 1); - Ptr a = vector.Get (0); - NS_TEST_ASSERT_UNEQUAL (a, 0); - p->AddToVector2 (); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 1); - p->GetAttribute ("TestVector2", vector); - NS_TEST_ASSERT_EQUAL (vector.GetN (), 2); - } - - NS_TEST_ASSERT (AttributeList::GetGlobal ()->SetFailSafe ("ns3::AttributeObjectTest::TestBoolName", StringValue ("true"))); - p = CreateObject (); - BooleanValue boolV; - p->GetAttribute ("TestBoolName", boolV); - NS_TEST_ASSERT_EQUAL (boolV.Get (), true); - - NS_TEST_ASSERT (AttributeList::GetGlobal ()->SetFailSafe ("ns3::AttributeObjectTest::TestBoolName", StringValue ("false"))); - p = CreateObject (); - p->GetAttribute ("TestBoolName", boolV); - NS_TEST_ASSERT_EQUAL (boolV.Get (), false); - - IntegerValue i; - p->GetAttribute ("IntegerTraceSource1", i); - NS_TEST_ASSERT_EQUAL (i.Get (), -2); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (+5))); - p->GetAttribute ("IntegerTraceSource1", i); - NS_TEST_ASSERT_EQUAL (i.Get (), +5); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (127))); - NS_TEST_ASSERT (!p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (128))); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (-128))); - NS_TEST_ASSERT (!p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (-129))); - - p->GetAttribute ("IntegerTraceSource2", i); - NS_TEST_ASSERT_EQUAL (i.Get (), -2); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource2", IntegerValue (+5))); - p->GetAttribute ("IntegerTraceSource2", i); - NS_TEST_ASSERT_EQUAL (i.Get (), +5); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource2", IntegerValue (127))); - NS_TEST_ASSERT (!p->SetAttributeFailSafe ("IntegerTraceSource2", IntegerValue (128))); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource2", IntegerValue (-128))); - NS_TEST_ASSERT (!p->SetAttributeFailSafe ("IntegerTraceSource2", IntegerValue (-129))); - - m_got1 = -2; - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (-1))); - NS_TEST_ASSERT (p->TraceConnectWithoutContext ("Source1", MakeCallback (&AttributeTest::NotifySource1, this))); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (0))); - NS_TEST_ASSERT_EQUAL (m_got1, 0); - NS_TEST_ASSERT (p->TraceDisconnectWithoutContext ("Source1", MakeCallback (&AttributeTest::NotifySource1, this))); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", IntegerValue (1))); - NS_TEST_ASSERT_EQUAL (m_got1, 0); - - m_got2 = 4.3; - p->InvokeCb (1.0, -5, 0.0); - NS_TEST_ASSERT_EQUAL (m_got2, 4.3); - NS_TEST_ASSERT (p->TraceConnectWithoutContext ("Source2", MakeCallback (&AttributeTest::NotifySource2, this))); - NS_TEST_ASSERT_EQUAL (m_got2, 4.3); - p->InvokeCb (1.0, -5, 0.0); - NS_TEST_ASSERT_EQUAL (m_got2, 1.0); - NS_TEST_ASSERT (p->TraceDisconnectWithoutContext ("Source2", MakeCallback (&AttributeTest::NotifySource2, this))); - p->InvokeCb (-1.0, -5, 0.0); - NS_TEST_ASSERT_EQUAL (m_got2, 1.0); - - NS_TEST_ASSERT (p->TraceConnectWithoutContext ("ValueSource", MakeCallback (&AttributeTest::NotifySourceValue, this))); - - PointerValue ptr; - p->GetAttribute ("Pointer", ptr); - Ptr derived = ptr.Get (); - NS_TEST_ASSERT (derived == 0); - derived = Create (); - NS_TEST_ASSERT (p->SetAttributeFailSafe("Pointer", PointerValue (derived))); - p->GetAttribute ("Pointer", ptr); - Ptr stored = ptr.Get (); - NS_TEST_ASSERT (stored == derived); - p->GetAttribute ("Pointer", ptr); - Ptr storedBase = ptr.Get (); - NS_TEST_ASSERT (stored == storedBase); - p->GetAttribute ("Pointer", ptr); - Ptr x = ptr.Get (); - NS_TEST_ASSERT (x == 0); - - p = CreateObjectWithAttributes ("Pointer", PointerValue (Create ())); - NS_TEST_ASSERT (p != 0); - derived = 0; - p->GetAttribute ("Pointer", ptr); - derived = ptr.Get (); - NS_TEST_ASSERT (derived != 0); - - p = CreateObject (); - NS_TEST_ASSERT (p != 0); - m_gotCbValue = 1; - p->InvokeCbValue (2); - CallbackValue cbValue = MakeCallback (&AttributeTest::NotifyCallbackValue, this); - NS_TEST_ASSERT_EQUAL (m_gotCbValue, 1); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("Callback", - cbValue)); - p->InvokeCbValue (2); - NS_TEST_ASSERT_EQUAL (m_gotCbValue, 2); - NS_TEST_ASSERT (p->SetAttributeFailSafe ("Callback", - CallbackValue (MakeNullCallback ()))); - p->InvokeCbValue (3); - NS_TEST_ASSERT_EQUAL (m_gotCbValue, 2); - - return result; -} - - - -static AttributeTest g_parameterTest; - -} // namespace ns3 - - -#endif /* RUN_SELF_TESTS */ diff --git a/src/core/callback-test-suite.cc b/src/core/callback-test-suite.cc new file mode 100644 index 000000000..b1e94d333 --- /dev/null +++ b/src/core/callback-test-suite.cc @@ -0,0 +1,602 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "test.h" +#include "callback.h" +#include + +namespace ns3 { + +class X : public ns3::Test +{ +public: + X () : Test ("Callback") {} + void PublicParent (void) {} +protected: + static void StaticProtectedParent (void) {} + void ProtectedParent (void) {} +private: + void PrivateParent (void) {} +}; + +// =========================================================================== +// Test the basic Callback mechanism +// =========================================================================== +class BasicCallbackTestCase : public TestCase +{ +public: + BasicCallbackTestCase (); + virtual ~BasicCallbackTestCase () {} + + void Target1 (void) {m_test1 = true;} + int Target2 (void) {m_test2 = true; return 2;} + void Target3 (double a) {m_test3 = true;} + int Target4 (double a, int b) {m_test4 = true; return 4;} + +private: + virtual bool DoRun (void); + virtual void DoSetup (void); + + bool m_test1; + bool m_test2; + bool m_test3; + bool m_test4; +}; + +static bool gBasicCallbackTest5; +static bool gBasicCallbackTest6; +static bool gBasicCallbackTest7; + +void +BasicCallbackTarget5 (void) +{ + gBasicCallbackTest5 = true; +} + +void +BasicCallbackTarget6 (int) +{ + gBasicCallbackTest6 = true; +} + +int +BasicCallbackTarget7 (int a) +{ + gBasicCallbackTest7 = true; + return a; +} + +BasicCallbackTestCase::BasicCallbackTestCase () + : TestCase ("Check basic Callback mechansim") +{ +} + +void +BasicCallbackTestCase::DoSetup (void) +{ + m_test1 = false; + m_test2 = false; + m_test3 = false; + m_test4 = false; + gBasicCallbackTest5 = false; + gBasicCallbackTest6 = false; + gBasicCallbackTest7 = false; +} + +bool +BasicCallbackTestCase::DoRun (void) +{ + // + // Make sure we can declare and compile a Callback pointing to a member + // function returning void and execute it. + // + Callback target1 (this, &BasicCallbackTestCase::Target1); + target1 (); + NS_TEST_ASSERT_MSG_EQ (m_test1, true, "Callback did not fire"); + + // + // Make sure we can declare and compile a Callback pointing to a member + // function that returns an int and execute it. + // + Callback target2; + target2 = Callback (this, &BasicCallbackTestCase::Target2); + target2 (); + NS_TEST_ASSERT_MSG_EQ (m_test2, true, "Callback did not fire"); + + // + // Make sure we can declare and compile a Callback pointing to a member + // function that returns void, takes a double parameter, and execute it. + // + Callback target3 = Callback (this, &BasicCallbackTestCase::Target3); + target3 (0.0); + NS_TEST_ASSERT_MSG_EQ (m_test3, true, "Callback did not fire"); + + // + // Make sure we can declare and compile a Callback pointing to a member + // function that returns void, takes two parameters, and execute it. + // + Callback target4 = Callback (this, &BasicCallbackTestCase::Target4); + target4 (0.0, 1); + NS_TEST_ASSERT_MSG_EQ (m_test4, true, "Callback did not fire"); + + // + // Make sure we can declare and compile a Callback pointing to a non-member + // function that returns void, and execute it. This is a lower level call + // than MakeCallback so we have got to include at least two arguments to make + // sure that the constructor is properly disambiguated. If the arguments are + // not needed, we just pass in dummy values. + // + Callback target5 = Callback (&BasicCallbackTarget5, true, true); + target5 (); + NS_TEST_ASSERT_MSG_EQ (gBasicCallbackTest5, true, "Callback did not fire"); + + // + // Make sure we can declare and compile a Callback pointing to a non-member + // function that returns void, takes one integer argument and execute it. + // We also need to provide two dummy arguments to the constructor here. + // + Callback target6 = Callback (&BasicCallbackTarget6, true, true); + target6 (1); + NS_TEST_ASSERT_MSG_EQ (gBasicCallbackTest6, true, "Callback did not fire"); + + // + // Make sure we can declare and compile a Callback pointing to a non-member + // function that returns int, takes one integer argument and execute it. + // We also need to provide two dummy arguments to the constructor here. + // + Callback target7 = Callback (&BasicCallbackTarget7, true, true); + target7 (1); + NS_TEST_ASSERT_MSG_EQ (gBasicCallbackTest7, true, "Callback did not fire"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test the MakeCallback mechanism +// =========================================================================== +class MakeCallbackTestCase : public TestCase +{ +public: + MakeCallbackTestCase (); + virtual ~MakeCallbackTestCase () {} + + void Target1 (void) {m_test1 = true;} + int Target2 (void) {m_test2 = true; return 2;} + void Target3 (double a) {m_test3 = true;} + int Target4 (double a, int b) {m_test4 = true; return 4;} + +private: + virtual bool DoRun (void); + virtual void DoSetup (void); + + bool m_test1; + bool m_test2; + bool m_test3; + bool m_test4; +}; + +static bool gMakeCallbackTest5; +static bool gMakeCallbackTest6; +static bool gMakeCallbackTest7; + +void +MakeCallbackTarget5 (void) +{ + gMakeCallbackTest5 = true; +} + +void +MakeCallbackTarget6 (int) +{ + gMakeCallbackTest6 = true; +} + +int +MakeCallbackTarget7 (int a) +{ + gMakeCallbackTest7 = true; + return a; +} + +MakeCallbackTestCase::MakeCallbackTestCase () + : TestCase ("Check MakeCallback() mechanism") +{ +} + +void +MakeCallbackTestCase::DoSetup (void) +{ + m_test1 = false; + m_test2 = false; + m_test3 = false; + m_test4 = false; + gMakeCallbackTest5 = false; + gMakeCallbackTest6 = false; + gMakeCallbackTest7 = false; +} + +bool +MakeCallbackTestCase::DoRun (void) +{ + // + // Make sure we can declare and make a Callback pointing to a member + // function returning void and execute it. + // + Callback target1 = MakeCallback (&MakeCallbackTestCase::Target1, this); + target1 (); + NS_TEST_ASSERT_MSG_EQ (m_test1, true, "Callback did not fire"); + + // + // Make sure we can declare and make a Callback pointing to a member + // function that returns an int and execute it. + // + Callback target2 = MakeCallback (&MakeCallbackTestCase::Target2, this); + target2 (); + NS_TEST_ASSERT_MSG_EQ (m_test2, true, "Callback did not fire"); + + // + // Make sure we can declare and make a Callback pointing to a member + // function that returns void, takes a double parameter, and execute it. + // + Callback target3 = MakeCallback (&MakeCallbackTestCase::Target3, this); + target3 (0.0); + NS_TEST_ASSERT_MSG_EQ (m_test3, true, "Callback did not fire"); + + // + // Make sure we can declare and make a Callback pointing to a member + // function that returns void, takes two parameters, and execute it. + // + Callback target4 = MakeCallback (&MakeCallbackTestCase::Target4, this); + target4 (0.0, 1); + NS_TEST_ASSERT_MSG_EQ (m_test4, true, "Callback did not fire"); + + // + // Make sure we can declare and make a Callback pointing to a non-member + // function that returns void, and execute it. This uses a higher level call + // than in the basic tests so we do not need to include any dummy arguments + // here. + // + Callback target5 = MakeCallback (&MakeCallbackTarget5); + target5 (); + NS_TEST_ASSERT_MSG_EQ (gMakeCallbackTest5, true, "Callback did not fire"); + + // + // Make sure we can declare and compile a Callback pointing to a non-member + // function that returns void, takes one integer argument and execute it. + // This uses a higher level call than in the basic tests so we do not need to + // include any dummy arguments here. + // + Callback target6 = MakeCallback (&MakeCallbackTarget6); + target6 (1); + NS_TEST_ASSERT_MSG_EQ (gMakeCallbackTest6, true, "Callback did not fire"); + + // + // Make sure we can declare and compile a Callback pointing to a non-member + // function that returns int, takes one integer argument and execute it. + // This uses a higher level call than in the basic tests so we do not need to + // include any dummy arguments here. + // + Callback target7 = MakeCallback (&MakeCallbackTarget7); + target7 (1); + NS_TEST_ASSERT_MSG_EQ (gMakeCallbackTest7, true, "Callback did not fire"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test the MakeBoundCallback mechanism +// =========================================================================== +class MakeBoundCallbackTestCase : public TestCase +{ +public: + MakeBoundCallbackTestCase (); + virtual ~MakeBoundCallbackTestCase () {} + +private: + virtual bool DoRun (void); + virtual void DoSetup (void); +}; + +static int gMakeBoundCallbackTest1; +static bool *gMakeBoundCallbackTest2; +static bool *gMakeBoundCallbackTest3a; +static int gMakeBoundCallbackTest3b; + +void +MakeBoundCallbackTarget1 (int a) +{ + gMakeBoundCallbackTest1 = a; +} + +void +MakeBoundCallbackTarget2 (bool *a) +{ + gMakeBoundCallbackTest2 = a; +} + +int +MakeBoundCallbackTarget3 (bool *a, int b) +{ + gMakeBoundCallbackTest3a = a; + gMakeBoundCallbackTest3b = b; + return 1234; +} + +MakeBoundCallbackTestCase::MakeBoundCallbackTestCase () + : TestCase ("Check MakeBoundCallback() mechanism") +{ +} + +void +MakeBoundCallbackTestCase::DoSetup (void) +{ + gMakeBoundCallbackTest1 = 0; + gMakeBoundCallbackTest2 = 0; + gMakeBoundCallbackTest3a = 0; + gMakeBoundCallbackTest3b = 0; +} + +bool +MakeBoundCallbackTestCase::DoRun (void) +{ + // + // This is slightly tricky to explain. A bound Callback allows us to package + // up arguments for use later. The arguments are bound when the callback is + // created and the code that fires the Callback does not know they are there. + // + // Since the callback is *declared* according to the way it will be used, the + // arguments are not seen there. However, the target function of the callback + // will have the provided arguments present. The MakeBoundCallback template + // function is what connects the two together and where you provide the + // arguments to be bound. + // + // Here we declare a Callback that returns a void and takes no parameters. + // MakeBoundCallback connects this Callback to a target function that returns + // void and takes an integer argument. That integer argument is bound to the + // value 1234. When the Callback is fired, no integer argument is provided + // directly. The argument is provided by bound Callback mechanism. + // + Callback target1 = MakeBoundCallback (&MakeBoundCallbackTarget1, 1234); + target1 (); + NS_TEST_ASSERT_MSG_EQ (gMakeBoundCallbackTest1, 1234, "Callback did not fire or binding not correct"); + + // + // Make sure we can bind a pointer value (a common use case). + // + bool a; + Callback target2 = MakeBoundCallback (&MakeBoundCallbackTarget2, &a); + target2 (); + NS_TEST_ASSERT_MSG_EQ (gMakeBoundCallbackTest2, &a, "Callback did not fire or binding not correct"); + + // + // Make sure we can mix and match bound and unbound arguments. This callback + // returns an integer so we should see that appear. + // + Callback target3 = MakeBoundCallback (&MakeBoundCallbackTarget3, &a); + int result = target3 (2468); + NS_TEST_ASSERT_MSG_EQ (result, 1234, "Return value of callback not correct"); + NS_TEST_ASSERT_MSG_EQ (gMakeBoundCallbackTest3a, &a, "Callback did not fire or binding not correct"); + NS_TEST_ASSERT_MSG_EQ (gMakeBoundCallbackTest3b, 2468, "Callback did not fire or argument not correct"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test the Nullify mechanism +// =========================================================================== +class NullifyCallbackTestCase : public TestCase +{ +public: + NullifyCallbackTestCase (); + virtual ~NullifyCallbackTestCase () {} + + void Target1 (void) {m_test1 = true;} + +private: + virtual bool DoRun (void); + virtual void DoSetup (void); + + bool m_test1; +}; + +NullifyCallbackTestCase::NullifyCallbackTestCase () + : TestCase ("Check Nullify() and IsNull()") +{ +} + +void +NullifyCallbackTestCase::DoSetup (void) +{ + m_test1 = false; +} + +bool +NullifyCallbackTestCase::DoRun (void) +{ + // + // Make sure we can declare and make a Callback pointing to a member + // function returning void and execute it. + // + Callback target1 = MakeCallback (&NullifyCallbackTestCase::Target1, this); + target1 (); + NS_TEST_ASSERT_MSG_EQ (m_test1, true, "Callback did not fire"); + + NS_TEST_ASSERT_MSG_EQ (target1.IsNull (), false, "Working Callback reports IsNull()"); + + target1.Nullify (); + + NS_TEST_ASSERT_MSG_EQ (target1.IsNull (), true, "Nullified Callback reports not IsNull()"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Make sure that various MakeCallback template functions compile and execute. +// Doesn't check an results of the execution. +// =========================================================================== +class MakeCallbackTemplatesTestCase : public TestCase +{ +public: + MakeCallbackTemplatesTestCase (); + virtual ~MakeCallbackTemplatesTestCase () {} + + void Target1 (void) {m_test1 = true;} + +private: + virtual bool DoRun (void); + + bool m_test1; +}; + +void TestFZero (void) {} +void TestFOne (int) {} +void TestFTwo (int, int) {} +void TestFThree (int, int, int) {} +void TestFFour (int, int, int, int) {} +void TestFFive (int, int, int, int, int) {} +void TestFSix (int, int, int, int, int, int) {} + +void TestFROne (int &) {} +void TestFRTwo (int &, int &) {} +void TestFRThree (int &, int &, int &) {} +void TestFRFour (int &, int &, int &, int &) {} +void TestFRFive (int &, int &, int &, int &, int &) {} +void TestFRSix (int &, int &, int &, int &, int &, int &) {} + +class CallbackTestParent +{ +public: + void PublicParent (void) {} +protected: + void ProtectedParent (void) {} + static void StaticProtectedParent (void) {} +private: + void PrivateParent (void) {} +}; + +class CallbackTestClass : public CallbackTestParent +{ +public: + void TestZero (void) {} + void TestOne (int) {} + void TestTwo (int, int) {} + void TestThree (int, int, int) {} + void TestFour (int, int, int, int) {} + void TestFive (int, int, int, int, int) {} + void TestSix (int, int, int, int, int, int) {} + void TestCZero (void) const {} + void TestCOne (int) const {} + void TestCTwo (int, int) const {} + void TestCThree (int, int, int) const {} + void TestCFour (int, int, int, int) const {} + void TestCFive (int, int, int, int, int) const {} + void TestCSix (int, int, int, int, int, int) const {} + + void CheckParentalRights (void) + { + MakeCallback (&CallbackTestParent::StaticProtectedParent); + MakeCallback (&CallbackTestParent::PublicParent, this); + MakeCallback (&CallbackTestClass::ProtectedParent, this); + // as expected, fails. + // MakeCallback (&CallbackTestParent::PrivateParent, this); + // unexpected, but fails too. It does fumble me. + // MakeCallback (&CallbackTestParent::ProtectedParent, this); + } + +}; + +MakeCallbackTemplatesTestCase::MakeCallbackTemplatesTestCase () + : TestCase ("Check various MakeCallback() template functions") +{ +} + +bool +MakeCallbackTemplatesTestCase::DoRun (void) +{ + CallbackTestClass that; + + MakeCallback (&CallbackTestClass::TestZero, &that); + MakeCallback (&CallbackTestClass::TestOne, &that); + MakeCallback (&CallbackTestClass::TestTwo, &that); + MakeCallback (&CallbackTestClass::TestThree, &that); + MakeCallback (&CallbackTestClass::TestFour, &that); + MakeCallback (&CallbackTestClass::TestFive, &that); + MakeCallback (&CallbackTestClass::TestSix, &that); + + MakeCallback (&CallbackTestClass::TestCZero, &that); + MakeCallback (&CallbackTestClass::TestCOne, &that); + MakeCallback (&CallbackTestClass::TestCTwo, &that); + MakeCallback (&CallbackTestClass::TestCThree, &that); + MakeCallback (&CallbackTestClass::TestCFour, &that); + MakeCallback (&CallbackTestClass::TestCFive, &that); + MakeCallback (&CallbackTestClass::TestCSix, &that); + + MakeCallback (&TestFZero); + MakeCallback (&TestFOne); + MakeCallback (&TestFTwo); + MakeCallback (&TestFThree); + MakeCallback (&TestFFour); + MakeCallback (&TestFFive); + MakeCallback (&TestFSix); + + MakeCallback (&TestFROne); + MakeCallback (&TestFRTwo); + MakeCallback (&TestFRThree); + MakeCallback (&TestFRFour); + MakeCallback (&TestFRFive); + MakeCallback (&TestFRSix); + + MakeBoundCallback (&TestFOne, 1); + MakeBoundCallback (&TestFTwo, 1); + MakeBoundCallback (&TestFThree, 1); + MakeBoundCallback (&TestFFour, 1); + MakeBoundCallback (&TestFFive, 1); + + MakeBoundCallback (&TestFROne, 1); + MakeBoundCallback (&TestFRTwo, 1); + MakeBoundCallback (&TestFRThree, 1); + MakeBoundCallback (&TestFRFour, 1); + MakeBoundCallback (&TestFRFive, 1); + + that.CheckParentalRights (); + + return GetErrorStatus (); +} + +// =========================================================================== +// The Test Suite that glues all of the Test Cases together. +// =========================================================================== +class CallbackTestSuite : public TestSuite +{ +public: + CallbackTestSuite (); +}; + +CallbackTestSuite::CallbackTestSuite () + : TestSuite ("callback", UNIT) +{ + AddTestCase (new BasicCallbackTestCase); + AddTestCase (new MakeCallbackTestCase); + AddTestCase (new MakeBoundCallbackTestCase); + AddTestCase (new NullifyCallbackTestCase); + AddTestCase (new MakeCallbackTemplatesTestCase); +} + +CallbackTestSuite CallbackTestSuite; + +} // namespace diff --git a/src/core/callback-test.cc b/src/core/callback-test.cc deleted file mode 100644 index 776bdf41f..000000000 --- a/src/core/callback-test.cc +++ /dev/null @@ -1,324 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2005,2006 INRIA - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Mathieu Lacage - */ - -#include "test.h" -#include "callback.h" -#include - -#ifdef RUN_SELF_TESTS - -namespace ns3 { - -static bool gTest5 = false; -static bool gTest6 = false; -static bool gTest7 = false; - -void Test5 (void) -{ - gTest5 = true; -} - -void Test6 (int) -{ - gTest6 = true; -} - -int Test7 (int a) -{ - gTest7 = true; - return a; -} - -void *Test9 (bool *a) -{ - return a; -} - -void *Test10 (bool *a, int const & b) -{ - return a; -} - -void TestFZero (void) {} -void TestFOne (int) {} -void TestFTwo (int, int) {} -void TestFThree (int, int, int) {} -void TestFFour (int, int, int, int) {} -void TestFFive (int, int, int, int, int) {} -void TestFSix (int, int, int, int, int, int) {} - -void TestFROne (int &) {} -void TestFRTwo (int &, int &) {} -void TestFRThree (int &, int &, int &) {} -void TestFRFour (int &, int &, int &, int &) {} -void TestFRFive (int &, int &, int &, int &, int &) {} -void TestFRSix (int &, int &, int &, int &, int &, int &) {} - -class X : public ns3::Test -{ -public: - X () : Test ("Callback") {} - void PublicParent (void) {} -protected: - static void StaticProtectedParent (void) {} - void ProtectedParent (void) {} -private: - void PrivateParent (void) {} -}; - -class CallbackTest : public X -{ -private: - bool m_test1; - bool m_test2; - bool m_test3; - bool m_test4; -public: - CallbackTest (); - virtual bool RunTests (void); - void Reset (void); - bool IsWrong (void); - void Test1 (void); - int Test2 (void); - void Test3 (double a); - int Test4 (double a, int b); - void Test8 (Callback callback); - - void TestZero (void) {} - void TestOne (int) {} - void TestTwo (int, int) {} - void TestThree (int, int, int) {} - void TestFour (int, int, int, int) {} - void TestFive (int, int, int, int, int) {} - void TestSix (int, int, int, int, int, int) {} - - void TestCZero (void) const {} - void TestCOne (int) const {} - void TestCTwo (int, int) const {} - void TestCThree (int, int, int) const {} - void TestCFour (int, int, int, int) const {} - void TestCFive (int, int, int, int, int) const {} - void TestCSix (int, int, int, int, int, int) const {} -}; - -CallbackTest::CallbackTest () - : m_test1 (false), - m_test2 (false), - m_test3 (false), - m_test4 (false) -{} - -void -CallbackTest::Test1 (void) -{ - m_test1 = true; -} -int -CallbackTest::Test2 (void) -{ - m_test2 = true; - return 2; -} -void -CallbackTest::Test3 (double a) -{ - m_test3 = true; -} -int -CallbackTest::Test4 (double a, int b) -{ - m_test4 = true; - return 4; -} -void -CallbackTest::Test8 (Callback callback) -{ - callback (3); -} - -bool -CallbackTest::IsWrong (void) -{ - if (!m_test1 || - !m_test2 || - !m_test3 || - !m_test4 || - !gTest5 || - !gTest6 || - !gTest7) - { - return true; - } - return false; -} - -void -CallbackTest::Reset (void) -{ - m_test1 = false; - m_test2 = false; - m_test3 = false; - m_test4 = false; - gTest5 = false; - gTest6 = false; - gTest7 = false; -} - - -bool -CallbackTest::RunTests (void) -{ - bool ok = true; - - typedef ns3::Callback A; - typedef ns3::Callback B; - typedef ns3::Callback C; - typedef ns3::Callback D; - typedef ns3::Callback E; - typedef ns3::Callback F; - typedef ns3::Callback G; - - A a0 (this, &CallbackTest::Test1); - B b0; - b0 = B (this, &CallbackTest::Test2); - C c0 = C (this, &CallbackTest::Test3); - D d0 = D (this, &CallbackTest::Test4); - E e0 = E (&Test5, true, true); - F f0 = F (&Test6, true, true); - G g0 = G (&Test7, true, true); - - a0 (); - b0 (); - c0 (0.0); - d0 (0.0, 1); - e0 (); - f0 (1); - g0 (1); - - if (IsWrong ()) - { - ok = false; - } - - Reset (); - - A a1 = ns3::MakeCallback (&CallbackTest::Test1, this); - B b1 = ns3::MakeCallback (&CallbackTest::Test2, this); - C c1 = ns3::MakeCallback (&CallbackTest::Test3, this); - D d1 = ns3::MakeCallback (&CallbackTest::Test4, this); - E e1 = ns3::MakeCallback (&Test5); - F f1 = ns3::MakeCallback (&Test6); - G g1 = ns3::MakeCallback (&Test7); - - a1 (); - b1 (); - c1 (0.0); - d1 (0.0, 1); - e1 (); - f1 (1); - g1 (2); - - a1.Nullify (); - b1.Nullify (); - c1.Nullify (); - d1.Nullify (); - e1.Nullify (); - g1.Nullify (); - - Test8 (f1); - - f1.Nullify (); - - Callback a2; - - if (IsWrong ()) - { - ok = false; - } - - - MakeBoundCallback (&Test7, 0); - bool v; - MakeBoundCallback (&Test9, &v); - MakeBoundCallback (&Test10, &v); - - - MakeCallback (&CallbackTest::TestZero, this); - MakeCallback (&CallbackTest::TestOne, this); - MakeCallback (&CallbackTest::TestTwo, this); - MakeCallback (&CallbackTest::TestThree, this); - MakeCallback (&CallbackTest::TestFour, this); - MakeCallback (&CallbackTest::TestFive, this); - MakeCallback (&CallbackTest::TestSix, this); - - MakeCallback (&CallbackTest::TestCZero, this); - MakeCallback (&CallbackTest::TestCOne, this); - MakeCallback (&CallbackTest::TestCTwo, this); - MakeCallback (&CallbackTest::TestCThree, this); - MakeCallback (&CallbackTest::TestCFour, this); - MakeCallback (&CallbackTest::TestCFive, this); - MakeCallback (&CallbackTest::TestCSix, this); - - MakeCallback (&TestFZero); - MakeCallback (&TestFOne); - MakeCallback (&TestFTwo); - MakeCallback (&TestFThree); - MakeCallback (&TestFFour); - MakeCallback (&TestFFive); - MakeCallback (&TestFSix); - - MakeCallback (&TestFROne); - MakeCallback (&TestFRTwo); - MakeCallback (&TestFRThree); - MakeCallback (&TestFRFour); - MakeCallback (&TestFRFive); - MakeCallback (&TestFRSix); - - - MakeBoundCallback (&TestFOne, 1); - MakeBoundCallback (&TestFTwo, 1); - MakeBoundCallback (&TestFThree, 1); - MakeBoundCallback (&TestFFour, 1); - MakeBoundCallback (&TestFFive, 1); - - MakeBoundCallback (&TestFROne, 1); - MakeBoundCallback (&TestFRTwo, 1); - MakeBoundCallback (&TestFRThree, 1); - MakeBoundCallback (&TestFRFour, 1); - MakeBoundCallback (&TestFRFive, 1); - - - MakeCallback (&X::StaticProtectedParent); - MakeCallback (&X::PublicParent, this); - MakeCallback (&CallbackTest::ProtectedParent, this); - // as expected, fails. - //MakeCallback (&X::PrivateParent, this); - // unexpected, but fails too. - // It does fumble me. - //MakeCallback (&X::ProtectedParent, this); - - return ok; -} - -static CallbackTest gCallbackTest; - -}; // namespace - -#endif /* RUN_SELF_TESTS */ diff --git a/src/core/command-line.cc b/src/core/command-line.cc index 77849cb1f..e534d1445 100644 --- a/src/core/command-line.cc +++ b/src/core/command-line.cc @@ -22,8 +22,10 @@ #include "config.h" #include "global-value.h" #include "type-id.h" +#include "test.h" #include "string.h" #include +#include NS_LOG_COMPONENT_DEFINE ("CommandLine"); @@ -277,30 +279,25 @@ CommandLine::AddValue (const std::string &name, m_items.push_back (item); } - -} // namespace ns3 - -#ifdef RUN_SELF_TESTS - -#include "test.h" -#include - -using namespace ns3; - -class CommandLineTest : public Test +// =========================================================================== +// A test base class that drives Command Line parsing +// =========================================================================== +class CommandLineTestCaseBase : public TestCase { public: - CommandLineTest (); - virtual bool RunTests (void); -private: + CommandLineTestCaseBase (std::string description); + virtual ~CommandLineTestCaseBase () {} + void Parse (const CommandLine &cmd, int n, ...); }; -CommandLineTest::CommandLineTest () - : Test ("CommandLine") -{} +CommandLineTestCaseBase::CommandLineTestCaseBase (std::string description) + : TestCase (description) +{ +} + void -CommandLineTest::Parse (const CommandLine &cmd, int n, ...) +CommandLineTestCaseBase::Parse (const CommandLine &cmd, int n, ...) { char **args = new char* [n+1]; args[0] = (char *) "Test"; @@ -317,41 +314,175 @@ CommandLineTest::Parse (const CommandLine &cmd, int n, ...) cmd.Parse (argc, args); delete [] args; } -bool -CommandLineTest::RunTests (void) + +// =========================================================================== +// Test boolean Command Line processing +// =========================================================================== +class CommandLineBooleanTestCase : public CommandLineTestCaseBase { - bool result = true; +public: + CommandLineBooleanTestCase (); + virtual ~CommandLineBooleanTestCase () {} - bool myBool = false; - uint32_t myUint32 = 10; - std::string myStr = "MyStr"; - int32_t myInt32 = -1; - CommandLine cmd; +private: + virtual bool DoRun (void); - cmd.AddValue ("my-bool", "help", myBool); - Parse (cmd, 1, "--my-bool=0"); - NS_TEST_ASSERT_EQUAL (myBool, false); - Parse (cmd, 1, "--my-bool=1"); - NS_TEST_ASSERT_EQUAL (myBool, true); +}; - cmd.AddValue ("my-uint32", "help", myUint32); - Parse (cmd, 2, "--my-bool=0", "--my-uint32=9"); - NS_TEST_ASSERT_EQUAL (myUint32, 9); - - cmd.AddValue ("my-str", "help", myStr); - Parse (cmd, 2, "--my-bool=0", "--my-str=XX"); - NS_TEST_ASSERT_EQUAL (myStr, "XX"); - - cmd.AddValue ("my-int32", "help", myInt32); - Parse (cmd, 2, "--my-bool=0", "--my-int32=-3"); - NS_TEST_ASSERT_EQUAL (myInt32, -3); - Parse (cmd, 2, "--my-bool=0", "--my-int32=+2"); - NS_TEST_ASSERT_EQUAL (myInt32, +2); - - return result; +CommandLineBooleanTestCase::CommandLineBooleanTestCase () + : CommandLineTestCaseBase ("Check boolean arguments") +{ } +bool +CommandLineBooleanTestCase::DoRun (void) +{ + CommandLine cmd; + bool myBool = true; -static CommandLineTest g_cmdLineTest; + cmd.AddValue ("my-bool", "help", myBool); -#endif /* RUN_SELF_TESTS */ + Parse (cmd, 1, "--my-bool=0"); + NS_TEST_ASSERT_MSG_EQ (myBool, false, "Command parser did not correctly set a boolean value to false"); + + Parse (cmd, 1, "--my-bool=1"); + NS_TEST_ASSERT_MSG_EQ (myBool, true, "Command parser did not correctly set a boolean value to true"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test int Command Line processing +// =========================================================================== +class CommandLineIntTestCase : public CommandLineTestCaseBase +{ +public: + CommandLineIntTestCase (); + virtual ~CommandLineIntTestCase () {} + +private: + virtual bool DoRun (void); + +}; + +CommandLineIntTestCase::CommandLineIntTestCase () + : CommandLineTestCaseBase ("Check int arguments") +{ +} + +bool +CommandLineIntTestCase::DoRun (void) +{ + CommandLine cmd; + bool myBool = true; + int32_t myInt32 = 10; + + cmd.AddValue ("my-bool", "help", myBool); + cmd.AddValue ("my-int32", "help", myInt32); + + Parse (cmd, 2, "--my-bool=0", "--my-int32=-3"); + NS_TEST_ASSERT_MSG_EQ (myBool, false, "Command parser did not correctly set a boolean value to false"); + NS_TEST_ASSERT_MSG_EQ (myInt32, -3, "Command parser did not correctly set an integer value to -3"); + + Parse (cmd, 2, "--my-bool=1", "--my-int32=+2"); + NS_TEST_ASSERT_MSG_EQ (myBool, true, "Command parser did not correctly set a boolean value to true"); + NS_TEST_ASSERT_MSG_EQ (myInt32, +2, "Command parser did not correctly set an integer value to +2"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test unsigned int Command Line processing +// =========================================================================== +class CommandLineUnsignedIntTestCase : public CommandLineTestCaseBase +{ +public: + CommandLineUnsignedIntTestCase (); + virtual ~CommandLineUnsignedIntTestCase () {} + +private: + virtual bool DoRun (void); + +}; + +CommandLineUnsignedIntTestCase::CommandLineUnsignedIntTestCase () + : CommandLineTestCaseBase ("Check unsigned int arguments") +{ +} + +bool +CommandLineUnsignedIntTestCase::DoRun (void) +{ + CommandLine cmd; + bool myBool = true; + uint32_t myUint32 = 10; + + cmd.AddValue ("my-bool", "help", myBool); + cmd.AddValue ("my-uint32", "help", myUint32); + + Parse (cmd, 2, "--my-bool=0", "--my-uint32=9"); + + NS_TEST_ASSERT_MSG_EQ (myBool, false, "Command parser did not correctly set a boolean value to true"); + NS_TEST_ASSERT_MSG_EQ (myUint32, 9, "Command parser did not correctly set an unsigned integer value to 9"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test string Command Line processing +// =========================================================================== +class CommandLineStringTestCase : public CommandLineTestCaseBase +{ +public: + CommandLineStringTestCase (); + virtual ~CommandLineStringTestCase () {} + +private: + virtual bool DoRun (void); + +}; + +CommandLineStringTestCase::CommandLineStringTestCase () + : CommandLineTestCaseBase ("Check unsigned int arguments") +{ +} + +bool +CommandLineStringTestCase::DoRun (void) +{ + CommandLine cmd; + uint32_t myUint32 = 10; + std::string myStr = "MyStr"; + + cmd.AddValue ("my-uint32", "help", myUint32); + cmd.AddValue ("my-str", "help", myStr); + + Parse (cmd, 2, "--my-uint32=9", "--my-str=XX"); + + NS_TEST_ASSERT_MSG_EQ (myUint32, 9, "Command parser did not correctly set an unsigned integer value to 9"); + NS_TEST_ASSERT_MSG_EQ (myStr, "XX", "Command parser did not correctly set an string value to \"XX\""); + + return GetErrorStatus (); +} + +// =========================================================================== +// The Test Suite that glues all of the Test Cases together. +// =========================================================================== +class CommandLineTestSuite : public TestSuite +{ +public: + CommandLineTestSuite (); +}; + +CommandLineTestSuite::CommandLineTestSuite () + : TestSuite ("command-line", BVT) +{ + AddTestCase (new CommandLineBooleanTestCase); + AddTestCase (new CommandLineIntTestCase); + AddTestCase (new CommandLineUnsignedIntTestCase); + AddTestCase (new CommandLineStringTestCase); +} + +CommandLineTestSuite CommandLineTestSuite; + +} // namespace ns3 diff --git a/src/core/config.cc b/src/core/config.cc index eba50a765..57216897d 100644 --- a/src/core/config.cc +++ b/src/core/config.cc @@ -25,6 +25,13 @@ #include "names.h" #include "pointer.h" #include "log.h" + +#include "test.h" +#include "integer.h" +#include "traced-value.h" +#include "trace-source-accessor.h" +#include "callback.h" + #include NS_LOG_COMPONENT_DEFINE ("Config"); @@ -645,303 +652,640 @@ Ptr GetRootNamespaceObject (uint32_t i) return Singleton::Get ()->GetRootNamespaceObject (i); } - } // namespace Config -} // namespace ns3 - -#ifdef RUN_SELF_TESTS - -#include "test.h" -#include "integer.h" -#include "traced-value.h" -#include "trace-source-accessor.h" -#include "callback.h" - -namespace ns3 { - -class MyNode : public Object +// =========================================================================== +// An object with some attributes that we can play with using config. +// =========================================================================== +class ConfigTestObject : public Object { public: static TypeId GetTypeId (void); - void AddNodeA (Ptr a); - void AddNodeB (Ptr b); + void AddNodeA (Ptr a); + void AddNodeB (Ptr b); - void SetNodeA (Ptr a); - void SetNodeB (Ptr b); + void SetNodeA (Ptr a); + void SetNodeB (Ptr b); int8_t GetA (void) const; int8_t GetB (void) const; private: - std::vector > m_nodesA; - std::vector > m_nodesB; - Ptr m_nodeA; - Ptr m_nodeB; + std::vector > m_nodesA; + std::vector > m_nodesB; + Ptr m_nodeA; + Ptr m_nodeB; int8_t m_a; int8_t m_b; TracedValue m_trace; }; -TypeId MyNode::GetTypeId (void) +TypeId +ConfigTestObject::GetTypeId (void) { - static TypeId tid = TypeId ("MyNode") + static TypeId tid = TypeId ("ConfigTestObject") .SetParent () .AddAttribute ("NodesA", "", ObjectVectorValue (), - MakeObjectVectorAccessor (&MyNode::m_nodesA), - MakeObjectVectorChecker ()) + MakeObjectVectorAccessor (&ConfigTestObject::m_nodesA), + MakeObjectVectorChecker ()) .AddAttribute ("NodesB", "", ObjectVectorValue (), - MakeObjectVectorAccessor (&MyNode::m_nodesB), - MakeObjectVectorChecker ()) + MakeObjectVectorAccessor (&ConfigTestObject::m_nodesB), + MakeObjectVectorChecker ()) .AddAttribute ("NodeA", "", PointerValue (), - MakePointerAccessor (&MyNode::m_nodeA), - MakePointerChecker ()) + MakePointerAccessor (&ConfigTestObject::m_nodeA), + MakePointerChecker ()) .AddAttribute ("NodeB", "", PointerValue (), - MakePointerAccessor (&MyNode::m_nodeB), - MakePointerChecker ()) + MakePointerAccessor (&ConfigTestObject::m_nodeB), + MakePointerChecker ()) .AddAttribute ("A", "", IntegerValue (10), - MakeIntegerAccessor (&MyNode::m_a), + MakeIntegerAccessor (&ConfigTestObject::m_a), MakeIntegerChecker ()) .AddAttribute ("B", "", IntegerValue (9), - MakeIntegerAccessor (&MyNode::m_b), + MakeIntegerAccessor (&ConfigTestObject::m_b), MakeIntegerChecker ()) .AddAttribute ("Source", "XX", IntegerValue (-1), - MakeIntegerAccessor (&MyNode::m_trace), + MakeIntegerAccessor (&ConfigTestObject::m_trace), MakeIntegerChecker ()) .AddTraceSource ("Source", "XX", - MakeTraceSourceAccessor (&MyNode::m_trace)) + MakeTraceSourceAccessor (&ConfigTestObject::m_trace)) ; return tid; } void -MyNode::SetNodeA (Ptr a) +ConfigTestObject::SetNodeA (Ptr a) { m_nodeA = a; } + void -MyNode::SetNodeB (Ptr b) +ConfigTestObject::SetNodeB (Ptr b) { m_nodeB = b; } + void -MyNode::AddNodeA (Ptr a) +ConfigTestObject::AddNodeA (Ptr a) { m_nodesA.push_back (a); } + void -MyNode::AddNodeB (Ptr b) +ConfigTestObject::AddNodeB (Ptr b) { m_nodesB.push_back (b); } + int8_t -MyNode::GetA (void) const +ConfigTestObject::GetA (void) const { return m_a; } + int8_t -MyNode::GetB (void) const +ConfigTestObject::GetB (void) const { return m_b; } - -class ConfigTest : public Test +// =========================================================================== +// Test for the ability to register and use a root namespace +// =========================================================================== +class RootNamespaceConfigTestCase : public TestCase { public: - ConfigTest (); - virtual bool RunTests (void); + RootNamespaceConfigTestCase (); + virtual ~RootNamespaceConfigTestCase () {} + private: - void ChangeNotification (int16_t old, int16_t newValue); - void ChangeNotificationWithPath (std::string path, int16_t old, int16_t newValue); - int16_t m_traceNotification; - std::string m_tracePath; + virtual bool DoRun (void); + virtual void DoTeardown (void); }; -static ConfigTest g_configTestUnique; - -ConfigTest::ConfigTest () - : Test ("Config") -{} +RootNamespaceConfigTestCase::RootNamespaceConfigTestCase () + : TestCase ("Check ability to register a root namespace and use it") +{ +} void -ConfigTest::ChangeNotification (int16_t oldValue, int16_t newValue) +RootNamespaceConfigTestCase::DoTeardown (void) { - m_traceNotification = newValue; -} - -void -ConfigTest::ChangeNotificationWithPath (std::string path, int16_t old, int16_t newValue) -{ - m_traceNotification = newValue; - m_tracePath = path; -} - -bool -ConfigTest::RunTests (void) -{ - bool result = true; - - Ptr root = CreateObject (); - Config::RegisterRootNamespaceObject (root); - Config::Set ("/A", IntegerValue (1)); - Config::Set ("/B", IntegerValue (-1)); - IntegerValue v; - root->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), 1); - root->GetAttribute ("B", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -1); - - Ptr a = CreateObject (); - root->SetNodeA (a); - Config::Set ("/NodeA/A", IntegerValue (2)); - Config::Set ("/NodeA/B", IntegerValue (-2)); - a->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), 2); - a->GetAttribute ("B", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -2); - Config::Set ("/NodeB/A", IntegerValue (3)); - Config::Set ("/NodeB/B", IntegerValue (-3)); - a->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), 2); - a->GetAttribute ("B", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -2); - - Ptr b = CreateObject (); - a->SetNodeB (b); - Config::Set ("/NodeA/NodeB/A", IntegerValue (4)); - Config::Set ("/NodeA/NodeB/B", IntegerValue (-4)); - b->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), 4); - b->GetAttribute ("B", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -4); - - Ptr c = CreateObject (); - root->SetNodeB (c); - Config::Set ("/NodeB/A", IntegerValue (5)); - Config::Set ("/NodeB/B", IntegerValue (-5)); - c->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), 5); - c->GetAttribute ("B", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -5); - - - Ptr d0 = CreateObject (); - Ptr d1 = CreateObject (); - Ptr d2 = CreateObject (); - Ptr d3 = CreateObject (); - b->AddNodeB (d0); - b->AddNodeB (d1); - b->AddNodeB (d2); - b->AddNodeB (d3); - Config::Set ("/NodeA/NodeB/NodesB/0/A", IntegerValue (-11)); - d0->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -11); - d0->GetAttribute ("B", v); - NS_TEST_ASSERT_EQUAL (v.Get (), 9); - d1->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), 10); - d1->GetAttribute ("B", v); - NS_TEST_ASSERT_EQUAL (v.Get (), 9); - Config::Set ("/NodeA/NodeB/NodesB/0|1/A", IntegerValue (-12)); - d0->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -12); - d1->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -12); - Config::Set ("/NodeA/NodeB/NodesB/|0|1|/A", IntegerValue (-13)); - d0->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -13); - d1->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -13); - Config::Set ("/NodeA/NodeB/NodesB/[0-2]/A", IntegerValue (-14)); - d0->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -14); - d1->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -14); - d2->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -14); - Config::Set ("/NodeA/NodeB/NodesB/[1-3]/A", IntegerValue (-15)); - d0->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -14); - d1->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -15); - d2->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -15); - d3->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -15); - Config::Set ("/NodeA/NodeB/NodesB/[0-1]|3/A", IntegerValue (-16)); - d0->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -16); - d1->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -16); - d2->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -15); - d3->GetAttribute ("A", v); - NS_TEST_ASSERT_EQUAL (v.Get (), -16); - - - Config::ConnectWithoutContext ("/NodeA/NodeB/NodesB/[0-1]|3/Source", - MakeCallback (&ConfigTest::ChangeNotification, this)); - m_traceNotification = 0; - // this should trigger no notification - d2->SetAttribute ("Source", IntegerValue (-2)); - NS_TEST_ASSERT_EQUAL (m_traceNotification, 0); - m_traceNotification = 0; - // this should trigger a notification - d1->SetAttribute ("Source", IntegerValue (-3)); - NS_TEST_ASSERT_EQUAL (m_traceNotification, -3); - Config::DisconnectWithoutContext ("/NodeA/NodeB/NodesB/[0-1]|3/Source", - MakeCallback (&ConfigTest::ChangeNotification, this)); - m_traceNotification = 0; - // this should _not_ trigger a notification - d1->SetAttribute ("Source", IntegerValue (-4)); - NS_TEST_ASSERT_EQUAL (m_traceNotification, 0); - - - Config::Connect ("/NodeA/NodeB/NodesB/[0-1]|3/Source", - MakeCallback (&ConfigTest::ChangeNotificationWithPath, this)); - m_traceNotification = 0; - // this should trigger no notification - d2->SetAttribute ("Source", IntegerValue (-2)); - NS_TEST_ASSERT_EQUAL (m_traceNotification, 0); - m_traceNotification = 0; - m_tracePath = ""; - // this should trigger a notification - d1->SetAttribute ("Source", IntegerValue (-3)); - NS_TEST_ASSERT_EQUAL (m_traceNotification, -3); - NS_TEST_ASSERT_EQUAL (m_tracePath, "/NodeA/NodeB/NodesB/1/Source"); - m_traceNotification = 0; - m_tracePath = ""; - // this should trigger a notification - d3->SetAttribute ("Source", IntegerValue (-3)); - NS_TEST_ASSERT_EQUAL (m_traceNotification, -3); - NS_TEST_ASSERT_EQUAL (m_tracePath, "/NodeA/NodeB/NodesB/3/Source"); - Config::Disconnect ("/NodeA/NodeB/NodesB/[0-1]|3/Source", - MakeCallback (&ConfigTest::ChangeNotificationWithPath, this)); - m_traceNotification = 0; - // this should _not_ trigger a notification - d1->SetAttribute ("Source", IntegerValue (-4)); - NS_TEST_ASSERT_EQUAL (m_traceNotification, 0); - // // The Config system is intertwined with the Names system. In the process - // of parsing the paths above, we also created a NamesPriv singleton. In + // of parsing the paths in the tests, we create a NamesPriv singleton. In // order to get a valgrind-clean run we need to clean up that singleton. // Names::Delete (); - - return result; } +bool +RootNamespaceConfigTestCase::DoRun (void) +{ + IntegerValue iv; + // + // Create an object and register its attributes directly in the root + // namespace. + // + Ptr root = CreateObject (); + Config::RegisterRootNamespaceObject (root); + + // + // We should find the default values there. + // + root->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" not initialized as expected"); + + // + // Now use the config mechanism to set the attribute; and we should find the + // new value. + // + Config::Set ("/A", IntegerValue (1)); + root->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 1, "Object Attribute \"A\" not set correctly"); + + // + // We should find the default values of "B" too. + // + root->GetAttribute ("B", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 9, "Object Attribute \"B\" not initialized as expected"); + + // + // Now use the config mechanism to set the attribute; and we should find the + // new value. + // + Config::Set ("/B", IntegerValue (-1)); + root->GetAttribute ("B", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -1, "Object Attribute \"B\" not set correctly"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test for the ability to add an object under the root namespace. +// =========================================================================== +class UnderRootNamespaceConfigTestCase : public TestCase +{ +public: + UnderRootNamespaceConfigTestCase (); + virtual ~UnderRootNamespaceConfigTestCase () {} + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +UnderRootNamespaceConfigTestCase::UnderRootNamespaceConfigTestCase () + : TestCase ("Check ability to register an object under the root namespace and use it") +{ +} + +void +UnderRootNamespaceConfigTestCase::DoTeardown (void) +{ + // + // The Config system is intertwined with the Names system. In the process + // of parsing the paths in the tests, we create a NamesPriv singleton. In + // order to get a valgrind-clean run we need to clean up that singleton. + // + Names::Delete (); +} + +bool +UnderRootNamespaceConfigTestCase::DoRun (void) +{ + IntegerValue iv; + // + // Create an object and register its attributes directly in the root + // namespace. + // + Ptr root = CreateObject (); + Config::RegisterRootNamespaceObject (root); + + Ptr a = CreateObject (); + root->SetNodeA (a); + + // + // We should find the default values there. + // + a->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" not initialized as expected"); + + // + // Now use the config mechanism to set the attribute; and we should find the + // new value. + // + Config::Set ("/NodeA/A", IntegerValue (1)); + a->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 1, "Object Attribute \"A\" not set correctly"); + + // + // We should find the default values of "B" too. + // + a->GetAttribute ("B", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 9, "Object Attribute \"B\" not initialized as expected"); + + // + // Now use the config mechanism to set the attribute; and we should find the + // new value. + // + Config::Set ("/NodeA/B", IntegerValue (-1)); + a->GetAttribute ("B", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -1, "Object Attribute \"B\" not set correctly"); + + // + // Try and set through a nonexistent path. Should do nothing. + // + Config::Set ("/NodeB/A", IntegerValue (1234)); + a->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 1, "Object Attribute \"A\" unexpectedly set via bad path"); + + Config::Set ("/NodeB/B", IntegerValue (1234)); + a->GetAttribute ("B", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -1, "Object Attribute \"B\" unexpectedly set via bad path"); + + // + // Step down one level of recursion and try again + // + Ptr b = CreateObject (); + + // + // We should find the default values there. + // + b->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" not initialized as expected"); + b->GetAttribute ("B", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 9, "Object Attribute \"B\" not initialized as expected"); + + // + // Now tell A that it has a B; and we should be able to set this new object's + // Attributes. + // + a->SetNodeB (b); + + Config::Set ("/NodeA/NodeB/A", IntegerValue (4)); + Config::Set ("/NodeA/NodeB/B", IntegerValue (-4)); + b->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 4, "Object Attribute \"A\" not set as expected"); + b->GetAttribute ("B", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -4, "Object Attribute \"B\" not set as expected"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test for the ability to deal configure with vectors of objects. +// =========================================================================== +class ObjectVectorConfigTestCase : public TestCase +{ +public: + ObjectVectorConfigTestCase (); + virtual ~ObjectVectorConfigTestCase () {} + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +ObjectVectorConfigTestCase::ObjectVectorConfigTestCase () + : TestCase ("Check ability to configure vectors of Object using regular expressions") +{ +} + +void +ObjectVectorConfigTestCase::DoTeardown (void) +{ + // + // The Config system is intertwined with the Names system. In the process + // of parsing the paths in the tests, we create a NamesPriv singleton. In + // order to get a valgrind-clean run we need to clean up that singleton. + // + Names::Delete (); +} + +bool +ObjectVectorConfigTestCase::DoRun (void) +{ + IntegerValue iv; + + // + // Create a root namespace object + // + Ptr root = CreateObject (); + Config::RegisterRootNamespaceObject (root); + + // + // Create an object under the root. + // + Ptr a = CreateObject (); + root->SetNodeA (a); + + // + // Create an object one level down. + // + Ptr b = CreateObject (); + a->SetNodeB (b); + + // + // Add four objects to the ObjectVector Attribute at the bottom of the + // object hierarchy. By this point, we believe that the Attributes + // will be initialized correctly. + // + Ptr obj0 = CreateObject (); + Ptr obj1 = CreateObject (); + Ptr obj2 = CreateObject (); + Ptr obj3 = CreateObject (); + b->AddNodeB (obj0); + b->AddNodeB (obj1); + b->AddNodeB (obj2); + b->AddNodeB (obj3); + + // + // Set an Attribute of the zeroth Object in the vector by explicitly writing + // the '0' and make sure that only the one thing changed. + // + Config::Set ("/NodeA/NodeB/NodesB/0/A", IntegerValue (-11)); + obj0->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -11, "Object Attribute \"A\" not set as expected"); + + obj1->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" unexpectedly set"); + + obj2->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" unexpectedly set"); + + obj3->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" unexpectedly set"); + + // + // Start using regular expression-like syntax to set Attributes. First try + // the OR syntax. Make sure that the two objects changed and nothing else + // + Config::Set ("/NodeA/NodeB/NodesB/0|1/A", IntegerValue (-12)); + obj0->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -12, "Object Attribute \"A\" not set as expected"); + + obj1->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -12, "Object Attribute \"A\" not set as expected"); + + obj2->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" unexpectedly set"); + + obj3->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" unexpectedly set"); + + // + // Make sure that extra '|' are allowed at the start and end of the regular expression + // + Config::Set ("/NodeA/NodeB/NodesB/|0|1|/A", IntegerValue (-13)); + obj0->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -13, "Object Attribute \"A\" not set as expected"); + + obj1->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -13, "Object Attribute \"A\" not set as expected"); + + obj2->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" unexpectedly set"); + + obj3->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" unexpectedly set"); + + // + // Try the [x-y] syntax + // + Config::Set ("/NodeA/NodeB/NodesB/[0-2]/A", IntegerValue (-14)); + obj0->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -14, "Object Attribute \"A\" not set as expected"); + + obj1->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -14, "Object Attribute \"A\" not set as expected"); + + obj2->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -14, "Object Attribute \"A\" not set as expected"); + + obj3->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 10, "Object Attribute \"A\" unexpectedly set"); + + // + // Try the [x-y] syntax at the other limit + // + Config::Set ("/NodeA/NodeB/NodesB/[1-3]/A", IntegerValue (-15)); + obj0->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -14, "Object Attribute \"A\" unexpectedly set"); + + obj1->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -15, "Object Attribute \"A\" not set as expected"); + + obj2->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -15, "Object Attribute \"A\" not set as expected"); + + obj3->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -15, "Object Attribute \"A\" not set as expected"); + + // + // Combine the [x-y] syntax and the OR sntax + // + Config::Set ("/NodeA/NodeB/NodesB/[0-1]|3/A", IntegerValue (-16)); + obj0->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -16, "Object Attribute \"A\" not set as expected"); + + obj1->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -16, "Object Attribute \"A\" not set as expected"); + + obj2->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -15, "Object Attribute \"A\" unexpectedly set"); + + obj3->GetAttribute ("A", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), -16, "Object Attribute \"A\" not set as expected"); + + return GetErrorStatus (); +} + +// =========================================================================== +// Test for the ability to trace configure with vectors of objects. +// =========================================================================== +class ObjectVectorTraceConfigTestCase : public TestCase +{ +public: + ObjectVectorTraceConfigTestCase (); + virtual ~ObjectVectorTraceConfigTestCase () {} + + void Trace (int16_t oldValue, int16_t newValue) {m_newValue = newValue;} + void TraceWithPath (std::string path, int16_t old, int16_t newValue) {m_newValue = newValue; m_path = path;} + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); + + int16_t m_newValue; + std::string m_path; +}; + +ObjectVectorTraceConfigTestCase::ObjectVectorTraceConfigTestCase () + : TestCase ("Check ability to trace connect through vectors of Object using regular expressions") +{ +} + +void +ObjectVectorTraceConfigTestCase::DoTeardown (void) +{ + // + // The Config system is intertwined with the Names system. In the process + // of parsing the paths in the tests, we create a NamesPriv singleton. In + // order to get a valgrind-clean run we need to clean up that singleton. + // + Names::Delete (); +} + +bool +ObjectVectorTraceConfigTestCase::DoRun (void) +{ + IntegerValue iv; + + // + // Create a root namespace object + // + Ptr root = CreateObject (); + Config::RegisterRootNamespaceObject (root); + + // + // Create an object under the root. + // + Ptr a = CreateObject (); + root->SetNodeA (a); + + // + // Create an object one level down. + // + Ptr b = CreateObject (); + a->SetNodeB (b); + + // + // Add four objects to the ObjectVector Attribute at the bottom of the + // object hierarchy. By this point, we believe that the Attributes + // will be initialized correctly. + // + Ptr obj0 = CreateObject (); + Ptr obj1 = CreateObject (); + Ptr obj2 = CreateObject (); + Ptr obj3 = CreateObject (); + b->AddNodeB (obj0); + b->AddNodeB (obj1); + b->AddNodeB (obj2); + b->AddNodeB (obj3); + + // + // Do a trace connect to some of the sources. We already checked parsing of + // the regular expressions, so we'll concentrate on the tracing part of the + // puzzle here. + // + Config::ConnectWithoutContext ("/NodeA/NodeB/NodesB/[0-1]|3/Source", + MakeCallback (&ObjectVectorTraceConfigTestCase::Trace, this)); + + // + // If we bug the trace source referred to by index '0' above, we should see + // the trace fire. + // + m_newValue = 0; + obj0->SetAttribute ("Source", IntegerValue (-1)); + NS_TEST_ASSERT_MSG_EQ (m_newValue, -1, "Trace 0 did not fire as expected"); + + // + // If we bug the trace source referred to by index '1' above, we should see + // the trace fire. + // + m_newValue = 0; + obj1->SetAttribute ("Source", IntegerValue (-2)); + NS_TEST_ASSERT_MSG_EQ (m_newValue, -2, "Trace 1 did not fire as expected"); + + // + // If we bug the trace source referred to by index '2' which is skipped above, + // we should not see the trace fire. + // + m_newValue = 0; + obj2->SetAttribute ("Source", IntegerValue (-3)); + NS_TEST_ASSERT_MSG_EQ (m_newValue, 0, "Trace 2 fired unexpectedly"); + + // + // If we bug the trace source referred to by index '3' above, we should see + // the trace fire. + // + m_newValue = 0; + obj3->SetAttribute ("Source", IntegerValue (-4)); + NS_TEST_ASSERT_MSG_EQ (m_newValue, -4, "Trace 3 did not fire as expected"); + + // + // Do a trace connect (with context) to some of the sources. + // + Config::Connect ("/NodeA/NodeB/NodesB/[0-1]|3/Source", + MakeCallback (&ObjectVectorTraceConfigTestCase::TraceWithPath, this)); + + // + // If we bug the trace source referred to by index '0' above, we should see + // the trace fire with the expected context path. + // + m_newValue = 0; + m_path = ""; + obj0->SetAttribute ("Source", IntegerValue (-1)); + NS_TEST_ASSERT_MSG_EQ (m_newValue, -1, "Trace 0 did not fire as expected"); + NS_TEST_ASSERT_MSG_EQ (m_path, "/NodeA/NodeB/NodesB/0/Source", "Trace 0 did not provide expected context"); + + // + // If we bug the trace source referred to by index '1' above, we should see + // the trace fire with the expected context path. + // + m_newValue = 0; + m_path = ""; + obj1->SetAttribute ("Source", IntegerValue (-2)); + NS_TEST_ASSERT_MSG_EQ (m_newValue, -2, "Trace 1 did not fire as expected"); + NS_TEST_ASSERT_MSG_EQ (m_path, "/NodeA/NodeB/NodesB/1/Source", "Trace 1 did not provide expected context"); + + // + // If we bug the trace source referred to by index '2' which is skipped above, + // we should not see the trace fire. + // + m_newValue = 0; + m_path = ""; + obj2->SetAttribute ("Source", IntegerValue (-3)); + NS_TEST_ASSERT_MSG_EQ (m_newValue, 0, "Trace 2 fired unexpectedly"); + + // + // If we bug the trace source referred to by index '3' above, we should see + // the trace fire with the expected context path. + // + m_newValue = 0; + m_path = ""; + obj3->SetAttribute ("Source", IntegerValue (-4)); + NS_TEST_ASSERT_MSG_EQ (m_newValue, -4, "Trace 3 did not fire as expected"); + NS_TEST_ASSERT_MSG_EQ (m_path, "/NodeA/NodeB/NodesB/1/Source", "Trace 1 did not provide expected context"); + + return GetErrorStatus (); +} + +// =========================================================================== +// The Test Suite that glues all of the Test Cases together. +// =========================================================================== +class ConfigTestSuite : public TestSuite +{ +public: + ConfigTestSuite (); +}; + +ConfigTestSuite::ConfigTestSuite () + : TestSuite ("config", BVT) +{ + AddTestCase (new RootNamespaceConfigTestCase); + AddTestCase (new UnderRootNamespaceConfigTestCase); + AddTestCase (new ObjectVectorConfigTestCase); +} + +ConfigTestSuite configTestSuite; + } // namespace ns3 - - -#endif /* RUN_SELF_TEST */ diff --git a/src/core/global-value.cc b/src/core/global-value.cc index 506fb11b8..d5c50f615 100644 --- a/src/core/global-value.cc +++ b/src/core/global-value.cc @@ -21,6 +21,9 @@ #include "fatal-error.h" #include "attribute.h" #include "string.h" +#include "uinteger.h" +#include "test.h" + #include "ns3/core-config.h" #ifdef HAVE_STDLIB_H #include @@ -205,54 +208,74 @@ GlobalValue::GetVector (void) return &vector; } -} // namespace ns3 - -#ifdef RUN_SELF_TESTS - -#include "test.h" -#include "uinteger.h" - -namespace ns3 { - -class GlobalValueTests : public Test +// =========================================================================== +// Test for the ability to get at a GlobalValue. +// =========================================================================== +class GlobalValueTestCase : public TestCase { public: - GlobalValueTests (); - virtual bool RunTests (void); + GlobalValueTestCase (); + virtual ~GlobalValueTestCase () {} + private: + virtual bool DoRun (void); }; -GlobalValueTests::GlobalValueTests () - : Test ("GlobalValue") -{} -bool -GlobalValueTests::RunTests (void) +GlobalValueTestCase::GlobalValueTestCase () + : TestCase ("Check GlobalValue mechanism") { - bool result = true; +} + +bool +GlobalValueTestCase::DoRun (void) +{ + // + // Typically these are static globals but we can make one on the stack to + // keep it hidden from the documentation. + // GlobalValue uint = GlobalValue ("TestUint", "help text", UintegerValue (10), MakeUintegerChecker ()); + // + // Make sure we can get at the value and that it was initialized correctly. + // + UintegerValue uv; + uint.GetValue (uv); + NS_TEST_ASSERT_MSG_EQ (uv.Get (), 10, "GlobalValue \"TestUint\" not initialized as expected"); - UintegerValue v; - uint.GetValue (v); - NS_TEST_ASSERT_EQUAL (10, v.Get ()); - + // + // Remove the global value for a valgrind clean run + // GlobalValue::Vector *vector = GlobalValue::GetVector (); for (GlobalValue::Vector::iterator i = vector->begin (); i != vector->end (); ++i) { if ((*i) == &uint) { vector->erase (i); - break; - } + break; + } } - return result; + return GetErrorStatus (); } -static GlobalValueTests g_initialValueTests; +// =========================================================================== +// The Test Suite that glues all of the Test Cases together. +// =========================================================================== +class GlobalValueTestSuite : public TestSuite +{ +public: + GlobalValueTestSuite (); +}; + +GlobalValueTestSuite::GlobalValueTestSuite () + : TestSuite ("global-value", BVT) +{ + AddTestCase (new GlobalValueTestCase); +} + +GlobalValueTestSuite globalValueTestSuite; } // namespace ns3 -#endif /* RUN_SELF_TESTS */ diff --git a/src/core/global-value.h b/src/core/global-value.h index c744247dd..942de8e56 100644 --- a/src/core/global-value.h +++ b/src/core/global-value.h @@ -139,7 +139,8 @@ public: private: - friend class GlobalValueTests; + friend class GlobalValueTestCase; + static Vector *GetVector (void); void InitializeFromEnv (void); std::string m_name; diff --git a/src/core/names-test-suite.cc b/src/core/names-test-suite.cc new file mode 100644 index 000000000..626e9c605 --- /dev/null +++ b/src/core/names-test-suite.cc @@ -0,0 +1,975 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "test.h" +#include "names.h" + +using namespace ns3; + +// =========================================================================== +// Cook up a couple of simple object class that we can use in the object +// naming tests. They do nothing but be of the right type. +// =========================================================================== +class TestObject : public Object +{ +public: + static TypeId GetTypeId (void) + { + static TypeId tid = TypeId ("TestObject") + .SetParent (Object::GetTypeId ()) + .HideFromDocumentation () + .AddConstructor (); + return tid; + } + TestObject () {} + virtual void Dispose (void) {} +}; + +class AlternateTestObject : public Object +{ +public: + static TypeId GetTypeId (void) + { + static TypeId tid = TypeId ("AlternateTestObject") + .SetParent (Object::GetTypeId ()) + .HideFromDocumentation () + .AddConstructor (); + return tid; + } + AlternateTestObject () {} + virtual void Dispose (void) {} +}; + +// =========================================================================== +// Test case to make sure that the Object Name Service can do its most basic +// job and add associations between Objects using the lowest level add +// function, which is: +// +// Add (Ptr context, std::string name, Ptr object); +// +// All other add functions will just translate into this form, so this is the +// most basic Add functionality. +// =========================================================================== +class BasicAddTestCase : public TestCase +{ +public: + BasicAddTestCase (); + virtual ~BasicAddTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +BasicAddTestCase::BasicAddTestCase () + : TestCase ("Check low level Names::Add and Names::FindName functionality") +{ +} + +BasicAddTestCase::~BasicAddTestCase () +{ +} + +void +BasicAddTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +BasicAddTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add (Ptr (0, false), "Name One", objectOne); + + Ptr objectTwo = CreateObject (); + Names::Add (Ptr (0, false), "Name Two", objectTwo); + + Ptr childOfObjectOne = CreateObject (); + Names::Add (objectOne, "Child", childOfObjectOne); + + Ptr childOfObjectTwo = CreateObject (); + Names::Add (objectTwo, "Child", childOfObjectTwo); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Name One", "Could not Names::Add and Names::FindName an Object"); + + found = Names::FindName (objectTwo); + NS_TEST_ASSERT_MSG_EQ (found, "Name Two", "Could not Names::Add and Names::FindName a second Object"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + found = Names::FindName (childOfObjectTwo); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can correctly use a +// string context in the most basic ways +// +// Add (std::string context, std::string name, Ptr object); +// +// High level path-based functions will translate into this form, so this is +// the second most basic Add functionality. +// =========================================================================== +class StringContextAddTestCase : public TestCase +{ +public: + StringContextAddTestCase (); + virtual ~StringContextAddTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +StringContextAddTestCase::StringContextAddTestCase () + : TestCase ("Check string context Names::Add and Names::FindName functionality") + +{ +} + +StringContextAddTestCase::~StringContextAddTestCase () +{ +} + +void +StringContextAddTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +StringContextAddTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add ("/Names", "Name One", objectOne); + + Ptr objectTwo = CreateObject (); + Names::Add ("/Names", "Name Two", objectTwo); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("/Names/Name One", "Child", childOfObjectOne); + + Ptr childOfObjectTwo = CreateObject (); + Names::Add ("/Names/Name Two", "Child", childOfObjectTwo); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Name One", "Could not Names::Add and Names::FindName an Object"); + + found = Names::FindName (objectTwo); + NS_TEST_ASSERT_MSG_EQ (found, "Name Two", "Could not Names::Add and Names::FindName a second Object"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + found = Names::FindName (childOfObjectTwo); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can correctly use a +// fully qualified path to add assocations +// +// Add (std::string name, Ptr object); +// =========================================================================== +class FullyQualifiedAddTestCase : public TestCase +{ +public: + FullyQualifiedAddTestCase (); + virtual ~FullyQualifiedAddTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +FullyQualifiedAddTestCase::FullyQualifiedAddTestCase () + : TestCase ("Check fully qualified path Names::Add and Names::FindName functionality") + +{ +} + +FullyQualifiedAddTestCase::~FullyQualifiedAddTestCase () +{ +} + +void +FullyQualifiedAddTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +FullyQualifiedAddTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add ("/Names/Name One", objectOne); + + Ptr objectTwo = CreateObject (); + Names::Add ("/Names/Name Two", objectTwo); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("/Names/Name One/Child", childOfObjectOne); + + Ptr childOfObjectTwo = CreateObject (); + Names::Add ("/Names/Name Two/Child", childOfObjectTwo); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Name One", "Could not Names::Add and Names::FindName an Object"); + + found = Names::FindName (objectTwo); + NS_TEST_ASSERT_MSG_EQ (found, "Name Two", "Could not Names::Add and Names::FindName a second Object"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + found = Names::FindName (childOfObjectTwo); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can correctly use a +// relative path to add assocations. This functionality is provided as a +// convenience so clients don't always have to provide the name service +// namespace name in all of their strings. +// +// +// Add (std::string name, Ptr object); +// =========================================================================== +class RelativeAddTestCase : public TestCase +{ +public: + RelativeAddTestCase (); + virtual ~RelativeAddTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +RelativeAddTestCase::RelativeAddTestCase () + : TestCase ("Check relative path Names::Add and Names::FindName functionality") + +{ +} + +RelativeAddTestCase::~RelativeAddTestCase () +{ +} + +void +RelativeAddTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +RelativeAddTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add ("Name One", objectOne); + + Ptr objectTwo = CreateObject (); + Names::Add ("Name Two", objectTwo); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("Name One/Child", childOfObjectOne); + + Ptr childOfObjectTwo = CreateObject (); + Names::Add ("Name Two/Child", childOfObjectTwo); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Name One", "Could not Names::Add and Names::FindName an Object"); + + found = Names::FindName (objectTwo); + NS_TEST_ASSERT_MSG_EQ (found, "Name Two", "Could not Names::Add and Names::FindName a second Object"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + found = Names::FindName (childOfObjectTwo); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can rename objects in +// its most basic way, which is +// +// Rename (Ptr context, std::string oldname, std::string newname); +// +// All other rename functions will just translate into this form, so this is the +// most basic rename functionality. +// =========================================================================== +class BasicRenameTestCase : public TestCase +{ +public: + BasicRenameTestCase (); + virtual ~BasicRenameTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +BasicRenameTestCase::BasicRenameTestCase () + : TestCase ("Check low level Names::Rename functionality") +{ +} + +BasicRenameTestCase::~BasicRenameTestCase () +{ +} + +void +BasicRenameTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +BasicRenameTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add (Ptr (0, false), "Name", objectOne); + + Ptr childOfObjectOne = CreateObject (); + Names::Add (objectOne, "Child", childOfObjectOne); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Name", "Could not Names::Add and Names::FindName an Object"); + + Names::Rename (Ptr (0, false), "Name", "New Name"); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "New Name", "Could not Names::Rename an Object"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + Names::Rename (objectOne, "Child", "New Child"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "New Child", "Could not Names::Rename a child Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can rename objects +// using a string context +// +// Rename (std::string context, std::string oldname, std::string newname); +// =========================================================================== +class StringContextRenameTestCase : public TestCase +{ +public: + StringContextRenameTestCase (); + virtual ~StringContextRenameTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +StringContextRenameTestCase::StringContextRenameTestCase () + : TestCase ("Check string context-based Names::Rename functionality") +{ +} + +StringContextRenameTestCase::~StringContextRenameTestCase () +{ +} + +void +StringContextRenameTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +StringContextRenameTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add ("/Names", "Name", objectOne); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("/Names/Name", "Child", childOfObjectOne); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Name", "Could not Names::Add and Names::FindName an Object"); + + Names::Rename ("/Names", "Name", "New Name"); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "New Name", "Could not Names::Rename an Object"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + Names::Rename ("/Names/New Name", "Child", "New Child"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "New Child", "Could not Names::Rename a child Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can rename objects +// using a fully qualified path name +// +// Rename (std::string oldpath, std::string newname); +// =========================================================================== +class FullyQualifiedRenameTestCase : public TestCase +{ +public: + FullyQualifiedRenameTestCase (); + virtual ~FullyQualifiedRenameTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +FullyQualifiedRenameTestCase::FullyQualifiedRenameTestCase () + : TestCase ("Check fully qualified path Names::Rename functionality") +{ +} + +FullyQualifiedRenameTestCase::~FullyQualifiedRenameTestCase () +{ +} + +void +FullyQualifiedRenameTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +FullyQualifiedRenameTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add ("/Names/Name", objectOne); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("/Names/Name/Child", childOfObjectOne); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Name", "Could not Names::Add and Names::FindName an Object"); + + Names::Rename ("/Names/Name", "New Name"); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "New Name", "Could not Names::Rename an Object"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + Names::Rename ("/Names/New Name/Child", "New Child"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "New Child", "Could not Names::Rename a child Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can rename objects +// using a relaltive path name +// +// Rename (std::string oldpath, std::string newname); +// =========================================================================== +class RelativeRenameTestCase : public TestCase +{ +public: + RelativeRenameTestCase (); + virtual ~RelativeRenameTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +RelativeRenameTestCase::RelativeRenameTestCase () + : TestCase ("Check relative path Names::Rename functionality") +{ +} + +RelativeRenameTestCase::~RelativeRenameTestCase () +{ +} + +void +RelativeRenameTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +RelativeRenameTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add ("Name", objectOne); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("Name/Child", childOfObjectOne); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Name", "Could not Names::Add and Names::FindName an Object"); + + Names::Rename ("Name", "New Name"); + + found = Names::FindName (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "New Name", "Could not Names::Rename an Object"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "Child", "Could not Names::Add and Names::FindName a child Object"); + + Names::Rename ("New Name/Child", "New Child"); + + found = Names::FindName (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "New Child", "Could not Names::Rename a child Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can look up an object +// and return its fully qualified path name +// +// FindPath (Ptr object); +// =========================================================================== +class FindPathTestCase : public TestCase +{ +public: + FindPathTestCase (); + virtual ~FindPathTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +FindPathTestCase::FindPathTestCase () + : TestCase ("Check Names::FindPath functionality") +{ +} + +FindPathTestCase::~FindPathTestCase () +{ +} + +void +FindPathTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +FindPathTestCase::DoRun (void) +{ + std::string found; + + Ptr objectOne = CreateObject (); + Names::Add ("Name", objectOne); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("/Names/Name/Child", childOfObjectOne); + + found = Names::FindPath (objectOne); + NS_TEST_ASSERT_MSG_EQ (found, "/Names/Name", "Could not Names::Add and Names::FindPath an Object"); + + found = Names::FindPath (childOfObjectOne); + NS_TEST_ASSERT_MSG_EQ (found, "/Names/Name/Child", "Could not Names::Add and Names::FindPath a child Object"); + + Ptr objectNotThere = CreateObject (); + found = Names::FindPath (objectNotThere); + NS_TEST_ASSERT_MSG_EQ (found, "", "Unexpectedly found a non-existent Object"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can find Objects using +// the lowest level find function, which is: +// +// Find (Ptr context, std::string name); +// =========================================================================== +class BasicFindTestCase : public TestCase +{ +public: + BasicFindTestCase (); + virtual ~BasicFindTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +BasicFindTestCase::BasicFindTestCase () + : TestCase ("Check low level Names::Find functionality") +{ +} + +BasicFindTestCase::~BasicFindTestCase () +{ +} + +void +BasicFindTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +BasicFindTestCase::DoRun (void) +{ + Ptr found; + + Ptr objectOne = CreateObject (); + Names::Add ("Name One", objectOne); + + Ptr objectTwo = CreateObject (); + Names::Add ("Name Two", objectTwo); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("Name One/Child", childOfObjectOne); + + Ptr childOfObjectTwo = CreateObject (); + Names::Add ("Name Two/Child", childOfObjectTwo); + + found = Names::Find (Ptr (0, false), "Name One"); + NS_TEST_ASSERT_MSG_EQ (found, objectOne, "Could not find a previously named Object via object context"); + + found = Names::Find (Ptr (0, false), "Name Two"); + NS_TEST_ASSERT_MSG_EQ (found, objectTwo, "Could not find a previously named Object via object context"); + + found = Names::Find (objectOne, "Child"); + NS_TEST_ASSERT_MSG_EQ (found, childOfObjectOne, "Could not find a previously named child Object via object context"); + + found = Names::Find (objectTwo, "Child"); + NS_TEST_ASSERT_MSG_EQ (found, childOfObjectTwo, "Could not find a previously named child Object via object context"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can find Objects using +// a string context-based find function, which is: +// +// Find (std::string context, std::string name); +// =========================================================================== +class StringContextFindTestCase : public TestCase +{ +public: + StringContextFindTestCase (); + virtual ~StringContextFindTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +StringContextFindTestCase::StringContextFindTestCase () + : TestCase ("Check string context-based Names::Find functionality") +{ +} + +StringContextFindTestCase::~StringContextFindTestCase () +{ +} + +void +StringContextFindTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +StringContextFindTestCase::DoRun (void) +{ + Ptr found; + + Ptr objectOne = CreateObject (); + Names::Add ("Name One", objectOne); + + Ptr objectTwo = CreateObject (); + Names::Add ("Name Two", objectTwo); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("Name One/Child", childOfObjectOne); + + Ptr childOfObjectTwo = CreateObject (); + Names::Add ("Name Two/Child", childOfObjectTwo); + + found = Names::Find ("/Names", "Name One"); + NS_TEST_ASSERT_MSG_EQ (found, objectOne, "Could not find a previously named Object via string context"); + + found = Names::Find ("/Names", "Name Two"); + NS_TEST_ASSERT_MSG_EQ (found, objectTwo, "Could not find a previously named Object via stribng context"); + + found = Names::Find ("/Names/Name One", "Child"); + NS_TEST_ASSERT_MSG_EQ (found, childOfObjectOne, "Could not find a previously named child Object via string context"); + + found = Names::Find ("/Names/Name Two", "Child"); + NS_TEST_ASSERT_MSG_EQ (found, childOfObjectTwo, "Could not find a previously named child Object via string context"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can find Objects using +// a fully qualified path name-based find function, which is: +// +// Find (std::string name); +// =========================================================================== +class FullyQualifiedFindTestCase : public TestCase +{ +public: + FullyQualifiedFindTestCase (); + virtual ~FullyQualifiedFindTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +FullyQualifiedFindTestCase::FullyQualifiedFindTestCase () + : TestCase ("Check fully qualified path Names::Find functionality") +{ +} + +FullyQualifiedFindTestCase::~FullyQualifiedFindTestCase () +{ +} + +void +FullyQualifiedFindTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +FullyQualifiedFindTestCase::DoRun (void) +{ + Ptr found; + + Ptr objectOne = CreateObject (); + Names::Add ("/Names/Name One", objectOne); + + Ptr objectTwo = CreateObject (); + Names::Add ("/Names/Name Two", objectTwo); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("/Names/Name One/Child", childOfObjectOne); + + Ptr childOfObjectTwo = CreateObject (); + Names::Add ("/Names/Name Two/Child", childOfObjectTwo); + + found = Names::Find ("/Names/Name One"); + NS_TEST_ASSERT_MSG_EQ (found, objectOne, "Could not find a previously named Object via string context"); + + found = Names::Find ("/Names/Name Two"); + NS_TEST_ASSERT_MSG_EQ (found, objectTwo, "Could not find a previously named Object via stribng context"); + + found = Names::Find ("/Names/Name One/Child"); + NS_TEST_ASSERT_MSG_EQ (found, childOfObjectOne, "Could not find a previously named child Object via string context"); + + found = Names::Find ("/Names/Name Two/Child"); + NS_TEST_ASSERT_MSG_EQ (found, childOfObjectTwo, "Could not find a previously named child Object via string context"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can find Objects using +// a relative path name-based find function, which is: +// +// Find (std::string name); +// =========================================================================== +class RelativeFindTestCase : public TestCase +{ +public: + RelativeFindTestCase (); + virtual ~RelativeFindTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +RelativeFindTestCase::RelativeFindTestCase () + : TestCase ("Check relative path Names::Find functionality") +{ +} + +RelativeFindTestCase::~RelativeFindTestCase () +{ +} + +void +RelativeFindTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +RelativeFindTestCase::DoRun (void) +{ + Ptr found; + + Ptr objectOne = CreateObject (); + Names::Add ("Name One", objectOne); + + Ptr objectTwo = CreateObject (); + Names::Add ("Name Two", objectTwo); + + Ptr childOfObjectOne = CreateObject (); + Names::Add ("Name One/Child", childOfObjectOne); + + Ptr childOfObjectTwo = CreateObject (); + Names::Add ("Name Two/Child", childOfObjectTwo); + + found = Names::Find ("Name One"); + NS_TEST_ASSERT_MSG_EQ (found, objectOne, "Could not find a previously named Object via string context"); + + found = Names::Find ("Name Two"); + NS_TEST_ASSERT_MSG_EQ (found, objectTwo, "Could not find a previously named Object via stribng context"); + + found = Names::Find ("Name One/Child"); + NS_TEST_ASSERT_MSG_EQ (found, childOfObjectOne, "Could not find a previously named child Object via string context"); + + found = Names::Find ("Name Two/Child"); + NS_TEST_ASSERT_MSG_EQ (found, childOfObjectTwo, "Could not find a previously named child Object via string context"); + + return false; +} + +// =========================================================================== +// Test case to make sure that the Object Name Service can find Objects using +// a second type. +// =========================================================================== +class AlternateFindTestCase : public TestCase +{ +public: + AlternateFindTestCase (); + virtual ~AlternateFindTestCase (); + +private: + virtual bool DoRun (void); + virtual void DoTeardown (void); +}; + +AlternateFindTestCase::AlternateFindTestCase () + : TestCase ("Check GetObject operation in Names::Find") +{ +} + +AlternateFindTestCase::~AlternateFindTestCase () +{ +} + +void +AlternateFindTestCase::DoTeardown (void) +{ + Names::Delete (); +} + +bool +AlternateFindTestCase::DoRun (void) +{ + Ptr testObject = CreateObject (); + Names::Add ("Test Object", testObject); + + Ptr alternateTestObject = CreateObject (); + Names::Add ("Alternate Test Object", alternateTestObject); + + Ptr foundTestObject; + Ptr foundAlternateTestObject; + + foundTestObject = Names::Find ("Test Object"); + NS_TEST_ASSERT_MSG_EQ (foundTestObject, testObject, + "Could not find a previously named TestObject via GetObject"); + + foundAlternateTestObject = Names::Find ("Alternate Test Object"); + NS_TEST_ASSERT_MSG_EQ (foundAlternateTestObject, alternateTestObject, + "Could not find a previously named AlternateTestObject via GetObject"); + + + foundAlternateTestObject = Names::Find ("Test Object"); + NS_TEST_ASSERT_MSG_EQ (foundAlternateTestObject, 0, + "Unexpectedly able to GetObject on a TestObject"); + + foundTestObject = Names::Find ("Alternate Test Object"); + NS_TEST_ASSERT_MSG_EQ (foundTestObject, 0, + "Unexpectedly able to GetObject on an AlternateTestObject"); + + return false; +} + +class NamesTestSuite : public TestSuite +{ +public: + NamesTestSuite (); +}; + +NamesTestSuite::NamesTestSuite () + : TestSuite ("object-name-service", UNIT) +{ + AddTestCase (new BasicAddTestCase); + AddTestCase (new StringContextAddTestCase); + AddTestCase (new FullyQualifiedAddTestCase); + AddTestCase (new RelativeAddTestCase); + AddTestCase (new BasicRenameTestCase); + AddTestCase (new StringContextRenameTestCase); + AddTestCase (new FullyQualifiedRenameTestCase); + AddTestCase (new RelativeRenameTestCase); + AddTestCase (new FindPathTestCase); + AddTestCase (new BasicFindTestCase); + AddTestCase (new StringContextFindTestCase); + AddTestCase (new FullyQualifiedFindTestCase); + AddTestCase (new RelativeFindTestCase); + AddTestCase (new AlternateFindTestCase); +} + +NamesTestSuite namesTestSuite; diff --git a/src/core/names.cc b/src/core/names.cc index 5d6aa45a5..d05a15d91 100644 --- a/src/core/names.cc +++ b/src/core/names.cc @@ -697,284 +697,3 @@ Names::FindInternal (Ptr context, std::string name) } } //namespace ns3 - -#ifdef RUN_SELF_TESTS - -#include "test.h" -#include "object-factory.h" - -namespace ns3 { - -class TestObject : public Object -{ -public: - static TypeId GetTypeId (void) - { - static TypeId tid = TypeId ("TestObject") - .SetParent (Object::GetTypeId ()) - .HideFromDocumentation () - .AddConstructor (); - return tid; - } - TestObject () {} - virtual void Dispose (void) {} -}; - -class NamesTest : public Test -{ -public: - NamesTest (); - virtual bool RunTests (void); -}; - -NamesTest::NamesTest () - : Test ("Names") -{ -} - -bool -NamesTest::RunTests (void) -{ - bool result = true; - - // - // Names::Add and Names::Rename return void to align with the Config API. - // The private versions of these functions do return error codes so we - // can test to make sure errors are detected. Names::Add and - // Names::Rename check for these error codes and abort if an error was - // detected. So when we expect that an error should be detected, we - // have to call the private routine to avoid a fatal error popping. - // - // Name a couple of objects at the root level - // - Ptr client = CreateObject (); - Names::Add ("Client", client); - - Ptr server = CreateObject (); - Names::Add ("Server", server); - - // - // We shouldn't be able to add another name to a previously named object - // - result = NamesPriv::Get ()->Add ("Not Client", client); - NS_TEST_ASSERT_EQUAL (result, false); - - // - // We shouldn't be able to duplicate a name at the root level. - // - Ptr secondClient = CreateObject (); - result = NamesPriv::Get ()->Add ("Client", secondClient); - NS_TEST_ASSERT_EQUAL (result, false); - - // - // We should be able to add a new name in the first object's context - // - Ptr clientEth0 = CreateObject (); - Names::Add (client, "eth0", clientEth0); - - // - // We shouldn't be able to duplicate a name in that context. - // - Ptr secondClientEth0 = CreateObject (); - result = NamesPriv::Get ()->Add (client, "eth0", secondClientEth0); - NS_TEST_ASSERT_EQUAL (result, false); - - // - // We should be able to add the same name in the second object's context - // - Ptr serverEth0 = CreateObject (); - Names::Add (server, "eth0", serverEth0); - - // - // We should be able to find the short names for the objects we created - // - std::string found; - - found = Names::FindName (client); - NS_TEST_ASSERT_EQUAL (found, "Client"); - - found = Names::FindName (server); - NS_TEST_ASSERT_EQUAL (found, "Server"); - - found = Names::FindName (clientEth0); - NS_TEST_ASSERT_EQUAL (found, "eth0"); - - found = Names::FindName (serverEth0); - NS_TEST_ASSERT_EQUAL (found, "eth0"); - - // - // We should be able to find the full names for the objects we created - // - found = Names::FindPath (client); - NS_TEST_ASSERT_EQUAL (found, "/Names/Client"); - - found = Names::FindPath (server); - NS_TEST_ASSERT_EQUAL (found, "/Names/Server"); - - found = Names::FindPath (clientEth0); - NS_TEST_ASSERT_EQUAL (found, "/Names/Client/eth0"); - - found = Names::FindPath (serverEth0); - NS_TEST_ASSERT_EQUAL (found, "/Names/Server/eth0"); - - // - // We should be able to find the objects from a context and name combination. - // Note that the Ptr (0, false) below is to differentiate a null object - // pointer from a null string pointer -- not normally needed in real use-cases. - // - // - Ptr foundObject; - - foundObject = Names::Find (Ptr (0, false), "Client"); - NS_TEST_ASSERT_EQUAL (foundObject, client); - - foundObject = Names::Find (Ptr (0, false), "Server"); - NS_TEST_ASSERT_EQUAL (foundObject, server); - - foundObject = Names::Find (client, "eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, clientEth0); - - foundObject = Names::Find (server, "eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, serverEth0); - - // - // We should be able to do the same thing by providing path strings instead - // of context objects. - // - - foundObject = Names::Find ("/Names", "Client"); - NS_TEST_ASSERT_EQUAL (foundObject, client); - - foundObject = Names::Find ("/Names", "Server"); - NS_TEST_ASSERT_EQUAL (foundObject, server); - - foundObject = Names::Find ("/Names/Client", "eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, clientEth0); - - foundObject = Names::Find ("/Names/Server", "eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, serverEth0); - - // - // We should be able to find the objects from their full path names - // - foundObject = Names::Find ("/Names/Client"); - NS_TEST_ASSERT_EQUAL (foundObject, client); - - foundObject = Names::Find ("/Names/Server"); - NS_TEST_ASSERT_EQUAL (foundObject, server); - - foundObject = Names::Find ("/Names/Client/eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, clientEth0); - - foundObject = Names::Find ("/Names/Server/eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, serverEth0); - - // - // We should be able to omit the root of the namespace from the full path names - // - foundObject = Names::Find ("Client"); - NS_TEST_ASSERT_EQUAL (foundObject, client); - - foundObject = Names::Find ("Server"); - NS_TEST_ASSERT_EQUAL (foundObject, server); - - foundObject = Names::Find ("Client/eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, clientEth0); - - foundObject = Names::Find ("Server/eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, serverEth0); - - // - // We should be able to add objects while including the root of the namespace - // in the name. - // - Ptr router1 = CreateObject (); - Names::Add ("/Names/Router1", router1); - - // - // We should be able to add objects while not including the root of the namespace - // in the name. - // - Ptr router2 = CreateObject (); - Names::Add ("Router2", router2); - - // - // We should be able to add sub-objects while including the root of the namespace - // in the name. - // - Ptr router1Eth0 = CreateObject (); - Names::Add ("/Names/Router1/eth0", router1Eth0); - - // - // We should be able to add sub-objects while not including the root of the namespace - // in the name. - // - Ptr router2Eth0 = CreateObject (); - Names::Add ("Router2/eth0", router2Eth0); - - // - // We should be able to find these objects in the same two ways - // - foundObject = Names::Find ("/Names/Router1"); - NS_TEST_ASSERT_EQUAL (foundObject, router1); - - foundObject = Names::Find ("Router1"); - NS_TEST_ASSERT_EQUAL (foundObject, router1); - - foundObject = Names::Find ("/Names/Router2"); - NS_TEST_ASSERT_EQUAL (foundObject, router2); - - foundObject = Names::Find ("Router2"); - NS_TEST_ASSERT_EQUAL (foundObject, router2); - - foundObject = Names::Find ("/Names/Router1/eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, router1Eth0); - - foundObject = Names::Find ("Router1/eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, router1Eth0); - - foundObject = Names::Find ("/Names/Router2/eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, router2Eth0); - - foundObject = Names::Find ("Router2/eth0"); - NS_TEST_ASSERT_EQUAL (foundObject, router2Eth0); - - // - // We have a pile of names defined. We should be able to rename them in the - // usual ways. - // - Names::Rename ("/Names/Router1", "RouterX"); - - foundObject = Names::Find ("/Names/RouterX"); - NS_TEST_ASSERT_EQUAL (foundObject, router1); - - Names::Rename ("Router2", "RouterY"); - - foundObject = Names::Find ("RouterY"); - NS_TEST_ASSERT_EQUAL (foundObject, router2); - - Names::Rename ("/Names/RouterX/eth0", "ath0"); - - foundObject = Names::Find ("/Names/RouterX/ath0"); - NS_TEST_ASSERT_EQUAL (foundObject, router1Eth0); - - foundObject = Names::Find ("RouterX/ath0"); - NS_TEST_ASSERT_EQUAL (foundObject, router1Eth0); - - // - // We should not be able to rename an object into conflict with another - // object. - // - - result = NamesPriv::Get ()->Rename ("/Names/RouterX", "RouterY"); - NS_TEST_ASSERT_EQUAL (result, false); - - Names::Delete (); - return true; -} - -static NamesTest g_namesTests; - -} // namespace ns3 - -#endif /* RUN_SELF_TESTS */ diff --git a/src/core/ptr.h b/src/core/ptr.h index b7ebc0d8e..5179093e5 100644 --- a/src/core/ptr.h +++ b/src/core/ptr.h @@ -140,6 +140,7 @@ Ptr Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7); /** * \relates Ptr + * \param p smart pointer * \return the pointer managed by this smart pointer. * * The underlying refcount is not incremented prior @@ -151,6 +152,7 @@ T * PeekPointer (const Ptr &p); /** * \relates Ptr + * \param p smart pointer * \return the pointer managed by this smart pointer. * * The underlying refcount is incremented prior diff --git a/src/core/rng-test-suite.cc b/src/core/rng-test-suite.cc new file mode 100644 index 000000000..49f20a68b --- /dev/null +++ b/src/core/rng-test-suite.cc @@ -0,0 +1,434 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include +#include +#include +#include +#include + +#include "test.h" +#include "random-variable.h" + +using namespace ns3; + +void +FillHistoRangeUniformly (double *array, uint32_t n, double start, double end) +{ + double increment = (end - start) / (n - 1.); + double d = start; + + for (uint32_t i = 0; i < n; ++i) + { + array[i] = d; + d += increment; + } +} + +// =========================================================================== +// Test case for uniform distribution random number generator +// =========================================================================== +class RngUniformTestCase : public TestCase +{ +public: + static const uint32_t N_RUNS = 5; + static const uint32_t N_BINS = 50; + static const uint32_t N_MEASUREMENTS = 1000000; + + RngUniformTestCase (); + virtual ~RngUniformTestCase (); + + double ChiSquaredTest (UniformVariable &u); + +private: + virtual bool DoRun (void); +}; + +RngUniformTestCase::RngUniformTestCase () + : TestCase ("Uniform Random Number Generator") +{ +} + +RngUniformTestCase::~RngUniformTestCase () +{ +} + +double +RngUniformTestCase::ChiSquaredTest (UniformVariable &u) +{ + gsl_histogram * h = gsl_histogram_alloc (N_BINS); + gsl_histogram_set_ranges_uniform (h, 0., 1.); + + for (uint32_t i = 0; i < N_MEASUREMENTS; ++i) + { + gsl_histogram_increment (h, u.GetValue ()); + } + + double tmp[N_BINS]; + + double expected = ((double)N_MEASUREMENTS / (double)N_BINS); + + for (uint32_t i = 0; i < N_BINS; ++i) + { + tmp[i] = gsl_histogram_get (h, i); + tmp[i] -= expected; + tmp[i] *= tmp[i]; + tmp[i] /= expected; + } + + gsl_histogram_free (h); + + double chiSquared = 0; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + chiSquared += tmp[i]; + } + + return chiSquared; +} + +bool +RngUniformTestCase::DoRun (void) +{ + SeedManager::SetSeed (time (0)); + + double sum = 0.; + double maxStatistic = gsl_cdf_chisq_Qinv (0.05, N_BINS); + + for (uint32_t i = 0; i < N_RUNS; ++i) + { + UniformVariable u; + double result = ChiSquaredTest (u); + sum += result; + } + + sum /= (double)N_RUNS; + + NS_TEST_ASSERT_MSG_LT (sum, maxStatistic, "Chi-squared statistic out of range"); + return false; +} + +// =========================================================================== +// Test case for normal distribution random number generator +// =========================================================================== +class RngNormalTestCase : public TestCase +{ +public: + static const uint32_t N_RUNS = 5; + static const uint32_t N_BINS = 50; + static const uint32_t N_MEASUREMENTS = 1000000; + + RngNormalTestCase (); + virtual ~RngNormalTestCase (); + + double ChiSquaredTest (NormalVariable &n); + +private: + virtual bool DoRun (void); +}; + +RngNormalTestCase::RngNormalTestCase () + : TestCase ("Normal Random Number Generator") +{ +} + +RngNormalTestCase::~RngNormalTestCase () +{ +} + +double +RngNormalTestCase::ChiSquaredTest (NormalVariable &n) +{ + gsl_histogram * h = gsl_histogram_alloc (N_BINS); + + double range[N_BINS + 1]; + FillHistoRangeUniformly (range, N_BINS + 1, -4., 4.); + range[0] = -std::numeric_limits::max (); + range[N_BINS] = std::numeric_limits::max (); + + gsl_histogram_set_ranges (h, range, N_BINS + 1); + + double expected[N_BINS]; + + double sigma = 1.; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + expected[i] = gsl_cdf_gaussian_P (range[i + 1], sigma) - gsl_cdf_gaussian_P (range[i], sigma); + expected[i] *= N_MEASUREMENTS; + } + + for (uint32_t i = 0; i < N_MEASUREMENTS; ++i) + { + gsl_histogram_increment (h, n.GetValue ()); + } + + double tmp[N_BINS]; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + tmp[i] = gsl_histogram_get (h, i); + tmp[i] -= expected[i]; + tmp[i] *= tmp[i]; + tmp[i] /= expected[i]; + } + + gsl_histogram_free (h); + + double chiSquared = 0; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + chiSquared += tmp[i]; + } + + return chiSquared; +} + +bool +RngNormalTestCase::DoRun (void) +{ + SeedManager::SetSeed (time (0)); + + double sum = 0.; + double maxStatistic = gsl_cdf_chisq_Qinv (0.05, N_BINS); + + for (uint32_t i = 0; i < N_RUNS; ++i) + { + NormalVariable n; + double result = ChiSquaredTest (n); + sum += result; + } + + sum /= (double)N_RUNS; + + NS_TEST_ASSERT_MSG_LT (sum, maxStatistic, "Chi-squared statistic out of range"); + return false; +} + +// =========================================================================== +// Test case for exponential distribution random number generator +// =========================================================================== +class RngExponentialTestCase : public TestCase +{ +public: + static const uint32_t N_RUNS = 5; + static const uint32_t N_BINS = 50; + static const uint32_t N_MEASUREMENTS = 1000000; + + RngExponentialTestCase (); + virtual ~RngExponentialTestCase (); + + double ChiSquaredTest (ExponentialVariable &n); + +private: + virtual bool DoRun (void); +}; + +RngExponentialTestCase::RngExponentialTestCase () + : TestCase ("Exponential Random Number Generator") +{ +} + +RngExponentialTestCase::~RngExponentialTestCase () +{ +} + +double +RngExponentialTestCase::ChiSquaredTest (ExponentialVariable &e) +{ + gsl_histogram * h = gsl_histogram_alloc (N_BINS); + + double range[N_BINS + 1]; + FillHistoRangeUniformly (range, N_BINS + 1, 0., 10.); + range[N_BINS] = std::numeric_limits::max (); + + gsl_histogram_set_ranges (h, range, N_BINS + 1); + + double expected[N_BINS]; + + double mu = 1.; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + expected[i] = gsl_cdf_exponential_P (range[i + 1], mu) - gsl_cdf_exponential_P (range[i], mu); + expected[i] *= N_MEASUREMENTS; + } + + for (uint32_t i = 0; i < N_MEASUREMENTS; ++i) + { + gsl_histogram_increment (h, e.GetValue ()); + } + + double tmp[N_BINS]; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + tmp[i] = gsl_histogram_get (h, i); + tmp[i] -= expected[i]; + tmp[i] *= tmp[i]; + tmp[i] /= expected[i]; + } + + gsl_histogram_free (h); + + double chiSquared = 0; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + chiSquared += tmp[i]; + } + + return chiSquared; +} + +bool +RngExponentialTestCase::DoRun (void) +{ + SeedManager::SetSeed (time (0)); + + double sum = 0.; + double maxStatistic = gsl_cdf_chisq_Qinv (0.05, N_BINS); + + for (uint32_t i = 0; i < N_RUNS; ++i) + { + ExponentialVariable e; + double result = ChiSquaredTest (e); + sum += result; + } + + sum /= (double)N_RUNS; + + NS_TEST_ASSERT_MSG_LT (sum, maxStatistic, "Chi-squared statistic out of range"); + return false; +} + +// =========================================================================== +// Test case for pareto distribution random number generator +// =========================================================================== +class RngParetoTestCase : public TestCase +{ +public: + static const uint32_t N_RUNS = 5; + static const uint32_t N_BINS = 50; + static const uint32_t N_MEASUREMENTS = 1000000; + + RngParetoTestCase (); + virtual ~RngParetoTestCase (); + + double ChiSquaredTest (ParetoVariable &p); + +private: + virtual bool DoRun (void); +}; + +RngParetoTestCase::RngParetoTestCase () + : TestCase ("Pareto Random Number Generator") +{ +} + +RngParetoTestCase::~RngParetoTestCase () +{ +} + +double +RngParetoTestCase::ChiSquaredTest (ParetoVariable &p) +{ + gsl_histogram * h = gsl_histogram_alloc (N_BINS); + + double range[N_BINS + 1]; + FillHistoRangeUniformly (range, N_BINS + 1, 1., 10.); + range[N_BINS] = std::numeric_limits::max (); + + gsl_histogram_set_ranges (h, range, N_BINS + 1); + + double expected[N_BINS]; + + double a = 1.5; + double b = 0.33333333; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + expected[i] = gsl_cdf_pareto_P (range[i + 1], a, b) - gsl_cdf_pareto_P (range[i], a, b); + expected[i] *= N_MEASUREMENTS; + } + + for (uint32_t i = 0; i < N_MEASUREMENTS; ++i) + { + gsl_histogram_increment (h, p.GetValue ()); + } + + double tmp[N_BINS]; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + tmp[i] = gsl_histogram_get (h, i); + tmp[i] -= expected[i]; + tmp[i] *= tmp[i]; + tmp[i] /= expected[i]; + } + + gsl_histogram_free (h); + + double chiSquared = 0; + + for (uint32_t i = 0; i < N_BINS; ++i) + { + chiSquared += tmp[i]; + } + + return chiSquared; +} + +bool +RngParetoTestCase::DoRun (void) +{ + SeedManager::SetSeed (time (0)); + + double sum = 0.; + double maxStatistic = gsl_cdf_chisq_Qinv (0.05, N_BINS); + + for (uint32_t i = 0; i < N_RUNS; ++i) + { + ParetoVariable e; + double result = ChiSquaredTest (e); + sum += result; + } + + sum /= (double)N_RUNS; + + NS_TEST_ASSERT_MSG_LT (sum, maxStatistic, "Chi-squared statistic out of range"); + return false; +} + +class RngTestSuite : public TestSuite +{ +public: + RngTestSuite (); +}; + +RngTestSuite::RngTestSuite () + : TestSuite ("random-number-generators", UNIT) +{ + AddTestCase (new RngUniformTestCase); + AddTestCase (new RngNormalTestCase); + AddTestCase (new RngExponentialTestCase); + AddTestCase (new RngParetoTestCase); +} + +RngTestSuite rngTestSuite; diff --git a/src/core/system-condition.h b/src/core/system-condition.h index eb3d78b0e..82e6c3fd6 100644 --- a/src/core/system-condition.h +++ b/src/core/system-condition.h @@ -61,6 +61,7 @@ public: /** * Set the value of the underlying condition. + * \param condition value */ void SetCondition (bool condition); @@ -91,6 +92,7 @@ public: /** * Wait a maximum of ns nanoseconds for the condition to be true. If the * wait times out, return true else return false. + * \param ns maximum of nanoseconds to wait */ bool TimedWait (uint64_t ns); diff --git a/src/core/system-thread.h b/src/core/system-thread.h index 480eb2f63..0d3f5add7 100644 --- a/src/core/system-thread.h +++ b/src/core/system-thread.h @@ -84,6 +84,8 @@ public: * method provided to do this is Join (). If you call Join() you will block * until the SystemThread run method returns. * + * @param callback entry point of the thread + * * @warning The SystemThread uses SIGALRM to wake threads that are possibly * blocked on IO. * @see Shutdown diff --git a/src/core/test.cc b/src/core/test.cc index 165827a41..f34c05a86 100644 --- a/src/core/test.cc +++ b/src/core/test.cc @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2005 INRIA + * Copyright (c) 2009 University of Washington * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -14,14 +14,562 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Mathieu Lacage */ #include "test.h" +#include "abort.h" +#include + +namespace ns3 { + + +// +// XML files have restrictions on certain characters that may be present in +// data. We need to replace these characters with their alternate +// representation on the way into the XML file. +// +std::string +ReplaceXmlSpecialCharacters (std::string xml) +{ + std::string specials = "<>&\"'"; + std::string replacements[] = {"<", ">", "&", "'", """}; + std::string result; + std::size_t index, length = xml.length (); + + for (size_t i = 0; i < length; ++i) + { + char character = xml[i]; + + if ((index = specials.find (character)) == std::string::npos) + { + result.push_back (character); + } + else + { + result += replacements[index]; + } + } + return result; +} + +bool +TestDoubleIsEqual (const double x1, const double x2, const double epsilon) +{ + int exponent; + double delta, difference; + + // + // Find exponent of largest absolute value + // + { + double max = (fabs (x1) > fabs (x2)) ? x1 : x2; + frexp (max, &exponent); + } + + // + // Form a neighborhood of size 2 * delta + // + delta = ldexp (epsilon, exponent); + difference = x1 - x2; + + if (difference > delta || difference < -delta) + { + return false; + } + return true; +} + + +TestCase::TestCase (std::string name) + : m_name (name), m_verbose (false), m_basedir ("invalid"), m_ofs (0), m_error (false) +{ +} + +TestCase::~TestCase () +{ +} + +void +TestCase::ReportStart (void) +{ + DoReportStart (); +} + +void +TestCase::ReportSuccess (void) +{ + DoReportSuccess (); +} + +void +TestCase::ReportFailure ( + std::string cond, + std::string actual, + std::string limit, + std::string message, + std::string file, + int32_t line) +{ + DoReportFailure (cond, actual, limit, message, file, line); +} + +void +TestCase::ReportEnd (void) +{ + DoReportStart (); +} + +bool +TestCase::Run (void) +{ + DoReportStart (); + DoSetup (); + m_error |= DoRun (); + DoTeardown (); + if (m_error == false) + { + DoReportSuccess (); + } + DoReportEnd (); + return m_error; +} + +void +TestCase::SetVerbose (bool verbose) +{ + m_verbose = verbose; +} + +void +TestCase::SetName (std::string name) +{ + m_name = name; +} + +std::string +TestCase::GetName (void) +{ + return m_name; +} + +void +TestCase::SetBaseDir (std::string basedir) +{ + m_basedir = basedir; +} + +std::string +TestCase::GetBaseDir (void) +{ + return m_basedir; +} + +std::string +TestCase::GetSourceDir (std::string file) +{ + std::string::size_type relPathBegin = file.find_first_of ("/"); + NS_ABORT_MSG_IF (relPathBegin == std::string::npos, "TestCase::GetSrouceDir(): Internal Error"); + std::string::size_type relPathEnd = file.find_last_of ("/"); + NS_ABORT_MSG_IF (relPathEnd == std::string::npos, "TestCase::GetSrouceDir(): Internal Error"); + + return GetBaseDir () + file.substr (relPathBegin, relPathEnd + 1 - relPathBegin); +} + +void +TestCase::SetStream (std::ofstream *ofs) +{ + m_ofs = ofs; +} + +std::ofstream * +TestCase::GetStream (void) +{ + return m_ofs; +} + +void +TestCase::SetErrorStatus (bool error) +{ + m_error = error; +} + +bool +TestCase::GetErrorStatus (void) +{ + return m_error; +} + + +void +TestCase::DoReportStart (void) +{ + m_startTime = times (&m_startTimes); + + if (m_ofs == 0) + { + return; + } + *m_ofs << " " << std::endl; + *m_ofs << " " << ReplaceXmlSpecialCharacters (GetName ()) << "" << std::endl; +} + +void +TestCase::DoReportSuccess (void) +{ + if (m_ofs == 0) + { + return; + } + *m_ofs << " PASS" << std::endl; +} + +void +TestCase::DoReportFailure ( + std::string cond, + std::string actual, + std::string limit, + std::string message, + std::string file, + int32_t line) +{ + m_error |= true; + + if (m_ofs == 0) + { + return; + } + + *m_ofs << " FAIL" << std::endl; + *m_ofs << " " << ReplaceXmlSpecialCharacters (cond) << "" << std::endl; + *m_ofs << " " << ReplaceXmlSpecialCharacters (actual) << "" << std::endl; + *m_ofs << " " << ReplaceXmlSpecialCharacters (limit) << "" << std::endl; + *m_ofs << " " << ReplaceXmlSpecialCharacters (message) << "" << std::endl; + *m_ofs << " " << ReplaceXmlSpecialCharacters (file) << "" << std::endl; + *m_ofs << " " << line << "" << std::endl; +} + +void +TestCase::DoReportEnd (void) +{ + static long ticksPerSecond = sysconf (_SC_CLK_TCK); + + if (m_ofs == 0) + { + return; + } + + struct tms endTimes; + clock_t endTime = times (&endTimes); + + clock_t elapsed = endTime - m_startTime; + clock_t elapsedUsr = endTimes.tms_utime - m_startTimes.tms_utime; + clock_t elapsedSys = endTimes.tms_stime - m_startTimes.tms_stime; + + (*m_ofs).precision (2); + *m_ofs << std::fixed; + + *m_ofs << " " << "real " << static_cast (elapsed) / ticksPerSecond + << " user " << static_cast (elapsedUsr) / ticksPerSecond + << " system " << static_cast (elapsedSys) / ticksPerSecond + << "" << std::endl; + + *m_ofs << " " << std::endl; +} + +void +TestCase::DoSetup (void) +{ +} + +void +TestCase::DoTeardown (void) +{ +} + +TestSuite::TestSuite (std::string name, TestType type) + : m_name (name), m_verbose (false), m_basedir ("invalid"), m_ofs (0), m_type (type) +{ + TestRunner::AddTestSuite (this); +} + +TestSuite::~TestSuite () +{ + for (TestCaseVector_t::iterator i = m_tests.begin (); i != m_tests.end (); ++i) + { + delete *i; + *i = 0; + } + + m_tests.erase (m_tests.begin (), m_tests.end ()); +} + +void +TestSuite::ReportStart (void) +{ + DoReportStart (); +} + +void +TestSuite::ReportSuccess (void) +{ + DoReportSuccess (); +} + +void +TestSuite::ReportFailure (void) +{ + DoReportFailure (); +} + +void +TestSuite::ReportEnd (void) +{ + DoReportEnd (); +} + +bool +TestSuite::Run (void) +{ + DoReportStart (); + DoSetup (); + bool error = DoRun (); + DoTeardown (); + if (error == false) + { + DoReportSuccess (); + } + else + { + DoReportFailure (); + } + + DoReportEnd (); + return error; +} + +uint32_t +TestSuite::AddTestCase (TestCase *testCase) +{ + uint32_t index = m_tests.size (); + m_tests.push_back (testCase); + return index; +} + +uint32_t +TestSuite::GetNTestCases (void) +{ + return m_tests.size (); +} + +TestCase * +TestSuite::GetTestCase (uint32_t n) +{ + return m_tests[n]; +} + +TestSuite::TestType +TestSuite::GetTestType (void) +{ + return m_type; +} + +void +TestSuite::SetVerbose (bool verbose) +{ + m_verbose = verbose; +} + +void +TestSuite::SetName (std::string name) +{ + m_name = name; +} + +std::string +TestSuite::GetName (void) +{ + return m_name; +} + +void +TestSuite::SetBaseDir (std::string basedir) +{ + m_basedir = basedir; +} + +std::string +TestSuite::GetBaseDir (void) +{ + return m_basedir; +} + +void +TestSuite::SetStream (std::ofstream *ofs) +{ + m_ofs = ofs; +} + +void +TestSuite::DoReportStart (void) +{ + m_startTime = times (&m_startTimes); + + if (m_ofs == 0) + { + return; + } + *m_ofs << "" << std::endl; + *m_ofs << " " << ReplaceXmlSpecialCharacters (GetName ()) << "" << std::endl; +} + +void +TestSuite::DoReportFailure (void) +{ + if (m_ofs == 0) + { + return; + } + *m_ofs << " FAIL" << std::endl; +} + +void +TestSuite::DoReportSuccess (void) +{ + if (m_ofs == 0) + { + return; + } + *m_ofs << " PASS" << std::endl; +} + +void +TestSuite::DoReportEnd (void) +{ + static long ticksPerSecond = sysconf (_SC_CLK_TCK); + + if (m_ofs == 0) + { + return; + } + struct tms endTimes; + clock_t endTime = times (&endTimes); + + clock_t elapsed = endTime - m_startTime; + clock_t elapsedUsr = endTimes.tms_utime - m_startTimes.tms_utime; + clock_t elapsedSys = endTimes.tms_stime - m_startTimes.tms_stime; + + (*m_ofs).precision (2); + *m_ofs << std::fixed; + + *m_ofs << " " << "real " << static_cast (elapsed) / ticksPerSecond + << " user " << static_cast (elapsedUsr) / ticksPerSecond + << " system " << static_cast (elapsedSys) / ticksPerSecond + << "" << std::endl; + + *m_ofs << "" << std::endl; +} + +void +TestSuite::DoSetup (void) +{ +} + +bool +TestSuite::DoRun (void) +{ + for (TestCaseVector_t::iterator i = m_tests.begin (); i != m_tests.end (); ++i) + { + (*i)->SetVerbose (m_verbose); + (*i)->SetBaseDir (m_basedir); + (*i)->SetStream (m_ofs); + bool err = (*i)->Run (); + if (err) + { + return err; + } + } + + return false; +} + +void +TestSuite::DoTeardown (void) +{ +} + +class TestRunnerImpl +{ +public: + uint32_t AddTestSuite (TestSuite *testSuite); + uint32_t GetNTestSuites (void); + TestSuite *GetTestSuite (uint32_t n); + bool RunTestSuite (uint32_t n); + + static TestRunnerImpl *Instance (void); +private: + TestRunnerImpl (); + ~TestRunnerImpl (); + + typedef std::vector TestSuiteVector_t; + TestSuiteVector_t m_suites; +}; + +TestRunnerImpl::TestRunnerImpl () +{ +} + +TestRunnerImpl::~TestRunnerImpl () +{ +} + +TestRunnerImpl * +TestRunnerImpl::Instance (void) +{ + static TestRunnerImpl runner; + return &runner; +} + +uint32_t +TestRunnerImpl::AddTestSuite (TestSuite *testSuite) +{ + uint32_t index = m_suites.size (); + m_suites.push_back (testSuite); + return index; +} + +uint32_t +TestRunnerImpl::GetNTestSuites (void) +{ + return m_suites.size (); +} + +TestSuite * +TestRunnerImpl::GetTestSuite (uint32_t n) +{ + return m_suites[n]; +} + +uint32_t +TestRunner::AddTestSuite (TestSuite *testSuite) +{ + return TestRunnerImpl::Instance ()->AddTestSuite (testSuite); +} + +uint32_t +TestRunner::GetNTestSuites (void) +{ + return TestRunnerImpl::Instance ()->GetNTestSuites (); +} + +TestSuite * +TestRunner::GetTestSuite (uint32_t n) +{ + return TestRunnerImpl::Instance ()->GetTestSuite (n); +} + +}; // namespace ns3 #ifdef RUN_SELF_TESTS -#include namespace ns3 { @@ -66,7 +614,6 @@ TestManager::PrintTestNames (std::ostream &os) } } - std::ostream & TestManager::Failure (void) { diff --git a/src/core/test.h b/src/core/test.h index 26caeae9c..d94441ab5 100644 --- a/src/core/test.h +++ b/src/core/test.h @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2005 INRIA + * Copyright (c) 2009 University of Washington * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -14,18 +14,996 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Mathieu Lacage */ #ifndef TEST_H #define TEST_H -#include +#include +#include +#include #include -#include -#include +#include +#include +#include +#include +#include +// +// Note on below macros: +// +// When multiple statements are used in a macro, they should be bound together +// in a loop syntactically, so the macro can appear safely inside if clauses +// or other places that expect a single statement or a statement block. The +// "strange" do while construct is a generally expected best practice for +// defining a robust macro. +// +/** + * \brief Convenience macro to extract the source directory of the current + * source file. + * + * \see TestCase::GetSourceDir + */ +#define NS_TEST_SOURCEDIR \ + TestCase::GetSourceDir (__FILE__) + +#define NS_TEST_RETURN_IF_ERROR \ + if (GetErrorStatus ()) \ + { \ + return true; \ + } + +// =========================================================================== +// Test for equality (generic version) +// =========================================================================== + +/** + * \internal + */ +#define NS_TEST_ASSERT_MSG_EQ_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) == (limit))) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportFailure (std::string (#actual) + " (actual) == " + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + return true; \ + } \ + } while (false) + +/** + * \brief Test that an actual and expected (limit) value are equal and report + * and abort if not. + * + * Check to see if the expected (limit) value is equal to the actual value found + * in a test case. If the two values are equal nothing happens, but if the + * comparison fails, an error is reported in a consistent way and the execution + * of the current test case is aborted. + * + * The message is interpreted as a stream, for example: + * + * \code + * NS_TEST_ASSERT_MSG_EQ (result, true, + * "cannot open file " << filename << " in test"); + * \endcode + * + * is legal. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the expected value of the test. + * \param msg Message that is output if the test does not pass. + * + * \warning Do not use this macro if you are comparing floating point numbers + * (float or double) as it is unlikely to do what you expect. Use + * NS_TEST_ASSERT_MSG_EQ_TOL instead. + */ +#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg) \ + NS_TEST_ASSERT_MSG_EQ_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +/** + * \internal + * + * Required to avoid use of return statement which allows use in methods + * (esp. callbacks) returning void. + */ +#define NS_TEST_EXPECT_MSG_EQ_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) == (limit))) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportFailure (std::string (#actual) + " (actual) == " + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + } \ + } while (false) + +/** + * \brief Test that an actual and expected (limit) value are equal and report + * if not. + * + * Check to see if the expected (lmit) value is equal to the actual value found + * in a test case. If the two values are equal nothing happens, but if the + * comparison fails, an error is reported in a consistent way. EXPECT* macros + * do not return if an error is detected. + * + * The message is interpreted as a stream, for example: + * + * \code + * NS_TEST_EXPECT_MSG_EQUAL (result, true, + * "cannot open file " << filename << " in test"); + * \endcode + * + * is legal. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the expected value of the test. + * \param msg Message that is output if the test does not pass. + * + * \warning Do not use this macro if you are comparing floating point numbers + * (float or double) as it is unlikely to do what you expect. Use + * NS_TEST_EXPECT_MSG_EQ_TOL instead. + */ +#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg) \ + NS_TEST_EXPECT_MSG_EQ_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +// =========================================================================== +// Test for equality with a provided tolerance (use for floating point +// comparisons -- both float and double) +// =========================================================================== + +/** + * \internal + */ +#define NS_TEST_ASSERT_MSG_EQ_TOL_INTERNAL(actual, limit, tol, msg, file, line) \ + do { \ + if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit << " +- " << tol; \ + std::ostringstream condStream; \ + condStream << #actual << " (actual) < " << #limit << " (limit) + " << #tol << " (tol) && " << \ + #actual << " (actual) > " << #limit << " (limit) - " << #tol << " (tol)"; \ + ReportFailure (condStream.str (), actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + return true; \ + } \ + } while (false) + +/** + * \brief Test that actual and expected (limit) values are equal to plus or minus + * some tolerance and report and abort if not. + * + * Check to see if the expected (limit) value is equal to the actual value found + * in a test case to some tolerance. This is not the same thing as asking if + * two floating point are equal to within some epsilon, but is useful for that + * case. This assertion is geared toward more of a measurement problem. Consider + * measuring a physical rod of some kind that you have ordered. You need to + * determine if it is "good." You won't measure the rod to an arbitrary precision + * of sixteen significant figures, you will measure the rod to determine if its + * length is within the tolerances you provided. For example, 12.00 inches plus + * or minus .005 inch may be just fine. + * + * In ns-3, you might want to measure a signal to noise ratio and check to see + * if the answer is what you expect. If you naively measure (double)1128.93 and + * compare this number with a constant 1128.93 you are almost certainly going to + * have your test fail because of floating point rounding errors. We provide a + * floating point comparison function ns3::TestDoubleIsEqual() but you will + * probably quickly find that is not what you want either. It may turn out to + * be the case that when you measured an snr that printed as 1128.93, what was + * actually measured was something more like 1128.9287653857625442 for example. + * Given that the double epsilon is on the order of 0.0000000000000009, you would + * need to provide sixteen significant figures of expected value for this kind of + * test to pass even with a typical test for floating point "approximate equality." + * That is clearly not required or desired. You really want to be able to provide + * 1128.93 along with a tolerance just like you provided 12 inches +- 0.005 inch + * above. + * + * This assertion is designed for real measurements by taking into account + * measurement tolerances. By doing so it also automatically compensates for + * floating point rounding errors. If you really want to check floating point + * equality down to the numeric_limits::epsilon () range, consider using + * ns3::TestDoubleIsEqual(). + * + * The message is interpreted as a stream, for example: + * + * \code + * NS_TEST_ASSERT_MSG_EQ_TOL (snr, 1128.93, 0.005, "wrong snr (" << snr << ") in test"); + * \endcode + * + * is legal. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the expected value of the test. + * \param tol Tolerance of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg) \ + NS_TEST_ASSERT_MSG_EQ_TOL_INTERNAL (actual, limit, tol, msg, __FILE__, __LINE__) + +/** + * \internal + * + * Required to avoid use of return statement which allows use in methods + * (esp. callbacks) returning void. + */ +#define NS_TEST_EXPECT_MSG_EQ_TOL_INTERNAL(actual, limit, tol, msg, file, line) \ + do { \ + if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit << " +- " << tol; \ + std::ostringstream condStream; \ + condStream << #actual << " (actual) < " << #limit << " (limit) + " << #tol << " (tol) && " << \ + #actual << " (actual) > " << #limit << " (limit) - " << #tol << " (tol)"; \ + ReportFailure (condStream.str (), actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + } \ + } while (false) + +/** + * \brief Test that actual and expected (limit) values are equal to plus or minus + * some tolerance and report if not. + * + * Check to see if the expected (limit) value is equal to the actual value found + * in a test case to some tolerance. This is not the same thing as asking if + * two floating point are equal to within some epsilon, but is useful for that + * case. This assertion is geared toward more of a measurement problem. Consider + * measuring a physical rod of some kind that you have ordered. You need to + * determine if it is "good." You won't measure the rod to an arbitrary precision + * of sixteen significant figures, you will measure the rod to determine if its + * length is within the tolerances you provided. For example, 12.00 inches plus + * or minus .005 inch may be just fine. + * + * In ns-3, you might want to measure a signal to noise ratio and check to see + * if the answer is what you expect. If you naively measure (double)1128.93 and + * compare this number with a constant 1128.93 you are almost certainly going to + * have your test fail because of floating point rounding errors. We provide a + * floating point comparison function ns3::TestDoubleIsEqual() but you will + * probably quickly find that is not what you want either. It may turn out to + * be the case that when you measured an snr that printed as 1128.93, what was + * actually measured was something more like 1128.9287653857625442 for example. + * Given that the double epsilon is on the order of 0.0000000000000009, you would + * need to provide sixteen significant figures of expected value for this kind of + * test to pass even with a typical test for floating point "approximate equality." + * That is clearly not required or desired. You really want to be able to provide + * 1128.93 along with a tolerance just like you provided 12 inches +- 0.005 inch + * above. + * + * This assertion is designed for real measurements by taking into account + * measurement tolerances. By doing so it also automatically compensates for + * floating point rounding errors. If you really want to check floating point + * equality down to the numeric_limits::epsilon () range, consider using + * ns3::TestDoubleIsEqual(). + * + * The message is interpreted as a stream, for example: + * + * \code + * NS_TEST_EXPECT_MSG_EQ_TOL (snr, 1128.93, 0.005, "wrong snr (" << snr << ") in test"); + * \endcode + * + * is legal. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the expected value of the test. + * \param tol Tolerance of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_EXPECT_MSG_EQ_TOL(actual, limit, tol, msg) \ + NS_TEST_EXPECT_MSG_EQ_TOL_INTERNAL (actual, limit, tol, msg, __FILE__, __LINE__) + +// =========================================================================== +// Test for inequality +// =========================================================================== + +/** + * \internal + */ +#define NS_TEST_ASSERT_MSG_NE_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) != (limit))) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportFailure (std::string (#actual) + " (actual) != " + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + return true; \ + } \ + } while (false) + +/** + * \brief Test that an actual and expected (limit) value are equal and report + * and abort if not. + * + * Check to see if the expected (limit) value is not equal to the actual value + * found in a test case. If the two values are equal nothing happens, but if + * the comparison fails, an error is reported in a consistent way and the + * execution of the current test case is aborted. + * + * The message is interpreted as a stream, for example: + * + * \code + * NS_TEST_ASSERT_MSG_NE (result, false, + * "cannot open file " << filename << " in test"); + * \endcode + * + * is legal. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the expected value of the test. + * \param msg Message that is output if the test does not pass. + * + * \warning Do not use this macro if you are comparing floating point numbers + * (float or double). Use NS_TEST_ASSERT_MSG_FLNE instead. + */ +#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg) \ + NS_TEST_ASSERT_MSG_NE_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +/** + * \internal + * + * Required to avoid use of return statement which allows use in methods + * (callbacks) returning void. + */ +#define NS_TEST_EXPECT_MSG_NE_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) != (limit))) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportFailure (std::string (#actual) + " (actual) != " + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + } \ + } while (false) + +/** + * \brief Test that an actual and expected (limit) value are equal and report + * if not. + * + * Check to see if the expected (limit) value is equal to the actual value + * found in a test case. If the two values are equal nothing happens, but if + * the comparison fails, an error is reported in a consistent way. EXPECT* + * macros do not return if an error is detected. + * + * The message is interpreted as a stream, for example: + * + * \code + * NS_TEST_EXPECT_MSG_EQUAL (result, true, + * "cannot open file " << filename << " in test"); + * \endcode + * + * is legal. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the expected value of the test. + * \param msg Message that is output if the test does not pass. + * + * \warning Do not use this macro if you are comparing floating point numbers + * (float or double). Use NS_TEST_EXPECT_MSG_FLNE instead. + */ +#define NS_TEST_EXPECT_MSG_NE(actual, limit, msg) \ + NS_TEST_EXPECT_MSG_NE_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +// =========================================================================== +// Test for less than relation +// =========================================================================== + +/** + * \internal + */ +#define NS_TEST_ASSERT_MSG_LT_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) < (limit))) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportFailure (std::string (#actual) + " (actual) < " + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + return true; \ + } \ + } while (false) + +/** + * \brief Test that an actual value is less than a limit and report and abort + * if not. + * + * Check to see if the actual value found in a test case is less than the + * limit value. If the actual value is lesser nothing happens, but if the + * check fails, an error is reported in a consistent way and the execution + * of the current test case is aborted. + * + * The message is interpreted as a stream. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the limit value of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_ASSERT_MSG_LT(actual, limit, msg) \ + NS_TEST_ASSERT_MSG_LT_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +/** + * \internal + * + * Required to avoid use of return statement which allows use in methods + * (callbacks) returning void. + */ +#define NS_TEST_EXPECT_MSG_LT_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) < (limit))) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportFailure (std::string (#actual) + " (actual) < " + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + } \ + } while (false) + +/** + * \brief Test that an actual value is less than a limit and report if not. + * + * Check to see if the actual value found in a test case is less than the + * limit value. If the actual value is lesser nothing happens, but if the + * check fails, an error is reported in a consistent way. EXPECT* macros do + * not return if an error is detected. + * + * The message is interpreted as a stream. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the limit value of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_EXPECT_MSG_LT(actual, limit, msg) \ + NS_TEST_EXPECT_MSG_LT_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +// =========================================================================== +// Test for greater than relation +// =========================================================================== + +/** + * \internal + */ +#define NS_TEST_ASSERT_MSG_GT_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) > (limit))) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportFailure (std::string (#actual) + " (actual) > " + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + return true; \ + } \ + } while (false) + +/** + * \brief Test that an actual value is greater than a limit and report and abort + * if not. + * + * Check to see if the actaul value found in a test case is greater than the + * limit value. If the actual value is greater nothing happens, but if the + * check fails, an error is reported in a consistent way and the execution + * of the current test case is aborted. + * + * The message is interpreted as a stream. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the limit value of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_ASSERT_MSG_GT(actual, limit, msg) \ + NS_TEST_ASSERT_MSG_GT_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +/** + * \internal + * + * Required to avoid use of return statement which allows use in methods + * (callbacks) returning void. + */ +#define NS_TEST_EXPECT_MSG_GT_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) > (limit))) \ + { \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportFailure (std::string (#actual) + " (actual) > " + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), msgStream.str (), file, line); \ + } \ + } while (false) + +/** + * \brief Test that an actual value is greater than a limit and report if not. + * + * Check to see if the actual value found in a test case is greater than the + * limit value. If the actual value is greater nothing happens, but if the + * check fails, an error is reported in a consistent way. EXPECT* macros do + * not return if an error is detected. + * + * The message is interpreted as a stream. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the limit value of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_EXPECT_MSG_GT(actual, limit, msg) \ + NS_TEST_EXPECT_MSG_GT_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +namespace ns3 { + +/** + * \brief Compare two double precision floating point numbers and declare them + * equal if they are within some epsilon of each other. + * + * Approximate comparison of floating point numbers near equality is trickier + * than one may expect and is well-discussed in the literature. Basic + * strategies revolve around a suggestion by Knuth to compare the floating + * point numbers as binary integers, supplying a maximum difference between + * them . This max difference is specified in Units in the Last Place (ulps) + * or a floating point epsilon. + * + * This routine is based on the GNU Scientific Library function gsl_fcmp. + * + * \param a The first of double precision floating point numbers to compare + * \param b The second of double precision floating point numbers to compare + * \param epsilon The second of double precision floating point numberss to compare + * \returns Returns true if the doubles are equal to a precision defined by epsilon + */ + bool TestDoubleIsEqual (const double a, const double b, const double epsilon = std::numeric_limits::epsilon ()); + +/** + * \brief A single test case. + */ +class TestCase +{ +public: + TestCase (std::string name); + virtual ~TestCase (); + + /** + * \brief Run this test case. + * \returns Boolean sense of "an error has occurred." + */ + bool Run (void); + + /** + * \brief Set the verbosity of this test case. + * \param verbose Whether or not to print "stuff." + */ + void SetVerbose (bool verbose); + + /** + * \brief Set the name of this test case. + */ + void SetName (std::string name); + + /** + * \brief Get the name of this test case. + */ + std::string GetName (void); + + /** + * \brief Set the base directory of the ns-3 distribution. + */ + void SetBaseDir (std::string dir); + + /** + * \brief Get the base directory of the ns-3 distribution. + */ + std::string GetBaseDir (void); + +/** + * \brief Get the source directory of the current source file. + * + * One of the basic models of the test environment is that dedicated test- + * and response vectors live in the same directory as the source file. So it + * is a common operation to figure out what directory a given source file lives + * in. + * + * __FILE__ provides almost all of what we need, but in the gnu toolchain it + * comes out as something like "../src/core/pcap-file-test-suite.cc". + * + * We really don't want to have any dependency on the directory out of which a + * test is run, so we ask that any test-runner give us the base directory of the + * distribution, which is set via TestCase::SetBaseDir(). That string will look + * something like "/home/user/repos/ns-3-allinone/ns-3-dev". + * + * This function stitches the two pieces together and removes the file name to + * return something like "/home/user/repos/ns-3-allinone/ns-3-dev/src/core/". + * + * \param file The current source file name relative to the base directory. + * \returns The current source directory. + * + * \warning Always call this function as GetSourceDir (__FILE__) or use the + * convenience macro NS_TEST_SOURCEDIR. + */ + std::string GetSourceDir (std::string file); + + /** + * \brief Set the stream to which status and result messages will be written. + * + * We really don't want to have to pass an ofstream around to every function + * and we especially don't want to have to make our clients plumb an ofstream + * around so we need to save it. Since file streams are not designed to be + * copied or assigned (what does it mean to have duplicate streams to a file) + * we have to stash a pointer to the stream. + * \param ofs output file stream + */ + void SetStream (std::ofstream *ofs); + + /** + * \brief Get the stream to which status and result messages will be written. + */ + std::ofstream *GetStream (void); + + /** + * \brief Manually Set the error status of this test case. + */ + void SetErrorStatus (bool error); + + /** + * \brief Get the error status of this test case. + */ + bool GetErrorStatus (void); + + void ReportStart (void); + void ReportSuccess (void); + void ReportFailure (std::string cond, std::string actual, std::string limit, std::string message, + std::string file, int32_t line); + void ReportEnd (void); + +protected: + /** + * \internal + * \brief Implementation of reporting method for the start of the test case. + */ + virtual void DoReportStart (void); + + /** + * \internal + * \brief Implementation of reporting method for success of the test case. + */ + virtual void DoReportSuccess (void); + + /** + * \internal + * \brief Implementation of reporting method for failure of the test case. + */ + virtual void DoReportFailure (std::string cond, std::string actual, std::string limit, std::string message, + std::string file, int32_t line); + + /** + * \internal + * \brief Implementation of reporting method for the end of the test case. + */ + virtual void DoReportEnd (void); + + /** + * \internal + * \param verbose Turn on any output the test case may provide + * \brief Implementation to do any local setup required for this test case. + */ + virtual void DoSetup (void); + + /** + * \internal + * \brief Implementation to actually run this test case. + * \param verbose Turn on any output the test case may provide + * \returns Boolean sense of "an error has occurred." + */ + virtual bool DoRun (void) = 0; + + /** + * \internal + * \param verbose Turn on any output the test case may provide + * \brief Implementation to do any local setup required for this test case. + */ + virtual void DoTeardown (void); + +private: + TestCase (TestCase& tc); + TestCase& operator= (TestCase& tc); + + std::string m_name; + bool m_verbose; + std::string m_basedir; + std::ofstream *m_ofs; + bool m_error; + clock_t m_startTime; + struct tms m_startTimes; +}; + +/** + * \brief A suite of tests to run. + */ +class TestSuite +{ +public: + /** + * \enum TestType + * \brief Type of test. + */ + enum TestType { + BVT = 1, /**< This test suite implements a Build Verification Test */ + UNIT, /**< This test suite implements a Unit Test */ + SYSTEM, /**< This test suite implements a System Test */ + EXAMPLE, /**< This test suite implements an Example Test */ + PERFORMANCE /**< This test suite implements a Performance Test */ + }; + + /** + * \brief Constuct a new test suite. + * + * \param name The name of the test suite. + * \param type The TestType of the test suite (defaults to UNIT test). + */ + TestSuite (std::string name, TestType type = UNIT); + + /** + * \brief Destroy a test suite. + */ + virtual ~TestSuite (); + + /** + * \brief Run this test suite. + * + * \returns Boolean sense of "an error has occurred." + */ + bool Run (void); + + /** + * \brief Add an individual test case to this test suite. + * + * \param testCase Pointer to the test case object to be added. + * \returns Integer assigned as identifer of the provided test case. + */ + uint32_t AddTestCase (TestCase *testCase); + + /** + * \brief Get the number of test cases that have been added to this test suite. + * + * \returns Number of test cases in the suite. + */ + uint32_t GetNTestCases (void); + + /** + * \brief Get the test case at index i. + */ + TestCase *GetTestCase (uint32_t i); + + /** + * \brief get the kind of test this test suite implements + * + * \returns the TestType of the suite. + */ + TestType GetTestType (void); + + /** + * \brief Set the verbosity of this test suite. + * \param verbose Whether or not to print "stuff." + */ + void SetVerbose (bool verbose); + + /** + * \brief Set the name of this test suite. + */ + void SetName (std::string name); + + /** + * \brief Get the name of this test suite. + */ + std::string GetName (void); + + /** + * \brief Set the base directory of the ns-3 distribution. + */ + void SetBaseDir (std::string basedir); + + /** + * \brief Get the base directory of the ns-3 distribution. + */ + std::string GetBaseDir (void); + + /** + * \brief Set the stream to which status and result messages will be written. + * + * We really don't want to have to pass an ofstream around to every function + * and we especially don't want to have to make our clients plumb an ofstream + * around so we need to save it. Since file streams are not designed to be + * copied or assigned (what does it mean to have duplicate streams to a file) + * we have to stash a pointer to the stream. + * \param ofs output file stream + */ + void SetStream (std::ofstream *ofs); + + void ReportStart (void); + void ReportSuccess (void); + void ReportFailure (void); + void ReportEnd (void); + +protected: + /** + * \internal + * \brief Implementation of reporting method for the start of the test suite. + */ + virtual void DoReportStart (void); + + /** + * \internal + * \brief Implementation of reporting method for success of the test suite. + */ + virtual void DoReportSuccess (void); + + /** + * \internal + * \brief Implementation of reporting method for failure of the test suite. + */ + virtual void DoReportFailure (void); + + /** + * \internal + * \brief Implementation of reporting method for the end of the test suite. + */ + virtual void DoReportEnd (void); + + /** + * \internal + * \param verbose Turn on any output the test case may provide + * \brief Implementation to do any local setup required for this test suite. + */ + virtual void DoSetup (void); + + /** + * \internal + * \brief Implementation to actually run this test suite. + * \param verbose Turn on any output the test case may provide + * \returns Boolean sense of "an error has occurred." + */ + virtual bool DoRun (void); + + /** + * \internal + * \param verbose Turn on any output the test case may provide + * \brief Implementation to do any local setup required for this test suite. + */ + virtual void DoTeardown (void); + +private: + TestSuite (TestSuite& ts); + TestSuite& operator= (TestSuite& ts); + + std::string m_name; + bool m_verbose; + std::string m_basedir; + std::ofstream *m_ofs; + TestType m_type; + + clock_t m_startTime; + struct tms m_startTimes; + + typedef std::vector TestCaseVector_t; + TestCaseVector_t m_tests; +}; + +/** + * \brief A runner to execute tests. + */ +class TestRunner +{ +public: + static uint32_t AddTestSuite (TestSuite *testSuite); + static uint32_t GetNTestSuites (void); + static TestSuite *GetTestSuite (uint32_t n); +}; + +/** + * \brief A simple way to store test vectors (for stimulus or from responses) + */ +template +class TestVectors +{ +public: + TestVectors (); + virtual ~TestVectors (); + + void Reserve (uint32_t reserve); + + uint32_t Add (T vector); + + uint32_t GetN (void) const; + T Get (uint32_t i) const; + +private: + TestVectors (const TestVectors& tv); + TestVectors& operator= (const TestVectors& tv); + bool operator== (const TestVectors& tv) const; + + typedef std::vector TestVector_t; + TestVector_t m_vectors; +}; + +template +TestVectors::TestVectors () + : m_vectors () +{ +} + +template +void +TestVectors::Reserve (uint32_t reserve) +{ + m_vectors.reserve (reserve); +} + +template +TestVectors::~TestVectors () +{ +} + +template +uint32_t +TestVectors::Add (T vector) +{ + uint32_t index = m_vectors.size (); + m_vectors.push_back (vector); + return index; +} + +template +uint32_t +TestVectors::GetN (void) const +{ + return m_vectors.size (); +} + +template +T +TestVectors::Get (uint32_t i) const +{ + NS_ABORT_MSG_UNLESS (m_vectors.size () > i, "TestVectors::Get(): Bad index"); + return m_vectors[i]; +} + +}; // namespace ns3 + +// +// Original ns-3 unit test code for compatibility +// #ifdef RUN_SELF_TESTS namespace ns3 { diff --git a/src/core/type-traits-test-suite.cc b/src/core/type-traits-test-suite.cc new file mode 100644 index 000000000..c61bd2986 --- /dev/null +++ b/src/core/type-traits-test-suite.cc @@ -0,0 +1,66 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "type-traits.h" +#include "test.h" + +namespace ns3 { + +class TypeTraitsTestCase : public TestCase +{ +public: + TypeTraitsTestCase (); + virtual ~TypeTraitsTestCase () {} + +private: + virtual bool DoRun (void); +}; + +TypeTraitsTestCase::TypeTraitsTestCase (void) + : TestCase ("Check type traits") +{ +} + +bool +TypeTraitsTestCase::DoRun (void) +{ + NS_TEST_ASSERT_MSG_EQ (TypeTraits::IsPointerToMember, 1, "Check"); + NS_TEST_ASSERT_MSG_EQ (TypeTraits::IsPointerToMember, 1, "Check"); + NS_TEST_ASSERT_MSG_EQ (TypeTraits::IsPointerToMember, 1, "Check"); + NS_TEST_ASSERT_MSG_EQ (TypeTraits::IsPointerToMember, 1, "Check"); + NS_TEST_ASSERT_MSG_EQ (TypeTraits::PointerToMemberTraits::nArgs, 0, "Check"); + NS_TEST_ASSERT_MSG_EQ (TypeTraits::PointerToMemberTraits::nArgs, 1, "Check"); + + return GetErrorStatus (); +} + +class TypeTraitsTestSuite : public TestSuite +{ +public: + TypeTraitsTestSuite (); +}; + +TypeTraitsTestSuite::TypeTraitsTestSuite () + : TestSuite ("type-traits", UNIT) +{ + AddTestCase (new TypeTraitsTestCase); +} + +TypeTraitsTestSuite typeTraitsTestSuite; + +} // namespace ns3 diff --git a/src/core/type-traits-test.cc b/src/core/type-traits-test.cc deleted file mode 100644 index 93e310bf4..000000000 --- a/src/core/type-traits-test.cc +++ /dev/null @@ -1,40 +0,0 @@ -#include "type-traits.h" -#include "test.h" - -#ifdef RUN_SELF_TESTS - -namespace ns3 { - -class TypeTraitsTest : public Test -{ -public: - TypeTraitsTest (); - virtual bool RunTests (void); -}; - -TypeTraitsTest::TypeTraitsTest () - : Test ("TypeTraits") -{} -bool -TypeTraitsTest::RunTests (void) -{ - bool result = true; - - //TypeTraits::ReferencedType ir; - //TypeTraits::NonConstType uci; - NS_TEST_ASSERT_EQUAL (TypeTraits::IsPointerToMember, 1); - NS_TEST_ASSERT_EQUAL (TypeTraits::IsPointerToMember, 1); - NS_TEST_ASSERT_EQUAL (TypeTraits::IsPointerToMember, 1); - NS_TEST_ASSERT_EQUAL (TypeTraits::IsPointerToMember, 1); - NS_TEST_ASSERT_EQUAL (TypeTraits::PointerToMemberTraits::nArgs, 0); - NS_TEST_ASSERT_EQUAL (TypeTraits::PointerToMemberTraits::nArgs, 1); - - return result; -} - -static TypeTraitsTest g_typeTraitsTest; - -} // namespace ns3 - -#endif /* RUN_SELF_TESTS */ - diff --git a/src/core/wscript b/src/core/wscript index b75c99e8b..49b1611f7 100644 --- a/src/core/wscript +++ b/src/core/wscript @@ -46,7 +46,6 @@ int main () def build(bld): core = bld.create_ns3_module('core') core.source = [ - 'callback-test.cc', 'log.cc', 'breakpoint.cc', 'type-id.cc', @@ -60,7 +59,6 @@ def build(bld): 'rng-stream.cc', 'command-line.cc', 'type-name.cc', - 'type-traits-test.cc', 'attribute.cc', 'boolean.cc', 'integer.cc', @@ -70,7 +68,6 @@ def build(bld): 'string.cc', 'pointer.cc', 'object-vector.cc', - 'attribute-test.cc', 'object-factory.cc', 'global-value.cc', 'traced-callback.cc', @@ -79,6 +76,10 @@ def build(bld): 'callback.cc', 'names.cc', 'vector.cc', + 'attribute-test-suite.cc', + 'callback-test-suite.cc', + 'names-test-suite.cc', + 'type-traits-test-suite.cc', ] headers = bld.new_task_gen('ns3header') @@ -149,3 +150,6 @@ def build(bld): 'system-condition.h', ]) + if bld.env['ENABLE_GSL']: + core.uselib = 'GSL GSLCBLAS M' + core.source.extend(['rng-test-suite.cc']) diff --git a/src/devices/bridge/bridge-net-device.h b/src/devices/bridge/bridge-net-device.h index c63a2db07..d982b09ad 100644 --- a/src/devices/bridge/bridge-net-device.h +++ b/src/devices/bridge/bridge-net-device.h @@ -70,12 +70,14 @@ public: BridgeNetDevice (); virtual ~BridgeNetDevice (); - /** \brief Add a 'port' to a bridge device + /** + * \brief Add a 'port' to a bridge device * * This method adds a new bridge port to a BridgeNetDevice, so that * the new bridge port NetDevice becomes part of the bridge and L2 * frames start being forwarded to/from this NetDevice. * + * \param bridgePort NetDevice * \attention The netdevice that is being added as bridge port must * _not_ have an IP address. In order to add IP connectivity to a * bridging node you must enable IP on the BridgeNetDevice itself, diff --git a/src/devices/csma/csma-net-device.h b/src/devices/csma/csma-net-device.h index aa94d1f98..60cfdf44f 100644 --- a/src/devices/csma/csma-net-device.h +++ b/src/devices/csma/csma-net-device.h @@ -349,12 +349,21 @@ public: /** * Start sending a packet down the channel. + * \param packet packet to send + * \param dest layer 2 destination address + * \param protocolNumber protocol number + * \return true if successfull, false otherwise (drop, ...) */ virtual bool Send (Ptr packet, const Address& dest, uint16_t protocolNumber); /** * Start sending a packet down the channel, with MAC spoofing + * \param packet packet to send + * \param source layer 2 source address + * \param dest layer 2 destination address + * \param protocolNumber protocol number + * \return true if successfull, false otherwise (drop, ...) */ virtual bool SendFrom (Ptr packet, const Address& source, const Address& dest, uint16_t protocolNumber); @@ -448,30 +457,35 @@ private: /** * Operator = is declared but not implemented. This disables the assigment * operator for CsmaNetDevice objects. - + * \param o object to copy */ CsmaNetDevice &operator = (const CsmaNetDevice &o); /** * Copy constructor is declared but not implemented. This disables the * copy constructor for CsmaNetDevice objects. + * \param o object to copy */ CsmaNetDevice (const CsmaNetDevice &o); /** * Initialization function used during object construction. + * \param sendEnable if device will be allowed to send + * \param receiveEnable if device will be allowed to receive */ void Init (bool sendEnable, bool receiveEnable); /** * Calculate the value for the MTU that would result from * setting the frame size to the given value. + * \param frameSize size of frame */ uint32_t MtuFromFrameSize (uint32_t frameSize); /** * Calculate the value for the frame size that would be required * to be able to set the MTU to the given value. + * \param mtu MTU */ uint32_t FrameSizeFromMtu (uint32_t mtu); diff --git a/src/devices/emu/emu-net-device.h b/src/devices/emu/emu-net-device.h index 9ac035672..279bd3492 100644 --- a/src/devices/emu/emu-net-device.h +++ b/src/devices/emu/emu-net-device.h @@ -225,12 +225,16 @@ private: /** * Adds the necessary headers and trailers to a packet of data in order to * respect the protocol implemented by the agent. + * \param p packet + * \param protocolNumber protocol number */ - void AddHeader(Ptr p, uint16_t protocolNumber); + void AddHeader (Ptr p, uint16_t protocolNumber); /** * Removes, from a packet of data, all headers and trailers that * relate to the protocol implemented by the agent + * \param p Packet whose headers need to be processed + * \param param An integer parameter that can be set by the function * \return Returns true if the packet should be forwarded up the * protocol stack. */ @@ -238,7 +242,7 @@ private: /** * Start Sending a Packet Down the Wire. - * + * @param p packet to send * @returns true if success, false on failure */ bool TransmitStart (Ptr p); diff --git a/src/devices/mesh/dot11s/airtime-metric.cc b/src/devices/mesh/dot11s/airtime-metric.cc new file mode 100644 index 000000000..cf6c27574 --- /dev/null +++ b/src/devices/mesh/dot11s/airtime-metric.cc @@ -0,0 +1,95 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#include "airtime-metric.h" +#include "ns3/wifi-remote-station-manager.h" +#include "ns3/wifi-mode.h" +namespace ns3 { +namespace dot11s { +NS_OBJECT_ENSURE_REGISTERED (AirtimeLinkMetricCalculator); +TypeId +AirtimeLinkMetricCalculator::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::dot11s::AirtimeLinkMetricCalculator") + .SetParent () + .AddConstructor () + .AddAttribute ( "OverheadNanosec", + "Overhead expressed in nanoseconds:DIFS+ 2* SIFS + 2* PREAMBLE + 2* ACK", + UintegerValue (108000), + MakeUintegerAccessor (&AirtimeLinkMetricCalculator::m_overheadNanosec), + MakeUintegerChecker (1) + ) + .AddAttribute ( "TestLength", + "Rate should be estimated using test length.", + UintegerValue (1024), + MakeUintegerAccessor ( + &AirtimeLinkMetricCalculator::m_testLength), + MakeUintegerChecker (1) + ) + .AddAttribute ( "Dot11MacHeaderLength", + "Length of the 802.11 header", + UintegerValue (36), + MakeUintegerAccessor ( + &AirtimeLinkMetricCalculator::m_headerLength), + MakeUintegerChecker (0) + ) + .AddAttribute ( "Dot11sMeshHeaderLength", + "Length of the mesh header", + UintegerValue (6), + MakeUintegerAccessor ( + &AirtimeLinkMetricCalculator::m_meshHeaderLength), + MakeUintegerChecker (0) + ) + ; + return tid; +} + +uint32_t +AirtimeLinkMetricCalculator::CalculateMetric (Mac48Address peerAddress, Ptr mac) +{ + /* Airtime link metric is defined in 11B.10 of 802.11s Draft D3.0 as: + * + * airtime = (O + Bt/r)* (1 + average retry counter), where + * o -- the PHY dependent channel access which includes frame headers, training sequences, + * access protocol frames, etc. + * bt -- the test packet length in bits (8192 by default), + * r -- the current bitrate of the packet, + * + * Final result is expressed in units of 0.01 Time Unit = 10.24 us (as required by 802.11s draft) + */ + + const double sec2ns = 1e9; // seconds -> nanoseconds conversion factor + const double ns2tu = 10240; // nanoseconds -> 0.01 TU conversion factor + + WifiRemoteStation * station = mac->GetStationManager ()->Lookup (peerAddress); + NS_ASSERT (station != 0); + Ptr test_frame = Create (m_testLength + m_headerLength + m_meshHeaderLength); + uint32_t rate = + station->GetDataMode (test_frame, m_testLength + m_headerLength + m_meshHeaderLength).GetDataRate (); + uint32_t payload_nanosec = (uint32_t) ( + (double) ((m_testLength + m_meshHeaderLength) * 8 /*octets -> bits*/) * sec2ns / ((double) rate)); + uint32_t header_nanosec = (uint32_t) ((double) (m_headerLength * 8 /*octets -> bits*/* sec2ns) + / ((double) mac->GetStationManager () -> GetBasicMode (0).GetDataRate ())); + uint32_t metric = (uint32_t) (((double) (payload_nanosec + header_nanosec + m_overheadNanosec)) / ns2tu + * (station->GetAvgSlrc () + 1)); + return metric; +} +} //namespace dot11s +} //namespace ns3 diff --git a/src/devices/mesh/dot11s/airtime-metric.h b/src/devices/mesh/dot11s/airtime-metric.h new file mode 100644 index 000000000..6755ac6b5 --- /dev/null +++ b/src/devices/mesh/dot11s/airtime-metric.h @@ -0,0 +1,59 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#ifndef AIRTIME_METRIC_H +#define AIRTIME_METRIC_H +#include "ns3/mesh-wifi-interface-mac.h" +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * + * \brief airtime link metric calculator + * + * \details Airtime link metric is defined in 11B.10 of 802.11s Draft D3.0 as: + * + * airtime = (O + Bt/r)* (1 + average retry counter), where + * + * o -- the PHY dependent channel access which includes frame headers, training sequences, + * access protocol frames, etc. + * bt -- the test packet length in bits (8192 by default), + * r -- the current bitrate of the packet, + * + * Final result is expressed in units of 0.01 Time Unit = 10.24 us (as required by 802.11s draft) + */ +class AirtimeLinkMetricCalculator : public Object +{ +public: + static TypeId GetTypeId (); + uint32_t CalculateMetric (Mac48Address peerAddress, Ptr mac); +private: + //\brief Overhead expressed in nanoseconds:DIFS+ 2* SIFS + 2*PREAMBLE + 2* ACK + uint32_t m_overheadNanosec; + ///\brief Bt value + uint32_t m_testLength; + ///\brief header length (used in overhead) + uint16_t m_headerLength; + ///\brief meshHeader length (6 octets usually) + uint16_t m_meshHeaderLength; +}; +} //namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/dot11s-mac-header.cc b/src/devices/mesh/dot11s/dot11s-mac-header.cc new file mode 100644 index 000000000..215e2ecb4 --- /dev/null +++ b/src/devices/mesh/dot11s/dot11s-mac-header.cc @@ -0,0 +1,380 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ns3/assert.h" +#include "ns3/address-utils.h" +#include "dot11s-mac-header.h" +#include "ns3/packet.h" +#include "ns3/test.h" + +namespace ns3 { +namespace dot11s { +/*********************************************************** + * Here Mesh Mac Header functionality is defined. + ***********************************************************/ +TypeId +MeshHeader::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::Dot11sMacHeader") + .SetParent
    () + .AddConstructor (); + return tid; +} +MeshHeader::MeshHeader () : + m_meshFlags (0), m_meshTtl (0), m_meshSeqno (0), m_addr4 (Mac48Address ()), m_addr5 (Mac48Address ()), + m_addr6 (Mac48Address ()) +{ +} +MeshHeader::~MeshHeader () +{ +} +TypeId +MeshHeader::GetInstanceTypeId () const +{ + return GetTypeId (); +} +void +MeshHeader::SetAddr4 (Mac48Address address) +{ + m_addr4 = address; +} +void +MeshHeader::SetAddr5 (Mac48Address address) +{ + m_addr5 = address; +} +void +MeshHeader::SetAddr6 (Mac48Address address) +{ + m_addr6 = address; +} +Mac48Address +MeshHeader::GetAddr4 () const +{ + return m_addr4; +} +Mac48Address +MeshHeader::GetAddr5 () const +{ + return m_addr5; +} +Mac48Address +MeshHeader::GetAddr6 () const +{ + return m_addr6; +} +void +MeshHeader::SetMeshSeqno (uint32_t seqno) +{ + m_meshSeqno = seqno; +} +uint32_t +MeshHeader::GetMeshSeqno () const +{ + return m_meshSeqno; +} +void +MeshHeader::SetMeshTtl (uint8_t TTL) +{ + m_meshTtl = TTL; +} +uint8_t +MeshHeader::GetMeshTtl () const +{ + return m_meshTtl; +} +void +MeshHeader::SetAddressExt (uint8_t num_of_addresses) +{ + NS_ASSERT (num_of_addresses <= 3); + m_meshFlags |= 0x03 & num_of_addresses; +} +uint8_t +MeshHeader::GetAddressExt () const +{ + return (0x03 & m_meshFlags); +} +uint32_t +MeshHeader::GetSerializedSize () const +{ + return 6 + GetAddressExt () * 6; +} +void +MeshHeader::Serialize (Buffer::Iterator start) const +{ + Buffer::Iterator i = start; + i.WriteU8 (m_meshFlags); + i.WriteU8 (m_meshTtl); + i.WriteHtolsbU32 (m_meshSeqno); + uint8_t addresses_to_add = GetAddressExt (); + //Writing Address extensions: + if ((addresses_to_add == 1) || (addresses_to_add == 3)) + { + WriteTo (i, m_addr4); + } + if (addresses_to_add > 1) + { + WriteTo (i, m_addr5); + } + if (addresses_to_add > 1) + { + WriteTo (i, m_addr6); + } +} +uint32_t +MeshHeader::Deserialize (Buffer::Iterator start) +{ + Buffer::Iterator i = start; + uint8_t addresses_to_read = 0; + m_meshFlags = i.ReadU8 (); + m_meshTtl = i.ReadU8 (); + m_meshSeqno = i.ReadLsbtohU32 (); + addresses_to_read = m_meshFlags & 0x03; + if ((addresses_to_read == 1) || (addresses_to_read == 3)) + { + ReadFrom (i, m_addr4); + } + if (addresses_to_read > 1) + { + ReadFrom (i, m_addr5); + } + if (addresses_to_read > 1) + { + ReadFrom (i, m_addr6); + } + return i.GetDistanceFrom (start); +} +void +MeshHeader::Print (std::ostream &os) const +{ + os << "flags = " << (uint16_t) m_meshFlags << std::endl << "ttl = " << (uint16_t) m_meshTtl + << std::endl << "seqno = " << m_meshSeqno << std::endl<< "addr4 = " << m_addr4 << std::endl + << "addr5 = " << m_addr5 << std::endl << "addr6 = " << m_addr6 << std::endl; +} +bool +operator== (const MeshHeader & a, const MeshHeader & b) +{ + return ((a.m_meshFlags == b.m_meshFlags) && (a.m_meshTtl == b.m_meshTtl) + && (a.m_meshSeqno == b.m_meshSeqno) && (a.m_addr4 == b.m_addr4) && (a.m_addr5 == b.m_addr5) + && (a.m_addr6 == b.m_addr6)); +} +/********************************************************** + * ActionFrame + **********************************************************/ +WifiMeshActionHeader::WifiMeshActionHeader () +{ +} +WifiMeshActionHeader::~WifiMeshActionHeader () +{ +} +void +WifiMeshActionHeader::SetAction (WifiMeshActionHeader::CategoryValue type, + WifiMeshActionHeader::ActionValue action) +{ + m_category = type; + + switch (type) + { + case MESH_PEERING_MGT: + { + m_actionValue = action.peerLink; + break; + } + case MESH_PATH_SELECTION: + { + m_actionValue = action.pathSelection; + break; + } + case MESH_LINK_METRIC: + case MESH_INTERWORKING: + case MESH_RESOURCE_COORDINATION: + case MESH_PROXY_FORWARDING: + break; + } +} +WifiMeshActionHeader::CategoryValue +WifiMeshActionHeader::GetCategory () +{ + switch (m_category) + { + case MESH_PEERING_MGT: + return MESH_PEERING_MGT; + case MESH_LINK_METRIC: + return MESH_LINK_METRIC; + case MESH_PATH_SELECTION: + return MESH_PATH_SELECTION; + case MESH_INTERWORKING: + return MESH_INTERWORKING; + case MESH_RESOURCE_COORDINATION: + return MESH_RESOURCE_COORDINATION; + case MESH_PROXY_FORWARDING: + return MESH_PROXY_FORWARDING; + default: + NS_FATAL_ERROR ("Unknown action value"); + return MESH_PEERING_MGT; + } +} +WifiMeshActionHeader::ActionValue +WifiMeshActionHeader::GetAction () +{ + ActionValue retval; + retval.peerLink = PEER_LINK_OPEN; // Needs to be initialized to something to quiet valgrind in default cases + switch (m_category) + { + case MESH_PEERING_MGT: + switch (m_actionValue) + { + case PEER_LINK_OPEN: + retval.peerLink = PEER_LINK_OPEN; + return retval; + case PEER_LINK_CONFIRM: + retval.peerLink = PEER_LINK_CONFIRM; + return retval; + case PEER_LINK_CLOSE: + retval.peerLink = PEER_LINK_CLOSE; + return retval; + default: + NS_FATAL_ERROR ("Unknown mesh peering management action code"); + retval.peerLink = PEER_LINK_OPEN; /* quiet compiler */ + return retval; + } + case MESH_PATH_SELECTION: + switch (m_actionValue) + { + case PATH_SELECTION: + retval.pathSelection = PATH_SELECTION; + return retval; + default: + NS_FATAL_ERROR ("Unknown mesh path selection action code"); + retval.peerLink = PEER_LINK_OPEN; /* quiet compiler */ + return retval; + } + case MESH_LINK_METRIC: + // not yet supported + case MESH_INTERWORKING: + // not yet supported + case MESH_RESOURCE_COORDINATION: + // not yet supported + default: + NS_FATAL_ERROR ("Unsupported mesh action"); + retval.peerLink = PEER_LINK_OPEN; /* quiet compiler */ + return retval; + } +} +TypeId +WifiMeshActionHeader::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::WifiMeshActionHeader") + .SetParent
    () + .AddConstructor (); + return tid; +} +TypeId +WifiMeshActionHeader::GetInstanceTypeId () const +{ + return GetTypeId (); +} +void +WifiMeshActionHeader::Print (std::ostream &os) const +{ +} +uint32_t +WifiMeshActionHeader::GetSerializedSize () const +{ + return 2; +} +void +WifiMeshActionHeader::Serialize (Buffer::Iterator start) const +{ + start.WriteU8 (m_category); + start.WriteU8 (m_actionValue); +} +uint32_t +WifiMeshActionHeader::Deserialize (Buffer::Iterator start) +{ + Buffer::Iterator i = start; + m_category = i.ReadU8 (); + m_actionValue = i.ReadU8 (); + return i.GetDistanceFrom (start); +} +#ifdef RUN_SELF_TESTS + +/// Built-in self test for Dot11sMacHeader +struct Dot11sMacHeaderBist : public Test +{ + Dot11sMacHeaderBist () : + Test ("Mesh/802.11s/MeshHeader") + { + } + virtual bool + RunTests (); +}; + +/// Test instance +static Dot11sMacHeaderBist g_Dot11sMacHeaderBist; + +bool +Dot11sMacHeaderBist::RunTests () +{ + bool result (true); + { + MeshHeader a; + a.SetAddressExt (3); + a.SetAddr4 (Mac48Address ("11:22:33:44:55:66")); + a.SetAddr5 (Mac48Address ("11:00:33:00:55:00")); + a.SetAddr6 (Mac48Address ("00:22:00:44:00:66")); + a.SetMeshTtl (122); + a.SetMeshSeqno (321); + Ptr packet = Create (); + packet->AddHeader (a); + MeshHeader b; + packet->RemoveHeader (b); + NS_TEST_ASSERT_EQUAL (a, b); + } + { + MeshHeader a; + a.SetAddressExt (2); + a.SetAddr5 (Mac48Address ("11:00:33:00:55:00")); + a.SetAddr6 (Mac48Address ("00:22:00:44:00:66")); + a.SetMeshTtl (122); + a.SetMeshSeqno (321); + Ptr packet = Create (); + packet->AddHeader (a); + MeshHeader b; + packet->RemoveHeader (b); + NS_TEST_ASSERT_EQUAL (a, b); + } + { + MeshHeader a; + a.SetAddressExt (1); + a.SetAddr4 (Mac48Address ("11:22:33:44:55:66")); + a.SetMeshTtl (122); + a.SetMeshSeqno (321); + Ptr packet = Create (); + packet->AddHeader (a); + MeshHeader b; + packet->RemoveHeader (b); + NS_TEST_ASSERT_EQUAL (a, b); + } + return result; +} +#endif +} //namespace dot11s +} // namespace ns3 diff --git a/src/devices/mesh/dot11s/dot11s-mac-header.h b/src/devices/mesh/dot11s/dot11s-mac-header.h new file mode 100644 index 000000000..57803b53a --- /dev/null +++ b/src/devices/mesh/dot11s/dot11s-mac-header.h @@ -0,0 +1,157 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + + +#ifndef MESH_WIFI_MAC_HEADER_H +#define MESH_WIFI_MAC_HEADER_H + +#include "ns3/header.h" +#include "ns3/mac48-address.h" + +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * + * \brief Mesh Control field, see IEEE 802.11s draft 3.0 section 7.1.3.5b + * + * Header format: | Mesh flags: 1 | TTL: 1 | Sequence number: 4 | Address ext.: 0, 6, 12 or 18 | + */ +class MeshHeader : public Header +{ +public: + MeshHeader (); + ~MeshHeader (); + static TypeId GetTypeId (); + virtual TypeId GetInstanceTypeId () const; + virtual void Print (std::ostream &os) const; + + void SetAddr4 (Mac48Address address); + void SetAddr5 (Mac48Address address); + void SetAddr6 (Mac48Address address); + Mac48Address GetAddr4 () const; + Mac48Address GetAddr5 () const; + Mac48Address GetAddr6 () const; + + void SetMeshSeqno (uint32_t seqno); + uint32_t GetMeshSeqno () const; + + void SetMeshTtl (uint8_t TTL); + uint8_t GetMeshTtl () const; + + void SetAddressExt (uint8_t num_of_addresses); + uint8_t GetAddressExt () const; + + virtual uint32_t GetSerializedSize () const; + virtual void Serialize (Buffer::Iterator start) const; + virtual uint32_t Deserialize (Buffer::Iterator start); +private: + uint8_t m_meshFlags; + uint8_t m_meshTtl; + uint32_t m_meshSeqno; + Mac48Address m_addr4; + Mac48Address m_addr5; + Mac48Address m_addr6; + friend bool operator== (const MeshHeader & a, const MeshHeader & b); +}; +bool operator== (const MeshHeader & a, const MeshHeader & b); + +/** + * \ingroup dot11s + * + * \brief See IEEE 802.11s draft 3.0 section 7.2.3.14 + * + * Header format: | category: 1 | action value: 1 | + */ +class WifiMeshActionHeader : public Header +{ +public: + WifiMeshActionHeader (); + ~WifiMeshActionHeader (); + + /* Compatible with open80211s implementation */ + enum CategoryValue //table 7-24 staring from 4 + { + MESH_PEERING_MGT = 30, + MESH_LINK_METRIC = 31, + MESH_PATH_SELECTION = 32, + MESH_INTERWORKING = 33, + MESH_RESOURCE_COORDINATION = 34, + MESH_PROXY_FORWARDING = 35, + }; + /* Compatible with open80211s implementation */ + enum PeerLinkMgtActionValue + { + PEER_LINK_OPEN = 0, + PEER_LINK_CONFIRM = 1, + PEER_LINK_CLOSE = 2, + }; + enum LinkMetricActionValue + { + LINK_METRIC_REQUEST = 0, + LINK_METRIC_REPORT, + }; + /* Compatible with open80211s implementation */ + enum PathSelectionActionValue + { + PATH_SELECTION = 0, + }; + enum InterworkActionValue + { + PORTAL_ANNOUNCEMENT = 0, + }; + enum ResourceCoordinationActionValue + { + CONGESTION_CONTROL_NOTIFICATION = 0, + MDA_SETUP_REQUEST, + MDA_SETUP_REPLY, + MDAOP_ADVERTISMENT_REQUEST, + MDAOP_ADVERTISMENTS, + MDAOP_SET_TEARDOWN, + BEACON_TIMING_REQUEST, + BEACON_TIMING_RESPONSE, + TBTT_ADJUSTMENT_REQUEST, + MESH_CHANNEL_SWITCH_ANNOUNCEMENT, + }; + typedef union + { + enum PeerLinkMgtActionValue peerLink; + enum LinkMetricActionValue linkMetrtic; + enum PathSelectionActionValue pathSelection; + enum InterworkActionValue interwork; + enum ResourceCoordinationActionValue resourceCoordination; + } ActionValue; + void SetAction (enum CategoryValue type,ActionValue action); + + CategoryValue GetCategory (); + ActionValue GetAction (); + static TypeId GetTypeId (); + virtual TypeId GetInstanceTypeId () const; + virtual void Print (std::ostream &os) const; + virtual uint32_t GetSerializedSize () const; + virtual void Serialize (Buffer::Iterator start) const; + virtual uint32_t Deserialize (Buffer::Iterator start); +private: + uint8_t m_category; + uint8_t m_actionValue; +}; +} //namespace dot11s +} // namespace ns3 +#endif /* MESH_WIFI_MAC_HEADER_H */ diff --git a/src/devices/mesh/dot11s/dot11s.h b/src/devices/mesh/dot11s/dot11s.h new file mode 100644 index 000000000..d3087b666 --- /dev/null +++ b/src/devices/mesh/dot11s/dot11s.h @@ -0,0 +1,79 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Pavel Boyko + * + * This is doxygen module description, don't include + */ +/** + * \ingroup mesh + * \defgroup dot11s IEEE 802.11s draft + * + * \brief IEEE 802.11s (mesh) draft standard implementation + * + * Current model conforms IEEE 802.11s D3.0 draft version and includes + * Peer Management Protocol and HWMP (routing) Protocol implementations. + * + * The multi-interface mesh points are supported as an + * extension of IEEE draft version 3.0. Note that corresponding helper + * creates single interface station by default. + * \section Dot11s Overview of IEEE 802.11s + * Implementation of 802.11s draft standard consists of two main parts: + * Peer management protocol and HWMP - Hybrid Wireless Mesh Protocol. + * + * The task of peer management protocol is the following: + * -open links detecting beacons and starting peer link finite + * state machine. + * -close peer links due to transmission failures or beacon loss. + * + * If peer link between sender and receiver does not exist, the packet will be dropped. + * So, the plug-in to peer management protocol is the first in the list of + * ns3::MeshWifiInterfaceMacPlugin + * \subsection IE Implementation of Information elements + * To make a model of 802.11s stack, we need to implement large quantity of information + * elements and have an ability to add them in a beacon. Also we have to parse beacon + * and extract proper information elements from it. So, two classes ns3::WifiInformationElement + * and ns3::WifiInformationElementVector support this functionality. The former keeps all + * internal structure of information element and its elementId. It has methods + * ns3::WifiInformationElement::SerializeInformation and ns3::WifiInformationElement::DeserializeInformation. + * The latter is ns3::WifiInformationElementVector adds all stored information elements to a packet. + * \subsection PMP Peer management protocol + * Peer management protocol consists of three main parts: + * - Protocol itself ns3::dot11s::PeerManagementProtocol, which keeps all active peer links on interfaces, + * handles all changes of their states and notifies a routing protocol about link failures. + * - MAC plug-in ns3::dot11s::PeerManagementProtocolMac which drops packet, if there is no peer link, + * and peek all needed information from management frames and information elements from beacons. + * - Peer link ns3::dot11s::PeerLink which keeps finite state machine of each peer link, keeps + * beacon loss counter and counter of successive transmission failures. + * + * Procedure of closing peer link is not described detailed in 802.11s draft standard, so in our model + * the link may be closed by: + * - beacon loss (see an appropriate attribute of ns3::dot11s::PeerLink class) + * - transmission failure -- when a predefined number of successive packets have failed to transmit, + * the link will be closed. + * + * Also Peer management protocol is responsible for beacon collision avoidance, because it keeps + * beacon timing elements from all neighbours. + * Note, that PeerManagementProtocol is not attached to MeshPointDevice as a routing protocol, + * but the structure is similar: the upper tier of protocol ns3::dot11s::PeerManagementProtocol + * and its plug-in is ns3::dot11s::PeerManagementProtocolMac. + * + * \subsection HWMP Hybrid Wireless Mesh Protocol + * HWMP is implemented in both modes -- reactive and proactive. Also we have implemented an ability + * to transmit broadcast data and management frames as unicasts (see appropriate attributes). + * This feature turns off at a station when the number of neighbours of the station is more than a threshold. + */ diff --git a/src/devices/mesh/dot11s/hwmp-protocol-mac.cc b/src/devices/mesh/dot11s/hwmp-protocol-mac.cc new file mode 100644 index 000000000..3434c84c9 --- /dev/null +++ b/src/devices/mesh/dot11s/hwmp-protocol-mac.cc @@ -0,0 +1,475 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ns3/mesh-wifi-interface-mac.h" +#include "ns3/packet.h" +#include "ns3/simulator.h" +#include "ns3/nstime.h" +#include "ns3/log.h" +#include "dot11s-mac-header.h" +#include "hwmp-protocol-mac.h" +#include "hwmp-tag.h" +#include "ie-dot11s-preq.h" +#include "ie-dot11s-prep.h" +#include "ie-dot11s-rann.h" +#include "ie-dot11s-perr.h" + +namespace ns3 { +namespace dot11s { + +NS_LOG_COMPONENT_DEFINE ("HwmpProtocolMac"); +HwmpProtocolMac::HwmpProtocolMac (uint32_t ifIndex, Ptr protocol) : + m_ifIndex (ifIndex), m_protocol (protocol) +{ +} +HwmpProtocolMac::~HwmpProtocolMac () +{ +} +void +HwmpProtocolMac::SetParent (Ptr parent) +{ + m_parent = parent; +} + +bool +HwmpProtocolMac::ReceiveData (Ptr packet, const WifiMacHeader & header) +{ + NS_ASSERT (header.IsData ()); + + MeshHeader meshHdr; + HwmpTag tag; + if (packet->PeekPacketTag (tag)) + { + NS_FATAL_ERROR ("HWMP tag is not supposed to be received by network"); + } + + packet->RemoveHeader (meshHdr); + m_stats.rxData++; + m_stats.rxDataBytes += packet->GetSize (); + + //TODO: address extension + Mac48Address destination; + Mac48Address source; + switch (meshHdr.GetAddressExt ()) + { + case 0: + source = header.GetAddr4 (); + destination = header.GetAddr3 (); + break; + default: + NS_FATAL_ERROR ( + "6-address scheme is not yet supported and 4-address extension is not supposed to be used for data frames."); + } + tag.SetSeqno (meshHdr.GetMeshSeqno ()); + tag.SetTtl (meshHdr.GetMeshTtl ()); + packet->AddPacketTag (tag); + + if ((destination == Mac48Address::GetBroadcast ()) && (m_protocol->DropDataFrame (meshHdr.GetMeshSeqno (), + source))) + { + return false; + } + return true; +} + +bool +HwmpProtocolMac::ReceiveAction (Ptr packet, const WifiMacHeader & header) +{ + m_stats.rxMgt++; + m_stats.rxMgtBytes += packet->GetSize (); + WifiMeshActionHeader actionHdr; + packet->RemoveHeader (actionHdr); + WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction (); + if (actionHdr.GetCategory () != WifiMeshActionHeader::MESH_PATH_SELECTION) + { + return true; + } + WifiInformationElementVector elements; + packet->RemoveHeader (elements); + std::vector failedDestinations; + for (WifiInformationElementVector::Iterator i = elements.Begin(); i != elements.End(); i ++) + { + if ((*i)->ElementId () == IE11S_RANN) + { + NS_LOG_WARN ("RANN is not supported!"); + } + if ((*i)->ElementId () == IE11S_PREQ) + { + Ptr preq = DynamicCast (*i); + NS_ASSERT (preq != 0); + m_stats.rxPreq++; + if (preq->GetOriginatorAddress () == m_protocol->GetAddress ()) + { + continue; + } + if (preq->GetTtl () == 0) + { + continue; + } + preq->DecrementTtl (); + m_protocol->ReceivePreq (*preq, header.GetAddr2 (), m_ifIndex, header.GetAddr3 (), + m_parent->GetLinkMetric (header.GetAddr2 ())); + } + if ((*i)->ElementId () == IE11S_PREP) + { + Ptr prep = DynamicCast (*i); + NS_ASSERT (prep != 0); + m_stats.rxPrep++; + if (prep->GetTtl () == 0) + { + continue; + } + prep->DecrementTtl (); + m_protocol->ReceivePrep (*prep, header.GetAddr2 (), m_ifIndex, header.GetAddr3 (), + m_parent->GetLinkMetric (header.GetAddr2 ())); + } + if ((*i)->ElementId () == IE11S_PERR) + { + Ptr perr = DynamicCast (*i); + NS_ASSERT (perr != 0); + m_stats.rxPerr++; + std::vector destinations = perr->GetAddressUnitVector (); + for (std::vector::const_iterator i = destinations.begin (); i + != destinations.end (); i++) + { + failedDestinations.push_back (*i); + } + } + } + if (failedDestinations.size () > 0) + { + m_protocol->ReceivePerr (failedDestinations, header.GetAddr2 (), m_ifIndex, header.GetAddr3 ()); + } + NS_ASSERT (packet->GetSize () == 0); + return false; +} + +bool +HwmpProtocolMac::Receive (Ptr packet, const WifiMacHeader & header) +{ + if (header.IsData ()) + { + return ReceiveData (packet, header); + } + else + { + if (header.IsAction ()) + { + return ReceiveAction (packet, header); + } + else + { + return true; // don't care + } + } +} +bool +HwmpProtocolMac::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, + Mac48Address to) +{ + if (!header.IsData ()) + { + return true; + } + HwmpTag tag; + bool tagExists = packet->RemovePacketTag (tag); + if (!tagExists) + { + NS_FATAL_ERROR ("HWMP tag must exist at this point"); + } + m_stats.txData++; + m_stats.txDataBytes += packet->GetSize (); + MeshHeader meshHdr; + meshHdr.SetMeshSeqno (tag.GetSeqno ()); + meshHdr.SetMeshTtl (tag.GetTtl ()); + packet->AddHeader (meshHdr); + header.SetAddr1 (tag.GetAddress ()); + return true; +} +WifiMeshActionHeader +HwmpProtocolMac::GetWifiMeshActionHeader () +{ + WifiMeshActionHeader actionHdr; + WifiMeshActionHeader::ActionValue action; + action.pathSelection = WifiMeshActionHeader::PATH_SELECTION; + actionHdr.SetAction (WifiMeshActionHeader::MESH_PATH_SELECTION, action); + return actionHdr; +} +void +HwmpProtocolMac::SendPreq (IePreq preq) +{ + NS_LOG_FUNCTION_NOARGS (); + std::vector preq_vector; + preq_vector.push_back (preq); + SendPreq (preq_vector); +} +void +HwmpProtocolMac::SendPreq (std::vector preq) +{ + Ptr packet = Create (); + WifiInformationElementVector elements; + for (std::vector::iterator i = preq.begin (); i != preq.end (); i++) + { + elements.AddInformationElement(Ptr (&(*i))); + } + packet->AddHeader(elements); + packet->AddHeader (GetWifiMeshActionHeader ()); + //create 802.11 header: + WifiMacHeader hdr; + hdr.SetAction (); + hdr.SetDsNotFrom (); + hdr.SetDsNotTo (); + hdr.SetAddr2 (m_parent->GetAddress ()); + hdr.SetAddr3 (m_protocol->GetAddress ()); + //Send Management frame + std::vector receivers = m_protocol->GetPreqReceivers (m_ifIndex); + for (std::vector::const_iterator i = receivers.begin (); i != receivers.end (); i++) + { + hdr.SetAddr1 (*i); + m_stats.txPreq++; + m_stats.txMgt++; + m_stats.txMgtBytes += packet->GetSize (); + m_parent->SendManagementFrame (packet, hdr); + } +} +void +HwmpProtocolMac::RequestDestination (Mac48Address dst, uint32_t originator_seqno, uint32_t dst_seqno) +{ + NS_LOG_FUNCTION_NOARGS (); + for (std::vector::iterator i = m_myPreq.begin (); i != m_myPreq.end (); i++) + { + if (i->IsFull ()) + { + continue; + } + NS_ASSERT (i->GetDestCount () > 0); + i->AddDestinationAddressElement (m_protocol->GetDoFlag (), m_protocol->GetRfFlag (), dst, dst_seqno); + } + IePreq preq; + preq.SetHopcount (0); + preq.SetTTL (m_protocol->GetMaxTtl ()); + preq.SetPreqID (m_protocol->GetNextPreqId ()); + preq.SetOriginatorAddress (m_protocol->GetAddress ()); + preq.SetOriginatorSeqNumber (originator_seqno); + preq.SetLifetime (m_protocol->GetActivePathLifetime ()); + preq.AddDestinationAddressElement (m_protocol->GetDoFlag (), m_protocol->GetRfFlag (), dst, dst_seqno); + m_myPreq.push_back (preq); + SendMyPreq (); +} +void +HwmpProtocolMac::SendMyPreq () +{ + NS_LOG_FUNCTION_NOARGS (); + if (m_preqTimer.IsRunning ()) + { + return; + } + if (m_myPreq.size () == 0) + { + return; + } + //reschedule sending PREQ + NS_ASSERT (!m_preqTimer.IsRunning ()); + m_preqTimer = Simulator::Schedule (m_protocol->GetPreqMinInterval (), &HwmpProtocolMac::SendMyPreq, this); + SendPreq (m_myPreq); + m_myPreq.clear (); +} +void +HwmpProtocolMac::SendPrep (IePrep prep, Mac48Address receiver) +{ + NS_LOG_FUNCTION_NOARGS (); + //Create packet + Ptr packet = Create (); + WifiInformationElementVector elements; + elements.AddInformationElement(Ptr (&prep)); + packet->AddHeader (elements); + packet->AddHeader (GetWifiMeshActionHeader ()); + //create 802.11 header: + WifiMacHeader hdr; + hdr.SetAction (); + hdr.SetDsNotFrom (); + hdr.SetDsNotTo (); + hdr.SetAddr1 (receiver); + hdr.SetAddr2 (m_parent->GetAddress ()); + hdr.SetAddr3 (m_protocol->GetAddress ()); + //Send Management frame + m_stats.txPrep++; + m_stats.txMgt++; + m_stats.txMgtBytes += packet->GetSize (); + m_parent->SendManagementFrame (packet, hdr); +} +void +HwmpProtocolMac::ForwardPerr (std::vector failedDestinations, std::vector< + Mac48Address> receivers) +{ + NS_LOG_FUNCTION_NOARGS (); + Ptr packet = Create (); + Ptr perr = Create (); + WifiInformationElementVector elements; + for (std::vector::const_iterator i = failedDestinations.begin (); i + != failedDestinations.end (); i++) + { + if (!perr->IsFull ()) + { + perr->AddAddressUnit (*i); + } + else + { + elements.AddInformationElement(perr); + perr->ResetPerr (); + } + } + if (perr->GetNumOfDest () > 0) + { + elements.AddInformationElement(perr); + } + packet->AddHeader (elements); + packet->AddHeader (GetWifiMeshActionHeader ()); + //create 802.11 header: + WifiMacHeader hdr; + hdr.SetAction (); + hdr.SetDsNotFrom (); + hdr.SetDsNotTo (); + hdr.SetAddr2 (m_parent->GetAddress ()); + hdr.SetAddr3 (m_protocol->GetAddress ()); + if (receivers.size () >= m_protocol->GetUnicastPerrThreshold ()) + { + receivers.clear (); + receivers.push_back (Mac48Address::GetBroadcast ()); + } + //Send Management frame + for (std::vector::const_iterator i = receivers.begin (); i != receivers.end (); i++) + { + hdr.SetAddr1 (*i); + m_stats.txPerr++; + m_stats.txMgt++; + m_stats.txMgtBytes += packet->GetSize (); + m_parent->SendManagementFrame (packet, hdr); + } +} +void +HwmpProtocolMac::InitiatePerr (std::vector failedDestinations, std::vector< + Mac48Address> receivers) +{ + //All duplicates in PERR are checked here, and there is no reason to + //check it at any athoer place + { + std::vector::const_iterator end = receivers.end (); + for (std::vector::const_iterator i = receivers.begin (); i != end; i++) + { + bool should_add = true; + for (std::vector::const_iterator j = m_myPerr.receivers.begin (); j + != m_myPerr.receivers.end (); j++) + { + if ((*i) == (*j)) + { + should_add = false; + } + } + if (should_add) + { + m_myPerr.receivers.push_back (*i); + } + } + } + { + std::vector::const_iterator end = failedDestinations.end (); + for (std::vector::const_iterator i = failedDestinations.begin (); i != end; i++) + { + bool should_add = true; + for (std::vector::const_iterator j = m_myPerr.destinations.begin (); j + != m_myPerr.destinations.end (); j++) + { + if (((*i).destination == (*j).destination) && ((*j).seqnum > (*i).seqnum)) + { + should_add = false; + } + } + if (should_add) + { + m_myPerr.destinations.push_back (*i); + } + } + } + SendMyPerr (); +} +void +HwmpProtocolMac::SendMyPerr () +{ + NS_LOG_FUNCTION_NOARGS (); + if (m_perrTimer.IsRunning ()) + { + return; + } + m_perrTimer = Simulator::Schedule (m_protocol->GetPerrMinInterval (), &HwmpProtocolMac::SendMyPerr, this); + ForwardPerr (m_myPerr.destinations, m_myPerr.receivers); + m_myPerr.destinations.clear (); + m_myPerr.receivers.clear (); +} +uint32_t +HwmpProtocolMac::GetLinkMetric (Mac48Address peerAddress) const +{ + return m_parent->GetLinkMetric (peerAddress); +} +uint16_t +HwmpProtocolMac::GetChannelId () const +{ + return m_parent->GetFrequencyChannel (); +} +HwmpProtocolMac::Statistics::Statistics () : + txPreq (0), rxPreq (0), txPrep (0), rxPrep (0), txPerr (0), rxPerr (0), txMgt (0), txMgtBytes (0), + rxMgt (0), rxMgtBytes (0), txData (0), txDataBytes (0), rxData (0), rxDataBytes (0) +{ +} +void +HwmpProtocolMac::Statistics::Print (std::ostream & os) const +{ + os << "" << std::endl; +} +void +HwmpProtocolMac::Report (std::ostream & os) const +{ + os << "GetAddress () << "\">" << std::endl; + m_stats.Print (os); + os << "" << std::endl; +} +void +HwmpProtocolMac::ResetStats () +{ + m_stats = Statistics::Statistics (); +} + +} //namespace dot11s +}//namespace ns3 diff --git a/src/devices/mesh/dot11s/hwmp-protocol-mac.h b/src/devices/mesh/dot11s/hwmp-protocol-mac.h new file mode 100644 index 000000000..2bc8c080f --- /dev/null +++ b/src/devices/mesh/dot11s/hwmp-protocol-mac.h @@ -0,0 +1,140 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef HWMP_STATE_H +#define HWMP_STATE_H + +#include "ns3/mesh-wifi-interface-mac-plugin.h" +#include "ns3/hwmp-protocol.h" + +namespace ns3 { + +class MeshWifiInterfaceMac; + +namespace dot11s { + +class HwmpProtocol; +class WifiMeshActionHeader; +class IePreq; +class IePrep; +class IePerr; + +/** + * \ingroup dot11s + * + * \brief Interface MAC plugin for HWMP -- 802.11s routing protocol + */ +class HwmpProtocolMac : public MeshWifiInterfaceMacPlugin +{ +public: + HwmpProtocolMac (uint32_t, Ptr); + ~HwmpProtocolMac (); + ///\name Inherited from MAC plugin + //\{ + void SetParent (Ptr parent); + bool Receive (Ptr packet, const WifiMacHeader & header); + bool UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to); + /// Update beacon is empty, because HWMP does not know anything about beacons + void UpdateBeacon (MeshWifiBeacon & beacon) const {}; + //\} + +private: + friend class HwmpProtocol; + ///\returns a path selection action header + static WifiMeshActionHeader GetWifiMeshActionHeader (); + ///\name Intercation with HWMP: + //\{ + void SendPreq (IePreq preq); + void SendPreq (std::vector preq); + void SendPrep (IePrep prep, Mac48Address receiver); + //Forward a peth error + void ForwardPerr (std::vector destinations, std::vector receivers); + // initiate my own path error + void InitiatePerr (std::vector destinations, std::vector receivers); + /** \brief Request a destination. If can not send preq immediately - + * add a destination to exisying PREQ generated by me and stored in + * PREQ queue + * \param dest is the destination to be resolved + * \param originator_seqno is a sequence number that shall be preq originator sequenece number + * \param dst_seqno is a sequence number taken from routing table + */ + void RequestDestination (Mac48Address dest, uint32_t originator_seqno, uint32_t dst_seqno); + //\} + + /// Sends one PREQ when PreqMinInterval after last PREQ expires (if any PREQ exists in rhe queue) + void SendMyPreq (); + void SendMyPerr (); + /// \return metric to HWMP protocol, needed only by metrics to add + //peer as routing entry + uint32_t GetLinkMetric (Mac48Address peerAddress) const; + uint16_t GetChannelId () const; + /// Report statistics + void Report (std::ostream &) const; + void ResetStats (); +private: + Ptr m_parent; + uint32_t m_ifIndex; + Ptr m_protocol; + + ///\name my PREQ and PREQ timer: + //\{ + EventId m_preqTimer; + std::vector m_myPreq; + //\} + ///\name PERR timer and stored path error + //\{ + EventId m_perrTimer; + struct MyPerr { + std::vector destinations; + std::vector receivers; + }; + MyPerr m_myPerr; + ///\name Statistics: + //\{ + struct Statistics + { + uint16_t txPreq; + uint16_t rxPreq; + uint16_t txPrep; + uint16_t rxPrep; + uint16_t txPerr; + uint16_t rxPerr; + uint16_t txMgt; + uint32_t txMgtBytes; + uint16_t rxMgt; + uint32_t rxMgtBytes; + uint16_t txData; + uint32_t txDataBytes; + uint16_t rxData; + uint32_t rxDataBytes; + void Print (std::ostream & os) const; + Statistics (); + }; + Statistics m_stats; + //\} +private: + /// Receive data frame + bool ReceiveData (Ptr packet, const WifiMacHeader & header); + /// Receive action management frame + bool ReceiveAction (Ptr packet, const WifiMacHeader & header); +}; +} //namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/hwmp-protocol.cc b/src/devices/mesh/dot11s/hwmp-protocol.cc new file mode 100644 index 000000000..2187a9cc0 --- /dev/null +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc @@ -0,0 +1,1150 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#include "hwmp-protocol.h" +#include "hwmp-protocol-mac.h" +#include "hwmp-tag.h" +#include "hwmp-rtable.h" +#include "ns3/log.h" +#include "ns3/simulator.h" +#include "ns3/packet.h" +#include "ns3/mesh-point-device.h" +#include "ns3/wifi-net-device.h" +#include "ns3/mesh-point-device.h" +#include "ns3/mesh-wifi-interface-mac.h" +#include "ns3/random-variable.h" +#include "airtime-metric.h" +#include "ie-dot11s-preq.h" +#include "ie-dot11s-prep.h" +#include "ie-dot11s-perr.h" + +NS_LOG_COMPONENT_DEFINE ("HwmpProtocol"); + +namespace ns3 { +namespace dot11s { + +NS_OBJECT_ENSURE_REGISTERED (HwmpProtocol); +TypeId +HwmpProtocol::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::dot11s::HwmpProtocol") + .SetParent () + .AddConstructor () + .AddAttribute ( "RandomStart", + "Random delay at first proactive PREQ", + TimeValue (Seconds (0.1)), + MakeTimeAccessor ( + &HwmpProtocol::m_randomStart), + MakeTimeChecker () + ) + .AddAttribute ( "MaxQueueSize", + "Maximum number of packets we can store when resolving route", + UintegerValue (255), + MakeUintegerAccessor ( + &HwmpProtocol::m_maxQueueSize), + MakeUintegerChecker (1) + ) + .AddAttribute ( "Dot11MeshHWMPmaxPREQretries", + "Maximum number of retries before we suppose the destination to be unreachable", + UintegerValue (3), + MakeUintegerAccessor ( + &HwmpProtocol::m_dot11MeshHWMPmaxPREQretries), + MakeUintegerChecker (1) + ) + .AddAttribute ( "Dot11MeshHWMPnetDiameterTraversalTime", + "Time we suppose the packet to go from one edge of the network to another", + TimeValue (MicroSeconds (1024*100)), + MakeTimeAccessor ( + &HwmpProtocol::m_dot11MeshHWMPnetDiameterTraversalTime), + MakeTimeChecker () + ) + .AddAttribute ( "Dot11MeshHWMPpreqMinInterval", + "Minimal interval between to successive PREQs", + TimeValue (MicroSeconds (1024*100)), + MakeTimeAccessor ( + &HwmpProtocol::m_dot11MeshHWMPpreqMinInterval), + MakeTimeChecker () + ) + .AddAttribute ( "Dot11MeshHWMPperrMinInterval", + "Minimal interval between to successive PREQs", + TimeValue (MicroSeconds (1024*100)), + MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPperrMinInterval), + MakeTimeChecker () + ) + .AddAttribute ( "Dot11MeshHWMPactiveRootTimeout", + "Lifetime of poractive routing information", + TimeValue (MicroSeconds (1024*5000)), + MakeTimeAccessor ( + &HwmpProtocol::m_dot11MeshHWMPactiveRootTimeout), + MakeTimeChecker () + ) + .AddAttribute ( "Dot11MeshHWMPactivePathTimeout", + "Lifetime of reactive routing information", + TimeValue (MicroSeconds (1024*5000)), + MakeTimeAccessor ( + &HwmpProtocol::m_dot11MeshHWMPactivePathTimeout), + MakeTimeChecker () + ) + .AddAttribute ( "Dot11MeshHWMPpathToRootInterval", + "Interval between two successive proactive PREQs", + TimeValue (MicroSeconds (1024*2000)), + MakeTimeAccessor ( + &HwmpProtocol::m_dot11MeshHWMPpathToRootInterval), + MakeTimeChecker () + ) + .AddAttribute ( "Dot11MeshHWMPrannInterval", + "Lifetime of poractive routing information", + TimeValue (MicroSeconds (1024*5000)), + MakeTimeAccessor ( + &HwmpProtocol::m_dot11MeshHWMPrannInterval), + MakeTimeChecker () + ) + .AddAttribute ( "MaxTtl", + "Initial value of Time To Live field", + UintegerValue (32), + MakeUintegerAccessor ( + &HwmpProtocol::m_maxTtl), + MakeUintegerChecker (2) + ) + .AddAttribute ( "UnicastPerrThreshold", + "Maximum number of PERR receivers, when we send a PERR as a chain of unicasts", + UintegerValue (32), + MakeUintegerAccessor ( + &HwmpProtocol::m_unicastPerrThreshold), + MakeUintegerChecker (1) + ) + .AddAttribute ( "UnicastPreqThreshold", + "Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts", + UintegerValue (1), + MakeUintegerAccessor ( + &HwmpProtocol::m_unicastPreqThreshold), + MakeUintegerChecker (1) + ) + .AddAttribute ( "UnicastDataThreshold", + "Maximum number ofbroadcast receivers, when we send a broadcast as a chain of unicasts", + UintegerValue (1), + MakeUintegerAccessor ( + &HwmpProtocol::m_unicastDataThreshold), + MakeUintegerChecker (1) + ) + .AddAttribute ( "DoFlag", + "Destination only HWMP flag", + BooleanValue (false), + MakeBooleanAccessor ( + &HwmpProtocol::m_doFlag), + MakeBooleanChecker () + ) + .AddAttribute ( "RfFlag", + "Reply and forward flag", + BooleanValue (true), + MakeBooleanAccessor ( + &HwmpProtocol::m_rfFlag), + MakeBooleanChecker () + ); + return tid; +} + +HwmpProtocol::HwmpProtocol (): + m_dataSeqno (1), + m_hwmpSeqno (1), + m_preqId (0), + m_rtable (CreateObject ()), + m_randomStart(Seconds (0.1)), + m_maxQueueSize (255), + m_dot11MeshHWMPmaxPREQretries (3), + m_dot11MeshHWMPnetDiameterTraversalTime (MicroSeconds (1024*100)), + m_dot11MeshHWMPpreqMinInterval (MicroSeconds (1024*100)), + m_dot11MeshHWMPperrMinInterval (MicroSeconds (1024*100)), + m_dot11MeshHWMPactiveRootTimeout (MicroSeconds (1024*5000)), + m_dot11MeshHWMPactivePathTimeout (MicroSeconds (1024*5000)), + m_dot11MeshHWMPpathToRootInterval (MicroSeconds (1024*2000)), + m_dot11MeshHWMPrannInterval (MicroSeconds (1024*5000)), + m_isRoot (false), + m_maxTtl (32), + m_unicastPerrThreshold (32), + m_unicastPreqThreshold (1), + m_unicastDataThreshold (1), + m_doFlag (false), + m_rfFlag (false) +{ + + if (m_isRoot) + { + SetRoot (); + } +} + +HwmpProtocol::~HwmpProtocol () +{ +} + +void +HwmpProtocol::DoDispose () +{ + for (std::map::iterator i = m_preqTimeouts.begin (); i != m_preqTimeouts.end (); i ++) + { + i->second.Cancel (); + } + m_proactivePreqTimer.Cancel(); + m_preqTimeouts.clear (); + m_lastDataSeqno.clear (); + m_lastHwmpSeqno.clear (); + m_rqueue.clear (); + m_rtable = 0; +} + +bool +HwmpProtocol::RequestRoute ( + uint32_t sourceIface, + const Mac48Address source, + const Mac48Address destination, + Ptr constPacket, + uint16_t protocolType, //ethrnet 'Protocol' field + MeshL2RoutingProtocol::RouteReplyCallback routeReply +) +{ + Ptr packet = constPacket->Copy (); + HwmpTag tag; + if (sourceIface == GetMeshPoint ()->GetIfIndex()) + { + // packet from level 3 + if (packet->PeekPacketTag (tag)) + { + NS_FATAL_ERROR ("HWMP tag has come with a packet from upper layer. This must not occur..."); + } + //Filling TAG: + if (destination == Mac48Address::GetBroadcast ()) + { + tag.SetSeqno (m_dataSeqno++); + } + tag.SetTtl (m_maxTtl); + } + else + { + if (!packet->RemovePacketTag (tag)) + { + NS_FATAL_ERROR ("HWMP tag is supposed to be here at this point."); + } + tag.DecrementTtl (); + if (tag.GetTtl () == 0) + { + m_stats.droppedTtl ++; + return false; + } + } + if (destination == Mac48Address::GetBroadcast ()) + { + m_stats.txBroadcast ++; + m_stats.txBytes += packet->GetSize (); + //channel IDs where we have already sent broadcast: + std::vector channels; + for (HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) + { + bool shouldSend = true; + for (std::vector::const_iterator chan = channels.begin (); chan != channels.end (); chan ++) + { + if ((*chan) == plugin->second->GetChannelId ()) + { + shouldSend = false; + } + } + if (!shouldSend) + { + continue; + } + channels.push_back (plugin->second->GetChannelId ()); + std::vector receivers = GetBroadcastReceivers (plugin->first); + for (std::vector::const_iterator i = receivers.begin (); i != receivers.end (); i ++) + { + Ptr packetCopy = packet->Copy(); + tag.SetAddress (*i); + packetCopy->AddPacketTag (tag); + routeReply (true, packetCopy, source, destination, protocolType, plugin->first); + } + } + } + else + { + return ForwardUnicast (sourceIface, source, destination, packet, protocolType, routeReply, tag.GetTtl ()); + } + return true; +} +bool +HwmpProtocol::RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, + const Mac48Address destination, Ptr packet, uint16_t& protocolType) +{ + HwmpTag tag; + if (!packet->RemovePacketTag (tag)) + { + NS_FATAL_ERROR ("HWMP tag must exist when packet received from the network"); + } + return true; +} +bool +HwmpProtocol::ForwardUnicast (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, + Ptr packet, uint16_t protocolType, RouteReplyCallback routeReply, uint32_t ttl) +{ + NS_ASSERT(destination != Mac48Address::GetBroadcast ()); + HwmpRtable::LookupResult result = m_rtable->LookupReactive (destination); + NS_LOG_DEBUG("Requested src = "<LookupReactiveExpired (destination); + //1. Lookup expired reactive path. If exists - start path error + // procedure towards a next hop of this path + //2. If there was no reactive path, we lookup expired proactive + // path. If exist - start path error procedure towards path to + // root + if (result.retransmitter == Mac48Address::GetBroadcast ()) + { + result = m_rtable->LookupProactiveExpired (); + } + if (result.retransmitter != Mac48Address::GetBroadcast ()) + { + std::vector destinations = m_rtable->GetUnreachableDestinations (result.retransmitter); + InitiatePathError (MakePathError (destinations)); + } + m_stats.totalDropped ++; + return false; + } + //Request a destination: + result = m_rtable->LookupReactiveExpired (destination); + if (ShouldSendPreq (destination)) + { + uint32_t originator_seqno = GetNextHwmpSeqno (); + uint32_t dst_seqno = 0; + if (result.retransmitter != Mac48Address::GetBroadcast ()) + { + dst_seqno = result.seqnum; + } + m_stats.initiatedPreq ++; + for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) + { + i->second->RequestDestination (destination, originator_seqno, dst_seqno); + } + } + QueuedPacket pkt; + pkt.pkt = packet; + pkt.dst = destination; + pkt.src = source; + pkt.protocol = protocolType; + pkt.reply = routeReply; + pkt.inInterface = sourceIface; + if (QueuePacket (pkt)) + { + m_stats.totalQueued ++; + return true; + } + else + { + m_stats.totalDropped ++; + return false; + } +} +void +HwmpProtocol::ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric) +{ + preq.IncrementMetric (metric); + //acceptance cretirea: + std::map::const_iterator i = m_lastHwmpSeqno.find (preq.GetOriginatorAddress()); + if (i == m_lastHwmpSeqno.end ()) + { + m_lastHwmpSeqno[preq.GetOriginatorAddress ()] = preq.GetOriginatorSeqNumber (); + m_lastHwmpMetric[preq.GetOriginatorAddress ()] = preq.GetMetric (); + } + else + { + if ((int32_t)(i->second - preq.GetOriginatorSeqNumber ()) > 0) + { + return; + } + if (i->second == preq.GetOriginatorSeqNumber ()) + { + //find metric + std::map::const_iterator j = m_lastHwmpMetric.find (preq.GetOriginatorAddress()); + NS_ASSERT (j != m_lastHwmpSeqno.end ()); + if (j->second <= preq.GetMetric ()) + { + return; + } + } + m_lastHwmpSeqno[preq.GetOriginatorAddress ()] = preq.GetOriginatorSeqNumber (); + m_lastHwmpMetric[preq.GetOriginatorAddress ()] = preq.GetMetric (); + } + NS_LOG_DEBUG("I am " << GetAddress () << "Accepted preq from address" << from << ", preq:" << preq); + std::vector > destinations = preq.GetDestinationList (); + //Add reactive path to originator: + if ( + ((m_rtable->LookupReactive (preq.GetOriginatorAddress ())).retransmitter == Mac48Address::GetBroadcast ()) || + ((m_rtable->LookupReactive (preq.GetOriginatorAddress ())).metric > preq.GetMetric ()) + ) + { + m_rtable->AddReactivePath ( + preq.GetOriginatorAddress (), + from, + interface, + preq.GetMetric (), + MicroSeconds (preq.GetLifetime () * 1024), + preq.GetOriginatorSeqNumber () + ); + ReactivePathResolved (preq.GetOriginatorAddress ()); + } + //Add reactive path for precursor: + if ( + ((m_rtable->LookupReactive (fromMp)).retransmitter == Mac48Address::GetBroadcast ()) || + ((m_rtable->LookupReactive (fromMp)).metric > preq.GetMetric ()) + ) + { + m_rtable->AddReactivePath ( + fromMp, + from, + interface, + metric, + MicroSeconds (preq.GetLifetime () * 1024), + preq.GetOriginatorSeqNumber () + ); + ReactivePathResolved (fromMp); + } + for (std::vector >::const_iterator i = destinations.begin (); i != destinations.end (); i++) + { + if ((*i)->GetDestinationAddress () == Mac48Address::GetBroadcast()) + { + //only proactive PREQ contains destination + //address as broadcast! Proactive preq MUST + //have destination count equal to 1 and + //per destination flags DO and RF + NS_ASSERT (preq.GetDestCount() == 1); + NS_ASSERT (((*i)->IsDo ()) && ((*i)->IsRf ())); + //Add proactive path only if it is the better then existed + //before + if ( + ((m_rtable->LookupProactive ()).retransmitter == Mac48Address::GetBroadcast ()) || + ((m_rtable->LookupProactive ()).metric > preq.GetMetric ()) + ) + { + m_rtable->AddProactivePath ( + preq.GetMetric (), + preq.GetOriginatorAddress (), + from, + interface, + MicroSeconds (preq.GetLifetime () * 1024), + preq.GetOriginatorSeqNumber () + ); + ProactivePathResolved (); + } + if (!preq.IsNeedNotPrep ()) + { + SendPrep ( + GetAddress (), + preq.GetOriginatorAddress (), + from, + preq.GetMetric (), + preq.GetOriginatorSeqNumber (), + GetNextHwmpSeqno (), + preq.GetLifetime (), + interface + ); + } + break; + } + if ((*i)->GetDestinationAddress () == GetAddress ()) + { + SendPrep ( + GetAddress (), + preq.GetOriginatorAddress (), + from, + (uint32_t)0, + preq.GetOriginatorSeqNumber (), + GetNextHwmpSeqno (), + preq.GetLifetime (), + interface + ); + NS_ASSERT(m_rtable->LookupReactive (preq.GetOriginatorAddress ()).retransmitter != Mac48Address::GetBroadcast ()); + preq.DelDestinationAddressElement ((*i)->GetDestinationAddress ()); + continue; + } + //check if can answer: + HwmpRtable::LookupResult result = m_rtable->LookupReactive ((*i)->GetDestinationAddress ()); + if ((! ((*i)->IsDo ())) && (result.retransmitter != Mac48Address::GetBroadcast ())) + { + //have a valid information and can answer + //!NB: If there is information from peer - set lifetime as + //we have got from PREQ, and set the rest lifetime of the + //route if the information is correct + uint32_t lifetime = result.lifetime.GetMicroSeconds () / 1024; + if ((lifetime > 0) && ((int32_t)(result.seqnum - (*i)->GetDestSeqNumber ()) >= 0)) + { + SendPrep ( + (*i)->GetDestinationAddress (), + preq.GetOriginatorAddress (), + from, + result.metric, + preq.GetOriginatorSeqNumber (), + result.seqnum, + lifetime, + interface + ); + if ((*i)->IsRf ()) + { + (*i)->SetFlags (true, false, (*i)->IsUsn ()); //DO = 1, RF = 0 + } + else + { + preq.DelDestinationAddressElement ((*i)->GetDestinationAddress ()); + continue; + } + } + } + } + //check if must retransmit: + if (preq.GetDestCount () == 0) + { + return; + } + //Forward PREQ to all interfaces: + NS_LOG_DEBUG("I am " << GetAddress () << "retransmitting PREQ:" << preq); + for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) + { + i->second->SendPreq (preq); + } +} +void +HwmpProtocol::ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric) +{ + prep.IncrementMetric (metric); + //acceptance cretirea: + std::map::const_iterator i = m_lastHwmpSeqno.find (prep.GetOriginatorAddress ()); + if (i == m_lastHwmpSeqno.end ()) + { + m_lastHwmpSeqno[prep.GetOriginatorAddress ()] = prep.GetOriginatorSeqNumber (); + } + else + { + if ((int32_t)(i->second - prep.GetOriginatorSeqNumber ()) > 0) + { + return; + } + else + { + m_lastHwmpSeqno[prep.GetOriginatorAddress ()] = prep.GetOriginatorSeqNumber (); + } + } + //update routing info + //Now add a path to destination and add precursor to source + NS_LOG_DEBUG("I am " << GetAddress () << ", received prep from " << prep.GetOriginatorAddress () << ", receiver was:" << from); + HwmpRtable::LookupResult result = m_rtable->LookupReactive (prep.GetDestinationAddress ()); + //Add a reactive path only if it is better than existing: + if ( + ((m_rtable->LookupReactive (prep.GetOriginatorAddress ())).retransmitter == Mac48Address::GetBroadcast ()) || + ((m_rtable->LookupReactive (prep.GetOriginatorAddress ())).metric > prep.GetMetric ()) + ) + { + m_rtable->AddReactivePath ( + prep.GetOriginatorAddress (), + from, + interface, + prep.GetMetric (), + MicroSeconds(prep.GetLifetime () * 1024), + prep.GetOriginatorSeqNumber ()); + m_rtable->AddPrecursor (prep.GetDestinationAddress (), interface, from); + if (result.retransmitter != Mac48Address::GetBroadcast ()) + { + m_rtable->AddPrecursor (prep.GetOriginatorAddress (), interface, result.retransmitter); + } + ReactivePathResolved (prep.GetOriginatorAddress ()); + } + if ( + ((m_rtable->LookupReactive (fromMp)).retransmitter == Mac48Address::GetBroadcast ()) || + ((m_rtable->LookupReactive (fromMp)).metric > prep.GetMetric ()) + ) + { + m_rtable->AddReactivePath ( + fromMp, + from, + interface, + metric, + MicroSeconds(prep.GetLifetime () * 1024), + prep.GetOriginatorSeqNumber ()); + ReactivePathResolved (fromMp); + } + if (prep.GetDestinationAddress () == GetAddress ()) + { + NS_LOG_DEBUG("I am "<LookupProactive (); + } + if (result.retransmitter == Mac48Address::GetBroadcast ()) + { + return; + } + //Forward PREP + HwmpProtocolMacMap::const_iterator prep_sender = m_interfaces.find (result.ifIndex); + NS_ASSERT (prep_sender != m_interfaces.end ()); + prep_sender->second->SendPrep (prep, result.retransmitter); +} +void +HwmpProtocol::ReceivePerr (std::vector destinations, Mac48Address from, uint32_t interface, Mac48Address fromMp) +{ + //Acceptance cretirea: + NS_LOG_DEBUG ("I am "< retval; + HwmpRtable::LookupResult result; + for (unsigned int i = 0; i < destinations.size (); i ++) + { + result = m_rtable->LookupReactiveExpired (destinations[i].destination); + if (!( + (result.retransmitter != from) || + (result.ifIndex != interface) || + ((int32_t)(result.seqnum - destinations[i].seqnum) > 0) + )) + { + retval.push_back (destinations[i]); + } + } + if (retval.size () == 0) + { + return; + } + ForwardPathError (MakePathError (retval)); +} +void +HwmpProtocol::SendPrep ( + Mac48Address src, + Mac48Address dst, + Mac48Address retransmitter, + uint32_t initMetric, + uint32_t originatorDsn, + uint32_t destinationSN, + uint32_t lifetime, + uint32_t interface) +{ + IePrep prep; + prep.SetHopcount (0); + prep.SetTtl (m_maxTtl); + prep.SetDestinationAddress (dst); + prep.SetDestinationSeqNumber (destinationSN); + prep.SetLifetime (lifetime); + prep.SetMetric (0); + prep.SetOriginatorAddress (src); + prep.SetOriginatorSeqNumber (originatorDsn); + HwmpProtocolMacMap::const_iterator prep_sender = m_interfaces.find (interface); + NS_ASSERT(prep_sender != m_interfaces.end ()); + prep_sender->second->SendPrep (prep, retransmitter); + m_stats.initiatedPrep ++; +} +bool +HwmpProtocol::Install (Ptr mp) +{ + m_mp = mp; + std::vector > interfaces = mp->GetInterfaces (); + for (std::vector >::const_iterator i = interfaces.begin (); i != interfaces.end (); i++) + { + // Checking for compatible net device + Ptr wifiNetDev = (*i)->GetObject (); + if (wifiNetDev == 0) + { + return false; + } + Ptr mac = wifiNetDev->GetMac ()->GetObject (); + if (mac == 0) + { + return false; + } + // Installing plugins: + Ptr hwmpMac = Create (wifiNetDev->GetIfIndex (), this); + m_interfaces[wifiNetDev->GetIfIndex ()] = hwmpMac; + mac->InstallPlugin (hwmpMac); + //Installing airtime link metric: + Ptr metric = CreateObject (); + mac->SetLinkMetricCallback (MakeCallback (&AirtimeLinkMetricCalculator::CalculateMetric, metric)); + } + mp->SetRoutingProtocol (this); + // Mesh point aggregates all installed protocols + mp->AggregateObject (this); + m_address = Mac48Address::ConvertFrom (mp->GetAddress ());// address; + return true; +} +void +HwmpProtocol::PeerLinkStatus(Mac48Address meshPointAddress, Mac48Address peerAddress, uint32_t interface, bool status) +{ + if (status) + { + return; + } + std::vector destinations = m_rtable->GetUnreachableDestinations (peerAddress); + InitiatePathError (MakePathError (destinations)); +} +void +HwmpProtocol::SetNeighboursCallback (Callback, uint32_t> cb) +{ + m_neighboursCallback = cb; +} +bool +HwmpProtocol::DropDataFrame (uint32_t seqno, Mac48Address source) +{ + if (source == GetAddress ()) + { + return true; + } + std::map >::const_iterator i = m_lastDataSeqno.find (source); + if (i == m_lastDataSeqno.end ()) + { + m_lastDataSeqno[source] = seqno; + } + else + { + if ((int32_t)(i->second - seqno) >= 0) + { + return true; + } + m_lastDataSeqno[source] = seqno; + } + return false; +} +HwmpProtocol::PathError +HwmpProtocol::MakePathError (std::vector destinations) +{ + PathError retval; + //HwmpRtable increments a sequence number as written in 11B.9.7.2 + retval.receivers = GetPerrReceivers (destinations); + if (retval.receivers.size () == 0) + { + return retval; + } + m_stats.initiatedPerr ++; + for (unsigned int i = 0; i < destinations.size (); i ++) + { + retval.destinations.push_back (destinations[i]); + m_rtable->DeleteReactivePath (destinations[i].destination); + } + return retval; +} +void +HwmpProtocol::InitiatePathError(PathError perr) +{ + for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) + { + std::vector receivers_for_interface; + for (unsigned int j = 0; j < perr.receivers.size (); j ++) + { + if (i->first == perr.receivers[j].first) + { + receivers_for_interface.push_back (perr.receivers[j].second); + } + } + i->second->InitiatePerr (perr.destinations, receivers_for_interface); + } +} +void +HwmpProtocol::ForwardPathError(PathError perr) +{ + for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) + { + std::vector receivers_for_interface; + for (unsigned int j = 0; j < perr.receivers.size (); j ++) + { + if (i->first == perr.receivers[j].first) + { + receivers_for_interface.push_back (perr.receivers[j].second); + } + } + i->second->ForwardPerr (perr.destinations, receivers_for_interface); + } +} + +std::vector > +HwmpProtocol::GetPerrReceivers (std::vector failedDest) +{ + HwmpRtable::PrecursorList retval; + for (unsigned int i = 0; i < failedDest.size (); i ++) + { + HwmpRtable::PrecursorList precursors = m_rtable->GetPrecursors (failedDest[i].destination); + m_rtable->DeleteReactivePath (failedDest[i].destination); + m_rtable->DeleteProactivePath (failedDest[i].destination); + for (unsigned int j = 0; j < precursors.size (); j ++) + { + retval.push_back (precursors[j]); + } + } + //Check if we have dublicates in retval and precursors: + for (unsigned int i = 0; i < retval.size (); i ++) + { + for (unsigned int j = i+1; j < retval.size (); j ++) + { + if (retval[i].second == retval[j].second) + { + retval.erase (retval.begin () + j); + } + } + } + return retval; +} +std::vector +HwmpProtocol::GetPreqReceivers (uint32_t interface) +{ + std::vector retval; + if (!m_neighboursCallback.IsNull ()) + { + retval = m_neighboursCallback (interface); + } + if ((retval.size () >= m_unicastPreqThreshold) || (retval.size () == 0)) + { + retval.clear (); + retval.push_back (Mac48Address::GetBroadcast ()); + } + return retval; +} +std::vector +HwmpProtocol::GetBroadcastReceivers (uint32_t interface) +{ + std::vector retval; + if (!m_neighboursCallback.IsNull ()) + { + retval = m_neighboursCallback (interface); + } + if ((retval.size () >= m_unicastDataThreshold) || (retval.size () == 0)) + { + retval.clear (); + retval.push_back (Mac48Address::GetBroadcast ()); + } + return retval; +} + +bool +HwmpProtocol::QueuePacket (QueuedPacket packet) +{ + if (m_rqueue.size () > m_maxQueueSize) + { + return false; + } + m_rqueue.push_back (packet); + return true; +} + +HwmpProtocol::QueuedPacket +HwmpProtocol::DequeueFirstPacketByDst (Mac48Address dst) +{ + QueuedPacket retval; + retval.pkt = 0; + for (std::vector::iterator i = m_rqueue.begin (); i != m_rqueue.end (); i++) + { + if ((*i).dst == dst) + { + retval = (*i); + m_rqueue.erase (i); + break; + } + } + return retval; +} + +HwmpProtocol::QueuedPacket +HwmpProtocol::DequeueFirstPacket () +{ + QueuedPacket retval; + retval.pkt = 0; + if (m_rqueue.size () != 0) + { + retval = m_rqueue[0]; + m_rqueue.erase (m_rqueue.begin ()); + } + return retval; +} + +void +HwmpProtocol::ReactivePathResolved (Mac48Address dst) +{ + HwmpRtable::LookupResult result = m_rtable->LookupReactive (dst); + NS_ASSERT(result.retransmitter != Mac48Address::GetBroadcast ()); + //Send all packets stored for this destination + QueuedPacket packet = DequeueFirstPacketByDst (dst); + while (packet.pkt != 0) + { + //set RA tag for retransmitter: + HwmpTag tag; + packet.pkt->RemovePacketTag (tag); + tag.SetAddress (result.retransmitter); + packet.pkt->AddPacketTag (tag); + m_stats.txUnicast ++; + m_stats.txBytes += packet.pkt->GetSize (); + packet.reply (true, packet.pkt, packet.src, packet.dst, packet.protocol, result.ifIndex); + + packet = DequeueFirstPacketByDst (dst); + } +} +void +HwmpProtocol::ProactivePathResolved () +{ + //send all packets to root + HwmpRtable::LookupResult result = m_rtable->LookupProactive (); + NS_ASSERT (result.retransmitter != Mac48Address::GetBroadcast ()); + QueuedPacket packet = DequeueFirstPacket (); + while (packet.pkt != 0) + { + //set RA tag for retransmitter: + HwmpTag tag; + if (!packet.pkt->RemovePacketTag (tag)) + { + NS_FATAL_ERROR ("HWMP tag must be present at this point"); + } + tag.SetAddress (result.retransmitter); + packet.pkt->AddPacketTag (tag); + m_stats.txUnicast ++; + m_stats.txBytes += packet.pkt->GetSize (); + packet.reply (true, packet.pkt, packet.src, packet.dst, packet.protocol, result.ifIndex); + + packet = DequeueFirstPacket (); + } +} + +bool +HwmpProtocol::ShouldSendPreq (Mac48Address dst) +{ + std::map::const_iterator i = m_preqTimeouts.find (dst); + if (i == m_preqTimeouts.end ()) + { + m_preqTimeouts[dst] = Simulator::Schedule ( + m_dot11MeshHWMPnetDiameterTraversalTime * Scalar (2), + &HwmpProtocol::RetryPathDiscovery, this, dst, 1); + return true; + } + return false; +} +void +HwmpProtocol::RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry) +{ + HwmpRtable::LookupResult result = m_rtable->LookupReactive (dst); + if (result.retransmitter == Mac48Address::GetBroadcast ()) + { + result = m_rtable->LookupProactive (); + } + if (result.retransmitter != Mac48Address::GetBroadcast ()) + { + std::map::iterator i = m_preqTimeouts.find (dst); + NS_ASSERT (i != m_preqTimeouts.end ()); + m_preqTimeouts.erase (i); + return; + } + numOfRetry++; + if (numOfRetry >= m_dot11MeshHWMPmaxPREQretries) + { + QueuedPacket packet = DequeueFirstPacketByDst (dst); + //purge queue and delete entry from retryDatabase + while (packet.pkt != 0) + { + m_stats.totalDropped ++; + packet.reply (false, packet.pkt, packet.src, packet.dst, packet.protocol, HwmpRtable::MAX_METRIC); + packet = DequeueFirstPacketByDst (dst); + } + std::map::iterator i = m_preqTimeouts.find (dst); + NS_ASSERT (i != m_preqTimeouts.end ()); + m_preqTimeouts.erase (i); + return; + } + uint32_t originator_seqno = GetNextHwmpSeqno (); + uint32_t dst_seqno = m_rtable->LookupReactiveExpired (dst).seqnum; + for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) + { + i->second->RequestDestination (dst, originator_seqno, dst_seqno); + } + m_preqTimeouts[dst] = Simulator::Schedule ( + Scalar (2 * (numOfRetry + 1)) * m_dot11MeshHWMPnetDiameterTraversalTime, + &HwmpProtocol::RetryPathDiscovery, this, dst, numOfRetry); +} +//Proactive PREQ routines: +void +HwmpProtocol::SetRoot () +{ + UniformVariable coefficient (0.0, m_randomStart.GetSeconds()); + Time randomStart = Seconds (coefficient.GetValue ()); + m_proactivePreqTimer = Simulator::Schedule (randomStart, &HwmpProtocol::SendProactivePreq, this); + NS_LOG_DEBUG ("ROOT IS: " << m_address); + SendProactivePreq (); + m_isRoot = true; +} +void +HwmpProtocol::UnsetRoot () +{ + m_proactivePreqTimer.Cancel (); +} +void +HwmpProtocol::SendProactivePreq () +{ + IePreq preq; + //By default: must answer + preq.SetHopcount (0); + preq.SetTTL (m_maxTtl); + preq.SetLifetime (m_dot11MeshHWMPactiveRootTimeout.GetMicroSeconds () /1024); + //\attention: do not forget to set originator address, sequence + //number and preq ID in HWMP-MAC plugin + preq.AddDestinationAddressElement (true, true, Mac48Address::GetBroadcast (), 0); + preq.SetOriginatorAddress (GetAddress ()); + preq.SetPreqID (GetNextPreqId ()); + preq.SetOriginatorSeqNumber (GetNextHwmpSeqno ()); + for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) + { + i->second->SendPreq (preq); + } + m_proactivePreqTimer = Simulator::Schedule (m_dot11MeshHWMPpathToRootInterval, &HwmpProtocol::SendProactivePreq, this); +} +bool +HwmpProtocol::GetDoFlag () +{ + return m_doFlag; +} +bool +HwmpProtocol::GetRfFlag () +{ + return m_rfFlag; +} +Time +HwmpProtocol::GetPreqMinInterval () +{ + return m_dot11MeshHWMPpreqMinInterval; +} +Time +HwmpProtocol::GetPerrMinInterval () +{ + return m_dot11MeshHWMPperrMinInterval; +} +uint8_t +HwmpProtocol::GetMaxTtl () +{ + return m_maxTtl; +} +uint32_t +HwmpProtocol::GetNextPreqId () +{ + m_preqId ++; + return m_preqId; +} +uint32_t +HwmpProtocol::GetNextHwmpSeqno () +{ + m_hwmpSeqno ++; + return m_hwmpSeqno; +} +uint32_t +HwmpProtocol::GetActivePathLifetime () +{ + return m_dot11MeshHWMPactivePathTimeout.GetMicroSeconds () / 1024; +} +uint8_t +HwmpProtocol::GetUnicastPerrThreshold () +{ + return m_unicastPerrThreshold; +} +Mac48Address +HwmpProtocol::GetAddress () +{ + return m_address; +} +//Statistics: +HwmpProtocol::Statistics::Statistics () : + txUnicast (0), + txBroadcast (0), + txBytes (0), + droppedTtl (0), + totalQueued (0), + totalDropped (0), + initiatedPreq (0), + initiatedPrep (0), + initiatedPerr (0) +{} +void HwmpProtocol::Statistics::Print (std::ostream & os) const +{ + os << "" << std::endl; + m_stats.Print (os); + for (HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) + { + plugin->second->Report (os); + } + os << "" << std::endl; +} +void +HwmpProtocol::ResetStats () +{ + m_stats = Statistics::Statistics (); + for (HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) + { + plugin->second->ResetStats (); + } +} +HwmpProtocol::QueuedPacket::QueuedPacket () : + pkt (0), + protocol (0), + inInterface (0) +{} +} //namespace dot11s +} //namespace ns3 diff --git a/src/devices/mesh/dot11s/hwmp-protocol.h b/src/devices/mesh/dot11s/hwmp-protocol.h new file mode 100644 index 000000000..98f56f45a --- /dev/null +++ b/src/devices/mesh/dot11s/hwmp-protocol.h @@ -0,0 +1,269 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#ifndef HWMP_PROTOCOL_H +#define HWMP_PROTOCOL_H + +#include "ns3/mesh-l2-routing-protocol.h" +#include "ns3/nstime.h" +#include "ns3/event-id.h" +#include +#include + +namespace ns3 { +class MeshPointDevice; +class Packet; +class Mac48Address; +namespace dot11s { +class HwmpProtocolMac; +class HwmpRtable; +class IePerr; +class IePreq; +class IePrep; +/** + * \ingroup dot11s + * + * \brief Hybrid wireless mesh protocol -- a routing protocol of IEEE 802.11s draft. + */ +class HwmpProtocol : public MeshL2RoutingProtocol +{ +public: + static TypeId GetTypeId (); + HwmpProtocol (); + ~HwmpProtocol (); + void DoDispose (); + /** + * \brief structure of unreachable destination - address and sequence number + */ + typedef struct + { + Mac48Address destination; + uint32_t seqnum; + } FailedDestination; + /// Route request, inherited from MeshL2RoutingProtocol + bool RequestRoute (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, + Ptr packet, uint16_t protocolType, RouteReplyCallback routeReply); + /// Cleanup packet from all tags + bool RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, + const Mac48Address destination, Ptr packet, uint16_t& protocolType); + /** + * \brief Install HWMP on given mesh point. + * + * Installing protocol cause installing its interface MAC plugins. + * + * Also MP aggregates all installed protocols, HWMP protocol can be accessed + * via MeshPointDevice::GetObject(); + */ + bool Install (Ptr); + void PeerLinkStatus (Mac48Address meshPontAddress, Mac48Address peerAddress, uint32_t interface,bool status); + ///\brief This callback is used to obtain active neighbours on a given interface + ///\param cb is a callback, which returns a list of addresses on given interface (uint32_t) + void SetNeighboursCallback (Callback, uint32_t> cb); + ///\name Proactive PREQ mechanism: + ///\{ + void SetRoot (); + void UnsetRoot (); + ///\} + ///\brief Statistics: + void Report (std::ostream &) const; + void ResetStats (); +private: + friend class HwmpProtocolMac; + + HwmpProtocol& operator= (const HwmpProtocol &); + HwmpProtocol (const HwmpProtocol &); + + /** + * \brief Structure of path error: IePerr and list of receivers: + * interfaces and MAC address + */ + struct PathError + { + std::vector destinations; ///< destination list: Mac48Address and sequence number + std::vector > receivers; ///< list of PathError receivrs (in case of unicast PERR) + }; + /// Packet waiting its routing information + struct QueuedPacket + { + Ptr pkt; ///< the packet + Mac48Address src; ///< src address + Mac48Address dst; ///< dst address + uint16_t protocol; ///< protocol number + uint32_t inInterface; ///< incoming device interface ID. (if packet has come from upper layers, this is Mesh point ID) + RouteReplyCallback reply; ///< how to reply + + QueuedPacket (); + }; + typedef std::map > HwmpProtocolMacMap; + /// Like RequestRoute, but for unicast packets + bool ForwardUnicast (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, + Ptr packet, uint16_t protocolType, RouteReplyCallback routeReply, uint32_t ttl); + + ///\name Interaction with HWMP MAC plugin + //\{ + void ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric); + void ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric); + void ReceivePerr (std::vector, Mac48Address from, uint32_t interface, Mac48Address fromMp); + void SendPrep ( + Mac48Address src, + Mac48Address dst, + Mac48Address retransmitter, + uint32_t initMetric, + uint32_t originatorDsn, + uint32_t destinationSN, + uint32_t lifetime, + uint32_t interface); + /** + * \brief forms a path error information element when list of destination fails on a given interface + * \attention removes all entries from routing table! + */ + PathError MakePathError (std::vector destinations); + ///\brief Forwards a received path error + void ForwardPathError (PathError perr); + ///\brief Pasess a selg-generated PERR to interface-plugin + void InitiatePathError (PathError perr); + /// \return list of addresses where a PERR should be sent to + std::vector > GetPerrReceivers (std::vector failedDest); + + /// \return list of addresses where a PERR should be sent to + std::vector GetPreqReceivers (uint32_t interface); + /// \return list of addresses where a broadcast should be + //retransmitted + std::vector GetBroadcastReceivers (uint32_t interface); + /** + * \brief MAC-plugin asks whether the frame can be dropped. Protocol automatically updates seqno. + * + * \return true if frame can be dropped + * \param seqno is the sequence number of source + * \param source is the source address + */ + bool DropDataFrame (uint32_t seqno, Mac48Address source); + //\} + ///\name Methods related to Queue/Dequeue procedures + ///\{ + bool QueuePacket (QueuedPacket packet); + QueuedPacket DequeueFirstPacketByDst (Mac48Address dst); + QueuedPacket DequeueFirstPacket (); + void ReactivePathResolved (Mac48Address dst); + void ProactivePathResolved (); + ///\} + ///\name Methods responsible for path discovery retry procedure: + ///\{ + /** + * \brief checks when the last path discovery procedure was started for a given destination. + * + * If the retry counter has not achieved the maximum level - preq should not be sent + */ + bool ShouldSendPreq (Mac48Address dst); + + /** + * \brief Generates PREQ retry when retry timeout has expired and route is still unresolved. + * + * When PREQ retry has achieved the maximum level - retry mechanism should be canceled + */ + void RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry); + /// Proactive Preq routines: + void SendProactivePreq (); + ///\} + ///\return address of MeshPointDevice + Mac48Address GetAddress (); + ///\name Methods needed by HwmpMacLugin to access protocol parameters: + ///\{ + bool GetDoFlag (); + bool GetRfFlag (); + Time GetPreqMinInterval (); + Time GetPerrMinInterval (); + uint8_t GetMaxTtl (); + uint32_t GetNextPreqId (); + uint32_t GetNextHwmpSeqno (); + uint32_t GetActivePathLifetime (); + uint8_t GetUnicastPerrThreshold (); + ///\} +private: + ///\name Statistics: + ///\{ + struct Statistics + { + uint16_t txUnicast; + uint16_t txBroadcast; + uint32_t txBytes; + uint16_t droppedTtl; + uint16_t totalQueued; + uint16_t totalDropped; + uint16_t initiatedPreq; + uint16_t initiatedPrep; + uint16_t initiatedPerr; + + void Print (std::ostream & os) const; + Statistics (); + }; + Statistics m_stats; + ///\} + HwmpProtocolMacMap m_interfaces; + Mac48Address m_address; + uint32_t m_dataSeqno; + uint32_t m_hwmpSeqno; + uint32_t m_preqId; + ///\name Sequence number filters + ///\{ + /// Data sequence number database + std::map m_lastDataSeqno; + /// DSN databse + std::map m_lastHwmpSeqno; + /// Metric database + std::map m_lastHwmpMetric; + ///\} + + /// Routing table + Ptr m_rtable; + + ///\name Timers: + ///\{ + std::map m_preqTimeouts; + EventId m_proactivePreqTimer; + /// Random start in Proactive PREQ propagation + Time m_randomStart; + ///\} + /// Packet Queue + std::vector m_rqueue; + ///\name HWMP-protocol parameters (attributes of GetTypeId) + ///\{ + uint16_t m_maxQueueSize; + uint8_t m_dot11MeshHWMPmaxPREQretries; + Time m_dot11MeshHWMPnetDiameterTraversalTime; + Time m_dot11MeshHWMPpreqMinInterval; + Time m_dot11MeshHWMPperrMinInterval; + Time m_dot11MeshHWMPactiveRootTimeout; + Time m_dot11MeshHWMPactivePathTimeout; + Time m_dot11MeshHWMPpathToRootInterval; + Time m_dot11MeshHWMPrannInterval; + bool m_isRoot; + uint8_t m_maxTtl; + uint8_t m_unicastPerrThreshold; + uint8_t m_unicastPreqThreshold; + uint8_t m_unicastDataThreshold; + bool m_doFlag; + bool m_rfFlag; + ///\} + Callback , uint32_t> m_neighboursCallback; +}; +} //namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/hwmp-rtable.cc b/src/devices/mesh/dot11s/hwmp-rtable.cc new file mode 100644 index 000000000..9348ab63d --- /dev/null +++ b/src/devices/mesh/dot11s/hwmp-rtable.cc @@ -0,0 +1,393 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ns3/object.h" +#include "ns3/assert.h" +#include "ns3/simulator.h" +#include "ns3/test.h" +#include "ns3/log.h" + +#include "hwmp-rtable.h" + +namespace ns3 { +namespace dot11s { + +NS_LOG_COMPONENT_DEFINE ("HwmpRtable"); + +NS_OBJECT_ENSURE_REGISTERED (HwmpRtable); + +TypeId +HwmpRtable::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::dot11s::HwmpRtable") + .SetParent () + .AddConstructor (); + return tid; +} +HwmpRtable::HwmpRtable () +{ + DeleteProactivePath (); +} +HwmpRtable::~HwmpRtable () +{ +} +void +HwmpRtable::DoDispose () +{ + m_routes.clear (); +} +void +HwmpRtable::AddReactivePath (Mac48Address destination, Mac48Address retransmitter, uint32_t interface, + uint32_t metric, Time lifetime, uint32_t seqnum) +{ + std::map::iterator i = m_routes.find (destination); + if (i == m_routes.end ()) + { + ReactiveRoute newroute; + m_routes[destination] = newroute; + } + i = m_routes.find (destination); + NS_ASSERT (i != m_routes.end ()); + i->second.retransmitter = retransmitter; + i->second.interface = interface; + i->second.metric = metric; + i->second.whenExpire = Simulator::Now () + lifetime; + i->second.seqnum = seqnum; +} +void +HwmpRtable::AddProactivePath (uint32_t metric, Mac48Address root, Mac48Address retransmitter, + uint32_t interface, Time lifetime, uint32_t seqnum) +{ + m_root.root = root; + m_root.retransmitter = retransmitter; + m_root.metric = metric; + m_root.whenExpire = Simulator::Now () + lifetime; + m_root.seqnum = seqnum; + m_root.interface = interface; +} +void +HwmpRtable::AddPrecursor (Mac48Address destination, uint32_t precursorInterface, + Mac48Address precursorAddress) +{ + std::pair precursor; + precursor.first = precursorInterface; + precursor.second = precursorAddress; + std::map::iterator i = m_routes.find (destination); + if (i != m_routes.end ()) + { + bool should_add = true; + for (unsigned int j = 0; j < i->second.precursors.size (); j++) + { + //NB: Only one active route may exist, so do not check + //interface ID, just address + if (i->second.precursors[j].second == precursorAddress) + { + should_add = false; + break; + } + } + if (should_add) + { + i->second.precursors.push_back (precursor); + } + } + if (m_root.root == destination) + { + for (unsigned int j = 0; j < m_root.precursors.size (); j++) + { + if (m_root.precursors[j].second == precursorAddress) + { + return; + } + } + } + m_root.precursors.push_back (precursor); +} +void +HwmpRtable::DeleteProactivePath () +{ + m_root.precursors.clear (); + m_root.interface = INTERFACE_ANY; + m_root.metric = MAX_METRIC; + m_root.retransmitter = Mac48Address::GetBroadcast (); + m_root.seqnum = 0; + m_root.whenExpire = Simulator::Now (); +} +void +HwmpRtable::DeleteProactivePath (Mac48Address root) +{ + if (m_root.root == root) + { + DeleteProactivePath (); + } +} +void +HwmpRtable::DeleteReactivePath (Mac48Address destination) +{ + std::map::iterator i = m_routes.find (destination); + if (i != m_routes.end ()) + { + m_routes.erase (i); + } +} +HwmpRtable::LookupResult +HwmpRtable::LookupReactive (Mac48Address destination) +{ + std::map::iterator i = m_routes.find (destination); + if (i == m_routes.end ()) + { + return LookupResult (); + } + if ((i->second.whenExpire < Simulator::Now ()) && (i->second.whenExpire != Seconds (0))) + { + NS_LOG_DEBUG ("Reactive route has expired, sorry."); + return LookupResult (); + } + return LookupReactiveExpired (destination); +} +HwmpRtable::LookupResult +HwmpRtable::LookupReactiveExpired (Mac48Address destination) +{ + std::map::iterator i = m_routes.find (destination); + if (i == m_routes.end ()) + { + return LookupResult (); + } + return LookupResult (i->second.retransmitter, i->second.interface, i->second.metric, i->second.seqnum, + i->second.whenExpire - Simulator::Now ()); +} +HwmpRtable::LookupResult +HwmpRtable::LookupProactive () +{ + if (m_root.whenExpire < Simulator::Now ()) + { + NS_LOG_DEBUG ("Proactive route has expired and will be deleted, sorry."); + DeleteProactivePath (); + } + return LookupProactiveExpired (); +} +HwmpRtable::LookupResult +HwmpRtable::LookupProactiveExpired () +{ + return LookupResult (m_root.retransmitter, m_root.interface, m_root.metric, m_root.seqnum, + m_root.whenExpire - Simulator::Now ()); +} +std::vector +HwmpRtable::GetUnreachableDestinations (Mac48Address peerAddress) +{ + HwmpProtocol::FailedDestination dst; + std::vector retval; + for (std::map::iterator i = m_routes.begin (); i != m_routes.end (); i++) + { + if (i->second.retransmitter == peerAddress) + { + dst.destination = i->first; + i->second.seqnum++; + dst.seqnum = i->second.seqnum; + retval.push_back (dst); + } + } + //Lookup a path to root + if (m_root.retransmitter == peerAddress) + { + dst.destination = m_root.root; + dst.seqnum = m_root.seqnum; + retval.push_back (dst); + } + return retval; +} +HwmpRtable::PrecursorList +HwmpRtable::GetPrecursors (Mac48Address destination) +{ + //We suppose that no duplicates here can be + PrecursorList retval; + std::map::iterator route = m_routes.find (destination); + if (route != m_routes.end ()) + { + for (unsigned int i = 0; i < route->second.precursors.size (); i++) + { + retval.push_back (route->second.precursors[i]); + } + } + if (m_root.root == destination) + { + for (unsigned int i = 0; i < m_root.precursors.size (); i++) + { + bool should_add = true; + for (unsigned int j = 0; j < retval.size (); j++) + { + if (retval[j].second == m_root.precursors[i].second) + { + should_add = false; + break; + } + } + if (should_add) + { + retval.push_back (m_root.precursors[i]); + } + } + } + return retval; +} +bool +HwmpRtable::LookupResult::operator== (const HwmpRtable::LookupResult & o) const +{ + return (retransmitter == o.retransmitter && ifIndex == o.ifIndex && metric == o.metric && seqnum + == o.seqnum); +} +HwmpRtable::LookupResult::LookupResult (Mac48Address r, uint32_t i, uint32_t m, uint32_t s, Time l) : + retransmitter (r), ifIndex (i), metric (m), seqnum (s), lifetime (l) +{ +} +bool +HwmpRtable::LookupResult::IsValid () const +{ + return !(retransmitter == Mac48Address::GetBroadcast () && ifIndex == INTERFACE_ANY && metric == MAX_METRIC + && seqnum == 0); +} +#ifdef RUN_SELF_TESTS +/// Unit test for HwmpRtable +class HwmpRtableTest : public Test +{ +public: + HwmpRtableTest (); + virtual bool + RunTests (); + +private: + /// Test Add apth and lookup path; + void + TestLookup (); + /** + * \name Test add path and try to lookup after entry has expired + * \{ + */ + void + TestAddPath (); + void + TestExpire (); + ///\} + /** + * \name Test add precursors and find precursor list in rtable + * \{ + */ + void + TestPrecursorAdd (); + void + TestPrecursorFind (); + ///\} +private: + bool result; + + Mac48Address dst; + Mac48Address hop; + uint32_t iface; + uint32_t metric; + uint32_t seqnum; + Time expire; + Ptr table; + std::vector precursors; +}; +/// Test instance +static HwmpRtableTest g_HwmpRtableTest; + +HwmpRtableTest::HwmpRtableTest () : + Test ("Mesh/802.11s/HwmpRtable"), result (true), dst ("01:00:00:01:00:01"), hop ("01:00:00:01:00:03"), + iface (8010), metric (10), seqnum (1), expire (Seconds (10)) +{ + precursors.push_back (Mac48Address ("00:10:20:30:40:50")); + precursors.push_back (Mac48Address ("00:11:22:33:44:55")); + precursors.push_back (Mac48Address ("00:01:02:03:04:05")); +} +void +HwmpRtableTest::TestLookup () +{ + HwmpRtable::LookupResult correct (hop, iface, metric, seqnum); + + // Reactive path + table->AddReactivePath (dst, hop, iface, metric, expire, seqnum); + NS_TEST_ASSERT (table->LookupReactive (dst) == correct); + table->DeleteReactivePath (dst); + NS_TEST_ASSERT (!table->LookupReactive (dst).IsValid ()); + + // Proactive + table->AddProactivePath (metric, dst, hop, iface, expire, seqnum); + NS_TEST_ASSERT (table->LookupProactive () == correct); + table->DeleteProactivePath (dst); + NS_TEST_ASSERT (!table->LookupProactive ().IsValid ()); +} +void +HwmpRtableTest::TestAddPath () +{ + table->AddReactivePath (dst, hop, iface, metric, expire, seqnum); + table->AddProactivePath (metric, dst, hop, iface, expire, seqnum); +} +void +HwmpRtableTest::TestExpire () +{ + // this is assumed to be called when path records are already expired + HwmpRtable::LookupResult correct (hop, iface, metric, seqnum); + NS_TEST_ASSERT (table->LookupReactiveExpired (dst) == correct); + NS_TEST_ASSERT (table->LookupProactiveExpired () == correct); + + NS_TEST_ASSERT (!table->LookupReactive (dst).IsValid ()); + NS_TEST_ASSERT (!table->LookupProactive ().IsValid ()); +} +void +HwmpRtableTest::TestPrecursorAdd () +{ + for (std::vector::const_iterator i = precursors.begin (); i != precursors.end (); i++) + { + table->AddPrecursor (dst, iface, *i); + // Check that duplicates are filtered + table->AddPrecursor (dst, iface, *i); + } +} +void +HwmpRtableTest::TestPrecursorFind () +{ + HwmpRtable::PrecursorList precursorList = table->GetPrecursors (dst); + NS_TEST_ASSERT (precursors.size () == precursorList.size ()); + for (unsigned int i = 0; i < precursors.size (); i++) + { + NS_TEST_ASSERT (precursorList[i].first == iface); + NS_TEST_ASSERT (precursorList[i].second == precursors[i]); + } +} +bool +HwmpRtableTest::RunTests () +{ + table = CreateObject (); + + Simulator::Schedule (Seconds (0), &HwmpRtableTest::TestLookup, this); + Simulator::Schedule (Seconds (1), &HwmpRtableTest::TestAddPath, this); + Simulator::Schedule (Seconds (2), &HwmpRtableTest::TestPrecursorAdd, this); + Simulator::Schedule (expire + Seconds (2), &HwmpRtableTest::TestExpire, this); + Simulator::Schedule (expire + Seconds (3), &HwmpRtableTest::TestPrecursorFind, this); + + Simulator::Run (); + Simulator::Destroy (); + + return result; +} +#endif // RUN_SELF_TESTS +} //namespace dot11s +} //namespace ns3 diff --git a/src/devices/mesh/dot11s/hwmp-rtable.h b/src/devices/mesh/dot11s/hwmp-rtable.h new file mode 100644 index 000000000..a22e980f5 --- /dev/null +++ b/src/devices/mesh/dot11s/hwmp-rtable.h @@ -0,0 +1,140 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef HWMP_RTABLE_H +#define HWMP_RTABLE_H + +#include +#include "ns3/nstime.h" +#include "ns3/mac48-address.h" +#include "ns3/hwmp-protocol.h" +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * + * \brief Routing table for HWMP -- 802.11s routing protocol + */ +class HwmpRtable : public Object +{ +public: + /// Means all interfaces + const static uint32_t INTERFACE_ANY = 0xffffffff; + /// Maximum (the best?) path metric + const static uint32_t MAX_METRIC = 0xffffffff; + + /// Route lookup result, return type of LookupXXX methods + struct LookupResult + { + Mac48Address retransmitter; + uint32_t ifIndex; + uint32_t metric; + uint32_t seqnum; + Time lifetime; + LookupResult (Mac48Address r = Mac48Address::GetBroadcast (), + uint32_t i = INTERFACE_ANY, + uint32_t m = MAX_METRIC, + uint32_t s = 0, + Time l = Seconds (0.0)); + /// True for valid route + bool IsValid () const; + /// Compare route lookup results, used by tests + bool operator==(const LookupResult & o) const; + }; + /// Path precursor = {MAC, interface ID} + typedef std::vector > PrecursorList; + +public: + static TypeId GetTypeId (); + HwmpRtable (); + ~HwmpRtable (); + void DoDispose (); + + ///\name Add/delete paths + //\{ + void AddReactivePath ( + Mac48Address destination, + Mac48Address retransmitter, + uint32_t interface, + uint32_t metric, + Time lifetime, + uint32_t seqnum + ); + void AddProactivePath ( + uint32_t metric, + Mac48Address root, + Mac48Address retransmitter, + uint32_t interface, + Time lifetime, + uint32_t seqnum + ); + void AddPrecursor (Mac48Address destination, uint32_t precursorInterface, Mac48Address precursorAddress); + PrecursorList GetPrecursors (Mac48Address destination); + void DeleteProactivePath (); + void DeleteProactivePath (Mac48Address root); + void DeleteReactivePath (Mac48Address destination); + //\} + + ///\name Lookup + //\{ + /// Lookup path to destination + LookupResult LookupReactive (Mac48Address destination); + /// Return all reactive paths, including expired + LookupResult LookupReactiveExpired (Mac48Address destination); + /// Find proactive path to tree root. Note that calling this method has side effect of deleting expired proactive path + LookupResult LookupProactive (); + /// Return all proactive paths, including expired + LookupResult LookupProactiveExpired (); + //\} + + /// When peer link with a given MAC-address fails - it returns list of unreachable destination addresses + std::vector GetUnreachableDestinations (Mac48Address peerAddress); + +private: + /// Route found in reactive mode + struct ReactiveRoute + { + Mac48Address retransmitter; + uint32_t interface; + uint32_t metric; + Time whenExpire; + uint32_t seqnum; + std::vector > precursors; + }; + /// Route fond in proactive mode + struct ProactiveRoute + { + Mac48Address root; + Mac48Address retransmitter; + uint32_t interface; + uint32_t metric; + Time whenExpire; + uint32_t seqnum; + std::vector > precursors; + }; + + /// List of routes + std::map m_routes; + /// Path to proactive tree root MP + ProactiveRoute m_root; +}; +} //namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/hwmp-tag.cc b/src/devices/mesh/dot11s/hwmp-tag.cc new file mode 100644 index 000000000..f37d90875 --- /dev/null +++ b/src/devices/mesh/dot11s/hwmp-tag.cc @@ -0,0 +1,151 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#include "hwmp-tag.h" + +namespace ns3 { +namespace dot11s { + +NS_OBJECT_ENSURE_REGISTERED (HwmpTag); +//Class HwmpTag: +HwmpTag::HwmpTag () : + m_address (Mac48Address::GetBroadcast ()), m_ttl (0), m_metric (0), m_seqno (0) +{ +} + +HwmpTag::~HwmpTag () +{ +} + +void +HwmpTag::SetAddress (Mac48Address retransmitter) +{ + m_address = retransmitter; +} + +Mac48Address +HwmpTag::GetAddress () +{ + return m_address; +} + +void +HwmpTag::SetTtl (uint8_t ttl) +{ + m_ttl = ttl; +} + +uint8_t +HwmpTag::GetTtl () +{ + return m_ttl; +} + +void +HwmpTag::SetMetric (uint32_t metric) +{ + m_metric = metric; +} + +uint32_t +HwmpTag::GetMetric () +{ + return m_metric; +} + +void +HwmpTag::SetSeqno (uint32_t seqno) +{ + m_seqno = seqno; +} + +uint32_t +HwmpTag::GetSeqno () +{ + return m_seqno; +} + +TypeId +HwmpTag::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::dot11s::HwmpTag") .SetParent () .AddConstructor (); + return tid; +} + +TypeId +HwmpTag::GetInstanceTypeId () const +{ + return GetTypeId (); +} + +uint32_t +HwmpTag::GetSerializedSize () const +{ + return 6 //address + + 1 //ttl + + 4 //metric + + 4; //seqno +} + +void +HwmpTag::Serialize (TagBuffer i) const +{ + uint8_t address[6]; + int j; + m_address.CopyTo (address); + i.WriteU8 (m_ttl); + i.WriteU32 (m_metric); + i.WriteU32 (m_seqno); + for (j = 0; j < 6; j++) + { + i.WriteU8 (address[j]); + } +} + +void +HwmpTag::Deserialize (TagBuffer i) +{ + uint8_t address[6]; + int j; + m_ttl = i.ReadU8 (); + m_metric = i.ReadU32 (); + m_seqno = i.ReadU32 (); + for (j = 0; j < 6; j++) + { + address[j] = i.ReadU8 (); + } + m_address.CopyFrom (address); +} + +void +HwmpTag::Print (std::ostream &os) const +{ + os << "address=" << m_address; + os << "ttl=" << m_ttl; + os << "metrc=" << m_metric; + os << "seqno=" << m_seqno; +} +void +HwmpTag::DecrementTtl () +{ + m_ttl--; +} +} //namespace dot11s +} //namespace ns3 diff --git a/src/devices/mesh/dot11s/hwmp-tag.h b/src/devices/mesh/dot11s/hwmp-tag.h new file mode 100644 index 000000000..c638cc8cc --- /dev/null +++ b/src/devices/mesh/dot11s/hwmp-tag.h @@ -0,0 +1,77 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + * Pavel Boyko + */ + +#ifndef HWMP_TAG_H +#define HWMP_TAG_H + +#include "ns3/tag.h" +#include "ns3/object.h" +#include "ns3/mac48-address.h" +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * + * \brief Hwmp tag implements interaction between HWMP + * protocol and MeshWifiMac + * + * \details Hwmp tag keeps the following: + * 1. When packet is passed from Hwmp to 11sMAC: + * - retransmitter address, + * - TTL value, + * 2. When packet is passed to Hwmp from 11sMAC: + * - lasthop address, + * - TTL value, + * - metric value (metric of link is recalculated + * at each packet, but routing table stores metric + * obtained during path discovery procedure) + */ +class HwmpTag : public Tag +{ +public: + HwmpTag (); + ~HwmpTag (); + void SetAddress (Mac48Address retransmitter); + Mac48Address GetAddress (); + void SetTtl (uint8_t ttl); + uint8_t GetTtl (); + void SetMetric (uint32_t metric); + uint32_t GetMetric (); + void SetSeqno (uint32_t seqno); + uint32_t GetSeqno (); + void DecrementTtl (); + + static TypeId GetTypeId (); + virtual TypeId GetInstanceTypeId () const; + virtual uint32_t GetSerializedSize () const; + virtual void Serialize (TagBuffer i) const; + virtual void Deserialize (TagBuffer i); + virtual void Print (std::ostream &os) const; +private: + Mac48Address m_address; + uint8_t m_ttl; + uint32_t m_metric; + uint32_t m_seqno; +}; +} //namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc new file mode 100644 index 000000000..a02053ab7 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc @@ -0,0 +1,233 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ie-dot11s-beacon-timing.h" +#include "ns3/packet.h" +namespace ns3 { +namespace dot11s { +/******************************************* + * IeBeaconTimingUnit + *******************************************/ +IeBeaconTimingUnit::IeBeaconTimingUnit () : + m_aid (0), m_lastBeacon (0), m_beaconInterval (0) +{ +} +void +IeBeaconTimingUnit::SetAid (uint8_t aid) +{ + m_aid = aid; +} +void +IeBeaconTimingUnit::SetLastBeacon (uint16_t lastBeacon) +{ + m_lastBeacon = lastBeacon; +} +void +IeBeaconTimingUnit::SetBeaconInterval (uint16_t beaconInterval) +{ + m_beaconInterval = beaconInterval; +} +uint8_t +IeBeaconTimingUnit::GetAid () const +{ + return m_aid; +} +uint16_t +IeBeaconTimingUnit::GetLastBeacon () const +{ + return m_lastBeacon; +} +uint16_t +IeBeaconTimingUnit::GetBeaconInterval () const +{ + return m_beaconInterval; +} +/******************************************* + * IeBeaconTiming + *******************************************/ +WifiElementId +IeBeaconTiming::ElementId () const +{ + return IE11S_BEACON_TIMING; +} +IeBeaconTiming::IeBeaconTiming () : + m_numOfUnits (0) +{ +} +IeBeaconTiming::NeighboursTimingUnitsList +IeBeaconTiming::GetNeighboursTimingElementsList () +{ + return m_neighbours; +} +void +IeBeaconTiming::AddNeighboursTimingElementUnit (uint16_t aid, Time last_beacon, //MicroSeconds! + Time beacon_interval //MicroSeconds! +) +{ + if (m_numOfUnits == 50) + { + return; + } + //First we lookup if this element already exists + for (NeighboursTimingUnitsList::const_iterator i = m_neighbours.begin (); i != m_neighbours.end (); i++) + { + if (((*i)->GetAid () == AidToU8 (aid)) && ((*i)->GetLastBeacon () == TimestampToU16 (last_beacon)) + && ((*i)->GetBeaconInterval () == BeaconIntervalToU16 (beacon_interval))) + { + return; + } + } + Ptr new_element = Create (); + new_element->SetAid (AidToU8 (aid)); + new_element->SetLastBeacon (TimestampToU16 (last_beacon)); + new_element->SetBeaconInterval (BeaconIntervalToU16 (beacon_interval)); + m_neighbours.push_back (new_element); + m_numOfUnits++; +} +void +IeBeaconTiming::DelNeighboursTimingElementUnit (uint16_t aid, Time last_beacon, Time beacon_interval) +{ + for (NeighboursTimingUnitsList::iterator i = m_neighbours.begin (); i != m_neighbours.end (); i++) + { + if (((*i)->GetAid () == AidToU8 (aid)) && ((*i)->GetLastBeacon () == TimestampToU16 (last_beacon)) + && ((*i)->GetBeaconInterval () == BeaconIntervalToU16 (beacon_interval))) + { + m_neighbours.erase (i); + m_numOfUnits--; + break; + } + } +} +void +IeBeaconTiming::ClearTimingElement () +{ + uint16_t to_delete = 0; + uint16_t i; + for (NeighboursTimingUnitsList::iterator j = m_neighbours.begin (); j != m_neighbours.end (); j++) + { + to_delete++; + (*j) = 0; + } + for (i = 0; i < to_delete; i++) + { + m_neighbours.pop_back (); + } + m_neighbours.clear (); + +} +uint8_t +IeBeaconTiming::GetInformationSize () const +{ + return (5 * m_numOfUnits ); +} +void +IeBeaconTiming::Print (std::ostream& os) const +{ + os << std::endl << "" << std::endl; + os << "Number of units: " << (uint16_t) m_numOfUnits << std::endl; + for (NeighboursTimingUnitsList::const_iterator j = m_neighbours.begin (); j != m_neighbours.end (); j++) + { + os << "AID=" << (uint16_t) (*j)->GetAid () << ", Last beacon was at " << (*j)->GetLastBeacon () + << ", with beacon interval " << (*j)->GetBeaconInterval () << std::endl; + } + os << "" << std::endl; +} +void +IeBeaconTiming::SerializeInformation (Buffer::Iterator i) const +{ + for (NeighboursTimingUnitsList::const_iterator j = m_neighbours.begin (); j != m_neighbours.end (); j++) + { + i.WriteU8 ((*j)->GetAid ()); + i.WriteHtolsbU16 ((*j)->GetLastBeacon ()); + i.WriteHtolsbU16 ((*j)->GetBeaconInterval ()); + } +} +uint8_t +IeBeaconTiming::DeserializeInformation (Buffer::Iterator start, uint8_t length) +{ + Buffer::Iterator i = start; + m_numOfUnits = length / 5; + for (int j = 0; j < m_numOfUnits; j++) + { + Ptr new_element = Create (); + new_element->SetAid (i.ReadU8 ()); + new_element->SetLastBeacon (i.ReadLsbtohU16 ()); + new_element->SetBeaconInterval (i.ReadLsbtohU16 ()); + m_neighbours.push_back (new_element); + } + return i.GetDistanceFrom (start); +} +; +uint16_t +IeBeaconTiming::TimestampToU16 (Time t) +{ + return ((uint16_t) ((t.GetMicroSeconds () >> 8) & 0xffff)); +} +; + +uint16_t +IeBeaconTiming::BeaconIntervalToU16 (Time t) +{ + return ((uint16_t) (t.GetMicroSeconds () >> 10) & 0xffff); +} +uint8_t +IeBeaconTiming::AidToU8 (uint16_t x) +{ + return (uint8_t) (x & 0xff); +} +bool +operator== (const IeBeaconTimingUnit & a, const IeBeaconTimingUnit & b) +{ + return ((a.GetAid () == b.GetAid ()) && (a.GetLastBeacon () == b.GetLastBeacon ()) + && (a.GetBeaconInterval () == b.GetBeaconInterval ())); +} +bool +IeBeaconTiming::operator== (WifiInformationElement const & a) +{ + try { + IeBeaconTiming const & aa = dynamic_cast(a); + + if (m_numOfUnits != aa.m_numOfUnits) + { + return false; + } + for (unsigned int i = 0; i < m_neighbours.size (); i++) + { + if (!(*PeekPointer (m_neighbours[i]) == *PeekPointer (aa.m_neighbours[i]))) + { + return false; + } + } + return true; + } + catch (std::bad_cast) + { + return false; + } +} +std::ostream & +operator << (std::ostream &os, const IeBeaconTiming &a) +{ + a.Print (os); + return os; +} +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h new file mode 100644 index 000000000..8d4c404e2 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h @@ -0,0 +1,115 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef WIFI_TIMING_ELEMENT_H +#define WIFI_TIMING_ELEMENT_H + +#include +#include "ns3/nstime.h" +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * \brief Describes one unit of beacon timing element + */ +class IeBeaconTimingUnit : public RefCountBase +{ +public: + IeBeaconTimingUnit (); + void SetAid (uint8_t aid); + void SetLastBeacon (uint16_t lastBeacon); + void SetBeaconInterval (uint16_t beaconInterval); + + uint8_t GetAid () const; + uint16_t GetLastBeacon () const; + uint16_t GetBeaconInterval () const; + +private: + /// Least significant octet of AID: + uint8_t m_aid; + /// Last time we received a beacon in accordance with a local TSF measured in 256 microseconds unit + uint16_t m_lastBeacon; + /// Beacon interval of remote mesh point + uint16_t m_beaconInterval; + friend bool operator== (const IeBeaconTimingUnit & a, const IeBeaconTimingUnit & b); +}; + +/** + * \ingroup dot11s + * \brief See 7.3.2.89 of 802.11s draft 2.07 + */ +class IeBeaconTiming : public WifiInformationElement +{ +public: + /** + * \ingroup dot11s + * This type is a list of timing elements obtained from neigbours with their beacons: + */ + typedef std::vector< Ptr > NeighboursTimingUnitsList; + + IeBeaconTiming (); + /** + * This methods are needed for beacon collision + * avoidance module: + */ + NeighboursTimingUnitsList GetNeighboursTimingElementsList (); + void AddNeighboursTimingElementUnit ( + uint16_t aid, + Time last_beacon, + Time beacon_interval + ); + void DelNeighboursTimingElementUnit ( + uint16_t aid, + Time last_beacon, + Time beacon_interval + ); + void ClearTimingElement (); + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual uint8_t GetInformationSize () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); + virtual void Print (std::ostream& os) const; + ///\} + bool operator== (WifiInformationElement const & a); +private: + /** + * Converters: + */ + static uint16_t TimestampToU16 (Time x); + static uint16_t BeaconIntervalToU16 (Time x); + static uint8_t AidToU8 (uint16_t x); + + NeighboursTimingUnitsList m_neighbours; + /** + * Timing element parameters: + */ + uint16_t m_numOfUnits; +}; +bool operator== (const IeBeaconTimingUnit & a, const IeBeaconTimingUnit & b); +std::ostream &operator << (std::ostream &os, const IeBeaconTiming &beaconTiming); +} // namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/ie-dot11s-configuration.cc b/src/devices/mesh/dot11s/ie-dot11s-configuration.cc new file mode 100644 index 000000000..770930d44 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-configuration.cc @@ -0,0 +1,224 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + */ + +#include "ie-dot11s-configuration.h" +#include "ns3/packet.h" +namespace ns3 { +namespace dot11s { + +Dot11sMeshCapability::Dot11sMeshCapability () : + acceptPeerLinks (true), MCCASupported (false), MCCAEnabled (false), forwarding (true), beaconTimingReport ( + true), TBTTAdjustment (true), powerSaveLevel (false) +{ +} +uint8_t +Dot11sMeshCapability::GetSerializedSize () const +{ + return 2; +} +uint16_t +Dot11sMeshCapability::GetUint16 () const +{ + uint16_t result = 0; + if (acceptPeerLinks) + { + result |= 1 << 0; + } + if (MCCASupported) + { + result |= 1 << 1; + } + if (MCCAEnabled) + { + result |= 1 << 2; + } + if (forwarding) + { + result |= 1 << 3; + } + if (beaconTimingReport) + { + result |= 1 << 4; + } + if (TBTTAdjustment) + { + result |= 1 << 5; + } + if (powerSaveLevel) + { + result |= 1 << 6; + } + return result; +} +Buffer::Iterator +Dot11sMeshCapability::Serialize (Buffer::Iterator i) const +{ + i.WriteHtolsbU16 (GetUint16 ()); + return i; +} +Buffer::Iterator +Dot11sMeshCapability::Deserialize (Buffer::Iterator i) +{ + uint16_t cap = i.ReadLsbtohU16 (); + acceptPeerLinks = Is (cap, 0); + MCCASupported = Is (cap, 1); + MCCAEnabled = Is (cap, 2); + forwarding = Is (cap, 3); + beaconTimingReport = Is (cap, 4); + TBTTAdjustment = Is (cap, 5); + powerSaveLevel = Is (cap, 6); + return i; +} +bool +Dot11sMeshCapability::Is (uint16_t cap, uint8_t n) const +{ + uint16_t mask = 1 << n; + return (cap & mask); +} +WifiElementId +IeConfiguration::ElementId () const +{ + return IE11S_MESH_CONFIGURATION; +} + +IeConfiguration::IeConfiguration () : + m_APSPId (PROTOCOL_HWMP), m_APSMId (METRIC_AIRTIME), m_CCMId (CONGESTION_NULL), m_SPId ( + SYNC_NEIGHBOUR_OFFSET), m_APId (AUTH_NULL), m_neighbors (0) +{ +} +uint8_t +IeConfiguration::GetInformationSize () const +{ + return 1 // Version + + 4 // APSPId + + 4 // APSMId + + 4 // CCMId + + 4 // SPId + + 4 // APId + + 1 // Mesh formation info (see 7.3.2.86.6 of 802.11s draft 3.0) + + m_meshCap.GetSerializedSize (); +} +void +IeConfiguration::SerializeInformation (Buffer::Iterator i) const +{ + i.WriteU8 (1); //Version + // Active Path Selection Protocol ID: + i.WriteHtolsbU32 (m_APSPId); + // Active Path Metric ID: + i.WriteHtolsbU32 (m_APSMId); + // Congestion Control Mode ID: + i.WriteHtolsbU32 (m_CCMId); + // Sync: + i.WriteHtolsbU32 (m_SPId); + // Auth: + i.WriteHtolsbU32 (m_APId); + i.WriteU8 (m_neighbors << 1); + m_meshCap.Serialize (i); +} +uint8_t +IeConfiguration::DeserializeInformation (Buffer::Iterator i, uint8_t length) +{ + Buffer::Iterator start = i; + uint8_t version; + version = i.ReadU8 (); + // Active Path Selection Protocol ID: + m_APSPId = (dot11sPathSelectionProtocol) i.ReadLsbtohU32 (); + // Active Path Metric ID: + m_APSMId = (dot11sPathSelectionMetric) i.ReadLsbtohU32 (); + // Congestion Control Mode ID: + m_CCMId = (dot11sCongestionControlMode) i.ReadLsbtohU32 (); + m_SPId = (dot11sSynchronizationProtocolIdentifier) i.ReadLsbtohU32 (); + m_APId = (dot11sAuthenticationProtocol) i.ReadLsbtohU32 (); + m_neighbors = (i.ReadU8 () >> 1) & 0xF; + i = m_meshCap.Deserialize (i); + return i.GetDistanceFrom (start); +} +void +IeConfiguration::Print (std::ostream& os) const +{ + os << std::endl << "" << std::endl; + os << "Number of neighbors: = " << (uint16_t) m_neighbors + << std::endl << "Active Path Selection Protocol ID: = " << (uint32_t) m_APSPId + << std::endl << "Active Path Selection Metric ID: = " << (uint32_t) m_APSMId + << std::endl << "Congestion Control Mode ID: = " << (uint32_t) m_CCMId + << std::endl << "Synchronize protocol ID: = " << (uint32_t) m_SPId + << std::endl << "Authentication protocol ID: = " << (uint32_t) m_APId + << std::endl << "Capabilities: = " << m_meshCap.GetUint16 () << std::endl; + os << "" << std::endl; +} +void +IeConfiguration::SetRouting (dot11sPathSelectionProtocol routingId) +{ + m_APSPId = routingId; +} +void +IeConfiguration::SetMetric (dot11sPathSelectionMetric metricId) +{ + m_APSMId = metricId; +} +bool +IeConfiguration::IsHWMP () +{ + return (m_APSPId == PROTOCOL_HWMP); +} +bool +IeConfiguration::IsAirtime () +{ + return (m_APSMId == METRIC_AIRTIME); +} +void +IeConfiguration::SetNeighborCount (uint8_t neighbors) +{ + m_neighbors = (neighbors > 31) ? 31 : neighbors; +} +uint8_t +IeConfiguration::GetNeighborCount () +{ + return m_neighbors; +} +Dot11sMeshCapability const& +IeConfiguration::MeshCapability () +{ + return m_meshCap; +} +bool +operator== (const Dot11sMeshCapability & a, const Dot11sMeshCapability & b) +{ + return ((a.acceptPeerLinks == b.acceptPeerLinks) && (a.MCCASupported == b.MCCASupported) && (a.MCCAEnabled + == b.MCCAEnabled) && (a.forwarding == b.forwarding) && (a.beaconTimingReport == b.beaconTimingReport) + && (a.TBTTAdjustment == b.TBTTAdjustment) && (a.powerSaveLevel == b.powerSaveLevel)); +} +bool +operator== (const IeConfiguration & a, const IeConfiguration & b) +{ + return ((a.m_APSPId == b.m_APSPId) && (a.m_APSMId == b.m_APSMId) && (a.m_CCMId == b.m_CCMId) && (a.m_SPId + == b.m_SPId) && (a.m_APId == b.m_APId) && (a.m_neighbors == b.m_neighbors) && (a.m_meshCap + == b.m_meshCap)); +} +std::ostream & +operator << (std::ostream &os, const IeConfiguration &a) +{ + a.Print (os); + return os; +} +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/ie-dot11s-configuration.h b/src/devices/mesh/dot11s/ie-dot11s-configuration.h new file mode 100644 index 000000000..f92546539 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-configuration.h @@ -0,0 +1,142 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + */ + + +#ifndef MESH_CONFIGURATION_H +#define MESH_CONFIGURATION_H + +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * \brief See 7.3.2.86.1 in 802.11s draft 3.0 + */ +enum dot11sPathSelectionProtocol +{ + PROTOCOL_HWMP = 0x000fac00, +}; +/** + * \ingroup dot11s + * \brief See 7.3.2.86.2 in 802.11s draft 3.0 + */ +enum dot11sPathSelectionMetric +{ + METRIC_AIRTIME = 0x000fac00, +}; +/** + * \ingroup dot11s + * \brief See 7.3.2.86.3 in 802.11s draft 3.0 + */ +enum dot11sCongestionControlMode +{ + CONGESTION_SIGNALING = 0x000fac00, + CONGESTION_NULL = 0x000facff, +}; +/** + * \ingroup dot11s + * \brief See 7.3.2.86.4 in 802.11s draft 3.0 + */ +enum dot11sSynchronizationProtocolIdentifier +{ + SYNC_NEIGHBOUR_OFFSET = 0x000fac00, + SYNC_NULL = 0x000facff, +}; +/** + * \ingroup dot11s + * \brief See 7.3.2.86.5 in 802.11s draft 3.0 + */ +enum dot11sAuthenticationProtocol +{ + AUTH_NULL = 0x000fac00, + AUTH_SAE = 0x000fac01, +}; +/** + * \ingroup dot11s + * \brief See 7.3.2.86.7 in 802.11s draft 3.0 + */ +class Dot11sMeshCapability +{ +public: + Dot11sMeshCapability (); + uint8_t GetSerializedSize () const; + Buffer::Iterator Serialize (Buffer::Iterator i) const; + Buffer::Iterator Deserialize (Buffer::Iterator i); + uint16_t GetUint16 () const; + bool acceptPeerLinks; + bool MCCASupported; + bool MCCAEnabled; + bool forwarding; + bool beaconTimingReport; + bool TBTTAdjustment; + bool powerSaveLevel; + bool Is (uint16_t cap,uint8_t n) const; + friend bool operator== (const Dot11sMeshCapability & a, const Dot11sMeshCapability & b); +}; + +/** + * \ingroup dot11s + * \brief Describes Mesh Configuration Element + * see 7.3.2.86 of 802.11s draft 3.0 + */ +class IeConfiguration : public WifiInformationElement +{ +public: + IeConfiguration (); + void SetRouting (dot11sPathSelectionProtocol routingId); + void SetMetric (dot11sPathSelectionMetric metricId); + bool IsHWMP (); + bool IsAirtime (); + void SetNeighborCount (uint8_t neighbors); + uint8_t GetNeighborCount (); + Dot11sMeshCapability const& MeshCapability (); + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual uint8_t GetInformationSize () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); + virtual void Print (std::ostream& os) const; + ///\} +private: + /** Active Path Selection Protocol ID */ + dot11sPathSelectionProtocol m_APSPId; + /** Active Path Metric ID */ + dot11sPathSelectionMetric m_APSMId; + /** Congestion Control Mode ID */ + dot11sCongestionControlMode m_CCMId; + /** Sync protocol ID */ + dot11sSynchronizationProtocolIdentifier m_SPId; + /** Auth protocol ID */ + dot11sAuthenticationProtocol m_APId; + Dot11sMeshCapability m_meshCap; + uint8_t m_neighbors; + friend bool operator== (const IeConfiguration & a, const IeConfiguration & b); +}; +bool operator== (const IeConfiguration & a, const IeConfiguration & b); +bool operator== (const Dot11sMeshCapability & a, const Dot11sMeshCapability & b); +std::ostream &operator << (std::ostream &os, const IeConfiguration &config); +} // namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/ie-dot11s-id.cc b/src/devices/mesh/dot11s/ie-dot11s-id.cc new file mode 100644 index 000000000..123a141f6 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-id.cc @@ -0,0 +1,158 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ie-dot11s-id.h" +#include "ns3/assert.h" + +namespace ns3 { +namespace dot11s { + +IeMeshId::IeMeshId () +{ + for (uint8_t i = 0; i < 32; i++) + { + m_meshId[i] = 0; + } +} +IeMeshId::IeMeshId (std::string s) +{ + NS_ASSERT (s.size () < 32); + const char *meshid = s.c_str (); + uint8_t len = 0; + while (*meshid != 0 && len < 32) + { + m_meshId[len] = *meshid; + meshid++; + len++; + } + NS_ASSERT (len <= 32); + while (len < 33) + { + m_meshId[len] = 0; + len++; + } +} +WifiElementId +IeMeshId::ElementId () const +{ + return IE11S_MESH_ID; +} +bool +IeMeshId::IsEqual (IeMeshId const &o) const +{ + uint8_t i = 0; + while (i < 32 && m_meshId[i] == o.m_meshId[i] && m_meshId[i] != 0) + { + i++; + } + if (m_meshId[i] != o.m_meshId[i]) + { + return false; + } + return true; +} +bool +IeMeshId::IsBroadcast (void) const +{ + if (m_meshId[0] == 0) + { + return true; + } + return false; +} +char * +IeMeshId::PeekString (void) const +{ + return (char *) m_meshId; +} +uint8_t +IeMeshId::GetInformationSize (void) const +{ + uint8_t size = 0; + while (m_meshId[size] != 0 && size < 32) + { + size++; + } + NS_ASSERT (size <= 32); + return size; +} +void +IeMeshId::SerializeInformation (Buffer::Iterator i) const +{ + uint8_t size = 0; + while (m_meshId[size] != 0 && size < 32) + { + i.WriteU8 (m_meshId[size]); + size++; + } +} +uint8_t +IeMeshId::DeserializeInformation (Buffer::Iterator start, uint8_t length) +{ + Buffer::Iterator i = start; + NS_ASSERT (length <= 32); + i.Read (m_meshId, length); + m_meshId[length] = 0; + return i.GetDistanceFrom (start); +} +void +IeMeshId::Print (std::ostream& os) const +{ + os << std::endl << "" << std::endl; + os << "meshId = " << PeekString (); + os << "" << std::endl; +} +bool +operator== (const IeMeshId & a, const IeMeshId & b) +{ + bool result (true); + uint8_t size = 0; + + while (size < 32) + { + result = result && (a.m_meshId[size] == b.m_meshId[size]); + if (a.m_meshId[size] == 0) + { + return result; + } + size++; + } + return result; +} +std::ostream & +operator << (std::ostream &os, const IeMeshId &a) +{ + a.Print (os); + return os; +} + +std::istream &operator >> (std::istream &is, IeMeshId &a) +{ + std::string str; + is >> str; + a = IeMeshId (str.c_str ()); + return is; +} + +ATTRIBUTE_HELPER_CPP (IeMeshId); + + +} //namespace dot11s +} // namespace ns3 diff --git a/src/devices/mesh/dot11s/ie-dot11s-id.h b/src/devices/mesh/dot11s/ie-dot11s-id.h new file mode 100644 index 000000000..ec2b27d0d --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-id.h @@ -0,0 +1,71 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef MESH_ID_H +#define MESH_ID_H + +#include +#include "ns3/buffer.h" +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 { +namespace dot11s { +/** + * \brief a IEEE 802.11s Mesh ID 7.3.287 of 802.11s draft 3.0 + * + */ +class IeMeshId : public WifiInformationElement +{ +public: + // broadcast meshId + IeMeshId (); + IeMeshId (std::string s); + + bool IsEqual (IeMeshId const &o) const; + bool IsBroadcast (void) const; + //uint32_t GetLength (void) const; + char *PeekString (void) const; + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length); + virtual void Print (std::ostream& os) const; + virtual uint8_t GetInformationSize () const; + ///\} +private: + uint8_t m_meshId[33]; + friend bool operator== (const IeMeshId & a, const IeMeshId & b); + +}; + +std::ostream &operator << (std::ostream &os, const IeMeshId &meshId); + +/** + * \class ns3::IeMeshIdValue + * \brief hold objects of type ns3::IeMeshId + */ + +ATTRIBUTE_HELPER_HEADER (IeMeshId); +} //namespace dot11s +} // namespace ns3 +#endif /* MESH_ID_H */ diff --git a/src/devices/mesh/dot11s/ie-dot11s-metric-report.cc b/src/devices/mesh/dot11s/ie-dot11s-metric-report.cc new file mode 100644 index 000000000..c24740a87 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-metric-report.cc @@ -0,0 +1,85 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ie-dot11s-metric-report.h" +#include "ns3/assert.h" + +namespace ns3 { +namespace dot11s { +IeLinkMetricReport::IeLinkMetricReport () : + m_metric (0) +{ +} +IeLinkMetricReport::IeLinkMetricReport (uint32_t metric) +{ + m_metric = metric; +} +WifiElementId +IeLinkMetricReport::ElementId () const +{ + return IE11S_LINK_METRIC_REPORT; +} +uint8_t +IeLinkMetricReport::GetInformationSize (void) const +{ + return sizeof (uint32_t); +} +uint32_t +IeLinkMetricReport::GetMetric () +{ + return m_metric; +} +void +IeLinkMetricReport::SetMetric (uint32_t metric) +{ + m_metric = metric; +} +void +IeLinkMetricReport::SerializeInformation (Buffer::Iterator i) const +{ + i.WriteHtolsbU32 (m_metric); +} +uint8_t +IeLinkMetricReport::DeserializeInformation (Buffer::Iterator start, uint8_t length) +{ + Buffer::Iterator i = start; + m_metric = i.ReadLsbtohU32 (); + return i.GetDistanceFrom (start); +} +void +IeLinkMetricReport::Print (std::ostream& os) const +{ + os << std::endl << "" << std::endl; + os << "Metric = " << m_metric; + os << "" << std::endl; +} +bool +operator== (const IeLinkMetricReport & a, const IeLinkMetricReport & b) +{ + return (a.m_metric == b.m_metric); +} +std::ostream & +operator << (std::ostream &os, const IeLinkMetricReport &a) +{ + a.Print (os); + return os; +} +} //namespace dot11s +} // namespace ns3 diff --git a/src/devices/mesh/dot11s/ie-dot11s-metric-report.h b/src/devices/mesh/dot11s/ie-dot11s-metric-report.h new file mode 100644 index 000000000..e5521637b --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-metric-report.h @@ -0,0 +1,60 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef METRIC_REPORT_H +#define METRIC_REPORT_H + +#include +#include "ns3/buffer.h" +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 { +namespace dot11s { +/** + * \brief a IEEE 802.11s Mesh ID 7.3.2.88 of 802.11s draft 3.0 + * + */ +class IeLinkMetricReport : public WifiInformationElement +{ +public: + IeLinkMetricReport (); + IeLinkMetricReport (uint32_t metric); + void SetMetric (uint32_t metric); + uint32_t GetMetric (); + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length); + virtual void Print (std::ostream& os) const; + virtual uint8_t GetInformationSize () const; + ///\} +private: + uint32_t m_metric; + friend bool operator== (const IeLinkMetricReport & a, const IeLinkMetricReport & b); + friend bool operator> (const IeLinkMetricReport & a, const IeLinkMetricReport & b); + friend bool operator< (const IeLinkMetricReport & a, const IeLinkMetricReport & b); +}; +std::ostream &operator << (std::ostream &os, const IeLinkMetricReport &linkMetricReport); +} //namespace dot11s +} // namespace ns3 +#endif /* METRIC_REPORT_H */ diff --git a/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc b/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc new file mode 100644 index 000000000..1d507d67e --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc @@ -0,0 +1,176 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + */ + +#include "ie-dot11s-peer-management.h" +#include "ns3/assert.h" +#include "ns3/packet.h" + +namespace ns3 { +namespace dot11s { + +IePeerManagement::IePeerManagement () : + m_length (3), m_subtype (PEER_OPEN), m_localLinkId (0), m_peerLinkId (0), m_reasonCode (REASON11S_RESERVED) +{ +} +WifiElementId +IePeerManagement::ElementId () const +{ + return IE11S_PEERING_MANAGEMENT; +} +void +IePeerManagement::SetPeerOpen (uint16_t localLinkId) +{ + m_length = 3; + m_subtype = PEER_OPEN; + m_localLinkId = localLinkId; +} +void +IePeerManagement::SetPeerClose (uint16_t localLinkId, uint16_t peerLinkId, PmpReasonCode reasonCode) +{ + m_length = 7; + m_subtype = PEER_CLOSE; + m_localLinkId = localLinkId; + m_peerLinkId = peerLinkId; + m_reasonCode = reasonCode; +} + +void +IePeerManagement::SetPeerConfirm (uint16_t localLinkId, uint16_t peerLinkId) +{ + m_length = 5; + m_subtype = PEER_CONFIRM; + m_localLinkId = localLinkId; + m_peerLinkId = peerLinkId; +} + +PmpReasonCode +IePeerManagement::GetReasonCode () const +{ + return m_reasonCode; +} + +uint16_t +IePeerManagement::GetLocalLinkId () const +{ + return m_localLinkId; +} + +uint16_t +IePeerManagement::GetPeerLinkId () const +{ + return m_peerLinkId; +} + +uint8_t +IePeerManagement::GetInformationSize (void) const +{ + return m_length; +} +uint8_t +IePeerManagement::GetSubtype () const +{ + return m_subtype; +} +bool +IePeerManagement::SubtypeIsOpen () const +{ + return (m_subtype == PEER_OPEN); +} +bool +IePeerManagement::SubtypeIsClose () const +{ + return (m_subtype == PEER_CLOSE); +} +bool +IePeerManagement::SubtypeIsConfirm () const +{ + return (m_subtype == PEER_CONFIRM); +} + +void +IePeerManagement::SerializeInformation (Buffer::Iterator i) const +{ + i.WriteU8 (m_subtype); + i.WriteHtolsbU16 (m_localLinkId); + if (m_length > 3) + { + i.WriteHtolsbU16 (m_peerLinkId); + } + if (m_length > 5) + { + i.WriteHtolsbU16 (m_reasonCode); + } +} +uint8_t +IePeerManagement::DeserializeInformation (Buffer::Iterator start, uint8_t length) +{ + Buffer::Iterator i = start; + m_subtype = i.ReadU8 (); + m_length = length; + if (m_subtype == PEER_OPEN) + { + NS_ASSERT (length == 3); + } + if (m_subtype == PEER_CONFIRM) + { + NS_ASSERT (length == 5); + } + if (m_subtype == PEER_CLOSE) + { + NS_ASSERT (length == 7); + } + m_localLinkId = i.ReadLsbtohU16 (); + if (m_length > 3) + { + m_peerLinkId = i.ReadLsbtohU16 (); + } + if (m_length > 5) + { + m_reasonCode = (PmpReasonCode) i.ReadLsbtohU16 (); + } + return i.GetDistanceFrom (start); +} +void +IePeerManagement::Print (std::ostream& os) const +{ + os << std::endl << "" << std::endl; + os << " Subtype: = " << (uint16_t) m_subtype << std::endl; + os << " Length: = " << (uint16_t) m_length << std::endl; + os << " LocalLinkId: = " << m_localLinkId << std::endl; + os << " PeerLinkId: = " << m_peerLinkId << std::endl; + os << " ReasonCode: = " << m_reasonCode << std::endl; + os << "" << std::endl; +} +bool +operator== (const IePeerManagement & a, const IePeerManagement & b) +{ + return ((a.m_length == b.m_length) && (a.m_subtype == b.m_subtype) && (a.m_localLinkId == b.m_localLinkId) + && (a.m_peerLinkId == b.m_peerLinkId) && (a.m_reasonCode == b.m_reasonCode)); +} +std::ostream & +operator << (std::ostream &os, const IePeerManagement &a) +{ + a.Print (os); + return os; +} +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/ie-dot11s-peer-management.h b/src/devices/mesh/dot11s/ie-dot11s-peer-management.h new file mode 100644 index 000000000..1428fa06d --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-peer-management.h @@ -0,0 +1,101 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + */ + +#ifndef MESH_PEER_MAN_ELEMENT +#define MESH_PEER_MAN_ELEMENT + +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 { +namespace dot11s { + +/** + * \ingroup dot11s + * \brief Codes used by 802.11s Peer Management Protocol + */ +enum PmpReasonCode +{ + REASON11S_PEERING_CANCELLED = 2, // according to open80211s + REASON11S_MESH_MAX_PEERS, + REASON11S_MESH_CAPABILITY_POLICY_VIOLATION, + REASON11S_MESH_CLOSE_RCVD, + REASON11S_MESH_MAX_RETRIES, + REASON11S_MESH_CONFIRM_TIMEOUT, + REASON11S_MESH_INVALID_GTK, + REASON11S_MESH_INCONSISTENT_PARAMETERS, + REASON11S_MESH_INVALID_SECURITY_CAPABILITY, + REASON11S_RESERVED, +}; + +/** + * \ingroup dot11s + * \brief See 7.3.2.85 of draft 2.07 + */ +class IePeerManagement : public WifiInformationElement +{ +public: + IePeerManagement (); + enum Subtype + { + PEER_OPEN = 0, + PEER_CONFIRM, + PEER_CLOSE, + }; + void SetPeerOpen (uint16_t localLinkId); + void SetPeerClose (uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode); + void SetPeerConfirm (uint16_t localLinkID, uint16_t peerLinkId); + + PmpReasonCode GetReasonCode () const; + uint16_t GetLocalLinkId () const; + uint16_t GetPeerLinkId () const; + bool SubtypeIsOpen () const; + bool SubtypeIsClose () const; + bool SubtypeIsConfirm () const ; + uint8_t GetSubtype () const; + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual uint8_t GetInformationSize (void) const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); + virtual void Print (std::ostream& os) const; + ///\} +private: + uint8_t m_length; + uint8_t m_subtype; + uint16_t m_localLinkId; + /** + * Present within confirm and may be present in close + */ + uint16_t m_peerLinkId; + /** + * Present only within close frame + */ + PmpReasonCode m_reasonCode; + friend bool operator== (const IePeerManagement & a, const IePeerManagement & b); +}; +bool operator== (const IePeerManagement & a, const IePeerManagement & b); +std::ostream &operator << (std::ostream &os, const IePeerManagement &peerMan); +} // namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/ie-dot11s-peering-protocol.cc b/src/devices/mesh/dot11s/ie-dot11s-peering-protocol.cc new file mode 100644 index 000000000..9cf0f5f86 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-peering-protocol.cc @@ -0,0 +1,65 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#include "ie-dot11s-peering-protocol.h" +namespace ns3 { +namespace dot11s { +uint8_t +IePeeringProtocol::GetInformationSize () const +{ + return 1; +} +IePeeringProtocol::IePeeringProtocol () : + m_protocol (0) +{ +} +WifiElementId +IePeeringProtocol::ElementId () const +{ + return IE11S_MESH_PEERING_PROTOCOL_VERSION; +} +void +IePeeringProtocol::SerializeInformation (Buffer::Iterator i) const +{ + i.WriteU8 (m_protocol); +} +uint8_t +IePeeringProtocol::DeserializeInformation (Buffer::Iterator i, uint8_t length) +{ + Buffer::Iterator start = i; + m_protocol = i.ReadU8 (); + return i.GetDistanceFrom (start); +} +void +IePeeringProtocol::Print (std::ostream& os) const +{ + os << std::endl << "" << std::endl; + os << "peering protocol = " << m_protocol; + os << "" << std::endl; +} +std::ostream & +operator << (std::ostream &os, const IePeeringProtocol &a) +{ + a.Print (os); + return os; +} +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/ie-dot11s-peering-protocol.h b/src/devices/mesh/dot11s/ie-dot11s-peering-protocol.h new file mode 100644 index 000000000..77e09171f --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-peering-protocol.h @@ -0,0 +1,49 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#ifndef MESH_PERING_PROTOCOL_H +#define MESH_PEERING_PROTOCOL_H + +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 +{ +namespace dot11s +{ +class IePeeringProtocol : public WifiInformationElement +{ +public: + IePeeringProtocol (); + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual uint8_t GetInformationSize () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); + virtual void Print (std::ostream& os) const; + ///\} +private: + uint8_t m_protocol; +}; +} // namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/ie-dot11s-perr.cc b/src/devices/mesh/dot11s/ie-dot11s-perr.cc new file mode 100644 index 000000000..b7aed0dd4 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-perr.cc @@ -0,0 +1,165 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ie-dot11s-perr.h" +#include "ns3/address-utils.h" +#include "ns3/packet.h" +namespace ns3 { +namespace dot11s { +IePerr::IePerr () +{ +} +IePerr::~IePerr () +{ +} +WifiElementId +IePerr::ElementId () const +{ + return IE11S_PERR; +} +void +IePerr::Print (std::ostream &os) const +{ + os << std::endl << "" << std::endl; + os << "Number of failed destinations: = " << m_addressUnits.size (); + for (unsigned int j = 0; j < m_addressUnits.size (); j++) + { + os << "Failed destination address: = " << m_addressUnits[j].destination << ", sequence number = " + << m_addressUnits[j].seqnum; + } + os << std::endl << "" << std::endl; +} +uint8_t +IePerr::GetNumOfDest () const +{ + return m_addressUnits.size (); +} +void +IePerr::SerializeInformation (Buffer::Iterator i) const +{ + i.WriteU8 (0); + i.WriteU8 (m_addressUnits.size ()); + for (unsigned int j = 0; j < m_addressUnits.size (); j++) + { + WriteTo (i, m_addressUnits[j].destination); + i.WriteHtolsbU32 (m_addressUnits[j].seqnum); + } +} +uint8_t +IePerr::DeserializeInformation (Buffer::Iterator start, uint8_t length) +{ + Buffer::Iterator i = start; + i.Next (1); //Mode flags is not used now + uint8_t numOfDest = i.ReadU8 (); + NS_ASSERT ((2 + 10 * numOfDest ) == length); + length = 0; //to avoid compiler warning in optimized builds + for (unsigned int j = 0; j < numOfDest; j++) + { + HwmpProtocol::FailedDestination unit; + ReadFrom (i, unit.destination); + unit.seqnum = i.ReadLsbtohU32 (); + m_addressUnits.push_back (unit); + } + return i.GetDistanceFrom (start); +} + +uint8_t +IePerr::GetInformationSize () const +{ + uint8_t retval = 1 //ModeFlags + + 1 //NumOfDests + + (6 + 4) * m_addressUnits.size (); + return retval; +} + +void +IePerr::AddAddressUnit (HwmpProtocol::FailedDestination unit) +{ + for (unsigned int i = 0; i < m_addressUnits.size (); i++) + { + if (m_addressUnits[i].destination == unit.destination) + { + return; + } + } + if ((m_addressUnits.size () + 1) * 10 + 2 > 255) + { + return; + } + m_addressUnits.push_back (unit); +} +bool +IePerr::IsFull () const +{ + return (GetInformationSize () + 2 /* ID + LENGTH*/+ 10 /* Size of Mac48Address + uint32_t (one unit)*/> 255); +} +std::vector +IePerr::GetAddressUnitVector () const +{ + return m_addressUnits; +} +void +IePerr::DeleteAddressUnit (Mac48Address address) +{ + for (std::vector::iterator i = m_addressUnits.begin (); i + != m_addressUnits.end (); i++) + { + if (i->destination == address) + { + m_addressUnits.erase (i); + break; + } + } +} +void +IePerr::ResetPerr () +{ + m_addressUnits.clear (); +} +bool +operator== (const IePerr & a, const IePerr & b) +{ + if (a.m_addressUnits.size () != b.m_addressUnits.size ()) + { + return false; + } + for (unsigned int i = 0; i < a.m_addressUnits.size (); i++) + { + if (a.m_addressUnits[i].destination != b.m_addressUnits[i].destination) + { + return false; + } + if (a.m_addressUnits[i].seqnum != b.m_addressUnits[i].seqnum) + { + return false; + } + } + return true; +} +std::ostream & +operator << (std::ostream & os, const IePerr & a) +{ + a.Print (os); + return os; +} +} // namespace dot11s +} //namespace ns3 + + diff --git a/src/devices/mesh/dot11s/ie-dot11s-perr.h b/src/devices/mesh/dot11s/ie-dot11s-perr.h new file mode 100644 index 000000000..110a2f5ce --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-perr.h @@ -0,0 +1,63 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef PERR_INFORMATION_ELEMENT_H +#define PERR_INFORMATION_ELEMENT_H + +#include "ns3/mac48-address.h" +#include "ns3/wifi-information-element-vector.h" +#include "ns3/hwmp-protocol.h" + +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * \brief See 7.3.2.98 of 802.11s draft 2.07 + */ +class IePerr : public WifiInformationElement +{ +public: + IePerr (); + ~IePerr (); + uint8_t GetNumOfDest () const; + void AddAddressUnit (HwmpProtocol::FailedDestination unit); + bool IsFull () const; + std::vector GetAddressUnitVector () const; + void DeleteAddressUnit (Mac48Address address); + void ResetPerr (); + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length); + virtual void Print (std::ostream& os) const; + virtual uint8_t GetInformationSize () const; + ///\} +private: + std::vector m_addressUnits; + friend bool operator== (const IePerr & a, const IePerr & b); +}; + bool operator== (const IePerr & a, const IePerr & b); + std::ostream &operator << (std::ostream &os, const IePerr &perr); +} // namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/ie-dot11s-prep.cc b/src/devices/mesh/dot11s/ie-dot11s-prep.cc new file mode 100644 index 000000000..dd58053cf --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-prep.cc @@ -0,0 +1,214 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ie-dot11s-prep.h" +#include "ns3/address-utils.h" +#include "ns3/assert.h" +#include "ns3/packet.h" +namespace ns3 { +namespace dot11s { +/******************************** + * IePrep + *******************************/ +IePrep::~IePrep () +{ +} +IePrep::IePrep () : + m_flags (0), m_hopcount (0), m_ttl (0), m_destinationAddress (Mac48Address::GetBroadcast ()), + m_destSeqNumber (0), m_lifetime (0), m_metric (0), m_originatorAddress (Mac48Address::GetBroadcast ()), + m_originatorSeqNumber (0) +{ +} +WifiElementId +IePrep::ElementId () const +{ + return IE11S_PREP; +} +void +IePrep::SetFlags (uint8_t flags) +{ + m_flags = flags; +} +void +IePrep::SetHopcount (uint8_t hopcount) +{ + m_hopcount = hopcount; +} +void +IePrep::SetTtl (uint8_t ttl) +{ + m_ttl = ttl; +} +void +IePrep::SetDestinationSeqNumber (uint32_t destSeqNumber) +{ + m_destSeqNumber = destSeqNumber; +} +void +IePrep::SetDestinationAddress (Mac48Address destAddress) +{ + m_destinationAddress = destAddress; +} +void +IePrep::SetMetric (uint32_t metric) +{ + m_metric = metric; +} +void +IePrep::SetOriginatorAddress (Mac48Address originatorAddress) +{ + m_originatorAddress = originatorAddress; +} +void +IePrep::SetOriginatorSeqNumber (uint32_t originatorSeqNumber) +{ + m_originatorSeqNumber = originatorSeqNumber; +} +void +IePrep::SetLifetime (uint32_t lifetime) +{ + m_lifetime = lifetime; +} +uint8_t +IePrep::GetFlags () const +{ + return m_flags; +} +uint8_t +IePrep::GetHopcount () const +{ + return m_hopcount; +} +uint32_t +IePrep::GetTtl () const +{ + return m_ttl; +} +uint32_t +IePrep::GetDestinationSeqNumber () const +{ + return m_destSeqNumber; +} +Mac48Address +IePrep::GetDestinationAddress () const +{ + return m_destinationAddress; +} +uint32_t +IePrep::GetMetric () const +{ + return m_metric; +} +Mac48Address +IePrep::GetOriginatorAddress () const +{ + return m_originatorAddress; +} +uint32_t +IePrep::GetOriginatorSeqNumber () const +{ + return m_originatorSeqNumber; +} +uint32_t +IePrep::GetLifetime () const +{ + return m_lifetime; +} +void +IePrep::DecrementTtl () +{ + m_ttl--; +} + +void +IePrep::IncrementMetric (uint32_t metric) +{ + m_metric += metric; +} + +void +IePrep::SerializeInformation (Buffer::Iterator i) const +{ + i.WriteU8 (m_flags); + i.WriteU8 (m_hopcount); + i.WriteU8 (m_ttl); + WriteTo (i, m_destinationAddress); + i.WriteHtolsbU32 (m_destSeqNumber); + i.WriteHtolsbU32 (m_lifetime); + i.WriteHtolsbU32 (m_metric); + WriteTo (i, m_originatorAddress); + i.WriteHtolsbU32 (m_originatorSeqNumber); +} +uint8_t +IePrep::DeserializeInformation (Buffer::Iterator start, uint8_t length) +{ + Buffer::Iterator i = start; + m_flags = i.ReadU8 (); + m_hopcount = i.ReadU8 (); + m_ttl = i.ReadU8 (); + ReadFrom (i, m_destinationAddress); + m_destSeqNumber = i.ReadLsbtohU32 (); + m_lifetime = i.ReadLsbtohU32 (); + m_metric = i.ReadLsbtohU32 (); + ReadFrom (i, m_originatorAddress); + m_originatorSeqNumber = i.ReadLsbtohU32 (); + return i.GetDistanceFrom (start); +} +uint8_t +IePrep::GetInformationSize () const +{ + uint32_t retval = 1 //Flags + + 1 //Hopcount + + 1 //Ttl + + 6 //Dest address + + 4 //Dest seqno + + 4 //Lifetime + + 4 //metric + + 6 //Originator address + + 4; //Originator seqno + return retval; +} +void +IePrep::Print (std::ostream& os) const +{ + os << std::endl << "" << std::endl; + os << "Flags: = " << m_flags << std::endl << "Hopcount: = " << m_hopcount << std::endl << "TTL: = " << m_ttl + << std::endl<< "Destination: = " << m_destinationAddress << std::endl << "Dest. seqnum: = " << m_destSeqNumber + << std::endl << "Lifetime: = " << m_lifetime << std::endl<< "Metric: = " << m_metric << std::endl << "Originator: = " + << m_originatorAddress << std::endl << "Orig. seqnum: = " << m_originatorSeqNumber << std::endl; + os << "" << std::endl; +} +bool +operator== (const IePrep & a, const IePrep & b) +{ + return ((a.m_flags == b.m_flags) && (a.m_hopcount == b.m_hopcount) && (a.m_ttl == b.m_ttl) + && (a.m_destinationAddress == b.m_destinationAddress) && (a.m_destSeqNumber == b.m_destSeqNumber) + && (a.m_lifetime == b.m_lifetime) && (a.m_metric == b.m_metric) && (a.m_originatorAddress + == b.m_originatorAddress) && (a.m_originatorSeqNumber == b.m_originatorSeqNumber)); +} +std::ostream & +operator << (std::ostream &os, const IePrep &a) +{ + a.Print (os); + return os; +} +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/ie-dot11s-prep.h b/src/devices/mesh/dot11s/ie-dot11s-prep.h new file mode 100644 index 000000000..a16563be6 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-prep.h @@ -0,0 +1,87 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef WIFI_PREP_INFORMATION_ELEMENT_H +#define WIFI_PREP_INFORMATION_ELEMENT_H + +#include "ns3/mac48-address.h" +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * \brief See 7.3.2.97 of 802.11s draft 2.07 + */ +class IePrep : public WifiInformationElement +{ +public: + IePrep (); + ~IePrep (); + void SetFlags (uint8_t flags); + void SetHopcount (uint8_t hopcount); + void SetTtl (uint8_t ttl); + void SetDestinationAddress (Mac48Address dest_address); + void SetDestinationSeqNumber (uint32_t dest_seq_number); + void SetLifetime (uint32_t lifetime); + void SetMetric (uint32_t metric); + void SetOriginatorAddress (Mac48Address originator_address); + void SetOriginatorSeqNumber (uint32_t originator_seq_number); + + uint8_t GetFlags () const; + uint8_t GetHopcount () const; + uint32_t GetTtl () const; + Mac48Address GetDestinationAddress () const; + uint32_t GetDestinationSeqNumber () const; + uint32_t GetLifetime () const; + uint32_t GetMetric () const; + Mac48Address GetOriginatorAddress () const; + uint32_t GetOriginatorSeqNumber ()const ; + + void DecrementTtl (); + void IncrementMetric (uint32_t metric); + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length); + virtual uint8_t GetInformationSize () const; + virtual void Print (std::ostream& os) const; + ///\} +private: + uint8_t m_flags; + uint8_t m_hopcount; + uint8_t m_ttl; + Mac48Address m_destinationAddress; + uint32_t m_destSeqNumber; + uint32_t m_lifetime; + uint32_t m_metric; + Mac48Address m_originatorAddress; + uint32_t m_originatorSeqNumber; + friend bool operator== (const IePrep & a, const IePrep & b); +}; +bool operator== (const IePrep & a, const IePrep & b); +std::ostream &operator << (std::ostream &os, const IePrep &prep); +} // namespace dot11s +} //namespace ns3 +#endif + diff --git a/src/devices/mesh/dot11s/ie-dot11s-preq.cc b/src/devices/mesh/dot11s/ie-dot11s-preq.cc new file mode 100644 index 000000000..c5d2c1ff9 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-preq.cc @@ -0,0 +1,450 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ie-dot11s-preq.h" +#include "ns3/address-utils.h" +#include "ns3/assert.h" +#include "ns3/packet.h" + +namespace ns3 { +namespace dot11s { +/************************* + * DestinationAddressUnit + ************************/ +DestinationAddressUnit::DestinationAddressUnit () : + m_do (false), m_rf (false), m_usn (false), m_destinationAddress (Mac48Address ()), m_destSeqNumber (0) +{ +} +void +DestinationAddressUnit::SetFlags (bool doFlag, bool rfFlag, bool usnFlag) +{ + m_do = doFlag; + m_rf = rfFlag; + m_usn = usnFlag; +} + +void +DestinationAddressUnit::SetDestSeqNumber (uint32_t dest_seq_number) +{ + m_destSeqNumber = dest_seq_number; + if (m_destSeqNumber != 0) + { + m_usn = true; + } +} +void +DestinationAddressUnit::SetDestinationAddress (Mac48Address dest_address) +{ + m_destinationAddress = dest_address; +} +bool +DestinationAddressUnit::IsDo () +{ + return m_do; +} + +bool +DestinationAddressUnit::IsRf () +{ + return m_rf; +} +bool +DestinationAddressUnit::IsUsn () +{ + return m_usn; +} +uint32_t +DestinationAddressUnit::GetDestSeqNumber () const +{ + return m_destSeqNumber; +} +Mac48Address +DestinationAddressUnit::GetDestinationAddress () const +{ + return m_destinationAddress; +} +/******************************** + * IePreq + *******************************/ +IePreq::~IePreq () +{ +} +IePreq::IePreq () : + m_maxSize (32), m_flags (0), m_hopCount (0), m_ttl (0), m_preqId (0), m_originatorAddress ( + Mac48Address::GetBroadcast ()), m_originatorSeqNumber (0), m_lifetime (0), m_metric (0), + m_destCount (0) +{ +} +WifiElementId +IePreq::ElementId () const +{ + return IE11S_PREQ; +} +void +IePreq::SetUnicastPreq () +{ + m_flags |= 1 << 1; +} + +void +IePreq::SetNeedNotPrep () +{ + m_flags |= 1 << 2; +} +void +IePreq::SetHopcount (uint8_t hopcount) +{ + m_hopCount = hopcount; +} +void +IePreq::SetTTL (uint8_t ttl) +{ + m_ttl = ttl; +} +void +IePreq::SetPreqID (uint32_t preq_id) +{ + m_preqId = preq_id; +} +void +IePreq::SetMetric (uint32_t metric) +{ + m_metric = metric; +} +void +IePreq::SetOriginatorAddress (Mac48Address originator_address) +{ + m_originatorAddress = originator_address; +} +void +IePreq::SetOriginatorSeqNumber (uint32_t originator_seq_number) +{ + m_originatorSeqNumber = originator_seq_number; +} +void +IePreq::SetLifetime (uint32_t lifetime) +{ + m_lifetime = lifetime; +} +void +IePreq::SetDestCount (uint8_t dest_count) +{ + m_destCount = dest_count; +} +bool +IePreq::IsUnicastPreq () const +{ + return (m_flags & (1 << 1)); +} +bool +IePreq::IsNeedNotPrep () const +{ + return (m_flags & (1 << 2)); +} +uint8_t +IePreq::GetHopCount () const +{ + return m_hopCount; +} +uint8_t +IePreq::GetTtl () const +{ + return m_ttl; +} +uint32_t +IePreq::GetPreqID () const +{ + return m_preqId; +} +uint32_t +IePreq::GetMetric () const +{ + return m_metric; +} +Mac48Address +IePreq::GetOriginatorAddress () const +{ + return m_originatorAddress; +} +uint32_t +IePreq::GetOriginatorSeqNumber () const +{ + return m_originatorSeqNumber; +} +uint32_t +IePreq::GetLifetime () const +{ + return m_lifetime; +} + +uint8_t +IePreq::GetDestCount () const +{ + return m_destCount; +} +void +IePreq::DecrementTtl () +{ + m_ttl--; + m_hopCount++; +} +void +IePreq::IncrementMetric (uint32_t metric) +{ + m_metric += metric; +} +void +IePreq::SerializeInformation (Buffer::Iterator i) const +{ + i.WriteU8 (m_flags); + i.WriteU8 (m_hopCount); + i.WriteU8 (m_ttl); + i.WriteHtolsbU32 (m_preqId); + WriteTo (i, m_originatorAddress); + i.WriteHtolsbU32 (m_originatorSeqNumber); + i.WriteHtolsbU32 (m_lifetime); + i.WriteHtolsbU32 (m_metric); + i.WriteU8 (m_destCount); + int written = 0; + for (std::vector >::const_iterator j = m_destinations.begin (); j + != m_destinations.end (); j++) + { + uint8_t flags = 0; + if ((*j)->IsDo ()) + { + flags |= 1 << 0; + } + if ((*j)->IsRf ()) + { + flags |= 1 << 1; + } + if ((*j)->IsUsn ()) + { + flags |= 1 << 2; + } + i.WriteU8 (flags); + WriteTo (i, (*j)->GetDestinationAddress ()); + i.WriteHtolsbU32 ((*j)->GetDestSeqNumber ()); + written++; + if (written > m_maxSize) + { + break; + } + } +} +uint8_t +IePreq::DeserializeInformation (Buffer::Iterator start, uint8_t length) +{ + Buffer::Iterator i = start; + m_flags = i.ReadU8 (); + m_hopCount = i.ReadU8 (); + m_ttl = i.ReadU8 (); + m_preqId = i.ReadLsbtohU32 (); + ReadFrom (i, m_originatorAddress); + m_originatorSeqNumber = i.ReadLsbtohU32 (); + m_lifetime = i.ReadLsbtohU32 (); + m_metric = i.ReadLsbtohU32 (); + m_destCount = i.ReadU8 (); + for (int j = 0; j < m_destCount; j++) + { + Ptr new_element = Create (); + bool doFlag = false; + bool rfFlag = false; + bool usnFlag = false; + uint8_t flags = i.ReadU8 (); + if (flags & (1 << 0)) + { + doFlag = true; + } + if (flags & (1 << 1)) + { + rfFlag = true; + } + if (flags & (1 << 2)) + { + usnFlag = true; + } + new_element->SetFlags (doFlag, rfFlag, usnFlag); + Mac48Address addr; + ReadFrom (i, addr); + new_element->SetDestinationAddress (addr); + new_element->SetDestSeqNumber (i.ReadLsbtohU32 ()); + m_destinations.push_back (new_element); + NS_ASSERT (28 + j * 11 < length); + } + return i.GetDistanceFrom (start); +} +uint8_t +IePreq::GetInformationSize () const +{ + uint8_t retval = 1 //Flags + + 1 //Hopcount + + 1 //TTL + + 4 //PREQ ID + + 6 //Source address (originator) + + 4 //Originator seqno + + 4 //Lifetime + + 4 //metric + + 1; //destination count + if (m_destCount > m_maxSize) + { + retval += (m_maxSize * 11); + } + else + { + retval += (m_destCount * 11); + } + return retval; +} +void +IePreq::Print (std::ostream &os) const +{ + os << std::endl << "" << std::endl; + os << " originator address = " << m_originatorAddress << "std::endl"; + os << " TTL = " << (uint16_t) m_ttl << "std::endl"; + os << " hop count = " << (uint16_t) m_hopCount << "std::endl"; + os << " metric = " << m_metric << "std::endl"; + os << " seqno = " << m_originatorSeqNumber << "std::endl"; + os << " lifetime = " << m_lifetime << "std::endl"; + os << " preq ID = " << m_preqId << "std::endl"; + os << " Destinations are:std::endl"; + for (int j = 0; j < m_destCount; j++) + { + os << " " << m_destinations[j]->GetDestinationAddress () << "std::endl"; + } + os << "" << std::endl; +} +std::vector > +IePreq::GetDestinationList () +{ + return m_destinations; +} +void +IePreq::AddDestinationAddressElement (bool doFlag, bool rfFlag, Mac48Address dest_address, + uint32_t dest_seq_number) +{ + for (std::vector >::const_iterator i = m_destinations.begin (); i + != m_destinations.end (); i++) + { + if ((*i)->GetDestinationAddress () == dest_address) + { + return; + } + } + //TODO: check overflow + Ptr new_element = Create (); + new_element->SetFlags (doFlag, rfFlag, (dest_seq_number == 0)); + new_element->SetDestinationAddress (dest_address); + new_element->SetDestSeqNumber (dest_seq_number); + m_destinations.push_back (new_element); + m_destCount++; +} +void +IePreq::DelDestinationAddressElement (Mac48Address dest_address) +{ + for (std::vector >::iterator i = m_destinations.begin (); i + != m_destinations.end (); i++) + { + if ((*i)->GetDestinationAddress () == dest_address) + { + m_destinations.erase (i); + m_destCount--; + break; + } + } +} +void +IePreq::ClearDestinationAddressElements () +{ + int i; + for (std::vector >::iterator j = m_destinations.begin (); j + != m_destinations.end (); j++) + { + (*j) = 0; + } + for (i = 0; i < m_destCount; i++) + { + m_destinations.pop_back (); + } + m_destinations.clear (); + m_destCount = 0; +} +bool +operator== (const DestinationAddressUnit & a, const DestinationAddressUnit & b) +{ + return (a.m_do == b.m_do && a.m_rf == b.m_rf && a.m_usn == b.m_usn && a.m_destinationAddress + == b.m_destinationAddress && a.m_destSeqNumber == b.m_destSeqNumber); +} +bool +operator== (const IePreq & a, const IePreq & b) +{ + bool ok = (a.m_flags == b.m_flags && a.m_hopCount == b.m_hopCount && a.m_ttl == b.m_ttl && a.m_preqId + == b.m_preqId && a.m_originatorAddress == b.m_originatorAddress && a.m_originatorSeqNumber + == b.m_originatorSeqNumber && a.m_lifetime == b.m_lifetime && a.m_metric == b.m_metric && a.m_destCount + == b.m_destCount); + + if (!ok) + { + return false; + } + if (a.m_destinations.size () != b.m_destinations.size ()) + { + return false; + } + for (size_t i = 0; i < a.m_destinations.size (); ++i) + { + if (!(*(PeekPointer (a.m_destinations[i])) == *(PeekPointer (b.m_destinations[i])))) + { + return false; + } + } + return true; +} +bool +IePreq::MayAddAddress (Mac48Address originator) +{ + if (m_originatorAddress != originator) + { + return false; + } + if (m_destinations[0]->GetDestinationAddress () == Mac48Address::GetBroadcast ()) + { + return false; + } + if ((GetInformationSize () + 11) > 255) + { + return false; + } + return true; +} +bool +IePreq::IsFull () const +{ + return ((GetInformationSize () + 11) > 255); +} +std::ostream & +operator << (std::ostream &os, const IePreq &a) +{ + a.Print (os); + return os; +} +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/ie-dot11s-preq.h b/src/devices/mesh/dot11s/ie-dot11s-preq.h new file mode 100644 index 000000000..8471f6673 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-preq.h @@ -0,0 +1,160 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef WIFI_PREQ_INFORMATION_ELEMENT_H +#define WIFI_PREQ_INFORMATION_ELEMENT_H + +#include + +#include "ns3/mac48-address.h" +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * \brief Describes an address unit in PREQ information element + * See 7.3.2.96 for more details + */ +class DestinationAddressUnit : public RefCountBase +{ +public: + DestinationAddressUnit (); + void SetFlags (bool doFlag, bool rfFlag, bool usnFlag); + void SetDestinationAddress (Mac48Address dest_address); + void SetDestSeqNumber (uint32_t dest_seq_number); + bool IsDo (); + bool IsRf (); + bool IsUsn (); + Mac48Address GetDestinationAddress () const; + uint32_t GetDestSeqNumber () const; +private: + bool m_do; + bool m_rf; + bool m_usn; + Mac48Address m_destinationAddress; + uint32_t m_destSeqNumber; + + friend bool operator== (const DestinationAddressUnit & a, const DestinationAddressUnit & b); +}; +/** + * \ingroup dot11s + * \brief See 7.3.2.96 of 802.11s draft 2.07 + */ +class IePreq : public WifiInformationElement +{ +public: + IePreq (); + ~IePreq (); + /** + * Add a destination address unit: flags, destination and sequence + * number + */ + void AddDestinationAddressElement ( + bool doFlag, + bool rfFlag, + Mac48Address dest_address, + uint32_t dest_seq_number + ); + /// Delete a destination address unit by destination + void DelDestinationAddressElement (Mac48Address dest_address); + /// Clear PREQ: remove all destinations + void ClearDestinationAddressElements (); + /// Get all destinations, which are stored in PREQ: + std::vector > GetDestinationList (); + /// SetProper flags which indicate that PREQ is unicast + void SetUnicastPreq (); + /* + * \brief In proactive case: need we send PREP + */ + void SetNeedNotPrep (); + ///\name Setters for fields: + ///\{ + void SetHopcount (uint8_t hopcount); + void SetTTL (uint8_t ttl); + void SetPreqID (uint32_t id); + void SetOriginatorAddress (Mac48Address originator_address); + void SetOriginatorSeqNumber (uint32_t originator_seq_number); + void SetLifetime (uint32_t lifetime); + void SetMetric (uint32_t metric); + void SetDestCount (uint8_t dest_count); + ///\} + ///\name Getters for fields: + ///\{ + bool IsUnicastPreq () const; + bool IsNeedNotPrep () const; + uint8_t GetHopCount () const; + uint8_t GetTtl ()const ; + uint32_t GetPreqID () const; + Mac48Address GetOriginatorAddress () const; + uint32_t GetOriginatorSeqNumber () const; + uint32_t GetLifetime () const; + uint32_t GetMetric () const; + uint8_t GetDestCount () const; + ///\} + /// Handle TTL and Metric: + void DecrementTtl (); + void IncrementMetric (uint32_t metric); + /* + * \brief Checks that preq's originator address equals to originator, and + * this preq is not proactive + */ + bool MayAddAddress (Mac48Address originator); + bool IsFull () const; + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); + virtual uint8_t GetInformationSize () const; + virtual void Print (std::ostream& os) const; + ///\} +private: + /** + * how many destinations we support + */ + uint8_t m_maxSize; //TODO: make as an attrubute + /** + * Fields of information element: + */ + uint8_t m_flags; + uint8_t m_hopCount; + uint8_t m_ttl; + uint32_t m_preqId; + Mac48Address m_originatorAddress; + uint32_t m_originatorSeqNumber; + uint32_t m_lifetime; + uint32_t m_metric; + uint8_t m_destCount; + std::vector > m_destinations; + + friend bool operator== (const IePreq & a, const IePreq & b); +}; + +bool operator== (const DestinationAddressUnit & a, const DestinationAddressUnit & b); +bool operator== (const IePreq & a, const IePreq & b); +std::ostream &operator << (std::ostream &os, const IePreq &preq); + +} // namespace dot11s +} //namespace ns3 +#endif + diff --git a/src/devices/mesh/dot11s/ie-dot11s-rann.cc b/src/devices/mesh/dot11s/ie-dot11s-rann.cc new file mode 100644 index 000000000..8b5ad2887 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-rann.cc @@ -0,0 +1,180 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ie-dot11s-rann.h" +#include "ns3/assert.h" +#include "ns3/address-utils.h" +#include "ns3/packet.h" + +namespace ns3 { +namespace dot11s { + +IeRann::~IeRann () +{ +} +IeRann::IeRann () : + m_flags (0), m_hopcount (0), m_ttl (0), m_originatorAddress (Mac48Address::GetBroadcast ()), + m_destSeqNumber (0), m_metric (0) +{ +} +WifiElementId +IeRann::ElementId () const +{ + return IE11S_RANN; +} + +void +IeRann::SetFlags (uint8_t flags) +{ + m_flags = flags; +} +void +IeRann::SetHopcount (uint8_t hopcount) +{ + m_hopcount = hopcount; +} +void +IeRann::SetTTL (uint8_t ttl) +{ + m_ttl = ttl; +} +void +IeRann::SetDestSeqNumber (uint32_t dest_seq_number) +{ + m_destSeqNumber = dest_seq_number; +} +void +IeRann::SetMetric (uint32_t metric) +{ + m_metric = metric; +} +void +IeRann::SetOriginatorAddress (Mac48Address originator_address) +{ + m_originatorAddress = originator_address; +} + +uint8_t +IeRann::GetFlags () +{ + return m_flags; +} +uint8_t +IeRann::GetHopcount () +{ + return m_hopcount; +} +uint8_t +IeRann::GetTtl () +{ + return m_ttl; +} +uint32_t +IeRann::GetDestSeqNumber () +{ + return m_destSeqNumber; +} +uint32_t +IeRann::GetMetric () +{ + return m_metric; +} +void +IeRann::DecrementTtl () +{ + m_ttl--; + m_hopcount++; +} + +void +IeRann::IncrementMetric (uint32_t m) +{ + m_metric += m; +} + +Mac48Address +IeRann::GetOriginatorAddress () +{ + return m_originatorAddress; +} +void +IeRann::SerializeInformation (Buffer::Iterator i) const +{ + i.WriteU8 (m_flags); + i.WriteU8 (m_hopcount); + i.WriteU8 (m_ttl); + WriteTo (i, m_originatorAddress); + i.WriteHtolsbU32 (m_destSeqNumber); + i.WriteHtolsbU32 (m_metric); +} +uint8_t +IeRann::DeserializeInformation (Buffer::Iterator start, uint8_t length) +{ + Buffer::Iterator i = start; + m_flags = i.ReadU8 (); + m_hopcount = i.ReadU8 (); + m_ttl = i.ReadU8 (); + ReadFrom (i, m_originatorAddress); + m_destSeqNumber = i.ReadLsbtohU32 (); + m_metric = i.ReadLsbtohU32 (); + return i.GetDistanceFrom (start); +} +uint8_t +IeRann::GetInformationSize () const +{ + uint8_t retval = 1 //Flags + + 1 //Hopcount + + 1 //TTL + + 6 //OriginatorAddress + + 4 //DestSeqNumber + + 4;//Metric + return retval; +} + +void +IeRann::Print (std::ostream &os) const +{ + os << std::endl << "" << std::endl; + os << " flags = " << (int) m_flags << "std::endl"; + os << " hop count = " << (int) m_hopcount << "std::endl"; + os << " TTL = " << (int) m_ttl << "std::endl"; + os << " originator address = " << m_originatorAddress << "std::endl"; + os << " dst seq. number = " << m_destSeqNumber << "std::endl"; + os << " metric = " << m_metric << "std::endl"; + os << "" << std::endl; +} + +bool +operator== (const IeRann & a, const IeRann & b) +{ + return (a.m_flags == b.m_flags && a.m_hopcount == b.m_hopcount && a.m_ttl == b.m_ttl + && a.m_originatorAddress == b.m_originatorAddress && a.m_destSeqNumber == b.m_destSeqNumber + && a.m_metric == b.m_metric); +} +std::ostream & +operator << (std::ostream &os, const IeRann &a) +{ + a.Print (os); + return os; +} +} +} // namespace ns3::dot11s + + diff --git a/src/devices/mesh/dot11s/ie-dot11s-rann.h b/src/devices/mesh/dot11s/ie-dot11s-rann.h new file mode 100644 index 000000000..4fa7c1f49 --- /dev/null +++ b/src/devices/mesh/dot11s/ie-dot11s-rann.h @@ -0,0 +1,78 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef RANN_INFORMATION_ELEMENT_H +#define RANN_INFORMATION_ELEMENT_H + +#include "ns3/mac48-address.h" +#include "ns3/wifi-information-element-vector.h" + +namespace ns3 { +namespace dot11s { +/** + * \ingroup dot11s + * \brief See 7.3.2.95 of 802.11s draft 2.07 + */ +class IeRann : public WifiInformationElement +{ +public: + IeRann (); + virtual ~IeRann (); + void SetFlags (uint8_t flags); + void SetHopcount (uint8_t hopcount); + void SetTTL (uint8_t ttl); + void SetOriginatorAddress (Mac48Address originator_address); + void SetDestSeqNumber (uint32_t dest_seq_number); + void SetMetric (uint32_t metric); + uint8_t GetFlags (); + uint8_t GetHopcount (); + uint8_t GetTtl (); + Mac48Address GetOriginatorAddress (); + uint32_t GetDestSeqNumber (); + uint32_t GetMetric (); + void DecrementTtl (); + void IncrementMetric (uint32_t metric); + /** + * \name Inherited from WifiInformationElement + * \{ + */ + virtual WifiElementId ElementId () const; + virtual void SerializeInformation (Buffer::Iterator i) const; + virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length); + virtual uint8_t GetInformationSize () const; + virtual void Print (std::ostream &os) const; + ///\} +private: + uint8_t m_flags; + uint8_t m_hopcount; + uint8_t m_ttl; + Mac48Address m_originatorAddress; + uint32_t m_destSeqNumber; + uint32_t m_metric; + + friend bool operator== (const IeRann & a, const IeRann & b); +}; + +bool operator== (const IeRann & a, const IeRann & b); +std::ostream &operator << (std::ostream &os, const IeRann &rann); +} // namespace dot11s +} //namespace ns3 + +#endif diff --git a/src/devices/mesh/dot11s/peer-link-frame.cc b/src/devices/mesh/dot11s/peer-link-frame.cc new file mode 100644 index 000000000..aa39a8da9 --- /dev/null +++ b/src/devices/mesh/dot11s/peer-link-frame.cc @@ -0,0 +1,311 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#include "peer-link-frame.h" +#include "ie-dot11s-peer-management.h" +#include "ns3/mesh-wifi-interface-mac.h" +#include "ns3/test.h" +#include "ns3/packet.h" + +namespace ns3 { +namespace dot11s { +NS_OBJECT_ENSURE_REGISTERED (PeerLinkFrameStart); + +PeerLinkFrameStart::PeerLinkFrameStart () : + m_subtype (255), m_capability (0), m_aid (0), m_rates (SupportedRates ()), m_meshId (), + m_config (IeConfiguration ()), m_reasonCode ((uint16_t) REASON11S_RESERVED) +{ +} +void +PeerLinkFrameStart::SetPlinkFrameSubtype (uint8_t subtype) +{ + m_subtype = subtype; +} +void +PeerLinkFrameStart::SetPlinkFrameStart (PeerLinkFrameStart::PlinkFrameStartFields fields) +{ + m_subtype = fields.subtype; + m_protocol = fields.protocol; + if (m_subtype != (uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE)) + { + m_capability = fields.capability; + } + if (m_subtype == (uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM)) + { + m_aid = fields.aid; + } + if (m_subtype != (uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE)) + { + m_rates = fields.rates; + } + if (m_subtype != (uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM)) + { + m_meshId = fields.meshId; + } + if (m_subtype != (uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE)) + { + m_config = fields.config; + } + else + { + m_reasonCode = fields.reasonCode; + } +} +PeerLinkFrameStart::PlinkFrameStartFields +PeerLinkFrameStart::GetFields () +{ + PlinkFrameStartFields retval; + //TODO: protocol version: + retval.subtype = m_subtype; + retval.capability = m_capability; + retval.aid = m_aid; + retval.rates = m_rates; + retval.meshId = m_meshId; + retval.config = m_config; + retval.reasonCode = m_reasonCode; + return retval; +} +TypeId +PeerLinkFrameStart::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::dot11s::PeerLinkFrameStart") .SetParent
    () .AddConstructor< + PeerLinkFrameStart> (); + return tid; +} +TypeId +PeerLinkFrameStart::GetInstanceTypeId () const +{ + return GetTypeId (); +} +void +PeerLinkFrameStart::Print (std::ostream &os) const +{ + os << "subtype = " << (uint16_t) m_subtype << std::endl << "capability = " << m_capability << std::endl << "laid = " + << (uint16_t) m_aid << std::endl << "rates = " << m_rates << std::endl << "meshId = "; + m_meshId.Print (os); + os << std::endl << "configuration = "; + m_config.Print (os); + os << std::endl << "reason code = " << m_reasonCode; +} +uint32_t +PeerLinkFrameStart::GetSerializedSize () const +{ + uint32_t size = 3; //Peering protocol + NS_ASSERT (m_subtype < 3); + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + size += 2; //capability + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM) == m_subtype) + { + size += 2; //AID of remote peer + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + size += m_rates.GetSerializedSize (); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM) != m_subtype) + { + size += m_meshId.GetInformationSize () + 2; + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + size += m_config.GetInformationSize () + 2; + } + else + { + size += 2; //reasonCode + } + return size; +} +void +PeerLinkFrameStart::Serialize (Buffer::Iterator start) const +{ + Buffer::Iterator i = start; + NS_ASSERT (m_subtype < 3); + i.WriteU8 (IE11S_MESH_PEERING_PROTOCOL_VERSION); + i.WriteU8 (m_protocol.GetInformationSize ()); + m_protocol.SerializeInformation (i); + i.Next (m_protocol.GetInformationSize ()); + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + i.WriteHtolsbU16 (m_capability); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM) == m_subtype) + { + i.WriteHtolsbU16 (m_aid); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + i = m_rates.Serialize (i); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM) != m_subtype) + { + i.WriteU8 (IE11S_MESH_ID); + i.WriteU8 (m_meshId.GetInformationSize ()); + m_meshId.SerializeInformation (i); + i.Next (m_meshId.GetInformationSize ()); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + i.WriteU8 (IE11S_MESH_CONFIGURATION); + i.WriteU8 (m_config.GetInformationSize ()); + m_config.SerializeInformation (i); + i.Next (m_config.GetInformationSize ()); + } + else + { + i.WriteHtolsbU16 (m_reasonCode); + } +} +uint32_t +PeerLinkFrameStart::Deserialize (Buffer::Iterator start) +{ + Buffer::Iterator i = start; + NS_ASSERT (m_subtype < 3); + { + uint8_t id = i.ReadU8 (); + uint8_t length = i.ReadU8 (); + m_protocol.DeserializeInformation (i, length); + if ((m_protocol.ElementId () != (WifiElementId) id) || (m_protocol.GetInformationSize () != length)) + { + NS_FATAL_ERROR ("Broken frame: Element ID does not match IE itself!"); + } + i.Next (m_protocol.GetInformationSize ()); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + m_capability = i.ReadLsbtohU16 (); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM) == m_subtype) + { + m_aid = i.ReadLsbtohU16 (); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + i = m_rates.Deserialize (i); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM) != m_subtype) + { + uint8_t id = i.ReadU8 (); + uint8_t length = i.ReadU8 (); + m_meshId.DeserializeInformation (i, length); + if ((m_meshId.ElementId () != (WifiElementId) id) || (m_meshId.GetInformationSize () != length)) + { + NS_FATAL_ERROR ("Broken frame: Element ID does not match IE itself!"); + } + i.Next (m_meshId.GetInformationSize ()); + } + if ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE) != m_subtype) + { + uint8_t id = i.ReadU8 (); + uint8_t length = i.ReadU8 (); + m_config. DeserializeInformation (i, length); + if ((m_config.ElementId () != (WifiElementId) id) || (m_config.GetInformationSize () != length)) + { + NS_FATAL_ERROR ("Broken frame: Element ID does not match IE itself!"); + } + i.Next (m_config.GetInformationSize ()); + } + else + { + m_reasonCode = i.ReadLsbtohU16 (); + } + return i.GetDistanceFrom (start); +} +bool +operator== (const PeerLinkFrameStart & a, const PeerLinkFrameStart & b) +{ + return ((a.m_subtype == b.m_subtype) && (a.m_capability == b.m_capability) && (a.m_aid == b.m_aid) + && (a.m_meshId.IsEqual (b.m_meshId)) && (a.m_config == b.m_config) + && (a.m_reasonCode == b.m_reasonCode)); +} +#ifdef RUN_SELF_TESTS +/// Built-in self test for PeerLinkFrameStart +struct PeerLinkFrameStartBist : public Test +{ + PeerLinkFrameStartBist () : + Test ("Mesh/802.11s/PeerLinkFrameStart") + { + } + virtual bool + RunTests (); +}; +/// Test instance +static PeerLinkFrameStartBist g_PeerLinkFrameStartBist; + +bool +PeerLinkFrameStartBist::RunTests () +{ + bool result (true); + { + PeerLinkFrameStart a; + PeerLinkFrameStart::PlinkFrameStartFields fields; + fields.subtype = (uint8_t) (WifiMeshActionHeader::PEER_LINK_OPEN); + fields.capability = 0; + fields.aid = 101; + fields.reasonCode = 12; + fields.meshId = IeMeshId ("qwertyuiop"); + a.SetPlinkFrameStart (fields); + Ptr packet = Create (); + packet->AddHeader (a); + PeerLinkFrameStart b; + b.SetPlinkFrameSubtype ((uint8_t) (WifiMeshActionHeader::PEER_LINK_OPEN)); + packet->RemoveHeader (b); + NS_TEST_ASSERT_EQUAL (a, b); + } + { + PeerLinkFrameStart a; + PeerLinkFrameStart::PlinkFrameStartFields fields; + fields.subtype = (uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM); + fields.capability = 0; + fields.aid = 1234; + fields.reasonCode = 12; + fields.meshId = IeMeshId ("qwerty"); + a.SetPlinkFrameStart (fields); + Ptr packet = Create (); + packet->AddHeader (a); + PeerLinkFrameStart b; + b.SetPlinkFrameSubtype ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CONFIRM)); + packet->RemoveHeader (b); + NS_TEST_ASSERT_EQUAL (a, b); + } + { + PeerLinkFrameStart a; + PeerLinkFrameStart::PlinkFrameStartFields fields; + fields.subtype = (uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE); + fields.capability = 0; + fields.aid = 10; + fields.meshId = IeMeshId ("qqq"); + fields.reasonCode = 12; + a.SetPlinkFrameStart (fields); + Ptr packet = Create (); + packet->AddHeader (a); + PeerLinkFrameStart b; + b.SetPlinkFrameSubtype ((uint8_t) (WifiMeshActionHeader::PEER_LINK_CLOSE)); + packet->RemoveHeader (b); + NS_TEST_ASSERT_EQUAL (a, b); + } + return result; +} +#endif +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/peer-link-frame.h b/src/devices/mesh/dot11s/peer-link-frame.h new file mode 100644 index 000000000..20a24c93b --- /dev/null +++ b/src/devices/mesh/dot11s/peer-link-frame.h @@ -0,0 +1,97 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#ifndef PEER_LINK_FRAME_START_H +#define PEER_LINK_FRAME_START_H +#include "ns3/header.h" +#include "ns3/supported-rates.h" +#include "dot11s-mac-header.h" +#include "ie-dot11s-configuration.h" +#include "ie-dot11s-peering-protocol.h" +#include "ie-dot11s-id.h" +namespace ns3 +{ +class MeshWifiInterfaceMac; +namespace dot11s +{ +/** + * \ingroup dot11s + * + * \brief 802.11s Peer link management frame: + * \details included the following (see chapters 7.4.12.1-7.4.12.3 of + * 802.11s): + * - Subtype field + * - Association ID field + * - Supported rates + * - Mesh ID of mesh + */ +class PeerLinkFrameStart : public Header +{ +public: + PeerLinkFrameStart (); + ///\brief fields: + struct PlinkFrameStartFields + { + uint8_t subtype; + IePeeringProtocol protocol; //Peering protocol version - in all subtypes - 3 octets + uint16_t capability; //open and confirm + uint16_t aid; //confirm only + SupportedRates rates; //open and confirm + IeMeshId meshId; //open and close + IeConfiguration config; //open and confirm + uint16_t reasonCode; //close only + }; + ///\attention: must be set before deserialize, before only multihop + //action header knows about subtype + void SetPlinkFrameSubtype (uint8_t subtype); + void SetPlinkFrameStart (PlinkFrameStartFields); + PlinkFrameStartFields GetFields (); + /** \name Inherited from header: + * \{ + */ + static TypeId GetTypeId (); + virtual TypeId GetInstanceTypeId () const; + virtual void Print (std::ostream &os) const; + virtual uint32_t GetSerializedSize () const; + virtual void Serialize (Buffer::Iterator start) const; + virtual uint32_t Deserialize (Buffer::Iterator start); + /** + * \} + */ +private: + uint8_t m_subtype; + IePeeringProtocol m_protocol; + uint16_t m_capability; + uint16_t m_aid; + SupportedRates m_rates; + IeMeshId m_meshId; + IeConfiguration m_config; + uint16_t m_reasonCode; + + friend bool operator== (const PeerLinkFrameStart & a, const PeerLinkFrameStart & b); + + PeerLinkFrameStart& operator= (const PeerLinkFrameStart &); + PeerLinkFrameStart (const PeerLinkFrameStart &); + +}; +bool operator== (const PeerLinkFrameStart & a, const PeerLinkFrameStart & b); +} //namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/peer-link.cc b/src/devices/mesh/dot11s/peer-link.cc new file mode 100644 index 000000000..825685397 --- /dev/null +++ b/src/devices/mesh/dot11s/peer-link.cc @@ -0,0 +1,696 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + * Pavel Boyko + */ + +#include "peer-management-protocol-mac.h" +#include "ns3/peer-link.h" +#include "ns3/log.h" +#include "ns3/simulator.h" +#include "ns3/traced-value.h" + +NS_LOG_COMPONENT_DEFINE ("Dot11sPeerManagementProtocol"); + +namespace ns3 { +namespace dot11s { + +NS_OBJECT_ENSURE_REGISTERED( PeerLink); + +TypeId +PeerLink::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::dot11s::PeerLink") + .SetParent () + .AddConstructor () + .AddAttribute ( "RetryTimeout", + "Retry timeout", + TimeValue (TimeValue (MicroSeconds (40 * 1024))), + MakeTimeAccessor ( + &PeerLink::m_dot11MeshRetryTimeout), + MakeTimeChecker () + ) + .AddAttribute ( "HoldingTimeout", + "Holding timeout", + TimeValue (TimeValue (MicroSeconds (40 * 1024))), + MakeTimeAccessor ( + &PeerLink::m_dot11MeshHoldingTimeout), + MakeTimeChecker () + ) + .AddAttribute ( "ConfirmTimeout", + "Confirm timeout", + TimeValue (TimeValue (MicroSeconds (40 * 1024))), + MakeTimeAccessor ( + &PeerLink::m_dot11MeshConfirmTimeout), + MakeTimeChecker () + ) + .AddAttribute ( "MaxRetries", + "Maximum number of retries", + UintegerValue (4), + MakeUintegerAccessor ( + &PeerLink::m_dot11MeshMaxRetries), + MakeUintegerChecker () + ) + .AddAttribute ( "MaxBeaconLoss", + "Maximum number of lost beacons before link will be closed", + UintegerValue (2), + MakeUintegerAccessor ( + &PeerLink::m_maxBeaconLoss), + MakeUintegerChecker (1) + ) + .AddAttribute ( "MaxPacketFailure", + "Maximum number of failed packets before link will be closed", + UintegerValue (2), + MakeUintegerAccessor ( + &PeerLink::m_maxPacketFail), + MakeUintegerChecker (1) + ) + ; + return tid; +} + + +//----------------------------------------------------------------------------- +// PeerLink public interface +//----------------------------------------------------------------------------- +PeerLink::PeerLink () : + m_peerAddress (Mac48Address::GetBroadcast ()), + m_peerMeshPointAddress (Mac48Address::GetBroadcast ()), + m_localLinkId (0), + m_peerLinkId (0), + m_packetFail (0), + m_state (IDLE), + m_retryCounter (0), + m_maxPacketFail (3) +{ +} +PeerLink::~PeerLink () +{ +} +void +PeerLink::DoDispose () +{ + m_retryTimer.Cancel (); + m_holdingTimer.Cancel (); + m_confirmTimer.Cancel (); + m_beaconLossTimer.Cancel (); + m_beaconTiming.ClearTimingElement (); +} +void +PeerLink::SetPeerAddress (Mac48Address macaddr) +{ + m_peerAddress = macaddr; +} +void +PeerLink::SetPeerMeshPointAddress (Mac48Address macaddr) +{ + m_peerMeshPointAddress = macaddr; +} +void +PeerLink::SetInterface (uint32_t interface) +{ + m_interface = interface; +} +void +PeerLink::SetLocalLinkId (uint16_t id) +{ + m_localLinkId = id; +} +void +PeerLink::SetLocalAid (uint16_t aid) +{ + m_assocId = aid; +} +void +PeerLink::SetBeaconInformation (Time lastBeacon, Time beaconInterval) +{ + m_lastBeacon = lastBeacon; + m_beaconInterval = beaconInterval; + m_beaconLossTimer.Cancel (); + Time delay = Seconds (beaconInterval.GetSeconds () * m_maxBeaconLoss); + NS_ASSERT (delay.GetMicroSeconds () != 0); + m_beaconLossTimer = Simulator::Schedule (delay, &PeerLink::BeaconLoss, this); +} +void +PeerLink::MLMESetSignalStatusCallback (PeerLink::SignalStatusCallback cb) +{ + m_linkStatusCallback = cb; +} +void +PeerLink::BeaconLoss () +{ + StateMachine (CNCL); +} +void +PeerLink::TransmissionSuccess () +{ + m_packetFail = 0; +} +void +PeerLink::TransmissionFailure () +{ + m_packetFail ++; + if (m_packetFail == m_maxPacketFail) + { + StateMachine (CNCL); + m_packetFail = 0; + } +} + +void +PeerLink::SetBeaconTimingElement (IeBeaconTiming beaconTiming) +{ + m_beaconTiming = beaconTiming; +} +Mac48Address +PeerLink::GetPeerAddress () const +{ + return m_peerAddress; +} +uint16_t +PeerLink::GetLocalAid () const +{ + return m_assocId; +} +Time +PeerLink::GetLastBeacon () const +{ + return m_lastBeacon; +} +Time +PeerLink::GetBeaconInterval () const +{ + return m_beaconInterval; +} +IeBeaconTiming +PeerLink::GetBeaconTimingElement () const +{ + return m_beaconTiming; +} +void +PeerLink::MLMECancelPeerLink (PmpReasonCode reason) +{ + StateMachine (CNCL, reason); +} +void +PeerLink::MLMEActivePeerLinkOpen () +{ + StateMachine (ACTOPN); +} +void +PeerLink::MLMEPeeringRequestReject () +{ + StateMachine (REQ_RJCT, REASON11S_PEERING_CANCELLED); +} +void +PeerLink::Close (uint16_t localLinkId, uint16_t peerLinkId, PmpReasonCode reason) +{ + if (peerLinkId != 0 && m_localLinkId != peerLinkId) + { + return; + } + if (m_peerLinkId == 0) + { + m_peerLinkId = localLinkId; + } + else + { + if (m_peerLinkId != localLinkId) + { + return; + } + } + StateMachine (CLS_ACPT, reason); +} +void +PeerLink::OpenAccept (uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp) +{ + m_peerLinkId = localLinkId; + m_configuration = conf; + if (m_peerMeshPointAddress != Mac48Address::GetBroadcast ()) + { + NS_ASSERT (m_peerMeshPointAddress == peerMp); + } + else + { + m_peerMeshPointAddress = peerMp; + } + StateMachine (OPN_ACPT); +} +void +PeerLink::OpenReject (uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason) +{ + if (m_peerLinkId == 0) + { + m_peerLinkId = localLinkId; + } + m_configuration = conf; + if (m_peerMeshPointAddress != Mac48Address::GetBroadcast ()) + { + NS_ASSERT (m_peerMeshPointAddress == peerMp); + } + else + { + m_peerMeshPointAddress = peerMp; + } + StateMachine (OPN_RJCT, reason); +} +void +PeerLink::ConfirmAccept (uint16_t localLinkId, uint16_t peerLinkId, uint16_t peerAid, IeConfiguration conf, + Mac48Address peerMp) +{ + if (m_localLinkId != peerLinkId) + { + return; + } + if (m_peerLinkId == 0) + { + m_peerLinkId = localLinkId; + } + else + { + if (m_peerLinkId != localLinkId) + { + return; + } + } + m_configuration = conf; + m_peerAssocId = peerAid; + if (m_peerMeshPointAddress != Mac48Address::GetBroadcast ()) + { + NS_ASSERT (m_peerMeshPointAddress == peerMp); + } + else + { + m_peerMeshPointAddress = peerMp; + } + StateMachine (CNF_ACPT); +} +void +PeerLink::ConfirmReject (uint16_t localLinkId, uint16_t peerLinkId, IeConfiguration conf, + Mac48Address peerMp, PmpReasonCode reason) +{ + if (m_localLinkId != peerLinkId) + { + return; + } + if (m_peerLinkId == 0) + { + m_peerLinkId = localLinkId; + } + else + { + if (m_peerLinkId != localLinkId) + { + return; + } + } + m_configuration = conf; + if (m_peerMeshPointAddress != Mac48Address::GetBroadcast ()) + { + NS_ASSERT (m_peerMeshPointAddress == peerMp); + } + m_peerMeshPointAddress = peerMp; + StateMachine (CNF_RJCT, reason); +} +bool +PeerLink::LinkIsEstab () const +{ + return (m_state == ESTAB); +} +bool +PeerLink::LinkIsIdle () const +{ + return (m_state == IDLE); +} +void +PeerLink::SetMacPlugin (Ptr plugin) +{ + m_macPlugin = plugin; +} +//----------------------------------------------------------------------------- +// Private +//----------------------------------------------------------------------------- +void +PeerLink::StateMachine (PeerEvent event, PmpReasonCode reasoncode) +{ + switch (m_state) + { + case IDLE: + switch (event) + { + case CNCL: + case CLS_ACPT: + m_state = IDLE; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, IDLE, IDLE); + break; + case REQ_RJCT: + SendPeerLinkClose (reasoncode); + break; + case ACTOPN: + m_state = OPN_SNT; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, IDLE, OPN_SNT); + SendPeerLinkOpen (); + SetRetryTimer (); + break; + case OPN_ACPT: + m_state = OPN_RCVD; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, IDLE, OPN_RCVD); + SendPeerLinkConfirm (); + SendPeerLinkOpen (); + SetRetryTimer (); + break; + default: + //11B.5.3.4 of 802.11s Draft D3.0 + //All other events shall be ignored in this state + break; + } + break; + case OPN_SNT: + switch (event) + { + case TOR1: + SendPeerLinkOpen (); + m_retryCounter++; + SetRetryTimer (); + break; + case CNF_ACPT: + m_state = CNF_RCVD; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_SNT, CNF_RCVD); + ClearRetryTimer (); + SetConfirmTimer (); + break; + case OPN_ACPT: + m_state = OPN_RCVD; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_SNT, OPN_RCVD); + SendPeerLinkConfirm (); + break; + case CLS_ACPT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_SNT, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (REASON11S_MESH_CLOSE_RCVD); + SetHoldingTimer (); + break; + case OPN_RJCT: + case CNF_RJCT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_SNT, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (reasoncode); + SetHoldingTimer (); + break; + case TOR2: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_SNT, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (REASON11S_MESH_MAX_RETRIES); + SetHoldingTimer (); + break; + case CNCL: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_SNT, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (REASON11S_PEERING_CANCELLED); + SetHoldingTimer (); + break; + default: + //11B.5.3.5 of 802.11s Draft D3.0 + //All other events shall be ignored in this state + break; + } + break; + case CNF_RCVD: + switch (event) + { + case CNF_ACPT: + break; + case OPN_ACPT: + m_state = ESTAB; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, CNF_RCVD, ESTAB); + ClearConfirmTimer (); + SendPeerLinkConfirm (); + NS_ASSERT (m_peerMeshPointAddress != Mac48Address::GetBroadcast ()); + break; + case CLS_ACPT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, CNF_RCVD, HOLDING); + ClearConfirmTimer (); + SendPeerLinkClose (REASON11S_MESH_CLOSE_RCVD); + SetHoldingTimer (); + break; + case CNF_RJCT: + case OPN_RJCT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, CNF_RCVD, HOLDING); + ClearConfirmTimer (); + SendPeerLinkClose (reasoncode); + SetHoldingTimer (); + break; + case CNCL: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, CNF_RCVD, HOLDING); + ClearConfirmTimer (); + SendPeerLinkClose (REASON11S_PEERING_CANCELLED); + SetHoldingTimer (); + break; + case TOC: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, CNF_RCVD, HOLDING); + SendPeerLinkClose (REASON11S_MESH_CONFIRM_TIMEOUT); + SetHoldingTimer (); + break; + default: + //11B.5.3.6 of 802.11s Draft D3.0 + //All other events shall be ignored in this state + break; + } + break; + case OPN_RCVD: + switch (event) + { + case TOR1: + SendPeerLinkOpen (); + m_retryCounter++; + SetRetryTimer (); + break; + case CNF_ACPT: + m_state = ESTAB; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_RCVD, ESTAB); + ClearRetryTimer (); + NS_ASSERT (m_peerMeshPointAddress != Mac48Address::GetBroadcast ()); + break; + case CLS_ACPT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_RCVD, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (REASON11S_MESH_CLOSE_RCVD); + SetHoldingTimer (); + break; + case OPN_RJCT: + case CNF_RJCT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_RCVD, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (reasoncode); + SetHoldingTimer (); + break; + case TOR2: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_RCVD, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (REASON11S_MESH_MAX_RETRIES); + SetHoldingTimer (); + break; + case CNCL: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, OPN_RCVD, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (REASON11S_PEERING_CANCELLED); + SetHoldingTimer (); + break; + default: + //11B.5.3.7 of 802.11s Draft D3.0 + //All other events shall be ignored in this state + break; + } + break; + case ESTAB: + switch (event) + { + case OPN_ACPT: + SendPeerLinkConfirm (); + break; + case CLS_ACPT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, ESTAB, HOLDING); + SendPeerLinkClose (REASON11S_MESH_CLOSE_RCVD); + SetHoldingTimer (); + break; + case OPN_RJCT: + case CNF_RJCT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, ESTAB, HOLDING); + ClearRetryTimer (); + SendPeerLinkClose (reasoncode); + SetHoldingTimer (); + break; + case CNCL: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, ESTAB, HOLDING); + SendPeerLinkClose (REASON11S_PEERING_CANCELLED); + SetHoldingTimer (); + break; + default: + //11B.5.3.8 of 802.11s Draft D3.0 + //All other events shall be ignored in this state + break; + } + break; + case HOLDING: + switch (event) + { + case CLS_ACPT: + ClearHoldingTimer (); + case TOH: + m_state = IDLE; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, HOLDING, IDLE); + break; + case OPN_ACPT: + case CNF_ACPT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, HOLDING, HOLDING); + // reason not spec in D2.0 + SendPeerLinkClose (REASON11S_PEERING_CANCELLED); + break; + case OPN_RJCT: + case CNF_RJCT: + m_state = HOLDING; + m_linkStatusCallback (m_interface, m_peerAddress, m_peerMeshPointAddress, HOLDING, HOLDING); + SendPeerLinkClose (reasoncode); + break; + default: + //11B.5.3.9 of 802.11s Draft D3.0 + //All other events shall be ignored in this state + break; + } + break; + } +} +void +PeerLink::ClearRetryTimer () +{ + m_retryTimer.Cancel (); +} +void +PeerLink::ClearConfirmTimer () +{ + m_confirmTimer.Cancel (); +} +void +PeerLink::ClearHoldingTimer () +{ + m_holdingTimer.Cancel (); +} +void +PeerLink::SendPeerLinkClose (PmpReasonCode reasoncode) +{ + IePeerManagement peerElement; + peerElement.SetPeerClose (m_localLinkId, m_peerLinkId, reasoncode); + m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_peerMeshPointAddress, m_assocId, peerElement, + m_configuration); +} +void +PeerLink::SendPeerLinkOpen () +{ + IePeerManagement peerElement; + peerElement.SetPeerOpen (m_localLinkId); + NS_ASSERT (m_macPlugin != 0); + m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_peerMeshPointAddress, m_assocId, peerElement, + m_configuration); +} +void +PeerLink::SendPeerLinkConfirm () +{ + IePeerManagement peerElement; + peerElement.SetPeerConfirm (m_localLinkId, m_peerLinkId); + m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_peerMeshPointAddress, m_assocId, peerElement, + m_configuration); +} +void +PeerLink::SetHoldingTimer () +{ + NS_ASSERT (m_dot11MeshHoldingTimeout.GetMicroSeconds () != 0); + m_holdingTimer = Simulator::Schedule (m_dot11MeshHoldingTimeout, &PeerLink::HoldingTimeout, this); +} +void +PeerLink::HoldingTimeout () +{ + StateMachine (TOH); +} +void +PeerLink::SetRetryTimer () +{ + NS_ASSERT (m_dot11MeshRetryTimeout.GetMicroSeconds () != 0); + m_retryTimer = Simulator::Schedule (m_dot11MeshRetryTimeout, &PeerLink::RetryTimeout, this); +} +void +PeerLink::RetryTimeout () +{ + if (m_retryCounter < m_dot11MeshMaxRetries) + { + StateMachine (TOR1); + } + else + { + StateMachine (TOR2); + } +} +void +PeerLink::SetConfirmTimer () +{ + NS_ASSERT (m_dot11MeshConfirmTimeout.GetMicroSeconds () != 0); + m_confirmTimer = Simulator::Schedule (m_dot11MeshConfirmTimeout, &PeerLink::ConfirmTimeout, this); +} +void +PeerLink::ConfirmTimeout () +{ + StateMachine (TOC); +} +void +PeerLink::Report (std::ostream & os) const +{ + if (m_state != ESTAB) + { + return; + } + os << "GetAddress () << "\"" << std::endl << + "peerInterfaceAddress=\"" << m_peerAddress << "\"" << std::endl << + "peerMeshPointAddress=\"" << m_peerMeshPointAddress << "\"" << std::endl << + "metric=\"" << m_macPlugin->GetLinkMetric (m_peerAddress) << "\"" << std::endl << + "lastBeacon=\"" << m_lastBeacon.GetSeconds () << "\"" << std::endl << + "localLinkId=\"" << m_localLinkId << "\"" << std::endl << + "peerLinkId=\"" << m_peerLinkId << "\"" << std::endl << + "assocId=\"" << m_assocId << "\"" << std::endl << + "/>" << std::endl; +} +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/peer-link.h b/src/devices/mesh/dot11s/peer-link.h new file mode 100644 index 000000000..6db10c5ab --- /dev/null +++ b/src/devices/mesh/dot11s/peer-link.h @@ -0,0 +1,263 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + */ + +#ifndef PEERLLINK_H_ +#define PEERLLINK_H_ + +#include "ns3/nstime.h" +#include "ns3/object.h" +#include "ns3/callback.h" +#include "ns3/mac48-address.h" +#include "ns3/event-id.h" +#include "ns3/ie-dot11s-beacon-timing.h" +#include "ns3/ie-dot11s-peer-management.h" +#include "ns3/ie-dot11s-configuration.h" +namespace ns3 { +namespace dot11s { +class PeerManagementProtocolMac; +/** + * \ingroup dot11s + * + * \brief Peer link model for 802.11s Peer Management protocol + */ +class PeerLink : public Object +{ +public: + friend class PeerManagementProtocol; + /// Support object system + static TypeId GetTypeId (); + /// C-tor create empty link + PeerLink (); + ~PeerLink (); + void DoDispose (); + /// Peer Link state: + enum PeerState { + IDLE, + OPN_SNT, + CNF_RCVD, + OPN_RCVD, + ESTAB, + HOLDING, + }; + /// Process beacon received from peer + void SetBeaconInformation (Time lastBeacon, Time BeaconInterval); + /** + * \brief Method used to detect peer link changes + * + * \param cb is a callback, which notifyes, that on interface (uint32_t), peer link + * with address (Mac48Address) was opened (bool is true) or closed (bool is false) + */ + void SetLinkStatusCallback (Callback cb); + /** + * \name Peer link getters/setters + * \{ + */ + void SetPeerAddress (Mac48Address macaddr); + void SetPeerMeshPointAddress (Mac48Address macaddr); + void SetInterface (uint32_t interface); + void SetLocalLinkId (uint16_t id); + //void SetPeerLinkId (uint16_t id); + void SetLocalAid (uint16_t aid); + //void SetPeerAid (uint16_t aid); + void SetBeaconTimingElement (IeBeaconTiming beaconTiming); + //void SetPeerLinkDescriptorElement (IePeerManagement peerLinkElement); + Mac48Address GetPeerAddress () const; + uint16_t GetLocalAid () const; + Time GetLastBeacon () const; + Time GetBeaconInterval () const; + IeBeaconTiming GetBeaconTimingElement ()const; + //IePeerManagement GetPeerLinkDescriptorElement ()const; + //\} + + /** + * \name MLME + * \{ + */ + /// MLME-CancelPeerLink.request + void MLMECancelPeerLink (PmpReasonCode reason); + /// MLME-ActivePeerLinkOpen.request + void MLMEActivePeerLinkOpen (); + /// MLME-PeeringRequestReject + void MLMEPeeringRequestReject (); + /// Callback type for MLME-SignalPeerLinkStatus event + typedef Callback SignalStatusCallback; + /// Set callback + void MLMESetSignalStatusCallback (SignalStatusCallback); + /// Reports about transmission success/failure + void TransmissionSuccess (); + void TransmissionFailure (); + //\} + ///\brief Statistics + void Report (std::ostream & os) const; +private: + /// Peer link events, see 802.11s draft 11B.3.3.2 + enum PeerEvent + { + CNCL, ///< Cancel peer link + ACTOPN, ///< Active peer link open + CLS_ACPT, ///< PeerLinkClose_Accept + OPN_ACPT, ///< PeerLinkOpen_Accept + OPN_RJCT, ///< PeerLinkOpen_Reject + REQ_RJCT, ///< PeerLinkOpenReject by internal reason + CNF_ACPT, ///< PeerLinkConfirm_Accept + CNF_RJCT, ///< PeerLinkConfirm_Reject + TOR1, ///< Timeout of retry timer + TOR2, ///< also timeout of retry timer + TOC, ///< Timeout of confirm timer + TOH, ///< Timeout of holding (gracefull closing) timer + }; + /// State transition + void StateMachine (PeerEvent event, PmpReasonCode = REASON11S_RESERVED); + /** + * \name Link response to received management frames + * + * \attention In all this methods {local/peer}LinkID correspond to _peer_ station, as written in + * received frame, e.g. I am peerLinkID and peer link is localLinkID . + * + * \{ + */ + /// Close link + void Close (uint16_t localLinkID, uint16_t peerLinkID, PmpReasonCode reason); + /// Accept open link + void OpenAccept (uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp); + /// Reject open link + void OpenReject (uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason); + /// Confirm accept + void ConfirmAccept ( + uint16_t localLinkId, + uint16_t peerLinkId, + uint16_t peerAid, + IeConfiguration conf, + Mac48Address peerMp + ); + /// Confirm reject + void ConfirmReject ( + uint16_t localLinkId, + uint16_t peerLinkId, + IeConfiguration conf, + Mac48Address peerMp, + PmpReasonCode reason + ); + //\} + /// True if link is established + bool LinkIsEstab () const; + /// True if link is idle. Link can be deleted in this state + bool LinkIsIdle () const; + /** + * Set pointer to MAC-plugin, which is responsible for sending peer + * link management frames + */ + void SetMacPlugin (Ptr plugin); + /** + * \name Event handlers + * \{ + */ + void ClearRetryTimer (); + void ClearConfirmTimer (); + void ClearHoldingTimer (); + void SetHoldingTimer (); + void SetRetryTimer (); + void SetConfirmTimer (); + //\} + + /** + * \name Work with management frames + * \{ + */ + void SendPeerLinkClose (PmpReasonCode reasoncode); + void SendPeerLinkOpen (); + void SendPeerLinkConfirm (); + //\} + + /** + * \name Timeout handlers + * \{ + */ + void HoldingTimeout (); + void RetryTimeout (); + void ConfirmTimeout (); + //\} + /// Several successive beacons were lost, close link + void BeaconLoss (); +private: + + PeerLink& operator= (const PeerLink &); + PeerLink (const PeerLink &); + + ///The number of interface I am associated with + uint32_t m_interface; + /// pointer to MAC plugin, which is responsible for peer management + Ptr m_macPlugin; + /// Peer address + Mac48Address m_peerAddress; + /// Mesh point address, equal to peer address in case of single + //interface mesh point + Mac48Address m_peerMeshPointAddress; + /// My ID of this link + uint16_t m_localLinkId; + /// Peer ID of this link + uint16_t m_peerLinkId; + /// My association ID + uint16_t m_assocId; + /// Assoc Id assigned to me by peer + uint16_t m_peerAssocId; + + /// When last beacon was received + Time m_lastBeacon; + /// Current beacon interval on corresponding interface + Time m_beaconInterval; + /// How many successive packets were failed to transmit + uint16_t m_packetFail; + + /// Current state + PeerState m_state; + /** + * \brief Mesh interface configuration + * \attention Is not used now, nothing to configure :) + */ + IeConfiguration m_configuration; + /// Beacon timing element received from the peer. Needed by BCA + IeBeaconTiming m_beaconTiming; + + /** + * \name Timers & counters used for internal state transitions + * \{ + */ + uint16_t m_dot11MeshMaxRetries; + Time m_dot11MeshRetryTimeout; + Time m_dot11MeshHoldingTimeout; + Time m_dot11MeshConfirmTimeout; + + EventId m_retryTimer; + EventId m_holdingTimer; + EventId m_confirmTimer; + uint16_t m_retryCounter; + EventId m_beaconLossTimer; + uint16_t m_maxBeaconLoss; + uint16_t m_maxPacketFail; + //\} + /// How to report my status change + SignalStatusCallback m_linkStatusCallback; +}; + +} // namespace dot11s +} //namespace ns3 +#endif /* PEERLLINK_H_ */ diff --git a/src/devices/mesh/dot11s/peer-management-protocol-mac.cc b/src/devices/mesh/dot11s/peer-management-protocol-mac.cc new file mode 100644 index 000000000..f1277aab8 --- /dev/null +++ b/src/devices/mesh/dot11s/peer-management-protocol-mac.cc @@ -0,0 +1,332 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "ie-dot11s-configuration.h" +#include "ie-dot11s-peer-management.h" +#include "dot11s-mac-header.h" +#include "peer-management-protocol-mac.h" +#include "peer-management-protocol.h" +#include "peer-link-frame.h" +#include "ns3/mesh-wifi-interface-mac.h" +#include "ns3/simulator.h" +#include "ns3/wifi-mac-header.h" +#include "ns3/wifi-information-element-vector.h" +#include "ns3/log.h" +namespace ns3 { +namespace dot11s { +PeerManagementProtocolMac::PeerManagementProtocolMac (uint32_t interface, + Ptr protocol) +{ + m_ifIndex = interface; + m_protocol = protocol; +} + +PeerManagementProtocolMac::~PeerManagementProtocolMac () +{ +} + +void +PeerManagementProtocolMac::SetParent (Ptr parent) +{ + m_parent = parent; + m_parent->TraceConnectWithoutContext ("TxErrHeader", MakeCallback (&PeerManagementProtocolMac::TxError, this)); + m_parent->TraceConnectWithoutContext ("TxOkHeader", MakeCallback (&PeerManagementProtocolMac::TxOk, this)); +} +void +PeerManagementProtocolMac::TxError (WifiMacHeader const &hdr) +{ + m_protocol->TransmissionFailure (m_ifIndex, hdr.GetAddr1 ()); +} +void +PeerManagementProtocolMac::TxOk (WifiMacHeader const &hdr) +{ + m_protocol->TransmissionSuccess (m_ifIndex, hdr.GetAddr1 ()); +} +bool +PeerManagementProtocolMac::Receive (Ptr const_packet, const WifiMacHeader & header) +{ + // First of all we copy a packet, because we need to remove some + //headers + Ptr packet = const_packet->Copy (); + if (header.IsBeacon ()) + { + MgtBeaconHeader beacon_hdr; + packet->RemoveHeader (beacon_hdr); + //meshId.FindFirst (myBeacon); + bool meshBeacon = false; + WifiInformationElementVector elements; + packet->RemoveHeader(elements); + Ptr beaconTiming = DynamicCast (elements.FindFirst (IE11S_BEACON_TIMING)); + Ptr meshId = DynamicCast (elements.FindFirst (IE11S_MESH_ID)); + + if ((beaconTiming != 0) && (meshId != 0)) + { + if (m_protocol->GetMeshId ()->IsEqual (*meshId)) + { + meshBeacon = true; + } + } + m_protocol->UpdatePeerBeaconTiming (m_ifIndex, meshBeacon, *beaconTiming, header.GetAddr2 (), + Simulator::Now (), MicroSeconds (beacon_hdr.GetBeaconIntervalUs ())); + // Beacon shall not be dropeed. May be needed to another plugins + return true; + } + if (header.IsAction ()) + { + WifiMeshActionHeader actionHdr; + packet->RemoveHeader (actionHdr); + WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction (); + // If can not handle - just return; + if (actionHdr.GetCategory () != WifiMeshActionHeader::MESH_PEERING_MGT) + { + return m_protocol->IsActiveLink (m_ifIndex, header.GetAddr2 ()); + } + m_stats.rxMgt++; + m_stats.rxMgtBytes += packet->GetSize (); + Mac48Address peerAddress = header.GetAddr2 (); + Mac48Address peerMpAddress = header.GetAddr3 (); + PeerLinkFrameStart::PlinkFrameStartFields fields; + { + PeerLinkFrameStart peerFrame; + peerFrame.SetPlinkFrameSubtype ((uint8_t) actionValue.peerLink); + packet->RemoveHeader (peerFrame); + fields = peerFrame.GetFields (); + NS_ASSERT (fields.subtype == actionValue.peerLink); + } + if ((actionValue.peerLink != WifiMeshActionHeader::PEER_LINK_CLOSE) && !(m_parent->CheckSupportedRates ( + fields.rates))) + { + m_protocol->ConfigurationMismatch (m_ifIndex, peerAddress); + // Broken peer link frame - drop it + m_stats.brokenMgt++; + return false; + } + if ((actionValue.peerLink != WifiMeshActionHeader::PEER_LINK_CONFIRM) && !fields.meshId.IsEqual ( + *(m_protocol->GetMeshId ()))) + { + m_protocol->ConfigurationMismatch (m_ifIndex, peerAddress); + // Broken peer link frame - drop it + m_stats.brokenMgt++; + return false; + } + Ptr peerElement; + //Peer Management element is the last element in this frame - so, we can use WifiInformationElementVector + WifiInformationElementVector elements; + packet->RemoveHeader (elements); + peerElement = DynamicCast(elements.FindFirst(IE11S_PEERING_MANAGEMENT)); + NS_ASSERT (peerElement != 0); + //Check taht frame subtype corresponds peer link subtype + if (peerElement->SubtypeIsOpen ()) + { + m_stats.rxOpen++; + NS_ASSERT (actionValue.peerLink == WifiMeshActionHeader::PEER_LINK_OPEN); + } + if (peerElement->SubtypeIsConfirm ()) + { + m_stats.rxConfirm++; + NS_ASSERT (actionValue.peerLink == WifiMeshActionHeader::PEER_LINK_CONFIRM); + } + if (peerElement->SubtypeIsClose ()) + { + m_stats.rxClose++; + NS_ASSERT (actionValue.peerLink == WifiMeshActionHeader::PEER_LINK_CLOSE); + } + //Deliver Peer link management frame to protocol: + m_protocol->ReceivePeerLinkFrame (m_ifIndex, peerAddress, peerMpAddress, fields.aid, *peerElement, + fields.config); + // if we can handle a frame - drop it + return false; + } + return m_protocol->IsActiveLink (m_ifIndex, header.GetAddr2 ()); +} +bool +PeerManagementProtocolMac::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, + Mac48Address from, Mac48Address to) +{ + if (header.IsAction ()) + { + WifiMeshActionHeader actionHdr; + packet->PeekHeader (actionHdr); + WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction (); + if (actionHdr.GetCategory () == WifiMeshActionHeader::MESH_PEERING_MGT) + { + return true; + } + } + if (header.GetAddr1 ().IsGroup ()) + { + return true; + } + else + { + if (m_protocol->IsActiveLink (m_ifIndex, header.GetAddr1 ())) + { + return true; + } + else + { + m_stats.dropped++; + return false; + } + } +} +void +PeerManagementProtocolMac::UpdateBeacon (MeshWifiBeacon & beacon) const +{ + Ptr beaconTiming = m_protocol->GetBeaconTimingElement (m_ifIndex); + beacon.AddInformationElement (beaconTiming); + beacon.AddInformationElement (m_protocol->GetMeshId ()); +} + +void +PeerManagementProtocolMac::SendPeerLinkManagementFrame (Mac48Address peerAddress, Mac48Address peerMpAddress, + uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig) +{ + //Create a packet: + meshConfig.SetNeighborCount (m_protocol->GetNumberOfLinks ()); + Ptr packet = Create (); + WifiInformationElementVector elements; + elements.AddInformationElement(Ptr (&peerElement)); + packet->AddHeader (elements); + PeerLinkFrameStart::PlinkFrameStartFields fields; + fields.rates = m_parent->GetSupportedRates (); + fields.capability = 0; + fields.meshId = *(m_protocol->GetMeshId ()); + fields.config = meshConfig; + PeerLinkFrameStart plinkFrame; + //Create an 802.11 frame header: + //Send management frame to MAC: + WifiMeshActionHeader actionHdr; + if (peerElement.SubtypeIsOpen ()) + { + m_stats.txOpen++; + WifiMeshActionHeader::ActionValue action; + action.peerLink = WifiMeshActionHeader::PEER_LINK_OPEN; + fields.subtype = WifiMeshActionHeader::PEER_LINK_OPEN; + actionHdr.SetAction (WifiMeshActionHeader::MESH_PEERING_MGT, action); + } + if (peerElement.SubtypeIsConfirm ()) + { + m_stats.txConfirm++; + WifiMeshActionHeader::ActionValue action; + action.peerLink = WifiMeshActionHeader::PEER_LINK_CONFIRM; + fields.aid = aid; + fields.subtype = WifiMeshActionHeader::PEER_LINK_CONFIRM; + actionHdr.SetAction (WifiMeshActionHeader::MESH_PEERING_MGT, action); + } + if (peerElement.SubtypeIsClose ()) + { + m_stats.txClose++; + WifiMeshActionHeader::ActionValue action; + action.peerLink = WifiMeshActionHeader::PEER_LINK_CLOSE; + fields.subtype = WifiMeshActionHeader::PEER_LINK_CLOSE; + fields.reasonCode = peerElement.GetReasonCode (); + actionHdr.SetAction (WifiMeshActionHeader::MESH_PEERING_MGT, action); + } + plinkFrame.SetPlinkFrameStart (fields); + packet->AddHeader (plinkFrame); + packet->AddHeader (actionHdr); + m_stats.txMgt++; + m_stats.txMgtBytes += packet->GetSize (); + // Wifi Mac header: + WifiMacHeader hdr; + hdr.SetAction (); + hdr.SetAddr1 (peerAddress); + hdr.SetAddr2 (m_parent->GetAddress ()); + //Addr is not used here, we use it as our MP address + hdr.SetAddr3 (m_protocol->GetAddress ()); + hdr.SetDsNotFrom (); + hdr.SetDsNotTo (); + m_parent->SendManagementFrame (packet, hdr); +} + +Mac48Address +PeerManagementProtocolMac::GetAddress () const +{ + if (m_parent != 0) + { + return m_parent->GetAddress (); + } + else + { + return Mac48Address::Mac48Address (); + } +} +std::pair +PeerManagementProtocolMac::GetBeaconInfo () const +{ + std::pair retval; + retval.first = m_parent->GetTbtt (); + retval.second = m_parent->GetBeaconInterval (); + return retval; +} +void +PeerManagementProtocolMac::SetBeaconShift (Time shift) +{ + if (shift != Seconds (0)) + { + m_stats.beaconShift++; + } + m_parent->ShiftTbtt (shift); +} +PeerManagementProtocolMac::Statistics::Statistics () : + txOpen (0), txConfirm (0), txClose (0), rxOpen (0), rxConfirm (0), rxClose (0), dropped (0), brokenMgt (0), + txMgt (0), txMgtBytes (0), rxMgt (0), rxMgtBytes (0), beaconShift (0) +{ +} +void +PeerManagementProtocolMac::Statistics::Print (std::ostream & os) const +{ + os << "" << std::endl; +} +void +PeerManagementProtocolMac::Report (std::ostream & os) const +{ + os << "GetAddress () << "\">" << std::endl; + m_stats.Print (os); + os << "" << std::endl; +} +void +PeerManagementProtocolMac::ResetStats () +{ + m_stats = Statistics::Statistics (); +} +uint32_t +PeerManagementProtocolMac::GetLinkMetric (Mac48Address peerAddress) +{ + return m_parent->GetLinkMetric (peerAddress); +} +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/peer-management-protocol-mac.h b/src/devices/mesh/dot11s/peer-management-protocol-mac.h new file mode 100644 index 000000000..46c727019 --- /dev/null +++ b/src/devices/mesh/dot11s/peer-management-protocol-mac.h @@ -0,0 +1,142 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef PEER_MANAGER_MAC_PLUGIN_H_ +#define PEER_MANAGER_MAC_PLUGIN_H_ + +#include "ns3/mesh-wifi-interface-mac-plugin.h" + +namespace ns3 { +class MeshWifiInterfaceMac; +namespace dot11s { +class PeerManagementProtocol; +class IeConfiguration; +class IePeerManagement; +class PeerManagementProtocol; +/** + * \ingroup dot11s + * + * \brief This is plugin to Mesh WiFi MAC, which implements + * interface to dot11s peer management protocol: it takes proper + * frames from MAC-layer, extracts peer link management information + * element and mesh configuration element and passes it to main part + * of protocol + */ +class PeerManagementProtocolMac : public MeshWifiInterfaceMacPlugin +{ +public: + PeerManagementProtocolMac (uint32_t interface, Ptr protocol); + ~PeerManagementProtocolMac (); + ///\name Inherited from plugin abstract class + ///\{ + void SetParent (Ptr parent); + bool Receive (Ptr packet, const WifiMacHeader & header); + bool UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to); + void UpdateBeacon (MeshWifiBeacon & beacon) const; + ///\} + ///\name Statistics: + ///\{ + void Report (std::ostream &) const; + void ResetStats (); + uint32_t GetLinkMetric (Mac48Address peerAddress); + ///\} +private: + PeerManagementProtocolMac& operator= (const PeerManagementProtocolMac &); + PeerManagementProtocolMac (const PeerManagementProtocolMac &); + + friend class PeerManagementProtocol; + friend class PeerLink; + ///\name Create peer link management frames: + ///\{ + struct PlinkFrameStart + { + uint8_t subtype; + uint16_t aid; + SupportedRates rates; + uint16_t qos; + }; + Ptr CreatePeerLinkOpenFrame (); + Ptr CreatePeerLinkConfirmFrame (); + Ptr CreatePeerLinkCloseFrame (); + /** + * \brief This structure keeps all fields in peer link management frame, + * which are not subclasses of WifiInformationElement + */ + /// \name Parses the start of the frame, where there are no + /// WifiInformationElements exist + PlinkFrameStart ParsePlinkFrame (Ptr packet); + ///\} + ///// Closes link when a proper number of successive transmissions have failed + void TxError (WifiMacHeader const &hdr); + void TxOk (WifiMacHeader const &hdr); + ///\name BCA functionallity: + ///\{ + ///\brief Fills TBTT and beacon interval. Needed by BCA + ///functionallity + ///\param first in retval is TBTT + ///\param second in retval is beacon interval + std::pair GetBeaconInfo () const; + void SetBeaconShift (Time shift); + ///\} + void SetPeerManagerProtcol (Ptr protocol); + void SendPeerLinkManagementFrame ( + Mac48Address peerAddress, + Mac48Address peerMpAddress, + uint16_t aid, + IePeerManagement peerElement, + IeConfiguration meshConfig + ); + ///\brief DUBUG only - to print established links + Mac48Address GetAddress () const; + ///\name Statistics + struct Statistics + { + uint16_t txOpen; + uint16_t txConfirm; + uint16_t txClose; + uint16_t rxOpen; + uint16_t rxConfirm; + uint16_t rxClose; + uint16_t dropped; + uint16_t brokenMgt; + uint16_t txMgt; + uint32_t txMgtBytes; + uint16_t rxMgt; + uint32_t rxMgtBytes; + uint16_t beaconShift; + + Statistics (); + void Print (std::ostream & os) const; + }; +private: + struct Statistics m_stats; + ///\} + ///\name Information about MAC and protocol: + ///\{ + Ptr m_parent; + uint32_t m_ifIndex; + Ptr m_protocol; + ///\} +}; + +} // namespace dot11s +} //namespace ns3 +#endif + diff --git a/src/devices/mesh/dot11s/peer-management-protocol.cc b/src/devices/mesh/dot11s/peer-management-protocol.cc new file mode 100644 index 000000000..cff61506a --- /dev/null +++ b/src/devices/mesh/dot11s/peer-management-protocol.cc @@ -0,0 +1,576 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + */ + +#include "ns3/peer-management-protocol.h" +#include "peer-management-protocol-mac.h" +#include "ie-dot11s-configuration.h" +#include "ie-dot11s-id.h" +#include "ns3/mesh-point-device.h" +#include "ns3/simulator.h" +#include "ns3/assert.h" +#include "ns3/log.h" +#include "ns3/random-variable.h" +#include "ns3/mesh-wifi-interface-mac.h" +#include "ns3/mesh-wifi-interface-mac-plugin.h" +#include "ns3/wifi-net-device.h" + +NS_LOG_COMPONENT_DEFINE ("PeerManagementProtocol"); +namespace ns3 { +namespace dot11s { +/*************************************************** + * PeerManager + ***************************************************/ +NS_OBJECT_ENSURE_REGISTERED (PeerManagementProtocol); + +TypeId +PeerManagementProtocol::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::dot11s::PeerManagementProtocol") + .SetParent () + .AddConstructor () + // maximum number of peer links. Now we calculate the total + // number of peer links on all interfaces + .AddAttribute ( "MaxNumberOfPeerLinks", + "Maximum number of peer links", + UintegerValue (32), + MakeUintegerAccessor ( + &PeerManagementProtocol::m_maxNumberOfPeerLinks), + MakeUintegerChecker () + ) + .AddAttribute ( "MaxBeaconLossForBeaconTiming", + "If maximum number of beacons were lost, station will not included in beacon timing element", + UintegerValue (3), + MakeUintegerAccessor ( + &PeerManagementProtocol::m_maxBeaconLostForBeaconTiming), + MakeUintegerChecker () + ) + ; + return tid; +} +PeerManagementProtocol::PeerManagementProtocol () : + m_lastAssocId (0), m_lastLocalLinkId (1), m_maxBeaconLostForBeaconTiming (3) +{ +} +PeerManagementProtocol::~PeerManagementProtocol () +{ +} +void +PeerManagementProtocol::DoDispose () +{ + //cancel cleanup event and go through the map of peer links, + //deleting each + for (PeerLinksMap::iterator j = m_peerLinks.begin (); j != m_peerLinks.end (); j++) + { + for (PeerLinksOnInterface::iterator i = j->second.begin (); i != j->second.end (); i++) + { + (*i) = 0; + } + j->second.clear (); + } + m_peerLinks.clear (); + //cleaning beacon structures: + for (BeaconInfoMap::iterator i = m_neighbourBeacons.begin (); i != m_neighbourBeacons.end (); i++) + { + i->second.clear (); + } + m_neighbourBeacons.clear (); +} + +bool +PeerManagementProtocol::Install (Ptr mp) +{ + std::vector > interfaces = mp->GetInterfaces (); + for (std::vector >::iterator i = interfaces.begin (); i != interfaces.end (); i++) + { + Ptr wifiNetDev = (*i)->GetObject (); + if (wifiNetDev == 0) + { + return false; + } + Ptr mac = wifiNetDev->GetMac ()->GetObject (); + if (mac == 0) + { + return false; + } + Ptr plugin = Create ((*i)->GetIfIndex (), this); + mac->InstallPlugin (plugin); + m_plugins[(*i)->GetIfIndex ()] = plugin; + PeerLinksOnInterface newmap; + m_peerLinks[(*i)->GetIfIndex ()] = newmap; + } + // Mesh point aggregates all installed protocols + m_address = Mac48Address::ConvertFrom (mp->GetAddress ()); + mp->AggregateObject (this); + return true; +} + +Ptr +PeerManagementProtocol::GetBeaconTimingElement (uint32_t interface) +{ + Ptr retval = Create (); + BeaconInfoMap::iterator i = m_neighbourBeacons.find (interface); + if (i == m_neighbourBeacons.end ()) + { + return retval; + } + bool cleaned = false; + while (!cleaned) + { + BeaconsOnInterface::iterator start = i->second.begin (); + for (BeaconsOnInterface::iterator j = start; j != i->second.end (); j++) + { + //check beacon loss and make a timing element + //if last beacon was m_maxBeaconLostForBeaconTiming beacons ago - we do not put it to the + //timing element + if ((j->second.referenceTbtt + j->second.beaconInterval * Scalar (m_maxBeaconLostForBeaconTiming)) + < Simulator::Now ()) + { + start = j; + i->second.erase (j); + break; + } + } + cleaned = true; + } + for (BeaconsOnInterface::const_iterator j = i->second.begin (); j != i->second.end (); j++) + { + retval->AddNeighboursTimingElementUnit (j->second.aid, j->second.referenceTbtt, + j->second.beaconInterval); + } + return retval; +} + +void +PeerManagementProtocol::FillBeaconInfo (uint32_t interface, Mac48Address peerAddress, Time receivingTime, + Time beaconInterval) +{ + BeaconInfoMap::iterator i = m_neighbourBeacons.find (interface); + if (i == m_neighbourBeacons.end ()) + { + BeaconsOnInterface newMap; + m_neighbourBeacons[interface] = newMap; + } + i = m_neighbourBeacons.find (interface); + BeaconsOnInterface::iterator j = i->second.find (peerAddress); + if (j == i->second.end ()) + { + BeaconInfo newInfo; + newInfo.referenceTbtt = receivingTime; + newInfo.beaconInterval = beaconInterval; + newInfo.aid = m_lastAssocId++; + if (m_lastAssocId == 0xff) + { + m_lastAssocId = 0; + } + i->second[peerAddress] = newInfo; + } + else + { + j->second.referenceTbtt = receivingTime; + j->second.beaconInterval = beaconInterval; + } +} + +void +PeerManagementProtocol::UpdatePeerBeaconTiming (uint32_t interface, bool meshBeacon, + IeBeaconTiming timingElement, Mac48Address peerAddress, Time receivingTime, Time beaconInterval) +{ + FillBeaconInfo (interface, peerAddress, receivingTime, beaconInterval); + if (!meshBeacon) + { + return; + } + //BCA: + PeerManagementProtocolMacMap::iterator plugin = m_plugins.find (interface); + NS_ASSERT (plugin != m_plugins.end ()); + Time shift = GetNextBeaconShift (interface); + if (TimeToTu (shift) != 0) + { + plugin->second->SetBeaconShift (shift); + } + //PM STATE Machine + //Check that a given beacon is not from our interface + for (PeerManagementProtocolMacMap::const_iterator i = m_plugins.begin (); i != m_plugins.end (); i++) + { + if (i->second->GetAddress () == peerAddress) + { + return; + } + } + Ptr peerLink = FindPeerLink (interface, peerAddress); + if (peerLink != 0) + { + peerLink->SetBeaconTimingElement (timingElement); + peerLink->SetBeaconInformation (receivingTime, beaconInterval); + } + else + { + if (ShouldSendOpen (interface, peerAddress)) + { + peerLink = InitiateLink (interface, peerAddress, Mac48Address::GetBroadcast (), receivingTime, + beaconInterval); + peerLink->SetBeaconTimingElement (timingElement); + peerLink->MLMEActivePeerLinkOpen (); + } + } +} + +void +PeerManagementProtocol::ReceivePeerLinkFrame (uint32_t interface, Mac48Address peerAddress, + Mac48Address peerMeshPointAddress, uint16_t aid, IePeerManagement peerManagementElement, + IeConfiguration meshConfig) +{ + Ptr peerLink = FindPeerLink (interface, peerAddress); + if (peerManagementElement.SubtypeIsOpen ()) + { + PmpReasonCode reasonCode (REASON11S_RESERVED); + bool reject = !(ShouldAcceptOpen (interface, peerAddress, reasonCode)); + if (peerLink == 0) + { + peerLink = InitiateLink (interface, peerAddress, peerMeshPointAddress, Simulator::Now (), Seconds ( + 1.0)); + } + if (!reject) + { + peerLink->OpenAccept (peerManagementElement.GetLocalLinkId (), meshConfig, peerMeshPointAddress); + } + else + { + peerLink->OpenReject (peerManagementElement.GetLocalLinkId (), meshConfig, peerMeshPointAddress, + reasonCode); + } + } + if (peerLink == 0) + { + return; + } + if (peerManagementElement.SubtypeIsConfirm ()) + { + peerLink->ConfirmAccept (peerManagementElement.GetLocalLinkId (), + peerManagementElement.GetPeerLinkId (), aid, meshConfig, peerMeshPointAddress); + } + if (peerManagementElement.SubtypeIsClose ()) + { + peerLink->Close (peerManagementElement.GetLocalLinkId (), peerManagementElement.GetPeerLinkId (), + peerManagementElement.GetReasonCode ()); + } +} +void +PeerManagementProtocol::ConfigurationMismatch (uint32_t interface, Mac48Address peerAddress) +{ + Ptr peerLink = FindPeerLink (interface, peerAddress); + if (peerLink != 0) + { + peerLink->MLMECancelPeerLink (REASON11S_MESH_CAPABILITY_POLICY_VIOLATION); + } +} +void +PeerManagementProtocol::TransmissionFailure (uint32_t interface, Mac48Address peerAddress) +{ + NS_LOG_DEBUG("transmission failed between "< peerLink = FindPeerLink(interface, peerAddress); + if (peerLink != 0) + { + peerLink->TransmissionFailure (); + } +} +void +PeerManagementProtocol::TransmissionSuccess (uint32_t interface, Mac48Address peerAddress) +{ + NS_LOG_DEBUG("transmission success "< peerLink = FindPeerLink(interface, peerAddress); + if (peerLink != 0) + { + peerLink->TransmissionSuccess (); + } +} +Ptr +PeerManagementProtocol::InitiateLink (uint32_t interface, Mac48Address peerAddress, + Mac48Address peerMeshPointAddress, Time lastBeacon, Time beaconInterval) +{ + Ptr new_link = CreateObject (); + if (m_lastLocalLinkId == 0xff) + { + m_lastLocalLinkId = 0; + } + //find a beacon entry + BeaconInfoMap::iterator beaconsOnInterface = m_neighbourBeacons.find (interface); + if (beaconsOnInterface == m_neighbourBeacons.end ()) + { + FillBeaconInfo (interface, peerAddress, lastBeacon, beaconInterval); + } + beaconsOnInterface = m_neighbourBeacons.find (interface); + BeaconsOnInterface::iterator beacon = beaconsOnInterface->second.find (peerAddress); + if (beacon == beaconsOnInterface->second.end ()) + { + FillBeaconInfo (interface, peerAddress, lastBeacon, beaconInterval); + } + beacon = beaconsOnInterface->second.find (peerAddress); + //find a peer link - it must not exist + if (FindPeerLink (interface, peerAddress) != 0) + { + NS_FATAL_ERROR ("Peer link must not exist."); + } + // Plugin must exist + PeerManagementProtocolMacMap::iterator plugin = m_plugins.find (interface); + NS_ASSERT (plugin != m_plugins.end ()); + PeerLinksMap::iterator iface = m_peerLinks.find (interface); + NS_ASSERT (iface != m_peerLinks.end ()); + new_link->SetLocalAid (beacon->second.aid); + new_link->SetInterface (interface); + new_link->SetLocalLinkId (m_lastLocalLinkId++); + new_link->SetPeerAddress (peerAddress); + new_link->SetPeerMeshPointAddress (peerMeshPointAddress); + new_link->SetBeaconInformation (lastBeacon, beaconInterval); + new_link->SetMacPlugin (plugin->second); + new_link->MLMESetSignalStatusCallback (MakeCallback (&PeerManagementProtocol::PeerLinkStatus, this)); + iface->second.push_back (new_link); + return new_link; +} +Ptr +PeerManagementProtocol::FindPeerLink (uint32_t interface, Mac48Address peerAddress) +{ + PeerLinksMap::iterator iface = m_peerLinks.find (interface); + NS_ASSERT (iface != m_peerLinks.end ()); + for (PeerLinksOnInterface::iterator i = iface->second.begin (); i != iface->second.end (); i++) + { + if ((*i)->GetPeerAddress () == peerAddress) + { + if ((*i)->LinkIsIdle ()) + { + (*i) = 0; + (iface->second).erase (i); + return 0; + } + else + { + return (*i); + } + } + } + return 0; +} +void +PeerManagementProtocol::SetPeerLinkStatusCallback ( + Callback cb) +{ + m_peerStatusCallback = cb; +} +std::vector +PeerManagementProtocol::GetActiveLinks (uint32_t interface) +{ + std::vector retval; + PeerLinksMap::iterator iface = m_peerLinks.find (interface); + NS_ASSERT (iface != m_peerLinks.end ()); + for (PeerLinksOnInterface::iterator i = iface->second.begin (); i != iface->second.end (); i++) + { + if ((*i)->LinkIsEstab ()) + { + retval.push_back ((*i)->GetPeerAddress ()); + } + } + return retval; +} +bool +PeerManagementProtocol::IsActiveLink (uint32_t interface, Mac48Address peerAddress) +{ + Ptr peerLink = FindPeerLink (interface, peerAddress); + if (peerLink != 0) + { + return (peerLink->LinkIsEstab ()); + } + return false; +} +bool +PeerManagementProtocol::ShouldSendOpen (uint32_t interface, Mac48Address peerAddress) +{ + return (m_stats.linksTotal <= m_maxNumberOfPeerLinks); +} +bool +PeerManagementProtocol::ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, + PmpReasonCode & reasonCode) +{ + if (m_stats.linksTotal > m_maxNumberOfPeerLinks) + { + reasonCode = REASON11S_MESH_MAX_PEERS; + return false; + } + return true; +} +Time +PeerManagementProtocol::GetNextBeaconShift (uint32_t interface) +{ + //REMINDER:: in timing element 1) last beacon reception time is measured in units of 256 microseconds + // 2) beacon interval is mesured in units of 1024 microseconds + // 3) hereafter TU = 1024 microseconds + //So, the shift is a random integer variable uniformly distributed in [-15;-1] U [1;15] + static int maxShift = 15; + static int minShift = 1; + UniformVariable randomSign (-1, 1); + UniformVariable randomShift (minShift, maxShift); + PeerLinksMap::iterator iface = m_peerLinks.find (interface); + NS_ASSERT (iface != m_peerLinks.end ()); + PeerManagementProtocolMacMap::iterator plugin = m_plugins.find (interface); + NS_ASSERT (plugin != m_plugins.end ()); + std::pair myBeacon = plugin->second->GetBeaconInfo (); + if (Simulator::Now () + TuToTime (maxShift) > myBeacon.first + myBeacon.second) + { + return MicroSeconds (0); + } + for (PeerLinksOnInterface::iterator i = iface->second.begin (); i != iface->second.end (); i++) + { + IeBeaconTiming::NeighboursTimingUnitsList neighbours; + if ((*i)->LinkIsIdle ()) + { + continue; + } + neighbours = (*i)->GetBeaconTimingElement ().GetNeighboursTimingElementsList (); + //Going through all my timing elements and detecting future beacon collisions + for (IeBeaconTiming::NeighboursTimingUnitsList::const_iterator j = neighbours.begin (); j + != neighbours.end (); j++) + { + //We apply MBAC only if beacon Intervals are equal + if ((*j)->GetBeaconInterval () == TimeToTu (myBeacon.second)) + { + //Apply MBCA if future beacons may coinside + if ((TimeToTu (myBeacon.first) - ((*j)->GetLastBeacon () / 4)) % ((*j)->GetBeaconInterval ()) + == 0) + { + int beaconShift = randomShift.GetInteger (minShift, maxShift) * ((randomSign.GetValue () + >= 0) ? 1 : -1); + NS_LOG_DEBUG ("Apply MBCA: Shift value = " << beaconShift << " beacon TUs"); + //Do not shift to the past! + return (TuToTime (beaconShift) + Simulator::Now () < myBeacon.first) ? TuToTime ( + beaconShift) : TuToTime (0); + } + } + } + } + return MicroSeconds (0); +} +Time +PeerManagementProtocol::TuToTime (uint32_t x) +{ + return MicroSeconds (x * 1024); +} +uint32_t +PeerManagementProtocol::TimeToTu (Time x) +{ + return (uint32_t) (x.GetMicroSeconds () / 1024); +} +void +PeerManagementProtocol::PeerLinkStatus (uint32_t interface, Mac48Address peerAddress, + Mac48Address peerMeshPointAddress, PeerLink::PeerState ostate, PeerLink::PeerState nstate) +{ + PeerManagementProtocolMacMap::iterator plugin = m_plugins.find (interface); + NS_ASSERT (plugin != m_plugins.end ()); + NS_LOG_DEBUG ("Link between me:" << m_address << " my interface:" << plugin->second->GetAddress () + << " and peer mesh point:" << peerMeshPointAddress << " and its interface:" << peerAddress + << ", at my interface ID:" << interface << ". State movement:" << ostate << " -> " << nstate); + if ((nstate == PeerLink::ESTAB) && (ostate != PeerLink::ESTAB)) + { + m_stats.linksOpened++; + m_stats.linksTotal++; + if (!m_peerStatusCallback.IsNull ()) + { + m_peerStatusCallback (peerMeshPointAddress, peerAddress, interface, true); + } + } + if ((ostate == PeerLink::ESTAB) && (nstate != PeerLink::ESTAB)) + { + m_stats.linksClosed++; + m_stats.linksTotal--; + if (!m_peerStatusCallback.IsNull ()) + { + m_peerStatusCallback (peerMeshPointAddress, peerAddress, interface, false); + } + } + if (nstate == PeerLink::IDLE) + { + Ptr link = FindPeerLink (interface, peerAddress); + NS_ASSERT (link == 0); + } +} +uint8_t +PeerManagementProtocol::GetNumberOfLinks () +{ + return m_stats.linksTotal; +} +Ptr +PeerManagementProtocol::GetMeshId () const +{ + NS_ASSERT (m_meshId != 0); + return m_meshId; +} +void +PeerManagementProtocol::SetMeshId (std::string s) +{ + m_meshId = Create (s); +} +Mac48Address +PeerManagementProtocol::GetAddress () +{ + return m_address; +} +PeerManagementProtocol::Statistics::Statistics (uint16_t t) : + linksTotal (t), linksOpened (0), linksClosed (0) +{ +} +void +PeerManagementProtocol::Statistics::Print (std::ostream & os) const +{ + os << "" << std::endl; +} +void +PeerManagementProtocol::Report (std::ostream & os) const +{ + os << "" << std::endl; + m_stats.Print (os); + for (PeerManagementProtocolMacMap::const_iterator plugins = m_plugins.begin (); plugins != m_plugins.end (); plugins++) + { + //Take statistics from plugin: + plugins->second->Report (os); + //Print all active peer links: + PeerLinksMap::const_iterator iface = m_peerLinks.find (plugins->second->m_ifIndex); + NS_ASSERT (iface != m_peerLinks.end ()); + for (PeerLinksOnInterface::const_iterator i = iface->second.begin (); i != iface->second.end (); i++) + { + (*i)->Report (os); + } + } + os << "" << std::endl; +} +void +PeerManagementProtocol::ResetStats () +{ + m_stats = Statistics::Statistics (m_stats.linksTotal); // don't reset number of links + for (PeerManagementProtocolMacMap::const_iterator plugins = m_plugins.begin (); plugins != m_plugins.end (); plugins++) + { + plugins->second->ResetStats (); + } +} + +} // namespace dot11s +} //namespace ns3 + diff --git a/src/devices/mesh/dot11s/peer-management-protocol.h b/src/devices/mesh/dot11s/peer-management-protocol.h new file mode 100644 index 000000000..e0dea2664 --- /dev/null +++ b/src/devices/mesh/dot11s/peer-management-protocol.h @@ -0,0 +1,258 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksey Kovalenko + */ + +#ifndef DOT11S_PEER_MAN_H +#define DOT11S_PEER_MAN_H + +#include "ns3/mac48-address.h" +#include "ns3/net-device.h" +#include "ns3/event-id.h" +#include "ns3/nstime.h" +#include "ie-dot11s-beacon-timing.h" +#include "ie-dot11s-peer-management.h" +#include "peer-link.h" + +#include +namespace ns3 { +class MeshPointDevice; +namespace dot11s { +class PeerManagementProtocolMac; +class PeerLink; +class IeMeshId; +class IePeerManagement; +class IeConfiguration; +/** + * \ingroup dot11s + * + * \brief 802.11s Peer Management Protocol model + */ +class PeerManagementProtocol : public Object +{ +public: + PeerManagementProtocol (); + ~PeerManagementProtocol (); + static TypeId GetTypeId (); + void DoDispose (); + /** + * \brief Install PMP on given mesh point. + * + * Installing protocol cause installing its interface MAC plugins. + * + * Also MP aggregates all installed protocols, PMP protocol can be accessed + * via MeshPointDevice::GetObject(); + */ + bool Install (Ptr); + /** + * \brief Methods that handle beacon sending/receiving procedure. + * + * \name This methods interact with MAC_layer plug-in + * \{ + */ + /** + * \brief When we are sending a beacon - we fill beacon timing + * element + * \return IeBeaconTiming is a beacon timing element that should be present in beacon + * \param interface is a interface sending a beacon + */ + Ptr GetBeaconTimingElement (uint32_t interface); + /** + * \brief When we receive a beacon from peer-station, we remember + * its beacon timing element (needed for peer choosing mechanism), + * and remember beacon timers - last beacon and beacon interval to + * detect beacon loss and cancel links + * \param interface is a interface on which beacon was received + * \param meshBeacon indicates whether the beacon is mesh beacon or not. + * \param timingElement is a timing element of remote beacon + * \param peerAddress is an address where a beacon was received from + * \param receivingTime is a time when beacon was received + * \param beaconInterval is a beacon interval of received beacon + */ + void UpdatePeerBeaconTiming ( + uint32_t interface, + bool meshBeacon, + IeBeaconTiming timingElement, + Mac48Address peerAddress, + Time receivingTime, + Time beaconInterval + ); + //\} + /** + * \brief Methods that handle Peer link management frames + * interaction: + * \{ + */ + /** + * Deliver Peer link management information to the protocol-part + * \param interface is a interface ID of a given MAC (interfaceID rather + * than MAC address, because many interfaces may have the same MAC) + * \param peerAddress is address of peer + * \param peerMeshPointAddress is address of peer mesh point device (equal + * to peer address when only one interface) + * \param aid is association ID, which peer has assigned to us + * \param peerManagementElement is peer link management element + * \param meshConfig is mesh configuration element taken from the peer + * management frame + */ + void ReceivePeerLinkFrame ( + uint32_t interface, + Mac48Address peerAddress, + Mac48Address peerMeshPointAddress, + uint16_t aid, + IePeerManagement peerManagementElement, + IeConfiguration meshConfig + ); + /** + * \brief Cancels peer link due to broken configuration (Mesh ID or Supported + * rates) + */ + void ConfigurationMismatch (uint32_t interface, Mac48Address peerAddress); + /** + * \brief Cancels peer link due to successive transmission failures + */ + void TransmissionFailure (uint32_t interface, const Mac48Address peerAddress); + /** + * \brief resets transmission failure statistics + */ + void TransmissionSuccess (uint32_t interface, const Mac48Address peerAddress); + /** + * \brief Checks if there is established link + */ + bool IsActiveLink (uint32_t interface, Mac48Address peerAddress); + //\} + ///\brief Needed by external module to do MLME + Ptr FindPeerLink (uint32_t interface, Mac48Address peerAddress); + void SetPeerLinkStatusCallback (Callback cb); + std::vector GetActiveLinks (uint32_t interface); + ///\brief needed by plugins to set global source address + Mac48Address GetAddress (); + ///\brief Needed to fill mesh configuration + uint8_t GetNumberOfLinks (); + void SetMeshId (std::string s); + Ptr GetMeshId () const; + ///\brief: Report statistics + void Report (std::ostream &) const; + void ResetStats (); +private: + /** \name Private structures + * \{ + */ + /// Keeps information about beacon of peer station: beacon interval, association ID, last time we have received a beacon + struct BeaconInfo + { + uint16_t aid; //Assoc ID + Time referenceTbtt; //When one of my station's beacons was put into a beacon queue; + Time beaconInterval; //Beacon interval of my station; + }; + /// We keep a vector of pointers to PeerLink class. This vector + /// keeps all peer links at a given interface. + typedef std::vector > PeerLinksOnInterface; + /// This map keeps all peer links. + typedef std::map PeerLinksMap; + /// This map keeps relationship between peer address and its beacon information + typedef std::map BeaconsOnInterface; + ///\brief This map keeps beacon information on all intefaces + typedef std::map BeaconInfoMap; + ///\brief this vector keeps pointers to MAC-plugins + typedef std::map > PeerManagementProtocolMacMap; + ///\} +private: + PeerManagementProtocol& operator= (const PeerManagementProtocol &); + PeerManagementProtocol (const PeerManagementProtocol &); + + /** + * \brief Fills information of received beacon. Needed to form own beacon timing element + */ + void FillBeaconInfo (uint32_t interface, Mac48Address peerAddress, Time receivingTime, Time beaconInterval); + Ptr InitiateLink ( + uint32_t interface, + Mac48Address peerAddress, + Mac48Address peerMeshPointAddress, + Time lastBeacon, + Time beaconInterval + ); + /** + * \name External peer-chooser + * \{ + */ + bool ShouldSendOpen (uint32_t interface, Mac48Address peerAddress); + bool ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, PmpReasonCode & reasonCode); + /** + * \} + * \brief Indicates changes in peer links + */ + void PeerLinkStatus (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddres, PeerLink::PeerState ostate, PeerLink::PeerState nstate); + ///\brief BCA + Time GetNextBeaconShift (uint32_t interface); + /** + * \name Time<-->TU converters: + * \{ + */ + Time TuToTime (uint32_t x); + uint32_t TimeToTu (Time x); + ///\} +private: + PeerManagementProtocolMacMap m_plugins; + Mac48Address m_address; + Ptr m_meshId; + /** + * \name Information related to beacons: + * \{ + */ + BeaconInfoMap m_neighbourBeacons; + ///\} + uint16_t m_lastAssocId; + uint16_t m_lastLocalLinkId; + uint8_t m_maxNumberOfPeerLinks; + uint8_t m_maxBeaconLostForBeaconTiming; + /** + * \name Peer Links + * \{ + */ + PeerLinksMap m_peerLinks; + /** + * \} + */ + /** + * \brief Callback to notify about peer link changes: + * Mac48Address is peer address of mesh point, + * Mac48Address is peer address of interface, + * uint32_t - interface ID, + * bool is status - true when new link has appeared, false - when link was closed, + */ + Callback m_peerStatusCallback; + ///\} + ///\name Statistics: + ///\{ + struct Statistics { + uint16_t linksTotal; + uint16_t linksOpened; + uint16_t linksClosed; + + Statistics (uint16_t t = 0); + void Print (std::ostream & os) const; + }; + struct Statistics m_stats; + ///\} +}; + +} // namespace dot11s +} //namespace ns3 +#endif diff --git a/src/devices/mesh/dot11s/waf b/src/devices/mesh/dot11s/waf new file mode 100755 index 000000000..0ca1fc3f4 --- /dev/null +++ b/src/devices/mesh/dot11s/waf @@ -0,0 +1 @@ +exec "`dirname "$0"`"/../../../../waf "$@" diff --git a/src/devices/mesh/dot11s/wscript b/src/devices/mesh/dot11s/wscript new file mode 100644 index 000000000..74a6e9dd8 --- /dev/null +++ b/src/devices/mesh/dot11s/wscript @@ -0,0 +1,37 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + obj = bld.create_ns3_module('dot11s', ['wifi', 'mesh']) + obj.source = [ + 'ie-dot11s-beacon-timing.cc', + 'ie-dot11s-configuration.cc', + 'ie-dot11s-id.cc', + 'ie-dot11s-peer-management.cc', + 'ie-dot11s-preq.cc', + 'ie-dot11s-prep.cc', + 'ie-dot11s-perr.cc', + 'ie-dot11s-rann.cc', + 'ie-dot11s-peering-protocol.cc', + 'ie-dot11s-metric-report.cc', + 'dot11s-mac-header.cc', + 'peer-link-frame.cc', + 'peer-link.cc', + 'peer-management-protocol-mac.cc', + 'peer-management-protocol.cc', + 'hwmp-tag.cc', + 'hwmp-rtable.cc', + 'hwmp-protocol-mac.cc', + 'hwmp-protocol.cc', + 'airtime-metric.cc', + ] + headers = bld.new_task_gen('ns3header') + headers.module = 'dot11s' + headers.source = [ + 'hwmp-protocol.h', + 'peer-management-protocol.h', + 'ie-dot11s-beacon-timing.h', + 'ie-dot11s-configuration.h', + 'ie-dot11s-peer-management.h', + 'ie-dot11s-id.h', + 'peer-link.h', + ] diff --git a/src/devices/mesh/flame/flame-header.cc b/src/devices/mesh/flame/flame-header.cc new file mode 100644 index 000000000..8deb86103 --- /dev/null +++ b/src/devices/mesh/flame/flame-header.cc @@ -0,0 +1,182 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ +#include "ns3/assert.h" +#include "ns3/address-utils.h" +#include "ns3/packet.h" +#include "ns3/test.h" + +#include "flame-header.h" + +namespace ns3 { +namespace flame { +FlameHeader::FlameHeader () : + m_cost (0), m_seqno (0), m_origDst (Mac48Address ()), m_origSrc (Mac48Address ()) +{ +} +FlameHeader::~FlameHeader () +{ +} +TypeId +FlameHeader::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::FlameHeader") + .SetParent
    () + .AddConstructor (); + return tid; +} +TypeId +FlameHeader::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} +void +FlameHeader::Print (std::ostream &os) const +{ + os << "Cost = " << (uint16_t) m_cost << std::endl << "Sequence number = " << m_seqno + << std::endl << "Orig Destination = " << m_origDst << std::endl << "Orig Source = " << m_origSrc << std::endl; +} +uint32_t +FlameHeader::GetSerializedSize (void) const +{ + return 1 // Reserved + + 1 // Cost + + 2 // Seqno + + 6 // Orig Dst + + 6 // Orig Src + + 2 // Flame Port + ; +} +void +FlameHeader::Serialize (Buffer::Iterator start) const +{ + Buffer::Iterator i = start; + i.WriteU8 (0); //Reserved + i.WriteU8 (m_cost); //Cost + i.WriteHtonU16 (m_seqno); //Seqno + WriteTo (i, m_origDst); + WriteTo (i, m_origSrc); + i.WriteHtonU16 (m_protocol); +} +uint32_t +FlameHeader::Deserialize (Buffer::Iterator start) +{ + Buffer::Iterator i = start; + i.Next (1); + m_cost = i.ReadU8 (); + m_seqno = i.ReadNtohU16 (); + ReadFrom (i, m_origDst); + ReadFrom (i, m_origSrc); + m_protocol = i.ReadNtohU16 (); + return i.GetDistanceFrom (start); +} +void +FlameHeader::AddCost (uint8_t cost) +{ + m_cost = (((uint16_t) cost + (uint16_t) m_cost) > 255) ? 255 : cost + m_cost; +} +uint8_t +FlameHeader::GetCost () const +{ + return m_cost; +} +void +FlameHeader::SetSeqno (uint16_t seqno) +{ + m_seqno = seqno; +} +uint16_t +FlameHeader::GetSeqno () const +{ + return m_seqno; +} +void +FlameHeader::SetOrigDst (Mac48Address dst) +{ + m_origDst = dst; +} +Mac48Address +FlameHeader::GetOrigDst () const +{ + return m_origDst; +} +void +FlameHeader::SetOrigSrc (Mac48Address src) +{ + m_origSrc = src; +} +Mac48Address +FlameHeader::GetOrigSrc () const +{ + return m_origSrc; +} +void +FlameHeader::SetProtocol (uint16_t protocol) +{ + m_protocol = protocol; +} +uint16_t +FlameHeader::GetProtocol () const +{ + return m_protocol; +} +bool +operator== (const FlameHeader & a, const FlameHeader & b) +{ + return ((a.m_cost == b.m_cost) && (a.m_seqno == b.m_seqno) && (a.m_origDst == b.m_origDst) && (a.m_origSrc + == b.m_origSrc) && (a.m_protocol == b.m_protocol)); +} + +#ifdef RUN_SELF_TESTS + +/// Built-in self test for FlameHeader +struct FlameHeaderBist : public Test +{ + FlameHeaderBist () : + Test ("Mesh/Flame/FlameHeader") + { + } + virtual bool + RunTests (); +}; + +/// Test instance +static FlameHeaderBist g_FlameHeaderBist; + +bool +FlameHeaderBist::RunTests () +{ + bool result (true); + FlameHeader a; + a.AddCost (123); + a.SetSeqno (456); + a.SetOrigDst (Mac48Address ("11:22:33:44:55:66")); + a.SetOrigSrc (Mac48Address ("00:11:22:33:44:55")); + a.SetProtocol (0x806); + Ptr packet = Create (); + packet->AddHeader (a); + FlameHeader b; + packet->RemoveHeader (b); + NS_TEST_ASSERT_EQUAL (b, a); + return result; +} +#endif + +} //namespace flame +} // namespace ns3 diff --git a/src/devices/mesh/flame/flame-header.h b/src/devices/mesh/flame/flame-header.h new file mode 100644 index 000000000..8879ea2b3 --- /dev/null +++ b/src/devices/mesh/flame/flame-header.h @@ -0,0 +1,80 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef FLAME_HEADER_H +#define FLAME_HEADER_H + +#include "ns3/header.h" +#include "ns3/mac48-address.h" + +namespace ns3 { +namespace flame { +/** + * \ingroup flame + * + * \brief Flame header + * + * Header format: | Reserved: 1 | cost: 1 | Sequence number: 2 | OrigDst: 6 | OrigSrc: 6 | Flame port : 2 | + */ + +class FlameHeader : public Header +{ +public: + + FlameHeader (); + ~FlameHeader (); + /** + * \name Inherited from Header class: + * \{ + */ + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; + virtual uint32_t GetSerializedSize (void) const; + virtual void Serialize (Buffer::Iterator start) const; + virtual uint32_t Deserialize (Buffer::Iterator start); + ///\} + /** + * \name Seeters/Getters for fields: + * \{ + */ + void AddCost (uint8_t cost); + uint8_t GetCost () const; + void SetSeqno (uint16_t seqno); + uint16_t GetSeqno () const; + void SetOrigDst (Mac48Address dst); + Mac48Address GetOrigDst () const; + void SetOrigSrc (Mac48Address OrigSrc); + Mac48Address GetOrigSrc () const; + void SetProtocol (uint16_t protocol); + uint16_t GetProtocol () const; + ///\} +private: + uint8_t m_cost; + uint16_t m_seqno; + Mac48Address m_origDst; + Mac48Address m_origSrc; + uint16_t m_protocol; + friend bool operator== (const FlameHeader & a, const FlameHeader & b); +}; +bool operator== (const FlameHeader & a, const FlameHeader & b); +} //namespace flame +} //namespace ns3 +#endif /* FLAME_HEADER_H */ diff --git a/src/devices/mesh/flame/flame-protocol-mac.cc b/src/devices/mesh/flame/flame-protocol-mac.cc new file mode 100644 index 000000000..f9b6650c5 --- /dev/null +++ b/src/devices/mesh/flame/flame-protocol-mac.cc @@ -0,0 +1,128 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "flame-protocol-mac.h" +#include "flame-protocol.h" +#include "flame-header.h" +#include "ns3/log.h" +namespace ns3 { +namespace flame { +NS_LOG_COMPONENT_DEFINE ("FlameProtocolMac"); +FlameProtocolMac::FlameProtocolMac (uint32_t ifIndex, Ptr protocol) : + m_protocol (protocol), m_ifIndex (ifIndex) +{ +} +FlameProtocolMac::~FlameProtocolMac () +{ +} +void +FlameProtocolMac::SetParent (Ptr parent) +{ + m_parent = parent; +} + +bool +FlameProtocolMac::Receive (Ptr packet, const WifiMacHeader & header) +{ + if (!header.IsData ()) + { + return true; + } + FlameTag tag; + if (packet->PeekPacketTag (tag)) + { + NS_FATAL_ERROR ("FLAME tag is not supposed to be received by network"); + } + tag.receiver = header.GetAddr1 (); + tag.transmitter = header.GetAddr2 (); + if (tag.receiver == Mac48Address::GetBroadcast ()) + { + m_stats.rxBroadcast++; + } + else + { + m_stats.rxUnicast++; + } + m_stats.rxBytes += packet->GetSize (); + packet->AddPacketTag (tag); + return true; +} +bool +FlameProtocolMac::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, + Mac48Address to) +{ + if (!header.IsData ()) + { + return true; + } + FlameTag tag; + if (!packet->RemovePacketTag (tag)) + { + NS_FATAL_ERROR ("FLAME tag must exist here"); + } + header.SetAddr1 (tag.receiver); + if (tag.receiver == Mac48Address::GetBroadcast ()) + { + m_stats.txBroadcast++; + } + else + { + m_stats.txUnicast++; + } + m_stats.txBytes += packet->GetSize (); + return true; +} +uint16_t +FlameProtocolMac::GetChannelId () const +{ + return m_parent->GetFrequencyChannel (); +} +FlameProtocolMac::Statistics::Statistics () : + txUnicast (0), txBroadcast (0), txBytes (0), rxUnicast (0), rxBroadcast (0), rxBytes (0) +{ +} +void +FlameProtocolMac::Statistics::Print (std::ostream &os) const +{ + os << "" << std::endl; +} +void +FlameProtocolMac::Report (std::ostream & os) const +{ + os << "GetAddress () << "\">" << std::endl; + m_stats.Print (os); + os << "" << std::endl; + +} +void +FlameProtocolMac::ResetStats () +{ + m_stats = Statistics (); +} + +} //namespace flame +} //namespace ns3 diff --git a/src/devices/mesh/flame/flame-protocol-mac.h b/src/devices/mesh/flame/flame-protocol-mac.h new file mode 100644 index 000000000..63de914fd --- /dev/null +++ b/src/devices/mesh/flame/flame-protocol-mac.h @@ -0,0 +1,80 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef FLAME_PROTOCOL_MAC_H +#define FLAME_PROTOCOL_MAC_H + +#include "ns3/mesh-wifi-interface-mac.h" + +namespace ns3 { +namespace flame { +class FlameProtocol; +/** + * \ingroup flame + * + * \brief Interface MAC plugin FLAME routing protocol + */ +class FlameProtocolMac : public MeshWifiInterfaceMacPlugin +{ +public: + FlameProtocolMac (uint32_t, Ptr); + ~FlameProtocolMac (); + ///\name Inherited from MAC plugin + //\{ + void SetParent (Ptr parent); + bool Receive (Ptr packet, const WifiMacHeader & header); + bool UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to); + /// Update beacon is empty, because HWMP does not know anything about beacons + void UpdateBeacon (MeshWifiBeacon & beacon) const {}; + //\} + uint16_t GetChannelId () const; + /// Report statistics + void Report (std::ostream &) const; + void ResetStats (); +private: + /** + * \name MeshPointDevice parameters: + * \{ + */ + Ptr m_protocol; + uint32_t m_ifIndex; + Ptr m_parent; + ///\} + ///\name Statistics: + ///\{ + struct Statistics + { + uint16_t txUnicast; + uint16_t txBroadcast; + uint32_t txBytes; + uint16_t rxUnicast; + uint16_t rxBroadcast; + uint32_t rxBytes; + + void Print (std::ostream & os) const; + Statistics (); + }; + Statistics m_stats; + ///\} + +}; +} //namespace flame +} //namespace ns3 +#endif /* FLAME_PROTOCOL_MAC_H */ diff --git a/src/devices/mesh/flame/flame-protocol.cc b/src/devices/mesh/flame/flame-protocol.cc new file mode 100644 index 000000000..d0bd251f0 --- /dev/null +++ b/src/devices/mesh/flame/flame-protocol.cc @@ -0,0 +1,377 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#include "flame-protocol.h" +#include "flame-protocol-mac.h" +#include "flame-header.h" +#include "flame-rtable.h" +#include "ns3/llc-snap-header.h" +#include "ns3/log.h" +#include "ns3/simulator.h" +#include "ns3/packet.h" +#include "ns3/mesh-point-device.h" +#include "ns3/wifi-net-device.h" +#include "ns3/mesh-point-device.h" +#include "ns3/mesh-wifi-interface-mac.h" +#include "ns3/random-variable.h" + +NS_LOG_COMPONENT_DEFINE ("FlameProtocol"); + +namespace ns3 { +namespace flame { +//----------------------------------------------------------------------------- +// FlameTag +//----------------------------------------------------------------------------- +NS_OBJECT_ENSURE_REGISTERED (FlameTag); + +TypeId +FlameTag::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::flame::FlameTag") .SetParent () .AddConstructor (); + return tid; +} + +TypeId +FlameTag::GetInstanceTypeId () const +{ + return GetTypeId (); +} + +uint32_t +FlameTag::GetSerializedSize () const +{ + return 12; +} + +void +FlameTag::Serialize (TagBuffer i) const +{ + uint8_t buf[6]; + receiver.CopyTo (buf); + for (int j = 0; j < 6; j++) + { + i.WriteU8 (buf[j]); + } + transmitter.CopyTo (buf); + for (int j = 0; j < 6; j++) + { + i.WriteU8 (buf[j]); + } + +} + +void +FlameTag::Deserialize (TagBuffer i) +{ + uint8_t buf[6]; + for (int j = 0; j < 6; j++) + { + buf[j] = i.ReadU8 (); + } + receiver.CopyFrom (buf); + for (int j = 0; j < 6; j++) + { + buf[j] = i.ReadU8 (); + } + transmitter.CopyFrom (buf); + +} + +void +FlameTag::Print (std::ostream &os) const +{ + os << "receiver = " << receiver << ", transmitter = " << transmitter; +} + +//----------------------------------------------------------------------------- +// FlameProtocol +//----------------------------------------------------------------------------- +TypeId +FlameProtocol::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::flame::FlameProtocol") + .SetParent () + .AddConstructor () + .AddAttribute ( "BroadcastInterval", + "How often we must send broadcast packets", + TimeValue (Seconds (5)), + MakeTimeAccessor ( + &FlameProtocol::m_broadcastInterval), + MakeTimeChecker () + ) + .AddAttribute ( "MaxCost", + "Cost threshold after which packet will be dropeed", + UintegerValue (32), + MakeUintegerAccessor ( + &FlameProtocol::m_maxCost), + MakeUintegerChecker (3) + ) + ; + return tid; +} +FlameProtocol::FlameProtocol () : + m_address (Mac48Address ()), m_broadcastInterval (Seconds (5)), m_lastBroadcast (Simulator::Now ()), + m_maxCost (32), m_myLastSeqno (1), m_rtable (CreateObject ()) +{ +} +FlameProtocol::~FlameProtocol () +{ +} +void +FlameProtocol::DoDispose () +{ +} +bool +FlameProtocol::RequestRoute (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, + Ptr const_packet, uint16_t protocolType, RouteReplyCallback routeReply) +{ + Ptr packet = const_packet->Copy (); + if (sourceIface == m_mp->GetIfIndex ()) + { + //Packet from upper layer! + FlameTag tag; + if (packet->PeekPacketTag (tag)) + { + NS_FATAL_ERROR ("FLAME tag is not supposed to be received from upper layers"); + } + FlameRtable::LookupResult result = m_rtable->Lookup (destination); + if (result.retransmitter == Mac48Address::GetBroadcast ()) + { + m_lastBroadcast = Simulator::Now (); + } + if (m_lastBroadcast + m_broadcastInterval < Simulator::Now ()) + { + result.retransmitter = Mac48Address::GetBroadcast (); + result.ifIndex = FlameRtable::INTERFACE_ANY; + m_lastBroadcast = Simulator::Now (); + } + FlameHeader flameHdr; + flameHdr.AddCost (0); + flameHdr.SetSeqno (m_myLastSeqno++); + flameHdr.SetProtocol (protocolType); + flameHdr.SetOrigDst (destination); + flameHdr.SetOrigSrc (source); + m_stats.txBytes += packet->GetSize (); + packet->AddHeader (flameHdr); + tag.receiver = result.retransmitter; + if (result.retransmitter == Mac48Address::GetBroadcast ()) + { + m_stats.txBroadcast++; + } + else + { + m_stats.txUnicast++; + } + NS_LOG_DEBUG ("Source: send packet with RA = " << tag.receiver); + packet->AddPacketTag (tag); + routeReply (true, packet, source, destination, FLAME_PROTOCOL, result.ifIndex); + } + else + { + FlameHeader flameHdr; + packet->RemoveHeader (flameHdr); + FlameTag tag; + + if (!packet->RemovePacketTag (tag)) + { + NS_FATAL_ERROR ("FLAME tag must exist here"); + } + if (destination == Mac48Address::GetBroadcast ()) + { + //Broadcast always is forwarded as broadcast! + NS_ASSERT (HandleDataFrame (flameHdr.GetSeqno (), source, flameHdr, tag.transmitter, sourceIface)); + FlameTag tag (Mac48Address::GetBroadcast ()); + flameHdr.AddCost (1); + m_stats.txBytes += packet->GetSize (); + packet->AddHeader (flameHdr); + packet->AddPacketTag (tag); + routeReply (true, packet, source, destination, FLAME_PROTOCOL, FlameRtable::INTERFACE_ANY); + m_stats.txBroadcast++; + return true; + } + else + { + // We check sequence only when forward unicast, because broadcast-checks were done + // inside remove routing stuff. + if (HandleDataFrame (flameHdr.GetSeqno (), source, flameHdr, tag.transmitter, sourceIface)) + { + return false; + } + FlameRtable::LookupResult result = m_rtable->Lookup (destination); + if (tag.receiver != Mac48Address::GetBroadcast ()) + { + if (result.retransmitter == Mac48Address::GetBroadcast ()) + { + NS_LOG_DEBUG ("unicast packet dropped, because no route! I am " << GetAddress () + << ", RA = " << tag.receiver << ", TA = " << tag.transmitter); + m_stats.totalDropped++; + return false; + } + } + tag.receiver = result.retransmitter; + if (result.retransmitter == Mac48Address::GetBroadcast ()) + { + m_stats.txBroadcast++; + } + else + { + m_stats.txUnicast++; + } + m_stats.txBytes += packet->GetSize (); + flameHdr.AddCost (1); + packet->AddHeader (flameHdr); + packet->AddPacketTag (tag); + routeReply (true, packet, source, destination, FLAME_PROTOCOL, result.ifIndex); + return true; + } + return true; + } + return false; +} +bool +FlameProtocol::RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, + const Mac48Address destination, Ptr packet, uint16_t& protocolType) +{ + //Filter seqno: + if (source == GetAddress ()) + { + NS_LOG_DEBUG ("Dropped my own frame!"); + return false; + } + FlameTag tag; + if (!packet->RemovePacketTag (tag)) + { + NS_FATAL_ERROR ("FLAME tag must exist when packet is coming to protocol"); + } + FlameHeader flameHdr; + packet->RemoveHeader (flameHdr); + if ((destination == GetAddress ()) && (m_lastBroadcast + m_broadcastInterval < Simulator::Now ())) + { + Ptr packet = Create (); + m_mp->Send(packet, Mac48Address::GetBroadcast (), 0); + m_lastBroadcast = Simulator::Now (); + } + NS_ASSERT (protocolType == FLAME_PROTOCOL); + protocolType = flameHdr.GetProtocol (); + if ((HandleDataFrame (flameHdr.GetSeqno (), source, flameHdr, tag.transmitter, fromIface)) + || packet->GetSize () == 0) + { + return false; + } + return true; +} +bool +FlameProtocol::Install (Ptr mp) +{ + m_mp = mp; + std::vector > interfaces = mp->GetInterfaces (); + for (std::vector >::const_iterator i = interfaces.begin (); i != interfaces.end (); i++) + { + // Checking for compatible net device + Ptr wifiNetDev = (*i)->GetObject (); + if (wifiNetDev == 0) + { + return false; + } + Ptr mac = wifiNetDev->GetMac ()->GetObject (); + if (mac == 0) + { + return false; + } + // Installing plugins: + Ptr flameMac = Create (wifiNetDev->GetIfIndex (), this); + m_interfaces[wifiNetDev->GetIfIndex ()] = flameMac; + mac->SetBeaconGeneration (false); + mac->InstallPlugin (flameMac); + } + mp->SetRoutingProtocol (this); + // Mesh point aggregates all installed protocols + mp->AggregateObject (this); + m_address = Mac48Address::ConvertFrom (mp->GetAddress ());//* address; + return true; +} +Mac48Address +FlameProtocol::GetAddress () +{ + return m_address; +} +bool +FlameProtocol::HandleDataFrame (uint16_t seqno, Mac48Address source, const FlameHeader flameHdr, + Mac48Address receiver, uint32_t fromInterface) +{ + if (source == GetAddress ()) + { + m_stats.totalDropped++; + return true; + } + FlameRtable::LookupResult result = m_rtable->Lookup (source); + if ((result.retransmitter != Mac48Address::GetBroadcast ()) && ((int16_t)(result.seqnum - seqno) >= 0)) + { + return true; + } + if (flameHdr.GetCost () > m_maxCost) + { + m_stats.droppedTtl++; + return true; + } + m_rtable->AddPath (source, receiver, fromInterface, flameHdr.GetCost (), flameHdr.GetSeqno ()); + return false; +} +//Statistics: +FlameProtocol::Statistics::Statistics () : + txUnicast (0), txBroadcast (0), txBytes (0), droppedTtl (0), totalDropped (0) +{ +} +void +FlameProtocol::Statistics::Print (std::ostream & os) const +{ + os << "" << std::endl; +} +void +FlameProtocol::Report (std::ostream & os) const +{ + os << "" << std::endl; + m_stats.Print (os); + for (FlamePluginMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin++) + { + plugin->second->Report (os); + } + os << "" << std::endl; +} +void +FlameProtocol::ResetStats () +{ + m_stats = Statistics (); + for (FlamePluginMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin++) + { + plugin->second->ResetStats (); + } +} + +} //namespace flame +} //namespace ns3 diff --git a/src/devices/mesh/flame/flame-protocol.h b/src/devices/mesh/flame/flame-protocol.h new file mode 100644 index 000000000..a787fc1b1 --- /dev/null +++ b/src/devices/mesh/flame/flame-protocol.h @@ -0,0 +1,158 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef FLAME_PROTOCOL_H +#define FLAME_PROTOCOL_H + + +#include "ns3/mesh-l2-routing-protocol.h" +#include "ns3/nstime.h" +#include "ns3/tag.h" +#include + +/** + * \ingroup mesh + * \defgroup flame FLAME + * + * \brief Forwarding LAyer for MEshing protocol + * + * Simple L2.5 mesh routing protocol developed by + * Herman Elfrink and presented in + * "Easy Wireless: broadband ad-hoc networking for emergency services" + * by Maurits de Graaf et. al. at The Sixth Annual Mediterranean Ad Hoc + * Networking WorkShop, Corfu, Greece, June 12-15, 2007 + * + * see also Linux kernel mailing list discussion at + * http://lkml.org/lkml/2006/5/23/82 + */ +namespace ns3 { +namespace flame { +class FlameProtocolMac; +class FlameHeader; +class FlameRtable; +/** + * \ingroup flame + * \brief Transmitter and receiver addresses + */ +class FlameTag : public Tag +{ +public: + /// transmitter for incoming: + Mac48Address transmitter; + /// Receiver of the packet: + Mac48Address receiver; + + FlameTag (Mac48Address a = Mac48Address ()) : + receiver (a){} + + ///\name Inherited from Tag + //\{ + static TypeId GetTypeId (); + TypeId GetInstanceTypeId () const; + uint32_t GetSerializedSize () const; + void Serialize (TagBuffer i) const; + void Deserialize (TagBuffer i); + void Print (std::ostream &os) const; + //\} +}; + +/** + * \ingroup flame + * \brief FLAME routing protocol + */ +class FlameProtocol : public MeshL2RoutingProtocol +{ +public: + static TypeId GetTypeId (); + FlameProtocol (); + ~FlameProtocol (); + void DoDispose (); + + /// Route request, inherited from MeshL2RoutingProtocol + bool RequestRoute (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, + Ptr packet, uint16_t protocolType, RouteReplyCallback routeReply); + /// Cleanup flame headers! + bool RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, + const Mac48Address destination, Ptr packet, uint16_t& protocolType); + /** + * \brief Install FLAME on given mesh point. + * + * Installing protocol cause installing its interface MAC plugins. + * + * Also MP aggregates all installed protocols, FLAME protocol can be accessed + * via MeshPointDevice::GetObject(); + */ + bool Install (Ptr); + Mac48Address GetAddress (); + /// Statistics + void Report (std::ostream &) const; + void ResetStats (); +private: + FlameProtocol& operator= (const FlameProtocol &); + FlameProtocol (const FlameProtocol &); + + /// LLC protocol number reserved by flame + static const uint16_t FLAME_PROTOCOL = 0x4040; + /** + * \brief Handles a packet: adds a routing information and drops packets by TTL or Seqno + * + * \return true if packet shall be dropped + */ + bool HandleDataFrame (uint16_t seqno, Mac48Address source, const FlameHeader flameHdr, Mac48Address receiver, uint32_t fromIface); + /** + * \name Information about MeshPointDeviceaddress, plugins + * \{ + */ + typedef std::map > FlamePluginMap; + FlamePluginMap m_interfaces; + Mac48Address m_address; + //\} + /** + * \name Broadcast timers: + * \{ + */ + Time m_broadcastInterval; + Time m_lastBroadcast; + //\} + /// Max Cost value (or TTL, because cost is actually hopcount) + uint8_t m_maxCost; + /// Sequence number: + uint16_t m_myLastSeqno; + /// Routing table: + Ptr m_rtable; + ///\name Statistics: + ///\{ + struct Statistics + { + uint16_t txUnicast; + uint16_t txBroadcast; + uint32_t txBytes; + uint16_t droppedTtl; + uint16_t totalDropped; + void Print (std::ostream & os) const; + Statistics (); + }; + Statistics m_stats; + ///\} + +}; +} //namespace flame +} //namespace ns3 +#endif /* FLAME_PROTOCOL_H */ diff --git a/src/devices/mesh/flame/flame-rtable.cc b/src/devices/mesh/flame/flame-rtable.cc new file mode 100644 index 000000000..c3825058d --- /dev/null +++ b/src/devices/mesh/flame/flame-rtable.cc @@ -0,0 +1,193 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ +#include "ns3/assert.h" +#include "ns3/simulator.h" +#include "ns3/test.h" +#include "ns3/log.h" + +#include "flame-rtable.h" +namespace ns3 { +namespace flame { + +NS_LOG_COMPONENT_DEFINE ("FlameRtable"); + +NS_OBJECT_ENSURE_REGISTERED (FlameRtable); + +TypeId +FlameRtable::GetTypeId () +{ + static TypeId tid = + TypeId ("ns3::flame::FlameRtable") + .SetParent () .AddConstructor () + .AddAttribute ( "Lifetime", + "The lifetime of the routing enrty", + TimeValue (Seconds (120)), MakeTimeAccessor ( + &FlameRtable::m_lifetime), + MakeTimeChecker () + ) + ; + return tid; +} +FlameRtable::FlameRtable () : + m_lifetime (Seconds (120)) +{ +} +FlameRtable::~FlameRtable () +{ +} +void +FlameRtable::DoDispose () +{ + m_routes.clear (); +} +void +FlameRtable::AddPath (const Mac48Address destination, const Mac48Address retransmitter, + const uint32_t interface, const uint8_t cost, const uint16_t seqnum) +{ + std::map::iterator i = m_routes.find (destination); + if (i == m_routes.end ()) + { + Route newroute; + newroute.cost = cost; + newroute.retransmitter = retransmitter; + newroute.interface = interface; + newroute.whenExpire = Simulator::Now () + m_lifetime; + newroute.seqnum = seqnum; + m_routes[destination] = newroute; + return; + } + i->second.seqnum = seqnum; + NS_ASSERT (i != m_routes.end ()); + i->second.retransmitter = retransmitter; + i->second.interface = interface; + i->second.cost = cost; + i->second.whenExpire = Simulator::Now () + m_lifetime; +} +FlameRtable::LookupResult +FlameRtable::Lookup (Mac48Address destination) +{ + std::map::iterator i = m_routes.find (destination); + if (i == m_routes.end ()) + { + return LookupResult (); + } + if ((i->second.whenExpire < Simulator::Now ())) + { + NS_LOG_DEBUG ("Route has expired, sorry."); + m_routes.erase (i); + return LookupResult (); + } + return LookupResult (i->second.retransmitter, i->second.interface, i->second.cost, i->second.seqnum); +} +bool +FlameRtable::LookupResult::operator== (const FlameRtable::LookupResult & o) const +{ + return (retransmitter == o.retransmitter && ifIndex == o.ifIndex && cost == o.cost && seqnum == o.seqnum); +} + +bool +FlameRtable::LookupResult::IsValid () const +{ + return !(retransmitter == Mac48Address::GetBroadcast () && ifIndex == INTERFACE_ANY && cost == MAX_COST + && seqnum == 0); +} + +#ifdef RUN_SELF_TESTS +/// Unit test for FlameRtable +class FlameRtableTest : public Test +{ +public: + FlameRtableTest (); + virtual bool + RunTests (); + +private: + /// Test Add apth and lookup path; + void + TestLookup (); + /** + * \name Test add path and try to lookup after entry has expired + * \{ + */ + void + TestAddPath (); + void + TestExpire (); + ///\} +private: + bool result; + + Mac48Address dst; + Mac48Address hop; + uint32_t iface; + uint8_t cost; + uint16_t seqnum; + Ptr table; +}; + +/// Test instance +static FlameRtableTest g_FlameRtableTest; + +FlameRtableTest::FlameRtableTest () : + Test ("Mesh/Flame/FlameRtable"), result (true), dst ("01:00:00:01:00:01"), hop ("01:00:00:01:00:03"), + iface (8010), cost (10), seqnum (1) +{ +} + +void +FlameRtableTest::TestLookup () +{ + FlameRtable::LookupResult correct (hop, iface, cost, seqnum); + + table->AddPath (dst, hop, iface, cost, seqnum); + NS_TEST_ASSERT (table->Lookup (dst) == correct); +} + +void +FlameRtableTest::TestAddPath () +{ + table->AddPath (dst, hop, iface, cost, seqnum); +} + +void +FlameRtableTest::TestExpire () +{ + // this is assumed to be called when path records are already expired + FlameRtable::LookupResult correct (hop, iface, cost, seqnum); + NS_TEST_ASSERT (!table->Lookup (dst).IsValid ()); +} +bool +FlameRtableTest::RunTests () +{ + table = CreateObject (); + + Simulator::Schedule (Seconds (0), &FlameRtableTest::TestLookup, this); + Simulator::Schedule (Seconds (1), &FlameRtableTest::TestAddPath, this); + Simulator::Schedule (Seconds (122), &FlameRtableTest::TestExpire, this); + + Simulator::Run (); + Simulator::Destroy (); + + return result; +} + +#endif // RUN_SELF_TESTS +} //namespace flame +} //namespace ns3 diff --git a/src/devices/mesh/flame/flame-rtable.h b/src/devices/mesh/flame/flame-rtable.h new file mode 100644 index 000000000..7912ea8c3 --- /dev/null +++ b/src/devices/mesh/flame/flame-rtable.h @@ -0,0 +1,106 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + */ + +#ifndef FLAME_RTABLE_H +#define FLAME_RTABLE_H + +#include +#include "ns3/nstime.h" +#include "ns3/object.h" +#include "ns3/mac48-address.h" + +namespace ns3 { +namespace flame { +/** + * \ingroup flame + * + * \brief Routing table for FLAME + */ +class FlameRtable : public Object +{ +public: + /// Means all interfaces + const static uint32_t INTERFACE_ANY = 0xffffffff; + /// Maximum (the best?) path cost + const static uint32_t MAX_COST = 0xff; + + /// Route lookup result, return type of LookupXXX methods + struct LookupResult + { + Mac48Address retransmitter; + uint32_t ifIndex; + uint8_t cost; + uint16_t seqnum; + LookupResult (Mac48Address r = Mac48Address::GetBroadcast (), + uint32_t i = INTERFACE_ANY, + uint8_t c = MAX_COST, + uint16_t s = 0) + : retransmitter (r), + ifIndex (i), + cost (c), + seqnum (s) + { + } + /// True for valid route + bool IsValid () const; + /// Compare route lookup results, used by tests + bool operator==(const LookupResult & o) const; + }; +public: + static TypeId GetTypeId (); + FlameRtable (); + ~FlameRtable (); + void DoDispose (); + + /// Add path + void AddPath ( + const Mac48Address destination, + const Mac48Address retransmitter, + const uint32_t interface, + const uint8_t cost, + const uint16_t seqnum + ); + /** + * \brief Lookup path to destination + * \return Broadcast if not found + */ + LookupResult Lookup (Mac48Address destination); +private: + FlameRtable& operator= (const FlameRtable &); + FlameRtable (const FlameRtable &); + + /// Routing table entry + struct Route + { + Mac48Address retransmitter; + uint32_t interface; + uint32_t cost; + Time whenExpire; + uint32_t seqnum; + }; + /// Lifetime parameter + Time m_lifetime; + /// List of routes + std::map m_routes; +}; + +} //namespace flame +} //namespace ns3 +#endif /* FLAME_PROTOCOL_H */ diff --git a/src/devices/mesh/flame/wscript b/src/devices/mesh/flame/wscript new file mode 100644 index 000000000..6b39918ee --- /dev/null +++ b/src/devices/mesh/flame/wscript @@ -0,0 +1,15 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + obj = bld.create_ns3_module('flame', ['mesh']) + obj.source = [ + 'flame-header.cc', + 'flame-rtable.cc', + 'flame-protocol-mac.cc', + 'flame-protocol.cc', + ] + headers = bld.new_task_gen('ns3header') + headers.module = 'flame' + headers.source = [ + 'flame-protocol.h', + ] diff --git a/src/devices/mesh/mesh-l2-routing-protocol.cc b/src/devices/mesh/mesh-l2-routing-protocol.cc new file mode 100644 index 000000000..e4f242fbf --- /dev/null +++ b/src/devices/mesh/mesh-l2-routing-protocol.cc @@ -0,0 +1,56 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Pavel Boyko + */ + +#include "ns3/log.h" +#include "ns3/mesh-l2-routing-protocol.h" +#include "ns3/mesh-point-device.h" + +NS_LOG_COMPONENT_DEFINE ("MeshL2RoutingProtocol"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (MeshL2RoutingProtocol); + +TypeId +MeshL2RoutingProtocol::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::MeshL2RoutingProtocol") + .SetParent (); + return tid; +} + +MeshL2RoutingProtocol::~MeshL2RoutingProtocol () +{ +} + +void +MeshL2RoutingProtocol::SetMeshPoint (Ptr mp) +{ + m_mp = mp; +} + +Ptr +MeshL2RoutingProtocol::GetMeshPoint () const +{ + return m_mp; +} + +} // namespace ns3 diff --git a/src/devices/mesh/mesh-l2-routing-protocol.h b/src/devices/mesh/mesh-l2-routing-protocol.h new file mode 100644 index 000000000..a265b3349 --- /dev/null +++ b/src/devices/mesh/mesh-l2-routing-protocol.h @@ -0,0 +1,126 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Pavel Boyko + */ + +#ifndef MESH_L2_ROUTING_PROTOCOL_H +#define MESH_L2_ROUTING_PROTOCOL_H + +#include "ns3/object.h" +#include "ns3/mac48-address.h" +#include "ns3/packet.h" + +namespace ns3 { + +class Packet; +class MeshPointDevice; + +/** + * \ingroup mesh + * + * \brief Interface for L2 mesh routing protocol and mesh point communication. + * + * Every mesh routing protocol must implement this interface. Each mesh point (MeshPointDevice) is supposed + * to know single L2RoutingProtocol to work with, see MeshPointDevice::SetRoutingProtocol (). + * + * This interface is similar to ipv4 routiong protocol base class. + */ +class MeshL2RoutingProtocol : public Object +{ +public: + /// Never forget to support NS3 object model + static TypeId GetTypeId (); + /// virtual D-tor for subclasses + virtual ~MeshL2RoutingProtocol (); + /** + * Callback to be invoked when route discovery procedure is completed. + * + * \param flag indicating whether a route was actually found and all needed information is + * added to the packet succesfully + * + * \param packet for which the route was resolved. All routing information for MAC layer + * must be stored in proper tags (like in case of HWMP, when WifiMacHeader + * needs address of next hop), or must be added as a packet header (if MAC + * does not need any additional information). So, the packet is returned back + * to MeshPointDevice looks like a pure packet with ethernet header + * (i.e data + src +dst + protocol). The only special information addressed + * to MeshPointDevice is an outcoming interface ID. + * + * \param src source address of the packet + * + * \param dst destiation address of the packet + * + * \param protocol ethernet 'Protocol' field, needed to form a proper MAC-layer header + * + * \param uint32_t outcoming interface to use or 0xffffffff if packet should be sent by ALL interfaces + */ + typedef Callback, /* packet */ + Mac48Address,/* src */ + Mac48Address,/* dst */ + uint16_t, /* protocol */ + uint32_t /* out interface ID */ + > RouteReplyCallback; + /** + * Request routing information, all packets must go through this request. + * + * Note that route discovery works async. -- RequestRoute returns immediately, while + * reply callback will be called when routing information will be available. + * \return true if valid route is already known + * \param sourceIface the incoming interface of the packet + * \param source source address + * \param destination destination address + * \param packet the packet to be resolved (needed the whole packet, because + * routing information is added as tags or headers). The packet + * will be returned to reply callback. + * \param protocolType protocol ID, needed to form a proper MAC-layer header + * \param routeReply callback to be invoked after route discovery procedure, supposed + * to really send packet using routing information. + */ + virtual bool RequestRoute (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, Ptr< + const Packet> packet, uint16_t protocolType, RouteReplyCallback routeReply) = 0; + /** + * \brief When packet is ready to go to upper layer, protocol must + * remove all its information: tags, header, etc. So, + * MeshPointDevice must call this method when passing a packet to + * upper layer. + * \returns true if packet shall not be dropeed, false otherwise. + * \param fromIface the incoming interface of the packet + * \param source source address + * \param destination destination address + * \param packet the packet to be handled + * \param protocolType protocol ID, needed to form a proper MAC-layer header + * \attention protocol type is passed by reference, because may be + * changed + */ + virtual bool RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, const Mac48Address destination, Ptr< + Packet> packet, uint16_t & protocolType) = 0; + /// Set host mesh point, analog of SetNode (...) methods for upper layer protocols. + void + SetMeshPoint (Ptr mp); + /// Each mesh protocol must be installed on the mesh point to work. + Ptr + GetMeshPoint () const; +protected: + /// Host mesh point + Ptr m_mp; +}; +}//namespace ns3 +#endif diff --git a/src/devices/mesh/mesh-point-device.cc b/src/devices/mesh/mesh-point-device.cc new file mode 100644 index 000000000..5c4dba64f --- /dev/null +++ b/src/devices/mesh/mesh-point-device.cc @@ -0,0 +1,462 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + * Pavel Boyko + */ + +#include "ns3/node.h" +#include "ns3/packet.h" +#include "ns3/log.h" +#include "ns3/pointer.h" +#include "ns3/mesh-point-device.h" +#include "ns3/wifi-net-device.h" +#include "ns3/mesh-wifi-interface-mac.h" + +NS_LOG_COMPONENT_DEFINE ("MeshPointDevice"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (MeshPointDevice); + +TypeId +MeshPointDevice::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::MeshPointDevice") + .SetParent () + .AddConstructor () + .AddAttribute ( "RoutingProtocol", + "The mesh routing protocol used by this mesh point.", + PointerValue (), + MakePointerAccessor ( + &MeshPointDevice::GetRoutingProtocol, &MeshPointDevice::SetRoutingProtocol), + MakePointerChecker< + MeshL2RoutingProtocol> ()); + return tid; +} + +MeshPointDevice::MeshPointDevice () : + m_ifIndex (0), m_mtu (1500) +{ + NS_LOG_FUNCTION_NOARGS (); + m_channel = CreateObject (); +} + +MeshPointDevice::~MeshPointDevice () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +void +MeshPointDevice::DoDispose () +{ + NS_LOG_FUNCTION_NOARGS (); + for (std::vector >::iterator iter = m_ifaces.begin (); iter != m_ifaces.end (); iter++) + { + *iter = 0; + } + m_ifaces.clear (); + m_node = 0; + NetDevice::DoDispose (); + +} + +//----------------------------------------------------------------------------- +// NetDevice interface implementation +//----------------------------------------------------------------------------- + +void +MeshPointDevice::ReceiveFromDevice (Ptr incomingPort, Ptr packet, uint16_t protocol, + Address const &src, Address const &dst, PacketType packetType) +{ + NS_LOG_FUNCTION_NOARGS (); + NS_LOG_DEBUG ("UID is " << packet->GetUid ()); + const Mac48Address src48 = Mac48Address::ConvertFrom (src); + const Mac48Address dst48 = Mac48Address::ConvertFrom (dst); + uint16_t& realProtocol = protocol; + NS_LOG_DEBUG ("SRC=" << src48 << ", DST = " << dst48 << ", I am: " << m_address); + if (!m_promiscRxCallback.IsNull ()) + { + m_promiscRxCallback (this, packet, protocol, src, dst, packetType); + } + if (dst48.IsGroup ()) + { + Ptr packet_copy = packet->Copy (); + if (m_routingProtocol->RemoveRoutingStuff (incomingPort->GetIfIndex (), src48, dst48, packet_copy, realProtocol)) + { + m_rxCallback (this, packet_copy, realProtocol, src); + Forward (incomingPort, packet, protocol, src48, dst48); + + m_rxStats.broadcastData++; + m_rxStats.broadcastDataBytes += packet->GetSize (); + } + return; + } + if (dst48 == m_address) + { + Ptr packet_copy = packet->Copy (); + if (m_routingProtocol->RemoveRoutingStuff (incomingPort->GetIfIndex (), src48, dst48, packet_copy, realProtocol)) + { + m_rxCallback (this, packet_copy, realProtocol, src); + m_rxStats.unicastData++; + m_rxStats.unicastDataBytes += packet->GetSize (); + } + return; + } + else + Forward (incomingPort, packet->Copy (), protocol, src48, dst48); +} + +void +MeshPointDevice::Forward (Ptr inport, Ptr packet, uint16_t protocol, + const Mac48Address src, const Mac48Address dst) +{ + // pass through routing protocol + m_routingProtocol->RequestRoute (inport->GetIfIndex (), src, dst, packet, protocol, MakeCallback ( + &MeshPointDevice::DoSend, this)); +} + +void +MeshPointDevice::SetIfIndex (const uint32_t index) +{ + NS_LOG_FUNCTION_NOARGS (); + m_ifIndex = index; +} + +uint32_t +MeshPointDevice::GetIfIndex () const +{ + NS_LOG_FUNCTION_NOARGS (); + return m_ifIndex; +} + +Ptr +MeshPointDevice::GetChannel () const +{ + NS_LOG_FUNCTION_NOARGS (); + return m_channel; +} + +Address +MeshPointDevice::GetAddress () const +{ + NS_LOG_FUNCTION_NOARGS (); + return m_address; +} + +void +MeshPointDevice::SetAddress (Address a) +{ + NS_LOG_WARN ("Manual changing mesh point address can cause routing errors."); + m_address = Mac48Address::ConvertFrom (a); +} + +bool +MeshPointDevice::SetMtu (const uint16_t mtu) +{ + NS_LOG_FUNCTION_NOARGS (); + m_mtu = mtu; + return true; +} + +uint16_t +MeshPointDevice::GetMtu () const +{ + NS_LOG_FUNCTION_NOARGS (); + return m_mtu; +} + +bool +MeshPointDevice::IsLinkUp () const +{ + NS_LOG_FUNCTION_NOARGS (); + return true; +} + +void +MeshPointDevice::AddLinkChangeCallback (Callback callback) +{ + // do nothing +} + +bool +MeshPointDevice::IsBroadcast () const +{ + NS_LOG_FUNCTION_NOARGS (); + return true; +} + +Address +MeshPointDevice::GetBroadcast () const +{ + NS_LOG_FUNCTION_NOARGS (); + return Mac48Address ("ff:ff:ff:ff:ff:ff"); +} + +bool +MeshPointDevice::IsMulticast () const +{ + NS_LOG_FUNCTION_NOARGS (); + return true; +} + +Address +MeshPointDevice::GetMulticast (Ipv4Address multicastGroup) const +{ + NS_LOG_FUNCTION (this << multicastGroup); + Mac48Address multicast = Mac48Address::GetMulticast (multicastGroup); + return multicast; +} + +bool +MeshPointDevice::IsPointToPoint () const +{ + NS_LOG_FUNCTION_NOARGS (); + return false; +} + +bool +MeshPointDevice::IsBridge () const +{ + NS_LOG_FUNCTION_NOARGS (); + return false; +} + +bool +MeshPointDevice::Send (Ptr packet, const Address& dest, uint16_t protocolNumber) +{ + const Mac48Address dst48 = Mac48Address::ConvertFrom (dest); + return m_routingProtocol->RequestRoute (m_ifIndex, m_address, dst48, packet, protocolNumber, MakeCallback ( + &MeshPointDevice::DoSend, this)); +} + +bool +MeshPointDevice::SendFrom (Ptr packet, const Address& src, const Address& dest, + uint16_t protocolNumber) +{ + const Mac48Address src48 = Mac48Address::ConvertFrom (src); + const Mac48Address dst48 = Mac48Address::ConvertFrom (dest); + return m_routingProtocol->RequestRoute (m_ifIndex, src48, dst48, packet, protocolNumber, MakeCallback ( + &MeshPointDevice::DoSend, this)); +} + +Ptr +MeshPointDevice::GetNode () const +{ + NS_LOG_FUNCTION_NOARGS (); + return m_node; +} + +void +MeshPointDevice::SetNode (Ptr node) +{ + NS_LOG_FUNCTION_NOARGS (); + m_node = node; +} + +bool +MeshPointDevice::NeedsArp () const +{ + NS_LOG_FUNCTION_NOARGS (); + return true; +} + +void +MeshPointDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb) +{ + NS_LOG_FUNCTION_NOARGS (); + m_rxCallback = cb; +} + +void +MeshPointDevice::SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb) +{ + NS_LOG_FUNCTION_NOARGS (); + m_promiscRxCallback = cb; +} + +bool +MeshPointDevice::SupportsSendFrom () const +{ + NS_LOG_FUNCTION_NOARGS (); + return false; // don't allow to bridge mesh network with something else. +} + +Address +MeshPointDevice::GetMulticast (Ipv6Address addr) const +{ + NS_LOG_FUNCTION (this << addr); + return Mac48Address::GetMulticast (addr); +} + +//----------------------------------------------------------------------------- +// Interfaces +//----------------------------------------------------------------------------- +uint32_t +MeshPointDevice::GetNInterfaces () const +{ + NS_LOG_FUNCTION_NOARGS (); + return m_ifaces.size (); +} + +Ptr +MeshPointDevice::GetInterface (uint32_t n) const +{ + for (std::vector >::const_iterator i = m_ifaces.begin (); i != m_ifaces.end (); i++) + { + if ((*i)->GetIfIndex () == n) + { + return (*i); + } + } + NS_FATAL_ERROR ("Mesh point interface is not found by index"); + return 0; +} +std::vector > +MeshPointDevice::GetInterfaces () const +{ + return m_ifaces; +} +void +MeshPointDevice::AddInterface (Ptr iface) +{ + NS_LOG_FUNCTION_NOARGS (); + + NS_ASSERT (iface != this); + if (!Mac48Address::IsMatchingType (iface->GetAddress ())) + { + NS_FATAL_ERROR ("Device does not support eui 48 addresses: cannot be used as a mesh point interface."); + } + if (!iface->SupportsSendFrom ()) + { + NS_FATAL_ERROR ("Device does not support SendFrom: cannot be used as a mesh point interface."); + } + + // Mesh point has MAC address of it's first interface + if (m_ifaces.empty ()) + { + m_address = Mac48Address::ConvertFrom (iface->GetAddress ()); + } + Ptr wifiNetDev = iface->GetObject (); + if (wifiNetDev == 0) + { + NS_FATAL_ERROR ("Device is not a WiFi NIC: cannot be used as a mesh point interface."); + } + Ptr ifaceMac = wifiNetDev->GetMac ()->GetObject (); + if (ifaceMac == 0) + { + NS_FATAL_ERROR ( + "WiFi device doesn't have correct MAC installed: cannot be used as a mesh point interface."); + } + ifaceMac->SetMeshPointAddress (m_address); + + // Receive frames from this interface + m_node->RegisterProtocolHandler (MakeCallback (&MeshPointDevice::ReceiveFromDevice, this), 0, iface, /*promiscuous = */ + true); + m_ifaces.push_back (iface); + m_channel->AddChannel (iface->GetChannel ()); +} + +//----------------------------------------------------------------------------- +// Protocols +//----------------------------------------------------------------------------- + +void +MeshPointDevice::SetRoutingProtocol (Ptr protocol) +{ + NS_LOG_FUNCTION_NOARGS (); + NS_ASSERT_MSG (PeekPointer (protocol->GetMeshPoint ()) == this, + "Routing protocol must be installed on mesh point to be useful."); + m_routingProtocol = protocol; +} + +Ptr +MeshPointDevice::GetRoutingProtocol () const +{ + return m_routingProtocol; +} + +void +MeshPointDevice::DoSend (bool success, Ptr packet, Mac48Address src, Mac48Address dst, + uint16_t protocol, uint32_t outIface) +{ + if (!success) + { + NS_LOG_DEBUG ("Resolve failed"); + return; + } + + // Count statistics + Statistics * stats = ((src == m_address) ? &m_txStats : &m_fwdStats); + + if (dst.IsBroadcast ()) + { + stats->broadcastData++; + stats->broadcastDataBytes += packet->GetSize (); + } + else + { + stats->unicastData++; + stats->unicastDataBytes += packet->GetSize (); + } + + // Send + if (outIface != 0xffffffff) + { + GetInterface (outIface)->SendFrom (packet, src, dst, protocol); + } + else + { + for (std::vector >::iterator i = m_ifaces.begin (); i != m_ifaces.end (); i++) + { + (*i) -> SendFrom (packet->Copy (), src, dst, protocol); + } + } +} +MeshPointDevice::Statistics::Statistics () : + unicastData (0), unicastDataBytes (0), broadcastData (0), broadcastDataBytes (0) +{ +} + +void +MeshPointDevice::Report (std::ostream & os) const +{ + os << "" << std::endl; +} + +void +MeshPointDevice::ResetStats () +{ + m_rxStats = Statistics (); + m_txStats = Statistics (); + m_fwdStats = Statistics (); +} + +} // namespace ns3 diff --git a/src/devices/mesh/mesh-point-device.h b/src/devices/mesh/mesh-point-device.h new file mode 100644 index 000000000..65aed00bb --- /dev/null +++ b/src/devices/mesh/mesh-point-device.h @@ -0,0 +1,185 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Pavel Boyko + */ + +#ifndef L2ROUTING_NET_DEVICE_H +#define L2ROUTING_NET_DEVICE_H + +#include "ns3/net-device.h" +#include "ns3/mac48-address.h" +#include "ns3/bridge-channel.h" +#include "ns3/mesh-l2-routing-protocol.h" + +namespace ns3 { + +class Node; +/** + * \ingroup mesh + * + * \brief Virtual net device modeling mesh point. + * + * Mesh point is a virtual net device which is responsible for + * - Aggreagating and coordinating 1..* real devices -- mesh interfaces, see MeshInterfaceDevice class. + * - Hosting all mesh-related level 2 protocols. + * + * One of hosted L2 protocols must inplement L2RoutingProtocol interface and is used for packets forwarding. + * + * From the level 3 point of view MeshPointDevice is similar to BridgeNetDevice, but the packets, + * which going through may be changed (because L2 protocols may require their own headers or tags). + * + * Attributes: TODO + */ +class MeshPointDevice : public NetDevice +{ +public: + /// Object type ID for NS3 object system + static TypeId GetTypeId (); + /// C-tor create empty (without interfaces and protocols) mesh point + MeshPointDevice (); + /// D-tor + virtual ~MeshPointDevice (); + + ///\name Interfaces + //\{ + /** + * \brief Attach new interface to the station. Interface must support 48-bit MAC address and SendFrom method. + * + * \attention Only MeshPointDevice can have IP address, but not individual interfaces. + */ + void AddInterface (Ptr port); + /** + * \return number of interfaces + */ + uint32_t GetNInterfaces () const; + /** + * \return interface device by its index (aka ID) + * \param id is interface id, 0 <= id < GetNInterfaces + */ + Ptr GetInterface (uint32_t id) const; + /** + * \return vector of interfaces + */ + std::vector > GetInterfaces () const; + //\} + + ///\name Protocols + //\{ + /// Register routing protocol to be used. Protocol must be alredy installed on this mesh point. + void SetRoutingProtocol (Ptr protocol); + /// Access current routing protocol + Ptr GetRoutingProtocol () const; + //\} + + ///\name NetDevice interface for upper layers + //\{ + virtual void SetIfIndex (const uint32_t index); + virtual uint32_t GetIfIndex () const; + virtual Ptr GetChannel () const; + virtual Address GetAddress () const; + virtual void SetAddress (Address a); + virtual bool SetMtu (const uint16_t mtu); + virtual uint16_t GetMtu () const; + virtual bool IsLinkUp () const; + virtual void AddLinkChangeCallback (Callback callback); + virtual bool IsBroadcast () const; + virtual Address GetBroadcast () const; + virtual bool IsMulticast () const; + virtual Address GetMulticast (Ipv4Address multicastGroup) const; + virtual bool IsPointToPoint () const; + virtual bool IsBridge () const; + virtual bool Send (Ptr packet, const Address& dest, uint16_t protocolNumber); + virtual bool SendFrom (Ptr packet, const Address& source, const Address& dest, uint16_t protocolNumber); + virtual Ptr GetNode () const; + virtual void SetNode (Ptr node); + virtual bool NeedsArp () const; + virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb); + virtual void SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb); + virtual bool SupportsSendFrom () const; + virtual Address GetMulticast (Ipv6Address addr) const; + virtual void DoDispose (); + //\} + + ///\name Statistics + //\{ + /// Print statistics counters + void Report (std::ostream & os) const; + /// Reset statistics counters + void ResetStats (); + //\} + +private: + /// Receive packet from interface + void ReceiveFromDevice (Ptr device, Ptr packet, uint16_t protocol, + Address const &source, Address const &destination, PacketType packetType); + /// Forward packet down to interfaces + void Forward (Ptr incomingPort, Ptr packet, + uint16_t protocol, const Mac48Address src, + const Mac48Address dst); + /** + * \brief Response callback for L2 routing protocol. This will be executed when routing information is ready. + * + * \param success True is route found. TODO: diagnose routing errors + * \param packet Packet to send + * \param src Source MAC address + * \param dst Destination MAC address + * \param protocol Protocol ID + * \param iface Interface to use (ID) for send (decided by routing protocol). All interfaces will be used if outIface = 0xffffffff + */ + void + DoSend (bool success, Ptr packet, Mac48Address src, Mac48Address dst, uint16_t protocol, + uint32_t iface); + +private: + /// Receive action + NetDevice::ReceiveCallback m_rxCallback; + /// Promisc receive action + NetDevice::PromiscReceiveCallback m_promiscRxCallback; + /// Mesh point MAC address, supposed to be the address of the first added interface + Mac48Address m_address; + /// Parent node + Ptr m_node; + /// List of interfaces + std::vector< Ptr > m_ifaces; + /// If index + uint32_t m_ifIndex; + /// MTU in bytes + uint16_t m_mtu; + /// Virtual channel for upper layers + Ptr m_channel; + /// Current routing protocol, used mainly by GetRoutingProtocol + Ptr m_routingProtocol; + + ///\name Device statistics counters + ///\{ + struct Statistics + { + uint32_t unicastData; + uint32_t unicastDataBytes; + uint32_t broadcastData; + uint32_t broadcastDataBytes; + + Statistics (); + }; + /// Counters + Statistics m_rxStats, m_txStats, m_fwdStats; + ///\} +}; +} //namespace ns3 +#endif diff --git a/src/devices/mesh/mesh-wifi-beacon.cc b/src/devices/mesh/mesh-wifi-beacon.cc new file mode 100644 index 000000000..a1300e9f8 --- /dev/null +++ b/src/devices/mesh/mesh-wifi-beacon.cc @@ -0,0 +1,62 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Pavel Boyko + */ + +#include "ns3/mesh-wifi-beacon.h" + + +namespace ns3 { + +MeshWifiBeacon::MeshWifiBeacon (Ssid ssid, SupportedRates rates, uint64_t us) +{ + m_header.SetSsid (ssid); + m_header.SetSupportedRates (rates); + m_header.SetBeaconIntervalUs (us); +} +void +MeshWifiBeacon::AddInformationElement (Ptr ie) +{ + m_elements.AddInformationElement (ie); +} + + +Ptr +MeshWifiBeacon::CreatePacket () +{ + Ptr packet = Create (); + packet->AddHeader (m_elements); + packet->AddHeader (BeaconHeader ()); + return packet; +} +WifiMacHeader +MeshWifiBeacon::CreateHeader (Mac48Address address, Mac48Address mpAddress) +{ + WifiMacHeader hdr; + + hdr.SetBeacon (); + hdr.SetAddr1 (Mac48Address::GetBroadcast ()); + hdr.SetAddr2 (address); + hdr.SetAddr3 (mpAddress); + hdr.SetDsNotFrom (); + hdr.SetDsNotTo (); + + return hdr; +} +} // namespace ns3 + diff --git a/src/devices/mesh/mesh-wifi-beacon.h b/src/devices/mesh/mesh-wifi-beacon.h new file mode 100644 index 000000000..4ac8afed7 --- /dev/null +++ b/src/devices/mesh/mesh-wifi-beacon.h @@ -0,0 +1,76 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Pavel Boyko + */ + +#ifndef MESHWIFIBEACON_H_ +#define MESHWIFIBEACON_H_ + +#include "ns3/object.h" +#include "ns3/packet.h" +#include "ns3/mgt-headers.h" // from wifi module +#include "ns3/wifi-mac-header.h" +#include "ns3/wifi-information-element-vector.h" + +#include + +namespace ns3 { + +/** + * \brief Beacon is beacon header + list of arbitrary information elements + * + * It is supposed that distinct mesh protocols can use beacons to transport + * their own information elements. + */ +class MeshWifiBeacon +{ +public: + /** + * C-tor + * + * \param ssid is SSID for beacon header + * \param rates is a set of supported rates + * \param us beacon interval in microseconds + */ + MeshWifiBeacon (Ssid ssid, SupportedRates rates, uint64_t us); + /// Read standard Wifi beacon header + MgtBeaconHeader BeaconHeader () const { return m_header; } + /// Add information element + void AddInformationElement (Ptr ie); + + /** + * Create wifi header for beacon frame. + * + * \param address is sender address + * \param mpAddress is mesh point address + */ + WifiMacHeader CreateHeader (Mac48Address address, Mac48Address mpAddress); + /// Create frame = { beacon header + all information elements sorted by ElementId () } + Ptr CreatePacket (); + +private: + /// Beacon header + MgtBeaconHeader m_header; + /// List of information elements added + WifiInformationElementVector m_elements; +}; + +} + + +#endif /* MESHWIFIBEACON_H_ */ diff --git a/src/devices/mesh/mesh-wifi-interface-mac-plugin.h b/src/devices/mesh/mesh-wifi-interface-mac-plugin.h new file mode 100644 index 000000000..e064e482d --- /dev/null +++ b/src/devices/mesh/mesh-wifi-interface-mac-plugin.h @@ -0,0 +1,71 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Pavel Boyko + */ + +#ifndef MESHWIFIINTERFACEMACPLUGIN_H_ +#define MESHWIFIINTERFACEMACPLUGIN_H_ + +#include "ns3/wifi-mac-header.h" +#include "ns3/packet.h" +#include "ns3/mac48-address.h" +#include "ns3/mesh-wifi-beacon.h" +#include "ns3/ref-count-base.h" + +namespace ns3 { + +class MeshWifiInterfaceMac; + +/** + * \ingroup mesh + * + * \brief Common interface for mesh point interface MAC plugins + * + * TODO: plugins description + */ +class MeshWifiInterfaceMacPlugin : public RefCountBase +{ +public: + /// This is for subclasses + virtual ~MeshWifiInterfaceMacPlugin (){}; + /// Each plugin must be installed on interface to work + virtual void SetParent (Ptr parent) = 0; + /** + * \brief Process received frame + * + * \return false if (and only if) frame should be dropped + * TODO define when MAC call this + */ + virtual bool Receive (Ptr packet, const WifiMacHeader & header) = 0; + /** + * \brief Update frame before it will be forwarded down + * + * \return false if (and only if) frame should be dropped + * TODO define when MAC call this, preconditions & postconditions + */ + virtual bool UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) = 0; + /** + * \brief Update beacon before it will be formed and sent + * + * TODO define when MAC call this + */ + virtual void UpdateBeacon (MeshWifiBeacon & beacon) const = 0; +}; + +} // namespace ns3 +#endif /* MESHWIFIINTERFACEMACPLUGIN_H_ */ diff --git a/src/devices/mesh/mesh-wifi-interface-mac.cc b/src/devices/mesh/mesh-wifi-interface-mac.cc new file mode 100644 index 000000000..31020f759 --- /dev/null +++ b/src/devices/mesh/mesh-wifi-interface-mac.cc @@ -0,0 +1,742 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Pavel Boyko + */ + +#include "ns3/mesh-wifi-interface-mac.h" +#include "ns3/mesh-wifi-beacon.h" +#include "ns3/log.h" +#include "ns3/wifi-phy.h" +#include "ns3/dcf-manager.h" +#include "ns3/mac-rx-middle.h" +#include "ns3/mac-low.h" +#include "ns3/dca-txop.h" +#include "ns3/random-variable.h" +#include "ns3/simulator.h" +#include "ns3/yans-wifi-phy.h" +#include "ns3/pointer.h" +#include "ns3/trace-source-accessor.h" +#include "ns3/qos-tag.h" + +NS_LOG_COMPONENT_DEFINE ("MeshWifiInterfaceMac"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (MeshWifiInterfaceMac); + +TypeId +MeshWifiInterfaceMac::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::MeshWifiInterfaceMac") + .SetParent () + .AddConstructor () + .AddAttribute ( "BeaconInterval", + "Beacon Interval", + TimeValue (Seconds (0.5)), + + MakeTimeAccessor ( + &MeshWifiInterfaceMac::m_beaconInterval), + MakeTimeChecker () + ) + .AddAttribute ( "RandomStart", + "Window when beacon generating starts (uniform random) in seconds", + TimeValue (Seconds (0.5)), + MakeTimeAccessor ( + &MeshWifiInterfaceMac::m_randomStart), + MakeTimeChecker () + ) + .AddAttribute ( "BeaconGeneration", + "Enable/Disable Beaconing.", + BooleanValue (true), + MakeBooleanAccessor ( + &MeshWifiInterfaceMac::SetBeaconGeneration, &MeshWifiInterfaceMac::GetBeaconGeneration), + MakeBooleanChecker () + ) + .AddTraceSource ( "TxOkHeader", + "The header of successfully transmitted packet", + MakeTraceSourceAccessor ( + &MeshWifiInterfaceMac::m_txOkCallback) + ) + .AddTraceSource ( "TxErrHeader", + "The header of unsuccessfully transmitted packet", + MakeTraceSourceAccessor ( + &MeshWifiInterfaceMac::m_txErrCallback) + ) + ; + return tid; +} +MeshWifiInterfaceMac::MeshWifiInterfaceMac () +{ + NS_LOG_FUNCTION (this); + + m_rxMiddle = new MacRxMiddle (); + m_rxMiddle->SetForwardCallback (MakeCallback (&MeshWifiInterfaceMac::Receive, this)); + + m_low = CreateObject (); + m_low->SetRxCallback (MakeCallback (&MacRxMiddle::Receive, m_rxMiddle)); + + m_dcfManager = new DcfManager (); + m_dcfManager->SetupLowListener (m_low); + + m_beaconDca = CreateObject (); + m_beaconDca->SetLow (m_low); + m_beaconDca->SetMinCw (0); + m_beaconDca->SetMaxCw (0); + m_beaconDca->SetAifsn (1); + m_beaconDca->SetManager (m_dcfManager); + + SetQueue (AC_VO); + SetQueue (AC_VI); + SetQueue (AC_BE); + SetQueue (AC_BK); +} +MeshWifiInterfaceMac::~MeshWifiInterfaceMac () +{ + NS_LOG_FUNCTION (this); +} +//----------------------------------------------------------------------------- +// WifiMac inherited +//----------------------------------------------------------------------------- +void +MeshWifiInterfaceMac::SetSlot (Time slotTime) +{ + NS_LOG_FUNCTION (this << slotTime); + m_dcfManager->SetSlot (slotTime); + m_low->SetSlotTime (slotTime); + m_slot = slotTime; +} +void +MeshWifiInterfaceMac::SetSifs (Time sifs) +{ + NS_LOG_FUNCTION (this << sifs); + m_dcfManager->SetSifs (sifs); + m_low->SetSifs (sifs); + m_sifs = sifs; +} +void +MeshWifiInterfaceMac::SetAckTimeout (Time ackTimeout) +{ + m_low->SetAckTimeout (ackTimeout); +} +void +MeshWifiInterfaceMac::SetCtsTimeout (Time ctsTimeout) +{ + m_low->SetCtsTimeout (ctsTimeout); +} +void +MeshWifiInterfaceMac::SetPifs (Time pifs) +{ + NS_LOG_FUNCTION (this << pifs); + m_pifs = pifs; +} +void +MeshWifiInterfaceMac::SetEifsNoDifs (Time eifsNoDifs) +{ + NS_LOG_FUNCTION (this << eifsNoDifs); + m_dcfManager->SetEifsNoDifs (eifsNoDifs); + m_eifsNoDifs = eifsNoDifs; +} +Time +MeshWifiInterfaceMac::GetSlot () const +{ + return m_slot; +} +Time +MeshWifiInterfaceMac::GetSifs () const +{ + return m_sifs; +} +Time +MeshWifiInterfaceMac::GetEifsNoDifs () const +{ + return m_eifsNoDifs; +} +Time +MeshWifiInterfaceMac::GetAckTimeout () const +{ + return m_low->GetAckTimeout (); +} +Time +MeshWifiInterfaceMac::GetCtsTimeout () const +{ + return m_low->GetCtsTimeout (); +} +Time +MeshWifiInterfaceMac::GetPifs () const +{ + return m_low->GetPifs (); +} +void +MeshWifiInterfaceMac::SetWifiPhy (Ptr phy) +{ + NS_LOG_FUNCTION (this << phy); + m_phy = phy; + m_dcfManager->SetupPhyListener (phy); + m_low->SetPhy (phy); +} +void +MeshWifiInterfaceMac::SetWifiRemoteStationManager (Ptr stationManager) +{ + NS_LOG_FUNCTION (this << stationManager); + m_stationManager = stationManager; + for (Queues::const_iterator i = m_queues.begin (); i != m_queues.end (); i++) + { + i->second->SetWifiRemoteStationManager (stationManager); + } + m_beaconDca->SetWifiRemoteStationManager (stationManager); + m_low->SetWifiRemoteStationManager (stationManager); +} +void +MeshWifiInterfaceMac::Enqueue (Ptr packet, Mac48Address to, Mac48Address from) +{ + NS_LOG_FUNCTION (this << packet << to << from); + ForwardDown (packet, from, to); +} +void +MeshWifiInterfaceMac::Enqueue (Ptr packet, Mac48Address to) +{ + NS_LOG_FUNCTION (this << packet << to); + ForwardDown (packet, m_low->GetAddress (), to); +} +bool +MeshWifiInterfaceMac::SupportsSendFrom () const +{ + return true; +} +void +MeshWifiInterfaceMac::SetForwardUpCallback ( + Callback , Mac48Address, Mac48Address> upCallback) +{ + NS_LOG_FUNCTION (this); + m_upCallback = upCallback; +} +void +MeshWifiInterfaceMac::SetLinkUpCallback (Callback linkUp) +{ + NS_LOG_FUNCTION (this); + if (!linkUp.IsNull ()) + { + linkUp (); + } +} +void +MeshWifiInterfaceMac::SetLinkDownCallback (Callback linkDown) +{ + NS_LOG_FUNCTION (this); +} +Mac48Address +MeshWifiInterfaceMac::GetAddress () const +{ + return m_address; +} +Mac48Address +MeshWifiInterfaceMac::GetBssid () const +{ + return m_address; +} +Ssid +MeshWifiInterfaceMac::GetSsid () const +{ + return m_meshId; +} +void +MeshWifiInterfaceMac::SetAddress (Mac48Address address) +{ + NS_LOG_FUNCTION (address); + m_low->SetAddress (address); + m_address = address; +} +void +MeshWifiInterfaceMac::SetSsid (Ssid ssid) +{ + NS_LOG_FUNCTION (ssid); + m_meshId = ssid; +} +void +MeshWifiInterfaceMac::DoDispose () +{ + NS_LOG_FUNCTION (this); + delete m_rxMiddle; + delete m_dcfManager; + //Delete smart pointers: + m_rxMiddle = 0; + m_low = 0; + m_dcfManager = 0; + m_phy = 0; + m_queues.clear (); + m_beaconSendEvent.Cancel (); + m_beaconDca = 0; + + WifiMac::DoDispose (); +} +//----------------------------------------------------------------------------- +// Plugins +//----------------------------------------------------------------------------- +void +MeshWifiInterfaceMac::InstallPlugin (Ptr plugin) +{ + NS_LOG_FUNCTION (this); + + plugin->SetParent (this); + m_plugins.push_back (plugin); +} +//----------------------------------------------------------------------------- +// Switch channels +//----------------------------------------------------------------------------- +uint16_t +MeshWifiInterfaceMac::GetFrequencyChannel () const +{ + NS_LOG_FUNCTION (this); + NS_ASSERT (m_phy != 0); // need PHY to set/get channel + + Ptr phy = m_phy->GetObject (); + if (phy != 0) + { + return phy->GetChannelNumber (); + } + else + { + return 0; + } +} +void +MeshWifiInterfaceMac::SwitchFrequencyChannel (uint16_t new_id) +{ + NS_LOG_FUNCTION (this); + NS_ASSERT (m_phy != 0); // need PHY to set/get channel + /* TODO + * + * Correct channel switching is: + * + * 1. Interface down, e.g. to stop packets from layer 3 + * 2. Wait before all output queues will be empty + * 3. Switch PHY channel + * 4. Interface up + * + * Now we use dirty channel switch -- just change frequency + */ + Ptr phy = m_phy->GetObject (); + phy->SetChannelNumber (new_id); + // Don't know NAV on new channel + m_dcfManager->NotifyNavResetNow (Seconds (0)); +} +//----------------------------------------------------------------------------- +// Forward frame up/down +//----------------------------------------------------------------------------- +void +MeshWifiInterfaceMac::ForwardUp (Ptr packet, Mac48Address src, Mac48Address dst) +{ + NS_LOG_FUNCTION (this << packet << src); + m_upCallback (packet, src, dst); +} + +void +MeshWifiInterfaceMac::ForwardDown (Ptr const_packet, Mac48Address from, Mac48Address to) +{ + // copy packet to allow modifications + Ptr packet = const_packet->Copy (); + WifiMacHeader hdr; + hdr.SetTypeData (); + hdr.SetAddr2 (GetAddress ()); + hdr.SetAddr3 (to); + hdr.SetAddr4 (from); + hdr.SetDsFrom (); + hdr.SetDsTo (); + // Fill QoS fields: + hdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK); + hdr.SetQosNoEosp (); + hdr.SetQosNoAmsdu (); + hdr.SetQosTxopLimit (0); + // Address 1 is unknwon here. Routing plugin is responsible to correctly set it. + hdr.SetAddr1 (Mac48Address ()); + // Filter packet through all installed plugins + for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--) + { + bool drop = !((*i)->UpdateOutcomingFrame (packet, hdr, from, to)); + if (drop) + { + return; // plugin drops frame + } + } + // Assert that address1 is set. Assert will fail e.g. if there is no installed routing plugin. + NS_ASSERT (hdr.GetAddr1 () != Mac48Address ()); + // Queue frame + WifiRemoteStation *destination = m_stationManager->Lookup (to); + if (destination->IsBrandNew ()) + { + // in adhoc mode, we assume that every destination + // supports all the rates we support. + for (uint32_t i = 0; i < m_phy->GetNModes (); i++) + { + destination->AddSupportedMode (m_phy->GetMode (i)); + } + destination->RecordDisassociated (); + } + //Classify: application sets a tag, which is removed here + // Get Qos tag: + AccessClass ac = AC_BE; + QosTag tag; + if (packet->RemovePacketTag (tag)) + { + ac = QosUtilsMapTidToAc (tag.Get ()); + } + m_stats.sentFrames++; + m_stats.sentBytes += packet->GetSize (); + NS_ASSERT (m_queues.find (ac) != m_queues.end ()); + m_queues[ac]->Queue (packet, hdr); +} +void +MeshWifiInterfaceMac::SendManagementFrame (Ptr packet, const WifiMacHeader& hdr) +{ + //Filter management frames: + WifiMacHeader header = hdr; + for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--) + { + bool drop = !((*i)->UpdateOutcomingFrame (packet, header, Mac48Address (), Mac48Address ())); + if (drop) + { + return; // plugin drops frame + } + } + m_stats.sentFrames++; + m_stats.sentBytes += packet->GetSize (); + if ((m_queues.find (AC_VO) == m_queues.end ()) || (m_queues.find (AC_BK) == m_queues.end ())) + { + NS_FATAL_ERROR ("Voice or Background queue is not set up!"); + } + /* + * When we send a management frame - it is better to enqueue it to + * priority queue. But when we send a broadcast management frame, + * like PREQ, little MinCw value may cause collisions during + * retransmissions (two neighbor stations may choose the same window + * size, and two packets will be collided). So, broadcast management + * frames go to BK queue. + */ + if (hdr.GetAddr1 () != Mac48Address::GetBroadcast ()) + { + m_queues[AC_VO]->Queue (packet, header); + } + else + { + m_queues[AC_BK]->Queue (packet, header); + } +} +SupportedRates +MeshWifiInterfaceMac::GetSupportedRates () const +{ + // set the set of supported rates and make sure that we indicate + // the Basic Rate set in this set of supported rates. + SupportedRates rates; + for (uint32_t i = 0; i < m_phy->GetNModes (); i++) + { + WifiMode mode = m_phy->GetMode (i); + rates.AddSupportedRate (mode.GetDataRate ()); + } + // set the basic rates + for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++) + { + WifiMode mode = m_stationManager->GetBasicMode (j); + rates.SetBasicRate (mode.GetDataRate ()); + } + return rates; +} +bool +MeshWifiInterfaceMac::CheckSupportedRates (SupportedRates rates) const +{ + for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++) + { + WifiMode mode = m_stationManager->GetBasicMode (i); + if (!rates.IsSupportedRate (mode.GetDataRate ())) + { + return false; + } + } + return true; +} +//----------------------------------------------------------------------------- +// Beacons +//----------------------------------------------------------------------------- +void +MeshWifiInterfaceMac::SetRandomStartDelay (Time interval) +{ + NS_LOG_FUNCTION (this << interval); + m_randomStart = interval; +} +void +MeshWifiInterfaceMac::SetBeaconInterval (Time interval) +{ + NS_LOG_FUNCTION (this << interval); + m_beaconInterval = interval; +} +Time +MeshWifiInterfaceMac::GetBeaconInterval () const +{ + return m_beaconInterval; +} +void +MeshWifiInterfaceMac::SetBeaconGeneration (bool enable) +{ + NS_LOG_FUNCTION (this << enable); + UniformVariable coefficient (0.0, m_randomStart.GetSeconds ()); + if (enable) + { + Time randomStart = Seconds (coefficient.GetValue ()); + // Now start sending beacons after some random delay (to avoid collisions) + NS_ASSERT (!m_beaconSendEvent.IsRunning ()); + m_beaconSendEvent = Simulator::Schedule (randomStart, &MeshWifiInterfaceMac::SendBeacon, this); + m_tbtt = Simulator::Now () + randomStart; + } + else + { + // stop sending beacons + m_beaconSendEvent.Cancel (); + } +} +bool +MeshWifiInterfaceMac::GetBeaconGeneration () const +{ + return m_beaconSendEvent.IsRunning (); +} +Time +MeshWifiInterfaceMac::GetTbtt () const +{ + return m_tbtt; +} +void +MeshWifiInterfaceMac::ShiftTbtt (Time shift) +{ + // User of ShiftTbtt () must take care don't shift it to the past + NS_ASSERT (GetTbtt () + shift > Simulator::Now ()); + + m_tbtt += shift; + // Shift scheduled event + Simulator::Cancel (m_beaconSendEvent); + m_beaconSendEvent = Simulator::Schedule (GetTbtt () - Simulator::Now (), &MeshWifiInterfaceMac::SendBeacon, + this); +} +void +MeshWifiInterfaceMac::ScheduleNextBeacon () +{ + m_tbtt += GetBeaconInterval (); + m_beaconSendEvent = Simulator::Schedule (GetBeaconInterval (), &MeshWifiInterfaceMac::SendBeacon, this); +} +void +MeshWifiInterfaceMac::SendBeacon () +{ + NS_LOG_FUNCTION (this); + NS_LOG_DEBUG (GetAddress () << " is sending beacon"); + + NS_ASSERT (!m_beaconSendEvent.IsRunning ()); + NS_ASSERT (Simulator::Now ().GetMicroSeconds () == GetTbtt ().GetMicroSeconds ()); // assert that beacon is just on time + + // Form & send beacon + MeshWifiBeacon beacon (GetSsid (), GetSupportedRates (), m_beaconInterval.GetMicroSeconds ()); + + // Ask all plugins to add their specific information elements to beacon + for (PluginList::const_iterator i = m_plugins.begin (); i != m_plugins.end (); ++i) + { + (*i)->UpdateBeacon (beacon); + } + m_beaconDca->Queue (beacon.CreatePacket (), beacon.CreateHeader (GetAddress (), GetMeshPointAddress ())); + + ScheduleNextBeacon (); +} +void +MeshWifiInterfaceMac::Receive (Ptr packet, WifiMacHeader const *hdr) +{ + // Process beacon + if ((hdr->GetAddr1 () != GetAddress ()) && (hdr->GetAddr1 () != Mac48Address::GetBroadcast ())) + { + return; + } + if (hdr->IsBeacon ()) + { + m_stats.recvBeacons++; + MgtBeaconHeader beacon_hdr; + Mac48Address from = hdr->GetAddr2 (); + + packet->PeekHeader (beacon_hdr); + + NS_LOG_DEBUG ("Beacon received from " << hdr->GetAddr2 () << " I am " << GetAddress () << " at " + << Simulator::Now ().GetMicroSeconds () << " microseconds"); + + // update supported rates + if (beacon_hdr.GetSsid ().IsEqual (GetSsid ())) + { + SupportedRates rates = beacon_hdr.GetSupportedRates (); + WifiRemoteStation * peerSta = m_stationManager->Lookup (hdr->GetAddr2 ()); + + for (uint32_t i = 0; i < m_phy->GetNModes (); i++) + { + WifiMode mode = m_phy->GetMode (i); + if (rates.IsSupportedRate (mode.GetDataRate ())) + { + peerSta->AddSupportedMode (mode); + if (rates.IsBasicRate (mode.GetDataRate ())) + { + m_stationManager->AddBasicMode (mode); + } + } + } + } + } + else + { + m_stats.recvBytes += packet->GetSize (); + m_stats.recvFrames++; + } + // Filter frame through all installed plugins + for (PluginList::iterator i = m_plugins.begin (); i != m_plugins.end (); ++i) + { + bool drop = !((*i)->Receive (packet, *hdr)); + if (drop) + { + return; // plugin drops frame + } + } + // Check if QoS tag exists and add it: + if (hdr->IsQosData ()) + { + packet->AddPacketTag (QosTag (hdr->GetQosTid ())); + } + // Forward data up + if (hdr->IsData ()) + { + ForwardUp (packet, hdr->GetAddr4 (), hdr->GetAddr3 ()); + } +} +uint32_t +MeshWifiInterfaceMac::GetLinkMetric (Mac48Address peerAddress) +{ + uint32_t metric = 1; + if (!m_linkMetricCallback.IsNull ()) + { + metric = m_linkMetricCallback (peerAddress, this); + } + return metric; +} +void +MeshWifiInterfaceMac::SetLinkMetricCallback (Callback > cb) +{ + m_linkMetricCallback = cb; +} +Ptr +MeshWifiInterfaceMac::GetStationManager () +{ + return m_stationManager; +} +void +MeshWifiInterfaceMac::SetMeshPointAddress (Mac48Address a) +{ + m_mpAddress = a; +} +Mac48Address +MeshWifiInterfaceMac::GetMeshPointAddress () const +{ + return m_mpAddress; +} +//Statistics: +MeshWifiInterfaceMac::Statistics::Statistics () : + recvBeacons (0), sentFrames (0), sentBytes (0), recvFrames (0), recvBytes (0) +{ +} +void +MeshWifiInterfaceMac::Statistics::Print (std::ostream & os) const +{ + os << "" << std::endl; +} +void +MeshWifiInterfaceMac::Report (std::ostream & os) const +{ + os << "" << std::endl; + m_stats.Print (os); + os << "" << std::endl; +} +void +MeshWifiInterfaceMac::ResetStats () +{ + m_stats = Statistics::Statistics (); +} +void +MeshWifiInterfaceMac::SetQueue (AccessClass ac) +{ + if (m_queues.find (ac) != m_queues.end ()) + { + NS_LOG_WARN ("Queue is already set!"); + return; + } + Ptr queue = Create (); + queue->SetLow (m_low); + queue->SetManager (m_dcfManager); + queue->SetTxOkCallback (MakeCallback (&MeshWifiInterfaceMac::TxOk, this)); + queue->SetTxFailedCallback (MakeCallback (&MeshWifiInterfaceMac::TxFailed, this)); + + m_queues.insert (std::make_pair (ac, queue)); +} +void +MeshWifiInterfaceMac::TxOk (WifiMacHeader const &hdr) +{ + m_txOkCallback (hdr); +} +void +MeshWifiInterfaceMac::TxFailed (WifiMacHeader const &hdr) +{ + m_txErrCallback (hdr); +} + +void +MeshWifiInterfaceMac::FinishConfigureStandard (enum WifiPhyStandard standard) +{ + switch (standard) + { + case WIFI_PHY_STANDARD_holland: + // fall through + case WIFI_PHY_STANDARD_80211a: + // fall through + case WIFI_PHY_STANDARD_80211_10Mhz: + // fall through + case WIFI_PHY_STANDARD_80211_5Mhz: + ConfigureDcf (m_queues[AC_BK], 15, 1023, AC_BK); + ConfigureDcf (m_queues[AC_BE], 15, 1023, AC_BE); + ConfigureDcf (m_queues[AC_VI], 15, 1023, AC_VI); + ConfigureDcf (m_queues[AC_VO], 15, 1023, AC_VO); + break; + case WIFI_PHY_STANDARD_80211b: + ConfigureDcf (m_queues[AC_BK], 31, 1023, AC_BK); + ConfigureDcf (m_queues[AC_BE], 31, 1023, AC_BE); + ConfigureDcf (m_queues[AC_VI], 31, 1023, AC_VI); + ConfigureDcf (m_queues[AC_VO], 31, 1023, AC_VO); + break; + default: + NS_ASSERT (false); + break; + } +} + +} // namespace ns3 + diff --git a/src/devices/mesh/mesh-wifi-interface-mac.h b/src/devices/mesh/mesh-wifi-interface-mac.h new file mode 100644 index 000000000..99bffce06 --- /dev/null +++ b/src/devices/mesh/mesh-wifi-interface-mac.h @@ -0,0 +1,254 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Pavel Boyko + */ + +#ifndef MESHWIFIINTERFACEMAC_H_ +#define MESHWIFIINTERFACEMAC_H_ + +#include +#include +#include "ns3/mac48-address.h" +#include "ns3/mgt-headers.h" +#include "ns3/callback.h" +#include "ns3/packet.h" +#include "ns3/nstime.h" +#include "ns3/wifi-remote-station-manager.h" +#include "ns3/wifi-mac.h" +#include "ns3/mesh-wifi-interface-mac-plugin.h" +#include "ns3/event-id.h" +#include "qos-utils.h" +namespace ns3 { + +class WifiMacHeader; +class DcaTxop; +class WifiPhy; +class DcfManager; +class MacRxMiddle; +class MacLow; +/** + * \ingroup mesh + * + * \brief Basic MAC of mesh point Wi-Fi interface. Its function is extendable through plugins mechanism. + * + * Now only three output queues are used: + * - beacons (PIFS and no backoff), + * - background traffic, + * - management and priority traffic. + * + */ +class MeshWifiInterfaceMac : public WifiMac +{ +public: + /// Never forget to support typeid + static TypeId GetTypeId (); + /// C-tor + MeshWifiInterfaceMac (); + /// D-tor + virtual ~MeshWifiInterfaceMac (); + + ///\name Inherited from WifiMac + //\{ + virtual void SetSlot (Time slotTime); + virtual void SetSifs (Time sifs); + virtual void SetPifs (Time pifs); + virtual void SetCtsTimeout (Time ctsTimeout); + virtual void SetAckTimeout (Time ackTimeout); + virtual void SetEifsNoDifs (Time eifsNoDifs); + virtual Time GetSlot () const; + virtual Time GetSifs () const; + virtual Time GetPifs () const; + virtual Time GetCtsTimeout () const; + virtual Time GetAckTimeout () const; + virtual Time GetEifsNoDifs () const; + virtual void SetWifiPhy (Ptr phy); + virtual void SetWifiRemoteStationManager (Ptr stationManager); + virtual void Enqueue (Ptr packet, Mac48Address to, Mac48Address from); + virtual void Enqueue (Ptr packet, Mac48Address to); + virtual bool SupportsSendFrom () const; + virtual void SetForwardUpCallback (Callback, Mac48Address, Mac48Address> upCallback); + virtual void SetLinkUpCallback (Callback linkUp); + virtual void SetLinkDownCallback (Callback linkDown); + virtual Mac48Address GetAddress () const; + virtual Mac48Address GetBssid () const; + virtual Ssid GetSsid () const; + virtual void SetAddress (Mac48Address address); + virtual void SetSsid (Ssid ssid); + //\} + + ///\name Each mesh point interfaces must know the mesh point address + //\{ + void SetMeshPointAddress (Mac48Address); + Mac48Address GetMeshPointAddress () const; + //\} + ///\name Beacons + //\{ + /// Set maximum initial random delay before first beacon + void SetRandomStartDelay (Time interval); + /// Set interval between two successive beacons + void SetBeaconInterval (Time interval); + /// \return interval between two beacons + Time GetBeaconInterval () const; + /** + * \brief Next beacon frame time + * + * This is supposed to be used by any entity managing beacon collision avoidance (e.g. Peer management protocol in 802.11s) + */ + Time GetTbtt () const; + /** + * \brief Shift TBTT. + * + * This is supposed to be used by any entity managing beacon collision avoidance (e.g. Peer management protocol in 802.11s) + * + * \attention User of ShiftTbtt () must take care to not shift it to the past. + */ + void ShiftTbtt (Time shift); + //\} + + ///\name Plugins + //\{ + /// Install plugin. TODO return unique ID to allow unregister plugins + void InstallPlugin (Ptr plugin); + //\} + + /** \name Channel switching + * + * Channel center frequency = Channel starting frequency + 5 * channel_id (MHz), + * where Starting channel frequency is standard-dependent as defined in IEEE 802.11-2007 17.3.8.3.2. + * + * Number of channels to use must be limited elsewhere. + */ + //\{ + /// Current channel Id + uint16_t GetFrequencyChannel () const; + /// Switch channel + void SwitchFrequencyChannel (uint16_t new_id); + //\} + + /// To be used by plugins sending management frames. + void SendManagementFrame (Ptr frame, const WifiMacHeader& hdr); + /// \return true if rates are supported + bool CheckSupportedRates (SupportedRates rates) const; + /// \return list of supported bitrates + SupportedRates GetSupportedRates () const; + ///\ name Metric Calculation routines: + ///\{ + void SetLinkMetricCallback (Callback > cb); + uint32_t GetLinkMetric (Mac48Address peerAddress); + Ptr GetStationManager (); + ///\} + ///\brief Statistics: + void Report (std::ostream &) const; + void ResetStats (); + /// Enable/disable beacons + void SetBeaconGeneration (bool enable); + void SetQueue (AccessClass ac); + virtual void FinishConfigureStandard (enum WifiPhyStandard standard); +private: + /// Frame receive handler + void Receive (Ptr packet, WifiMacHeader const *hdr); + /// Forward frame to mesh point + virtual void ForwardUp (Ptr packet, Mac48Address src, Mac48Address dst); + /// Send frame. Frame is supposed to be tagged by routing information. TODO: clarify this point + void ForwardDown (Ptr packet, Mac48Address from, Mac48Address to); + // Notify about tx OK/Error frames: + void TxOk (WifiMacHeader const &hdr); + void TxFailed (WifiMacHeader const &hdr); + /// Send beacon + void SendBeacon (); + /// Schedule next beacon + void ScheduleNextBeacon (); + /// Get current beaconing status + bool GetBeaconGeneration () const; + /// Real d-tor + virtual void DoDispose (); + +private: + typedef std::map > Queues; + typedef std::vector > PluginList; + ///\name Wifi MAC internals + //\{ + Queues m_queues; + Ptr m_beaconDca; + Ptr m_stationManager; + Ptr m_phy; + Callback , Mac48Address, Mac48Address> m_upCallback; + //\} + + ///\name Wifi timing intervals + //\{ + Time m_slot; + Time m_sifs; + Time m_pifs; + Time m_ackTimeout; + Time m_ctsTimeout; + Time m_eifsNoDifs; + //\} + + ///\name Mesh timing intervals + //\{ + /// Beaconing interval. + Time m_beaconInterval; + /// Maximum delay before first beacon + Time m_randomStart; + /// Time for the next frame + Time m_tbtt; + //\} + + /// DCF implementation + DcfManager* m_dcfManager; + /// Middle MAC sublayer + MacRxMiddle* m_rxMiddle; + /// Low MAC sublayer + Ptr m_low; + /// My address + Mac48Address m_address; + /// Mesh point address + Mac48Address m_mpAddress; + /// SSID + Ssid m_meshId; + + /// "Timer" for the next beacon + EventId m_beaconSendEvent; + /// List of all installed plugins + PluginList m_plugins; + Callback > m_linkMetricCallback; + ///\name Statistics: + ///\{ + struct Statistics + { + uint16_t recvBeacons; + uint32_t sentFrames; + uint32_t sentBytes; + uint32_t recvFrames; + uint32_t recvBytes; + void + Print (std::ostream & os) const; + Statistics (); + }; + Statistics m_stats; + ///\} + TracedCallback m_txOkCallback; + TracedCallback m_txErrCallback; + +}; + +} // namespace ns3 + +#endif /* MESHWIFIINTERFACEMAC_H_ */ diff --git a/src/devices/mesh/mesh.h b/src/devices/mesh/mesh.h new file mode 100644 index 000000000..148e4926b --- /dev/null +++ b/src/devices/mesh/mesh.h @@ -0,0 +1,104 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Aleksander Safonov + * Pavel Boyko + * + * This is top level mesh module description + */ + +/** + * \ingroup devices + * \defgroup mesh Mesh + * + * \brief MAC-layer mobile mesh networking. + * \section MeshOverview Overview of Layer-2 Mesh networking protocols + * + * The main goal of this module is to provide MAC-layer routing functionality. + + * The main part of MAC-layer routing model is specific type of a network device -- + * ns3::MeshPointDevice. Being an interface to upper-layer protocols, it provides routing functionality + * hidden from upper-layer protocols, by means of ns3::MeshL2RoutingProtocol. + * + * Our model supports stations with multiple network devices handled by a single + * MAC-layer routing protocol. So, ns3::MeshPointDevice serves as an umbrella to multiple + * network devices ("interfaces") working under the same MAC-layer routing protocol. + * + * Network devices may be of different types, each with a specific medium access method. + * So ns3::MeshL2RoutingProtocol consists of two parts: the one independent from the network device type, + * which we refer to as a routing protocol, and the other one depended on the network device type which + * we refer to as a plug-in to the routing protocol. + * + * One can imagine a MAC-layer routing as a two-tier model. ns3::MeshL2RoutingProtocol and ns3::MeshPointDevice + * belong to the upper tier. The task of ns3::MeshPointDevice is to send, receive, and forward frames, + * while the task of ns3::MeshL2RoutingProtocol is to resolve routes and keep frames waiting for route resolution. + * This functionality is independent from the types of underlying network devices ("interfaces"). + * + * The lower tier implements the part of MAC-layer routing, specific for underlying network devices + * and their medium access control methods. For example, HWMP routing protocol in IEEE802.11s + * uses its own specific management frames. + * + * At present, two routing protocols are implemented in this module: + * - HWMP (default routing protocol for IEEE802.11s standard) + Peer management protocol + * (also described in 802.11s standard draft) which is required by HWMP to manage peer links + * (it works like association mechanism in IEEE802.11). + * - FLAME (Forwarding LAyer for MEshing). + + * While HWMP only works with 802.11-MAC, FLAME works with all types of network devices, which support + * 48-bit MAC-addressing scheme. + * + * \subsection Architecture Architecture of MAC-layer routing stack + * As already mentioned, MAC-layer routing consists of two tiers. + * An ns3::MeshPointDevice which forwards frames by using an attached ns3::MeshL2RoutingProtocol forms + * the upper tier. The interface between ns3::MeshPointDevice and the upper-layer protocols is inherited + * from ns3::NetDevice class. The ns3::MeshPointDevice interacts with ns3::MeshL2RoutingProtocol as follows: + * ns3::MeshPointDevice gives to ns3::MeshL2RoutingProtocol a frame with the source and destination addresses, + * the network device index which the frame is received from, and a callback to be executed when the route is found. + * The callback is needed because all routing queues are implemented inside ns3::MeshL2RoutingProtocol. + * When the route is resolved, ns3::MeshL2RoutingProtocol returns the frame back to ns3::MeshPointDevice with the + * network device index which the packet shall be sent to. All additional routing information is stored inside + * the frame by means of tags. In the end, when all these routines are done, the frame goes to the lower tier. + + * The lower tier is responsible for filling MAC-specific headers. At present, we have only implemented the + * lower tier which is specific for ns3::WifiNetDevice. This tier is implemented as two base classes: + * ns3::MeshWifiInterfaceMac and ns3::MeshWifiInterfaceMacPlugin. The former is a new kind of WifiMac. If beacon + * generation is enabled or disabled, it implements IEEE802.11s mesh functionality or a simple ad hoc functionality + * of the MAC-high part of the WiFi model, respectively. The latter is a plug-in to L2Routing protocol. + * It handles all outgoing and incoming frames, fills headers and make decisions to drop a frame or not. Also, it + * adds information elements to beacons specific to given L2Routing protocol, if needed. + * \image html MeshArchitecture.png "Overview of the Mesh MAC-layer routing system" + * + * \subsection NewProtocol Adding a new protocol + * This module requires all the network devices operate with ns3::Mac48Address addressing scheme. + * + * To add a new L2Routing protocol, one needs to define the following: + * - Write an upper part of the protocol inherited from ns3::MeshL2Routing. + * - If the protocol works only with 802.11 MAC -- write a plug-in inherited from ns3::MeshWifiInterfaceMacPlugin + * - If the protocol works with other types of network devices -- write your own plug-in (interface for + * communication with other types of network devices is not implemented). + * + * When you implement a L2Routing protocol, remember that when you are at L2Routing tier, + * you work with a frame without an LLC header, and when you are at plug-in tier using + * ns3::MeshWifiInterfaceMacPlugin, an LLC header is already attached (by WifiNetDevice) + * + * \attention Note, when you use ns3::MeshWifiInterfaceMac, multiple plug-ins may be installed. + * + * \subsection Statistics + * Each L2Routing protocol has a structure to capture statistics, Report and ResetStats methods. + * This gives an opportunity to collect statistic to an *.xml file periodically. + */ diff --git a/src/devices/mesh/waf b/src/devices/mesh/waf new file mode 100755 index 000000000..4283ec141 --- /dev/null +++ b/src/devices/mesh/waf @@ -0,0 +1 @@ +exec "`dirname "$0"`"/../../../waf "$@" diff --git a/src/devices/mesh/wifi-information-element-vector.cc b/src/devices/mesh/wifi-information-element-vector.cc new file mode 100644 index 000000000..99d967315 --- /dev/null +++ b/src/devices/mesh/wifi-information-element-vector.cc @@ -0,0 +1,484 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Pavel Boyko + */ + +#include "wifi-information-element-vector.h" +#include "ns3/packet.h" +#include +#include "ns3/test.h" +#include "ns3/hwmp-protocol.h" +// All information elements: +#include "dot11s/ie-dot11s-beacon-timing.h" +#include "dot11s/ie-dot11s-configuration.h" +#include "dot11s/ie-dot11s-id.h" +#include "dot11s/ie-dot11s-metric-report.h" +#include "dot11s/ie-dot11s-peer-management.h" +#include "dot11s/ie-dot11s-peering-protocol.h" +#include "dot11s/ie-dot11s-perr.h" +#include "dot11s/ie-dot11s-prep.h" +#include "dot11s/ie-dot11s-preq.h" +#include "dot11s/ie-dot11s-rann.h" + +namespace ns3 { +bool +operator< (WifiInformationElement const & a, WifiInformationElement const & b) +{ + return (a.ElementId () < b.ElementId ()); +} + +WifiInformationElementVector::WifiInformationElementVector () : + m_maxSize (1500) +{ +} +WifiInformationElementVector::~WifiInformationElementVector () +{ +} +TypeId +WifiInformationElementVector::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::WifiInformationElementVector") + .SetParent
    (); + return tid; +} +TypeId +WifiInformationElementVector::GetInstanceTypeId () const +{ + return GetTypeId (); +} +uint32_t +WifiInformationElementVector::GetSerializedSize () const +{ + return GetSize (); +} +void +WifiInformationElementVector::Serialize (Buffer::Iterator start) const +{ + for(std::vector >::const_iterator i = m_elements.begin (); i != m_elements.end (); i ++) + { + start.WriteU8((*i)->ElementId ()); + start.WriteU8 ((*i)->GetInformationSize ()); + (*i)->SerializeInformation (start); + start.Next ((*i)->GetInformationSize ()); + } +} +uint32_t +WifiInformationElementVector::Deserialize (Buffer::Iterator start) +{ + Buffer::Iterator i = start; + uint32_t size = start.GetSize(); + while (size > 0) + { + uint32_t deserialized = DeserializeSingleIe(i); + i.Next (deserialized); + size -= deserialized; + } + return i.GetDistanceFrom(start); +} +uint32_t +WifiInformationElementVector::DeserializeSingleIe(Buffer::Iterator start) +{ + Buffer::Iterator i = start; + uint8_t id = i.ReadU8 (); + uint8_t length = i.ReadU8 (); + Ptr newElement; + switch (id) + { + case IE11S_MESH_CONFIGURATION: + newElement = Create (); + break; + case IE11S_MESH_ID: + newElement = Create (); + break; + case IE11S_LINK_METRIC_REPORT: + newElement = Create (); + break; + case IE11S_PEERING_MANAGEMENT: + newElement = Create (); + break; + case IE11S_BEACON_TIMING: + newElement = Create (); + break; + case IE11S_RANN: + newElement = Create (); + break; + case IE11S_PREQ: + newElement = Create (); + break; + case IE11S_PREP: + newElement = Create (); + break; + case IE11S_PERR: + newElement = Create (); + break; + case IE11S_MESH_PEERING_PROTOCOL_VERSION: + newElement = Create (); + break; + default: + NS_FATAL_ERROR ("Information element " << (uint16_t) id << " is not implemented"); + return 0; + } + if (GetSize () + length > m_maxSize) + { + NS_FATAL_ERROR ("Check max size for information element!"); + } + newElement->DeserializeInformation (i, length); + i.Next (length); + m_elements.push_back (newElement); + return i.GetDistanceFrom(start); +} +void +WifiInformationElementVector::Print(std::ostream & os) const +{ + //TODO +} +void +WifiInformationElementVector::SetMaxSize (uint16_t size) +{ + m_maxSize = size; +} +WifiInformationElementVector::Iterator +WifiInformationElementVector::Begin () +{ + return m_elements.begin (); +} +WifiInformationElementVector::Iterator +WifiInformationElementVector::End () +{ + return m_elements.end (); +} +bool +WifiInformationElementVector::AddInformationElement (Ptr element) +{ + if (element->GetInformationSize () + 2 + GetSize () > m_maxSize) + { + return false; + } + m_elements.push_back (element); + return true; +} +Ptr +WifiInformationElementVector::FindFirst (enum WifiElementId id) const +{ + for (IE_VECTOR::const_iterator i = m_elements.begin (); i != m_elements.end (); i++) + { + if ((*i)->ElementId () == id) + { + return (*i); + } + } + return 0; +} +namespace { +struct PIEComparator +{ + bool + operator () (Ptr a, Ptr b) const + { + return ((*PeekPointer (a)) < (*PeekPointer (b))); + } +}; +} +uint32_t +WifiInformationElementVector::GetSize () const +{ + uint32_t size = 0; + for (IE_VECTOR::const_iterator i = m_elements.begin (); i != m_elements.end (); i++) + { + size += ((*i)->GetInformationSize () + 2); + } + return size; +} + +bool +operator== (const WifiInformationElementVector & a, const WifiInformationElementVector & b) +{ + if (a.m_elements.size () != b.m_elements.size ()) + { + NS_ASSERT(false); + return false; + } + WifiInformationElementVector::IE_VECTOR::const_iterator j = b.m_elements.begin (); + for (WifiInformationElementVector::IE_VECTOR::const_iterator i = a.m_elements.begin (); i + != a.m_elements.end (); i++, j++) + { + if ((*i)->ElementId () != (*j)->ElementId ()) + { + return false; + } + if ((*i)->GetInformationSize () != (*j)->GetInformationSize ()) + { + return false; + } + uint8_t id = (*i)->ElementId (); + switch (id) + { + case IE11S_MESH_CONFIGURATION: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ((*j)))) + { + return false; + } + break; + case IE11S_MESH_ID: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ((*j)))) + { + return false; + } + break; + case IE11S_LINK_METRIC_REPORT: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ( + (*j)))) + { + return false; + } + break; + case IE11S_PEERING_MANAGEMENT: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ((*j)))) + { + return false; + } + break; + case IE11S_BEACON_TIMING: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ((*j)))) + { + return false; + } + break; + case IE11S_RANN: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ((*j)))) + { + return false; + } + break; + case IE11S_PREQ: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ((*j)))) + { + return false; + } + break; + case IE11S_PREP: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ((*j)))) + { + return false; + } + + break; + case IE11S_PERR: + if (DynamicCast ((*i)) == 0) + { + return false; + } + if (DynamicCast ((*j)) == 0) + { + return false; + } + if (!(*DynamicCast ((*i)) == *DynamicCast ((*j)))) + { + return false; + } + break; + case IE11S_MESH_PEERING_PROTOCOL_VERSION: + break; + default: + NS_FATAL_ERROR ("Information element " << (uint16_t) id << " is not implemented"); + return false; + } + } + return true; +} +#ifdef RUN_SELF_TESTS + +/// Built-in self test for WifiInformationElementVector +struct WifiInformationElementVectorBist : public Test +{ + WifiInformationElementVectorBist () : + Test ("Mesh/WifiInformationElementVector") + { + }; + virtual bool + RunTests (); +}; + +/// Test instance +static WifiInformationElementVectorBist g_IePrepBist; + +bool +WifiInformationElementVectorBist::RunTests () +{ + bool result = true; + WifiInformationElementVector vector; + { + //Mesh ID test + Ptr meshId = Create ("qwerty"); + vector.AddInformationElement (meshId); + } + { + Ptr config = Create (); + vector.AddInformationElement (config); + } + { + Ptr report = Create (123456); + vector.AddInformationElement (report); + } + { + Ptr peerMan1 = Create (); + peerMan1->SetPeerOpen (1); + Ptr peerMan2 = Create (); + peerMan2->SetPeerConfirm (1, 2); + Ptr peerMan3 = Create (); + peerMan3->SetPeerClose (1, 2, dot11s::REASON11S_MESH_CAPABILITY_POLICY_VIOLATION); + vector.AddInformationElement (peerMan1); + vector.AddInformationElement (peerMan2); + vector.AddInformationElement (peerMan3); + } + { + Ptr beaconTiming = Create (); + beaconTiming->AddNeighboursTimingElementUnit (1, Seconds (1.0), Seconds (4.0)); + beaconTiming->AddNeighboursTimingElementUnit (2, Seconds (2.0), Seconds (3.0)); + beaconTiming->AddNeighboursTimingElementUnit (3, Seconds (3.0), Seconds (2.0)); + beaconTiming->AddNeighboursTimingElementUnit (4, Seconds (4.0), Seconds (1.0)); + vector.AddInformationElement (beaconTiming); + } + { + Ptr rann = Create (); + rann->SetFlags (1); + rann->SetHopcount (2); + rann->SetTTL (4); + rann->DecrementTtl (); + NS_TEST_ASSERT_EQUAL (rann->GetTtl (), 3); + rann->SetOriginatorAddress (Mac48Address ("11:22:33:44:55:66")); + rann->SetDestSeqNumber (5); + rann->SetMetric (6); + rann->IncrementMetric (2); + NS_TEST_ASSERT_EQUAL (rann->GetMetric (), 8); + vector.AddInformationElement (rann); + } + { + Ptr preq = Create (); + preq->SetHopcount (0); + preq->SetTTL (1); + preq->SetPreqID (2); + preq->SetOriginatorAddress (Mac48Address ("11:22:33:44:55:66")); + preq->SetOriginatorSeqNumber (3); + preq->SetLifetime (4); + preq->AddDestinationAddressElement (false, false, Mac48Address ("11:11:11:11:11:11"), 5); + preq->AddDestinationAddressElement (false, false, Mac48Address ("22:22:22:22:22:22"), 6); + vector.AddInformationElement (preq); + } + { + Ptr prep = Create (); + prep->SetFlags (12); + prep->SetHopcount (11); + prep->SetTtl (10); + prep->SetDestinationAddress (Mac48Address ("11:22:33:44:55:66")); + prep->SetDestinationSeqNumber (123); + prep->SetLifetime (5000); + prep->SetMetric (4321); + prep->SetOriginatorAddress (Mac48Address ("33:00:22:00:11:00")); + prep->SetOriginatorSeqNumber (666); + vector.AddInformationElement (prep); + } + { + Ptr perr = Create (); + dot11s::HwmpProtocol::FailedDestination dest; + dest.destination = Mac48Address ("11:22:33:44:55:66"); + dest.seqnum = 1; + perr->AddAddressUnit (dest); + dest.destination = Mac48Address ("10:20:30:40:50:60"); + dest.seqnum = 2; + perr->AddAddressUnit (dest); + dest.destination = Mac48Address ("01:02:03:04:05:06"); + dest.seqnum = 3; + perr->AddAddressUnit (dest); + vector.AddInformationElement (perr); + } + Ptr packet = Create (); + packet->AddHeader (vector); + WifiInformationElementVector resultVector; + packet->RemoveHeader (resultVector); + NS_TEST_ASSERT (vector == resultVector); + + return result; +} + +#endif // RUN_SELF_TESTS +} //namespace ns3 diff --git a/src/devices/mesh/wifi-information-element-vector.h b/src/devices/mesh/wifi-information-element-vector.h new file mode 100644 index 000000000..e6506c58c --- /dev/null +++ b/src/devices/mesh/wifi-information-element-vector.h @@ -0,0 +1,157 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + * Pavel Boyko + */ + +#ifndef IE_VECTOR_H +#define IE_VECTOR_H + +#include "ns3/header.h" + +namespace ns3 { +class Packet; +/** + * \ingroup mesh + * + * \brief Enum of all known information element id (aka tags). + * + * For now only 802.11s (mesh) related elements are supported here (so 11S prefix), + * but this can change in future. + * + * Note that 802.11s element ids are not yet officially assigned, we use ones + * compatible with open80211s (http://o11s.org/) implementation. + */ +enum WifiElementId { + /* begin of open80211s-compatible IDs */ + IE11S_MESH_CONFIGURATION = 51, + IE11S_MESH_ID = 52, + /* end of open80211s-compatible IDs */ + IE11S_LINK_METRIC_REPORT = 20, + IE11S_CONGESTION_NOTIFICATION, + /* begin of open80211s-compatible IDs */ + IE11S_PEERING_MANAGEMENT = 55, + /* end of open80211s-compatible IDs */ + IE11S_SUPP_MBSS_REG_CLASSES_CHANNELS = 23, + IE11S_MESH_CHANNEL_SWITCH_ANNOUNCEMENT, + IE11S_MESH_TIM, + IE11S_AWAKE_WINDOW, + IE11S_BEACON_TIMING, + IE11S_MCCAOP_SETUP_REQUEST, + IE11S_MCCAOP_SETUP_REPLY, + IE11S_MCCAOP_ADVERTISEMENT, + IE11S_MCCAOP_RESERVATION_TEARDOWN, + IE11S_PORTAL_ANNOUNCEMENT, + IE11S_RANN = 67, + /* begin of open80211s-compatible IDs */ + IE11S_PREQ = 68, + IE11S_PREP = 69, + IE11S_PERR = 70, + /* end of open80211s-compatible IDs */ + IE11S_PROXY_UPDATE = 37, + IE11S_PROXY_UPDATE_CONFIRMATION, + IE11S_ABBREVIATED_HANDSHAKE, + IE11S_MESH_PEERING_PROTOCOL_VERSION = 74, +}; + +/** + * \ingroup mesh + * + * \brief Information element, as defined in 802.11-2007 standard + * + * Elements are defined to have a common general format consisting of a 1 octet Element ID field, a 1 octet + * length field, and a variable-length element-specific information field. Each element is assigned a unique + * Element ID as defined in this standard. The Length field specifies the number of octets in the Information + * field. + */ +class WifiInformationElement : public RefCountBase +{ +public: + ///\name Each subclass must implement + //\{ + virtual void Print (std::ostream &os) const = 0; + /// Own unique Element ID + virtual WifiElementId ElementId () const = 0; + /// Length of serialized information + virtual uint8_t GetInformationSize () const = 0; + /// Serialize information + virtual void SerializeInformation (Buffer::Iterator start) const = 0; + /// Deserialize information + virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length) = 0; + //\} + + /// Compare information elements using Element ID + friend bool operator< (WifiInformationElement const & a, WifiInformationElement const & b); + /// + virtual bool operator== (WifiInformationElement const & a) { return false; } +}; + +/// Compare information elements using Element ID +bool operator< (WifiInformationElement const & a, WifiInformationElement const & b); + +/** + * \ingroup mesh + * + * \brief Information element vector + * + * Implements a vector of WifiInformationElement's + */ +class WifiInformationElementVector : public Header +{ +public: + WifiInformationElementVector (); + ~WifiInformationElementVector (); + ///\name Inherited from Header + //\{ + static TypeId GetTypeId (); + TypeId GetInstanceTypeId () const; + virtual uint32_t GetSerializedSize () const; + virtual void Serialize (Buffer::Iterator start) const; + /** + * \attention When you use RemoveHeader, WifiInformationElementVector supposes, that + * all buffer consists of information elements + * @param start + * @return + */ + virtual uint32_t Deserialize (Buffer::Iterator start); + virtual void Print (std::ostream &os) const; + //\} + /** + * \brief Needed when you try to deserialize a lonely IE inside other header + * \param start is the start of the buffer + * \return deserialized bytes + */ + virtual uint32_t DeserializeSingleIe (Buffer::Iterator start); + ///Set maximum size to control overflow of the max packet length + void SetMaxSize (uint16_t size); + typedef std::vector >::iterator Iterator; + Iterator Begin (); + Iterator End (); + bool AddInformationElement (Ptr element); + Ptr FindFirst (enum WifiElementId id) const; +private: + typedef std::vector > IE_VECTOR; + uint32_t GetSize () const; + IE_VECTOR m_elements; + /// Size in bytes (actually, max packet length) + uint16_t m_maxSize; + friend bool operator== (const WifiInformationElementVector & a, const WifiInformationElementVector & b); +}; +bool operator== (const WifiInformationElementVector & a, const WifiInformationElementVector & b); +} +#endif diff --git a/src/devices/mesh/wscript b/src/devices/mesh/wscript new file mode 100644 index 000000000..d11c8cb1d --- /dev/null +++ b/src/devices/mesh/wscript @@ -0,0 +1,22 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + obj = bld.create_ns3_module('mesh', ['wifi']) + + obj.source = [ + 'wifi-information-element-vector.cc', + 'mesh-point-device.cc', + 'mesh-l2-routing-protocol.cc', + 'mesh-wifi-beacon.cc', + 'mesh-wifi-interface-mac.cc', + ] + headers = bld.new_task_gen('ns3header') + headers.module = 'mesh' + headers.source = [ + 'wifi-information-element-vector.h', + 'mesh-point-device.h', + 'mesh-l2-routing-protocol.h', + 'mesh-wifi-beacon.h', + 'mesh-wifi-interface-mac.h', + 'mesh-wifi-interface-mac-plugin.h', + ] diff --git a/src/devices/point-to-point/point-to-point-channel.cc b/src/devices/point-to-point/point-to-point-channel.cc index 6fa1b7bee..d95114428 100644 --- a/src/devices/point-to-point/point-to-point-channel.cc +++ b/src/devices/point-to-point/point-to-point-channel.cc @@ -91,6 +91,9 @@ PointToPointChannel::TransmitStart( Simulator::Schedule (txTime + m_delay, &PointToPointNetDevice::Receive, m_link[wire].m_dst, p); + + // Call the tx anim callback on the net device + src->m_txrxPointToPoint (p, src, m_link[wire].m_dst, txTime, txTime + m_delay); return true; } diff --git a/src/devices/point-to-point/point-to-point-net-device.cc b/src/devices/point-to-point/point-to-point-net-device.cc index ff6ec3693..ca02c7344 100644 --- a/src/devices/point-to-point/point-to-point-net-device.cc +++ b/src/devices/point-to-point/point-to-point-net-device.cc @@ -82,6 +82,9 @@ PointToPointNetDevice::GetTypeId (void) // Trace sources at the "top" of the net device, where packets transition // to/from higher layers. // + .AddTraceSource ("TxRxPointToPoint", + "Trace source indicating transmission of packet from the PointToPointChannel, used by the Animation interface.", + MakeTraceSourceAccessor (&PointToPointNetDevice::m_txrxPointToPoint)) .AddTraceSource ("MacTx", "Trace source indicating a packet has arrived for transmission by this device", MakeTraceSourceAccessor (&PointToPointNetDevice::m_macTxTrace)) diff --git a/src/devices/point-to-point/point-to-point-net-device.h b/src/devices/point-to-point/point-to-point-net-device.h index c13bd66d8..1dbfd25cb 100644 --- a/src/devices/point-to-point/point-to-point-net-device.h +++ b/src/devices/point-to-point/point-to-point-net-device.h @@ -275,12 +275,14 @@ private: /** * Calculate the value for the MTU that would result from * setting the frame size to the given value. + * \param frameSize size of frame */ uint32_t MtuFromFrameSize (uint32_t frameSize); /** * Calculate the value for the frame size that would be required * to be able to set the MTU to the given value. + * \param mtu MTU */ uint32_t FrameSizeFromMtu (uint32_t mtu); @@ -293,12 +295,16 @@ private: /** * Adds the necessary headers and trailers to a packet of data in order to * respect the protocol implemented by the agent. + * \param p packet + * \param protocolNumber protocol number */ void AddHeader(Ptr p, uint16_t protocolNumber); /** * Removes, from a packet of data, all headers and trailers that * relate to the protocol implemented by the agent + * \param p Packet whose headers need to be processed + * \param param An integer parameter that can be set by the function * \return Returns true if the packet should be forwarded up the * protocol stack. */ @@ -380,6 +386,24 @@ private: */ Ptr m_receiveErrorModel; + /** + * The trace source for the packet transmission animation events that the + * device can fire. + * Arguments to the callback are the packet, transmitting + * net device, receiving net device, transmittion time and + * packet receipt time. + * + * @see class CallBackTraceSource + */ + friend class PointToPointChannel; // Allow the channel to call the callback + TracedCallback, // Packet being transmitted + Ptr, // Transmitting NetDevice + Ptr, // Receiving NetDevice + Time, // Amount of time to transmit the pkt + Time // Last bit receive time (relative to now) + > m_txrxPointToPoint; + + /** * The trace source fired when packets come into the "top" of the device * at the L3/L2 transition, before being queued for transmission. diff --git a/src/devices/tap-bridge/tap-bridge.h b/src/devices/tap-bridge/tap-bridge.h index c6d62729a..d17553caf 100644 --- a/src/devices/tap-bridge/tap-bridge.h +++ b/src/devices/tap-bridge/tap-bridge.h @@ -113,7 +113,8 @@ public: TapBridge (); virtual ~TapBridge (); - /** \brief Get the bridged net device. + /** + * \brief Get the bridged net device. * * The bridged net device is the ns-3 device to which this bridge is connected, * @@ -121,10 +122,13 @@ public: */ Ptr GetBridgedNetDevice (void); - /** \brief Set the ns-3 net device to bridge. + /** + * \brief Set the ns-3 net device to bridge. * * This method tells the bridge which ns-3 net device it should use to connect - * the simulation side of the bridge. + * the simulation side of the bridge. + * + * \param bridgedDevice device to set * * \attention The ns-3 net device that is being set as the device must have an * an IP address assigned to it before the simulation is run. This address diff --git a/src/devices/virtual-net-device/virtual-net-device.h b/src/devices/virtual-net-device/virtual-net-device.h index cf8a1c1ed..b2f4adb59 100644 --- a/src/devices/virtual-net-device/virtual-net-device.h +++ b/src/devices/virtual-net-device/virtual-net-device.h @@ -93,6 +93,7 @@ public: /** * \brief Configure the reported MTU for the virtual device. The * default value is 65535. + * \param mtu MTU value to set * \return whether the MTU value was within legal bounds */ bool SetMtu (const uint16_t mtu); diff --git a/src/devices/wifi/dca-txop.cc b/src/devices/wifi/dca-txop.cc index 6b4a64f43..e19363591 100644 --- a/src/devices/wifi/dca-txop.cc +++ b/src/devices/wifi/dca-txop.cc @@ -58,6 +58,9 @@ private: virtual void DoNotifyCollision (void) { m_txop->NotifyCollision (); } + virtual void DoNotifyChannelSwitching (void) { + m_txop->NotifyChannelSwitching (); + } DcaTxop *m_txop; }; @@ -446,6 +449,13 @@ DcaTxop::NotifyCollision (void) RestartAccessIfNeeded (); } +void +DcaTxop::NotifyChannelSwitching (void) +{ + m_queue->Flush(); + m_currentPacket = 0; +} + void DcaTxop::GotCts (double snr, WifiMode txMode) { diff --git a/src/devices/wifi/dca-txop.h b/src/devices/wifi/dca-txop.h index 4fd697230..69b8a050f 100644 --- a/src/devices/wifi/dca-txop.h +++ b/src/devices/wifi/dca-txop.h @@ -127,6 +127,10 @@ private: void NotifyAccessGranted (void); void NotifyInternalCollision (void); void NotifyCollision (void); + /** + * When a channel switching occurs, enqueued packets are removed. + */ + void NotifyChannelSwitching (void); /* event handlers */ void GotCts (double snr, WifiMode txMode); void MissedCts (void); diff --git a/src/devices/wifi/dcf-manager-test.cc b/src/devices/wifi/dcf-manager-test.cc index b94f0ed3f..8972e527c 100644 --- a/src/devices/wifi/dcf-manager-test.cc +++ b/src/devices/wifi/dcf-manager-test.cc @@ -38,6 +38,7 @@ private: virtual void DoNotifyAccessGranted (void); virtual void DoNotifyInternalCollision (void); virtual void DoNotifyCollision (void); + virtual void DoNotifyChannelSwitching (void); typedef std::pair ExpectedGrant; typedef std::list ExpectedGrants; @@ -65,6 +66,7 @@ public: void NotifyAccessGranted (uint32_t i); void NotifyInternalCollision (uint32_t i); void NotifyCollision (uint32_t i); + void NotifyChannelSwitching (uint32_t i); private: @@ -88,6 +90,9 @@ private: void AddAccessRequestWithSuccessfullAck (uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from); void DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime, DcfStateTest *state); + void AddCcaBusyEvt (uint64_t at, uint64_t duration); + void AddSwitchingEvt (uint64_t at, uint64_t duration); + void AddRxStartEvt (uint64_t at, uint64_t duration); typedef std::vector DcfStates; @@ -122,7 +127,11 @@ DcfStateTest::DoNotifyCollision (void) { m_test->NotifyCollision (m_i); } - +void +DcfStateTest::DoNotifyChannelSwitching (void) +{ + m_test->NotifyChannelSwitching (m_i); +} DcfManagerTest::DcfManagerTest () @@ -182,7 +191,22 @@ DcfManagerTest::NotifyCollision (uint32_t i) m_result = result; } } - +void +DcfManagerTest::NotifyChannelSwitching (uint32_t i) +{ + DcfStateTest *state = m_dcfStates[i]; + bool result = true; + if (!state->m_expectedGrants.empty ()) + { + std::pair expected = state->m_expectedGrants.front (); + state->m_expectedGrants.pop_front (); + NS_TEST_ASSERT_EQUAL (Simulator::Now (), MicroSeconds (expected.second)); + } + if (!result) + { + m_result = result; + } +} void DcfManagerTest::ExpectInternalCollision (uint64_t time, uint32_t nSlots, uint32_t from) @@ -320,7 +344,27 @@ DcfManagerTest::DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime, Dc state->QueueTx (txTime, expectedGrantTime); m_dcfManager->RequestAccess (state); } - +void +DcfManagerTest::AddCcaBusyEvt (uint64_t at, uint64_t duration) +{ + Simulator::Schedule (MicroSeconds (at) - Now (), + &DcfManager::NotifyMaybeCcaBusyStartNow, m_dcfManager, + MicroSeconds (duration)); +} +void +DcfManagerTest::AddSwitchingEvt (uint64_t at, uint64_t duration) +{ + Simulator::Schedule (MicroSeconds (at) - Now (), + &DcfManager::NotifySwitchingStartNow, m_dcfManager, + MicroSeconds (duration)); +} +void +DcfManagerTest::AddRxStartEvt (uint64_t at, uint64_t duration) +{ + Simulator::Schedule (MicroSeconds (at) - Now (), + &DcfManager::NotifyRxStartNow, m_dcfManager, + MicroSeconds (duration)); +} @@ -559,7 +603,95 @@ DcfManagerTest::RunTests (void) AddAccessRequest (30, 50, 108, 0); ExpectCollision (30, 3, 0); // backoff: 3 slots EndTest (); - + + + // Channel switching tests + + // 0 20 23 24 25 + // | switching | sifs | aifsn | tx | + // | + // 21 access request. + StartTest (1, 3, 10); + AddDcfState (1); + AddSwitchingEvt(0,20); + AddAccessRequest (21, 1, 24, 0); + EndTest (); + + // 20 40 50 53 54 55 + // | switching | busy | sifs | aifsn | tx | + // | | + // 30 busy. 45 access request. + // + StartTest (1, 3, 10); + AddDcfState (1); + AddSwitchingEvt(20,20); + AddCcaBusyEvt(30,20); + AddAccessRequest (45, 1, 54, 0); + EndTest (); + + // 20 30 50 53 54 55 + // | rx | switching | sifs | aifsn | tx | + // | + // 51 access request. + // + StartTest (1, 3, 10); + AddDcfState (1); + AddRxStartEvt (20,40); + AddSwitchingEvt(30,20); + AddAccessRequest (51, 1, 54, 0); + EndTest (); + + // 20 30 50 53 54 55 + // | busy | switching | sifs | aifsn | tx | + // | + // 51 access request. + // + StartTest (1, 3, 10); + AddDcfState (1); + AddCcaBusyEvt (20,40); + AddSwitchingEvt(30,20); + AddAccessRequest (51, 1, 54, 0); + EndTest (); + + // 20 30 50 53 54 55 + // | nav | switching | sifs | aifsn | tx | + // | + // 51 access request. + // + StartTest (1, 3, 10); + AddDcfState (1); + AddNavStart (20,40); + AddSwitchingEvt(30,20); + AddAccessRequest (51, 1, 54, 0); + EndTest (); + + // 20 40 50 55 58 59 60 + // | tx | ack timeout | switching | sifs | aifsn | tx | + // | | + // 45 access request. 56 access request. + // + StartTest (1, 3, 10); + AddDcfState (1); + AddAccessRequestWithAckTimeout (20, 20, 20, 0); + AddAccessRequest (45, 1, 50, 0); + AddSwitchingEvt(50,5); + AddAccessRequest (56, 1, 59, 0); + EndTest (); + + // 20 60 66 70 74 78 80 100 106 110 112 + // | rx | sifs | aifsn | bslot0 | bslot1 | | switching | sifs | aifsn | tx | + // | | + // 30 access request. 101 access request. + // + StartTest (4, 6, 10); + AddDcfState (1); + AddRxOkEvt(20,40); + AddAccessRequest (30, 2, 80, 0); + ExpectCollision(30, 4, 0); // backoff: 4 slots + AddSwitchingEvt(80,20); + AddAccessRequest (101, 2, 110, 0); + EndTest (); + return m_result; } diff --git a/src/devices/wifi/dcf-manager.cc b/src/devices/wifi/dcf-manager.cc index 320bf0621..467caf77f 100644 --- a/src/devices/wifi/dcf-manager.cc +++ b/src/devices/wifi/dcf-manager.cc @@ -154,6 +154,11 @@ DcfState::NotifyInternalCollision (void) { DoNotifyInternalCollision (); } +void +DcfState::NotifyChannelSwitching (void) +{ + DoNotifyChannelSwitching (); +} /*************************************************************** @@ -211,6 +216,9 @@ public: virtual void NotifyMaybeCcaBusyStart (Time duration) { m_dcf->NotifyMaybeCcaBusyStartNow (duration); } + virtual void NotifySwitchingStart (Time duration) { + m_dcf->NotifySwitchingStartNow (duration); + } private: ns3::DcfManager *m_dcf; }; @@ -232,6 +240,8 @@ DcfManager::DcfManager () m_lastTxDuration (MicroSeconds (0)), m_lastBusyStart (MicroSeconds (0)), m_lastBusyDuration (MicroSeconds (0)), + m_lastSwitchingStart (MicroSeconds (0)), + m_lastSwitchingDuration (MicroSeconds (0)), m_rxing (false), m_slotTime (Seconds (0.0)), m_sifs (Seconds (0.0)), @@ -319,6 +329,18 @@ DcfManager::MostRecent (Time a, Time b, Time c, Time d, Time e, Time f) const return retval; } +Time +DcfManager::MostRecent (Time a, Time b, Time c, Time d, Time e, Time f, Time g) const +{ + Time h = Max (a, b); + Time i = Max (c, d); + Time j = Max (e, f); + Time k = Max (h, i); + Time l = Max (j, g); + Time retval = Max (k, l); + return retval; +} + bool DcfManager::IsBusy (void) const { @@ -454,12 +476,14 @@ DcfManager::GetAccessGrantStart (void) const Time navAccessStart = m_lastNavStart + m_lastNavDuration + m_sifs; Time ackTimeoutAccessStart = m_lastAckTimeoutEnd + m_sifs; Time ctsTimeoutAccessStart = m_lastCtsTimeoutEnd + m_sifs; + Time switchingAccessStart = m_lastSwitchingStart + m_lastSwitchingDuration + m_sifs; Time accessGrantedStart = MostRecent (rxAccessStart, busyAccessStart, txAccessStart, navAccessStart, ackTimeoutAccessStart, - ctsTimeoutAccessStart + ctsTimeoutAccessStart, + switchingAccessStart ); NS_LOG_INFO ("access grant start=" << accessGrantedStart << ", rx access start=" << rxAccessStart << @@ -596,6 +620,67 @@ DcfManager::NotifyMaybeCcaBusyStartNow (Time duration) m_lastBusyStart = Simulator::Now (); m_lastBusyDuration = duration; } + + +void +DcfManager::NotifySwitchingStartNow (Time duration) +{ + Time now = Simulator::Now (); + NS_ASSERT (m_lastTxStart + m_lastTxDuration <= now); + NS_ASSERT (m_lastSwitchingStart + m_lastSwitchingDuration <= now); + + if (m_rxing) + { + // channel switching during packet reception + m_lastRxEnd = Simulator::Now (); + m_lastRxDuration = m_lastRxEnd - m_lastRxStart; + m_lastRxReceivedOk = true; + m_rxing = false; + } + if (m_lastNavStart + m_lastNavDuration > now) + { + m_lastNavDuration = now - m_lastNavStart; + } + if (m_lastBusyStart + m_lastBusyDuration > now) + { + m_lastBusyDuration = now - m_lastBusyStart; + } + if (m_lastAckTimeoutEnd > now) + { + m_lastAckTimeoutEnd = now; + } + if (m_lastCtsTimeoutEnd > now) + { + m_lastCtsTimeoutEnd = now; + } + + // Cancel timeout + if (m_accessTimeout.IsRunning ()) + { + m_accessTimeout.Cancel (); + } + + // Reset backoffs + for (States::iterator i = m_states.begin (); i != m_states.end (); i++) + { + DcfState *state = *i; + uint32_t remainingSlots = state->GetBackoffSlots (); + if (remainingSlots > 0) + { + state->UpdateBackoffSlotsNow (remainingSlots, now); + NS_ASSERT(state->GetBackoffSlots()==0); + } + state->ResetCw(); + state->m_accessRequested = false; + state->NotifyChannelSwitching(); + } + + MY_DEBUG ("switching start for "<NotifyCollision (); } + virtual void DoNotifyChannelSwitching (void) { + m_txop->NotifyChannelSwitching (); + } EdcaTxopN *m_txop; }; @@ -427,6 +430,13 @@ EdcaTxopN::MissedCts (void) RestartAccessIfNeeded (); } +void +EdcaTxopN::NotifyChannelSwitching (void) +{ + m_queue->Flush(); + m_currentPacket = 0; +} + void EdcaTxopN::Queue (Ptr packet, WifiMacHeader const &hdr) { diff --git a/src/devices/wifi/edca-txop-n.h b/src/devices/wifi/edca-txop-n.h index 216c77bb1..eb80a4fc9 100644 --- a/src/devices/wifi/edca-txop-n.h +++ b/src/devices/wifi/edca-txop-n.h @@ -101,6 +101,10 @@ public: void NotifyAccessGranted (void); void NotifyInternalCollision (void); void NotifyCollision (void); + /** + * When a channel switching occurs, enqueued packets are removed. + */ + void NotifyChannelSwitching (void); /*event handlers*/ void GotCts (double snr, WifiMode txMode); diff --git a/src/devices/wifi/interference-helper.cc b/src/devices/wifi/interference-helper.cc index c375d095e..1a41e588b 100644 --- a/src/devices/wifi/interference-helper.cc +++ b/src/devices/wifi/interference-helper.cc @@ -460,7 +460,11 @@ InterferenceHelper::CalculateNoiseInterferenceW (Ptr i++; continue; } - if (event->Overlaps ((*i)->GetStartTime ())) + if ((*i)->Overlaps (event->GetStartTime ())) + { + noiseInterference += (*i)->GetRxPowerW (); + } + else if (event->Overlaps ((*i)->GetStartTime ())) { ni->push_back (NiChange ((*i)->GetStartTime (), (*i)->GetRxPowerW ())); } @@ -468,10 +472,6 @@ InterferenceHelper::CalculateNoiseInterferenceW (Ptr { ni->push_back (NiChange ((*i)->GetEndTime (), -(*i)->GetRxPowerW ())); } - if ((*i)->Overlaps (event->GetStartTime ())) - { - noiseInterference += (*i)->GetRxPowerW (); - } i++; } ni->push_back (NiChange (event->GetStartTime (), noiseInterference)); @@ -603,6 +603,10 @@ InterferenceHelper::CalculateSnrPer (Ptr event) return snrPer; } - +void +InterferenceHelper::EraseEvents (void) +{ + m_events.erase (m_events.begin (), m_events.end ()); +} } // namespace ns3 diff --git a/src/devices/wifi/interference-helper.h b/src/devices/wifi/interference-helper.h index 2140cb12a..0ae37b280 100644 --- a/src/devices/wifi/interference-helper.h +++ b/src/devices/wifi/interference-helper.h @@ -95,6 +95,7 @@ public: Time duration, double rxPower); struct InterferenceHelper::SnrPer CalculateSnrPer (Ptr event); + void EraseEvents (void); private: class NiChange { public: diff --git a/src/devices/wifi/mac-low.cc b/src/devices/wifi/mac-low.cc index bc0ee2035..c18a7638f 100644 --- a/src/devices/wifi/mac-low.cc +++ b/src/devices/wifi/mac-low.cc @@ -244,6 +244,30 @@ std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters return os; } + +/*************************************************************** + * Listener for PHY events. Forwards to MacLow + ***************************************************************/ + + +class PhyMacLowListener : public ns3::WifiPhyListener { +public: + PhyMacLowListener (ns3::MacLow *macLow) + : m_macLow (macLow) {} + virtual ~PhyMacLowListener () {} + virtual void NotifyRxStart (Time duration) {} + virtual void NotifyRxEndOk (void) {} + virtual void NotifyRxEndError (void) {} + virtual void NotifyTxStart (Time duration) {} + virtual void NotifyMaybeCcaBusyStart (Time duration) {} + virtual void NotifySwitchingStart (Time duration) { + m_macLow->NotifySwitchingStartNow (duration); + } +private: + ns3::MacLow *m_macLow; +}; + + MacLow::MacLow () : m_normalAckTimeoutEvent (), m_fastAckTimeoutEvent (), @@ -267,6 +291,14 @@ MacLow::~MacLow () NS_LOG_FUNCTION (this); } +void +MacLow::SetupPhyMacLowListener (Ptr phy) +{ + m_phyMacLowListener = new PhyMacLowListener (this); + phy->RegisterListener (m_phyMacLowListener); +} + + void MacLow::DoDispose (void) { @@ -274,6 +306,8 @@ MacLow::DoDispose (void) CancelAllEvents (); m_phy = 0; m_stationManager = 0; + delete m_phyMacLowListener; + m_phyMacLowListener = 0; } void @@ -339,6 +373,7 @@ MacLow::SetPhy (Ptr phy) m_phy = phy; m_phy->SetReceiveOkCallback (MakeCallback (&MacLow::ReceiveOk, this)); m_phy->SetReceiveErrorCallback (MakeCallback (&MacLow::ReceiveError, this)); + SetupPhyMacLowListener(phy); } void MacLow::SetWifiRemoteStationManager (Ptr manager) @@ -488,6 +523,22 @@ MacLow::ReceiveError (Ptr packet, double rxSnr) return; } +void +MacLow::NotifySwitchingStartNow (Time duration) +{ + NS_LOG_DEBUG ("switching channel. Cancelling MAC pending events"); + m_stationManager->Reset(); + CancelAllEvents(); + if (m_navCounterResetCtsMissed.IsRunning ()) + { + m_navCounterResetCtsMissed.Cancel(); + } + m_lastNavStart = Simulator::Now (); + m_lastNavDuration = Seconds (0); + m_currentPacket = 0; + m_listener = 0; +} + void MacLow::ReceiveOk (Ptr packet, double rxSnr, WifiMode txMode, WifiPreamble preamble) { diff --git a/src/devices/wifi/mac-low.h b/src/devices/wifi/mac-low.h index 7f1bca086..7b090fbd9 100644 --- a/src/devices/wifi/mac-low.h +++ b/src/devices/wifi/mac-low.h @@ -356,6 +356,14 @@ public: * the MAC layer that a packet was unsuccessfully received. */ void ReceiveError (Ptr packet, double rxSnr); + /** + * \param duration switching delay duration. + * + * This method is typically invoked by the PhyMacLowListener to notify + * the MAC layer that a channel switching occured. When a channel switching + * occurs, pending MAC transmissions (RTS, CTS, DATA and ACK) are cancelled. + */ + void NotifySwitchingStartNow (Time duration); private: void CancelAllEvents (void); uint32_t GetAckSize (void) const; @@ -402,6 +410,8 @@ private: void StartDataTxTimers (void); virtual void DoDispose (void); + void SetupPhyMacLowListener (Ptr phy); + Ptr m_phy; Ptr m_stationManager; MacLowRxCallback m_rxCallback; @@ -434,6 +444,9 @@ private: Time m_lastNavStart; Time m_lastNavDuration; + + // Listerner needed to monitor when a channel switching occurs. + class PhyMacLowListener *m_phyMacLowListener; }; } // namespace ns3 diff --git a/src/devices/wifi/minstrel-wifi-manager.cc b/src/devices/wifi/minstrel-wifi-manager.cc index 304a62a3a..ac24b1543 100644 --- a/src/devices/wifi/minstrel-wifi-manager.cc +++ b/src/devices/wifi/minstrel-wifi-manager.cc @@ -369,7 +369,6 @@ MinstrelWifiRemoteStation::GetManager (void) const WifiMode MinstrelWifiRemoteStation::DoGetDataMode (uint32_t size) { - UpdateStats (); if (!m_initialized) { CheckInit (); @@ -377,6 +376,7 @@ MinstrelWifiRemoteStation::DoGetDataMode (uint32_t size) /// start the rate at half way m_txrate = GetNSupportedModes () / 2; } + UpdateStats (); return GetSupportedMode (m_txrate); } @@ -385,7 +385,6 @@ MinstrelWifiRemoteStation::DoGetRtsMode (void) { NS_LOG_DEBUG ("DoGetRtsMode m_txrate=" << m_txrate); - UpdateStats (); return GetSupportedMode (0); } @@ -435,7 +434,7 @@ MinstrelWifiRemoteStation::FindRate () { /// now go through the table and find an index rate - idx = GetNextSample (); + idx = GetNextSample(); /** diff --git a/src/devices/wifi/supported-rates.cc b/src/devices/wifi/supported-rates.cc index a04f8b496..30edb9080 100644 --- a/src/devices/wifi/supported-rates.cc +++ b/src/devices/wifi/supported-rates.cc @@ -136,7 +136,7 @@ std::ostream &operator << (std::ostream &os, const SupportedRates &rates) { os << "*"; } - os << rate << "mbs"; + os << rate / 1000000 << "mbs"; if (i < rates.GetNRates () - 1) { os << " "; diff --git a/src/devices/wifi/wifi-phy-state-helper.cc b/src/devices/wifi/wifi-phy-state-helper.cc index 5626e4281..9a4d1cae8 100644 --- a/src/devices/wifi/wifi-phy-state-helper.cc +++ b/src/devices/wifi/wifi-phy-state-helper.cc @@ -54,9 +54,11 @@ WifiPhyStateHelper::WifiPhyStateHelper () m_endTx (Seconds (0)), m_endSync (Seconds (0)), m_endCcaBusy (Seconds (0)), + m_endSwitching (Seconds (0)), m_startTx (Seconds (0)), m_startSync (Seconds (0)), m_startCcaBusy (Seconds (0)), + m_startSwitching (Seconds (0)), m_previousStateChangeTime (Seconds (0)) { NS_LOG_FUNCTION (this); @@ -104,6 +106,11 @@ WifiPhyStateHelper::IsStateTx (void) { return (GetState () == WifiPhy::TX)?true:false; } +bool +WifiPhyStateHelper::IsStateSwitching (void) +{ + return (GetState () == WifiPhy::SWITCHING)?true:false; +} @@ -128,6 +135,9 @@ WifiPhyStateHelper::GetDelayUntilIdle (void) case WifiPhy::CCA_BUSY: retval = m_endCcaBusy - Simulator::Now (); break; + case WifiPhy::SWITCHING: + retval = m_endSwitching - Simulator::Now (); + break; case WifiPhy::IDLE: retval = Seconds (0); break; @@ -163,6 +173,9 @@ WifiPhyStateHelper::StateToString (enum WifiPhy::State state) case WifiPhy::SYNC: return "SYNC"; break; + case WifiPhy::SWITCHING: + return "SWITCHING"; + break; default: NS_ASSERT (false); // quiet compiler @@ -182,6 +195,10 @@ WifiPhyStateHelper::GetState (void) { return WifiPhy::SYNC; } + else if (m_endSwitching > Simulator::Now ()) + { + return WifiPhy::SWITCHING; + } else if (m_endCcaBusy > Simulator::Now ()) { return WifiPhy::CCA_BUSY; @@ -228,6 +245,13 @@ WifiPhyStateHelper::NotifyMaybeCcaBusyStart (Time duration) (*i)->NotifyMaybeCcaBusyStart (duration); } } +void +WifiPhyStateHelper::NotifySwitchingStart (Time duration) +{ + for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++) { + (*i)->NotifySwitchingStart (duration); + } +} void WifiPhyStateHelper::LogPreviousIdleAndCcaBusyStates (void) @@ -235,11 +259,14 @@ WifiPhyStateHelper::LogPreviousIdleAndCcaBusyStates (void) Time now = Simulator::Now (); Time idleStart = Max (m_endCcaBusy, m_endSync); idleStart = Max (idleStart, m_endTx); + idleStart = Max (idleStart, m_endSwitching); NS_ASSERT (idleStart <= now); if (m_endCcaBusy > m_endSync && + m_endCcaBusy > m_endSwitching && m_endCcaBusy > m_endTx) { Time ccaBusyStart = Max (m_endTx, m_endSync); ccaBusyStart = Max (ccaBusyStart, m_startCcaBusy); + ccaBusyStart = Max (ccaBusyStart, m_endSwitching); m_stateLogger (ccaBusyStart, idleStart - ccaBusyStart, WifiPhy::CCA_BUSY); } m_stateLogger (idleStart, now - idleStart, WifiPhy::IDLE); @@ -264,11 +291,13 @@ WifiPhyStateHelper::SwitchToTx (Time txDuration, Ptr packet, WifiM case WifiPhy::CCA_BUSY: { Time ccaStart = Max (m_endSync, m_endTx); ccaStart = Max (ccaStart, m_startCcaBusy); + ccaStart = Max (ccaStart, m_endSwitching); m_stateLogger (ccaStart, now - ccaStart, WifiPhy::CCA_BUSY); } break; case WifiPhy::IDLE: LogPreviousIdleAndCcaBusyStates (); break; + case WifiPhy::SWITCHING: default: NS_ASSERT (false); break; @@ -292,8 +321,10 @@ WifiPhyStateHelper::SwitchToSync (Time rxDuration) case WifiPhy::CCA_BUSY: { Time ccaStart = Max (m_endSync, m_endTx); ccaStart = Max (ccaStart, m_startCcaBusy); + ccaStart = Max (ccaStart, m_endSwitching); m_stateLogger (ccaStart, now - ccaStart, WifiPhy::CCA_BUSY); } break; + case WifiPhy::SWITCHING: case WifiPhy::SYNC: case WifiPhy::TX: NS_ASSERT (false); @@ -305,6 +336,49 @@ WifiPhyStateHelper::SwitchToSync (Time rxDuration) m_endSync = now + rxDuration; NS_ASSERT (IsStateSync ()); } + +void +WifiPhyStateHelper::SwitchToChannelSwitching (Time switchingDuration) +{ + NotifySwitchingStart (switchingDuration); + Time now = Simulator::Now (); + switch (GetState ()) { + case WifiPhy::SYNC: + /* The packet which is being received as well + * as its endSync event are cancelled by the caller. + */ + m_syncing = false; + m_stateLogger (m_startSync, now - m_startSync, WifiPhy::SYNC); + m_endSync = now; + break; + case WifiPhy::CCA_BUSY: { + Time ccaStart = Max (m_endSync, m_endTx); + ccaStart = Max (ccaStart, m_startCcaBusy); + ccaStart = Max (ccaStart, m_endSwitching); + m_stateLogger (ccaStart, now - ccaStart, WifiPhy::CCA_BUSY); + } break; + case WifiPhy::IDLE: + LogPreviousIdleAndCcaBusyStates (); + break; + case WifiPhy::TX: + case WifiPhy::SWITCHING: + default: + NS_ASSERT (false); + break; + } + + if (now < m_endCcaBusy) + { + m_endCcaBusy = now; + } + + m_stateLogger (now, switchingDuration, WifiPhy::SWITCHING); + m_previousStateChangeTime = now; + m_startSwitching = now; + m_endSwitching = now + switchingDuration; + NS_ASSERT (IsStateSwitching ()); +} + void WifiPhyStateHelper::SwitchFromSyncEndOk (Ptr packet, double snr, WifiMode mode, enum WifiPreamble preamble) { @@ -348,6 +422,8 @@ WifiPhyStateHelper::SwitchMaybeToCcaBusy (Time duration) NotifyMaybeCcaBusyStart (duration); Time now = Simulator::Now (); switch (GetState ()) { + case WifiPhy::SWITCHING: + break; case WifiPhy::IDLE: LogPreviousIdleAndCcaBusyStates (); break; diff --git a/src/devices/wifi/wifi-phy-state-helper.h b/src/devices/wifi/wifi-phy-state-helper.h index b28561550..de8443b18 100644 --- a/src/devices/wifi/wifi-phy-state-helper.h +++ b/src/devices/wifi/wifi-phy-state-helper.h @@ -43,12 +43,14 @@ public: bool IsStateBusy (void); bool IsStateSync (void); bool IsStateTx (void); + bool IsStateSwitching (void); Time GetStateDuration (void); Time GetDelayUntilIdle (void); Time GetLastRxStartTime (void) const; void SwitchToTx (Time txDuration, Ptr packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower); void SwitchToSync (Time syncDuration); + void SwitchToChannelSwitching (Time switchingDuration); void SwitchFromSyncEndOk (Ptr packet, double snr, WifiMode mode, enum WifiPreamble preamble); void SwitchFromSyncEndError (Ptr packet, double snr); void SwitchMaybeToCcaBusy (Time duration); @@ -66,15 +68,18 @@ private: void NotifySyncEndOk (void); void NotifySyncEndError (void); void NotifyMaybeCcaBusyStart (Time duration); + void NotifySwitchingStart (Time duration); void DoSwitchFromSync (void); bool m_syncing; Time m_endTx; Time m_endSync; Time m_endCcaBusy; + Time m_endSwitching; Time m_startTx; Time m_startSync; Time m_startCcaBusy; + Time m_startSwitching; Time m_previousStateChangeTime; Listeners m_listeners; diff --git a/src/devices/wifi/wifi-phy.h b/src/devices/wifi/wifi-phy.h index d75ff70da..2e2092748 100644 --- a/src/devices/wifi/wifi-phy.h +++ b/src/devices/wifi/wifi-phy.h @@ -97,6 +97,14 @@ public: * what duration it reported. */ virtual void NotifyMaybeCcaBusyStart (Time duration) = 0; + /** + * \param duration the expected channel switching duration. + * + * We do not send any event to notify the end of + * channel switching. Listeners should assume that the + * channel implicitely reverts to the idle or busy states. + */ + virtual void NotifySwitchingStart (Time duration) = 0; }; @@ -127,7 +135,11 @@ public: /** * The PHY layer is IDLE. */ - IDLE + IDLE, + /** + * The PHY layer is switching to other channel. + */ + SWITCHING }; /** * arg1: packet received successfully diff --git a/src/devices/wifi/wscript b/src/devices/wifi/wscript index 7df865e15..afdcb7776 100644 --- a/src/devices/wifi/wscript +++ b/src/devices/wifi/wscript @@ -1,12 +1,5 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- -def configure(conf): - have_gsl = conf.pkg_check_modules('GSL', 'gsl', mandatory=False) - conf.env['ENABLE_GSL'] = have_gsl - conf.report_optional_feature("GSL", "GNU Scientific Library (GSL)", - conf.env['ENABLE_GSL'], - "GSL not found") - def build(bld): obj = bld.create_ns3_module('wifi', ['node']) obj.source = [ @@ -120,7 +113,6 @@ def build(bld): if bld.env['ENABLE_GSL']: obj.uselib = 'GSL GSLCBLAS M' - obj.env.append_value('CXXDEFINES', "ENABLE_GSL") obj = bld.create_ns3_program('wifi-phy-test', ['core', 'simulator', 'mobility', 'node', 'wifi']) diff --git a/src/devices/wifi/yans-wifi-channel.h b/src/devices/wifi/yans-wifi-channel.h index 6bd05c4e0..ab6a4d526 100644 --- a/src/devices/wifi/yans-wifi-channel.h +++ b/src/devices/wifi/yans-wifi-channel.h @@ -76,7 +76,9 @@ public: * \param preamble the preamble associated to the packet * * This method should not be invoked by normal users. It is - * currently invoked only from WifiPhy::Send. + * currently invoked only from WifiPhy::Send. YansWifiChannel + * delivers packets only between PHYs with the same m_channelNumber, + * e.g. PHYs that are operating on the same channel. */ void Send (Ptr sender, Ptr packet, double txPowerDbm, WifiMode wifiMode, WifiPreamble preamble) const; diff --git a/src/devices/wifi/yans-wifi-phy.cc b/src/devices/wifi/yans-wifi-phy.cc index eead8afae..7efbf6739 100644 --- a/src/devices/wifi/yans-wifi-phy.cc +++ b/src/devices/wifi/yans-wifi-phy.cc @@ -302,27 +302,53 @@ YansWifiPhy::SetChannel (Ptr channel) { m_channel = channel; m_channel->Add (this); - m_channelId = 1; // always start on channel starting frequency (channel 1) + m_channelNumber = 1; // always start on channel starting frequency (channel 1) } void YansWifiPhy::SetChannelNumber (uint16_t nch) { - // TODO implement channel switching state machine here - DoSetChannelNumber (nch); -} + NS_ASSERT(!IsStateSwitching()); + switch (m_state->GetState ()) { + case YansWifiPhy::SYNC: + NS_LOG_DEBUG ("drop packet because of channel switching while reception"); + m_endSyncEvent.Cancel(); + goto switchChannel; + break; + case YansWifiPhy::TX: + NS_LOG_DEBUG ("channel switching postponed until end of current transmission"); + Simulator::Schedule (GetDelayUntilIdle(), &YansWifiPhy::SetChannelNumber, this, nch); + break; + case YansWifiPhy::CCA_BUSY: + case YansWifiPhy::IDLE: + goto switchChannel; + break; + default: + NS_ASSERT (false); + break; + } -void -YansWifiPhy::DoSetChannelNumber (uint16_t nch) -{ - NS_LOG_DEBUG("switching channel " << m_channelId << " -> " << nch); - m_channelId = nch; + return; + + switchChannel: + + NS_LOG_DEBUG("switching channel " << m_channelNumber << " -> " << nch); + m_state->SwitchToChannelSwitching(m_channelSwitchDelay); + m_interference.EraseEvents(); + /* + * Needed here to be able to correctly sensed the medium for the first + * time after the switching. The actual switching is not performed until + * after m_channelSwitchDelay. Packets received during the switching + * state are added to the event list and are employed later to figure + * out the state of the medium after the switching. + */ + m_channelNumber = nch; } uint16_t YansWifiPhy::GetChannelNumber() const { - return m_channelId; + return m_channelNumber; } double @@ -361,6 +387,24 @@ YansWifiPhy::StartReceivePacket (Ptr packet, rxPowerW); switch (m_state->GetState ()) { + case YansWifiPhy::SWITCHING: + NS_LOG_DEBUG ("drop packet because of channel switching"); + NotifyRxDrop (packet); + /* + * Packets received on the upcoming channel are added to the event list + * during the switching state. This way the medium can be correctly sensed + * when the device listens to the channel for the first time after the + * switching e.g. after channel switching, the channel may be sensed as + * busy due to other devices' tramissions started before the end of + * the switching. + */ + if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) + { + // that packet will be noise _after_ the completion of the + // channel switching. + goto maybeCcaBusy; + } + break; case YansWifiPhy::SYNC: NS_LOG_DEBUG ("drop packet because already in Sync (power="<< rxPowerW<<"W)"); @@ -431,7 +475,7 @@ YansWifiPhy::SendPacket (Ptr packet, WifiMode txMode, WifiPreamble * prevent it. * - we are idle */ - NS_ASSERT (!m_state->IsStateTx ()); + NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ()); Time txDuration = CalculateTxDuration (packet->GetSize (), txMode, preamble); if (m_state->IsStateSync ()) @@ -563,6 +607,11 @@ YansWifiPhy::IsStateTx (void) { return m_state->IsStateTx (); } +bool +YansWifiPhy::IsStateSwitching (void) +{ + return m_state->IsStateSwitching (); +} Time YansWifiPhy::GetStateDuration (void) diff --git a/src/devices/wifi/yans-wifi-phy.h b/src/devices/wifi/yans-wifi-phy.h index 34c3313e7..948d97bfb 100644 --- a/src/devices/wifi/yans-wifi-phy.h +++ b/src/devices/wifi/yans-wifi-phy.h @@ -77,6 +77,13 @@ public: * * where Starting channel frequency is standard-dependent, see SetStandard() * as defined in IEEE 802.11-2007 17.3.8.3.2. + * + * YansWifiPhy can switch among different channels. Basically, YansWifiPhy + * has a private attribute m_channelNumber that identifies the channel the + * PHY operates on. Channel switching cannot interrupt an ongoing transmission. + * When PHY is in TX state, the channel switching is postponed until the end + * of the current transmission. When the PHY is in SYNC state, the channel + * switching causes the drop of the sync packet. */ void SetChannelNumber (uint16_t id); /// Return current channel number, see SetChannelNumber() @@ -124,6 +131,7 @@ public: virtual bool IsStateBusy (void); virtual bool IsStateSync (void); virtual bool IsStateTx (void); + virtual bool IsStateSwitching (void); virtual Time GetStateDuration (void); virtual Time GetDelayUntilIdle (void); virtual Time GetLastRxStartTime (void) const; @@ -152,7 +160,6 @@ private: double RatioToDb (double ratio) const; double GetPowerDbm (uint8_t power) const; void EndSync (Ptr packet, Ptr event); - void DoSetChannelNumber(uint16_t id); private: double m_edThresholdW; @@ -164,7 +171,7 @@ private: uint32_t m_nTxPower; Ptr m_channel; - uint16_t m_channelId; + uint16_t m_channelNumber; Ptr m_device; Ptr m_mobility; Modes m_modes; diff --git a/src/helper/dot11s-installer.cc b/src/helper/dot11s-installer.cc new file mode 100644 index 000000000..9ed804b0d --- /dev/null +++ b/src/helper/dot11s-installer.cc @@ -0,0 +1,124 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ +#include "ns3/dot11s-installer.h" +#include "ns3/peer-management-protocol.h" +#include "ns3/hwmp-protocol.h" +#include "ns3/wifi-net-device.h" +#include "ns3/mesh-wifi-interface-mac.h" + +namespace ns3 { +using namespace dot11s; +NS_OBJECT_ENSURE_REGISTERED (Dot11sStack); +TypeId +Dot11sStack::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::Dot11sStack") + .SetParent () + .AddConstructor () + .AddAttribute ("Root", + "The MAC address of root mesh point.", + Mac48AddressValue (Mac48Address ("ff:ff:ff:ff:ff:ff")), + MakeMac48AddressAccessor (&Dot11sStack::m_root), + MakeMac48AddressChecker ()); + return tid; +} +Dot11sStack::Dot11sStack () : + m_root (Mac48Address ("ff:ff:ff:ff:ff:ff")) +{ +} +Dot11sStack::~Dot11sStack () +{ +} +void +Dot11sStack::DoDispose () +{ +} +bool +Dot11sStack::InstallStack (Ptr mp) +{ + //Install Peer management protocol: + Ptr pmp = CreateObject (); + pmp->SetMeshId ("mesh"); + bool install_ok = pmp->Install (mp); + if (!install_ok) + { + return false; + } + //Install HWMP: + Ptr hwmp = CreateObject (); + install_ok = hwmp->Install (mp); + if (!install_ok) + { + return false; + } + if (mp->GetAddress() == m_root) + { + hwmp->SetRoot (); + } + //Install interaction between HWMP and Peer management protocol: + pmp->SetPeerLinkStatusCallback (MakeCallback (&HwmpProtocol::PeerLinkStatus, hwmp)); + hwmp->SetNeighboursCallback (MakeCallback (&PeerManagementProtocol::GetActiveLinks, pmp)); + return true; +} +void +Dot11sStack::Report (const Ptr mp, std::ostream& os) +{ + mp->Report (os); + + std::vector > ifaces = mp->GetInterfaces (); + for (std::vector >::const_iterator i = ifaces.begin (); i != ifaces.end (); ++i) + { + Ptr device = (*i)->GetObject (); + NS_ASSERT (device != 0); + Ptr mac = device->GetMac ()->GetObject (); + NS_ASSERT (mac != 0); + mac->Report (os); + } + Ptr hwmp = mp->GetObject (); + NS_ASSERT (hwmp != 0); + hwmp->Report (os); + + Ptr pmp = mp->GetObject (); + NS_ASSERT (pmp != 0); + pmp->Report (os); +} +void +Dot11sStack::ResetStats (const Ptr mp) +{ + mp->ResetStats (); + + std::vector > ifaces = mp->GetInterfaces (); + for (std::vector >::const_iterator i = ifaces.begin (); i != ifaces.end (); ++i) + { + Ptr device = (*i)->GetObject (); + NS_ASSERT (device != 0); + Ptr mac = device->GetMac ()->GetObject (); + NS_ASSERT (mac != 0); + mac->ResetStats (); + } + Ptr hwmp = mp->GetObject (); + NS_ASSERT (hwmp != 0); + hwmp->ResetStats (); + + Ptr pmp = mp->GetObject (); + NS_ASSERT (pmp != 0); + pmp->ResetStats (); +} +} //namespace ns3 diff --git a/src/helper/dot11s-installer.h b/src/helper/dot11s-installer.h new file mode 100644 index 000000000..e2139e09b --- /dev/null +++ b/src/helper/dot11s-installer.h @@ -0,0 +1,43 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + + +#ifndef DOT11S_STACK_INSTALLER_H +#define DOT11S_STACK_INSTALLER_H +#include "ns3/mesh-stack-installer.h" +namespace ns3 { +class Dot11sStack : public MeshStack +{ + public: + static TypeId GetTypeId (); + Dot11sStack (); + ~Dot11sStack (); + void DoDispose (); + + ///\brief Installs 802.11s stack. needed by helper only + bool InstallStack (Ptr mp); + void Report (const Ptr mp, std::ostream&); + void ResetStats (const Ptr mp); + private: + Mac48Address m_root; +}; +} //namespace ns3 +#endif + diff --git a/src/helper/flame-installer.cc b/src/helper/flame-installer.cc new file mode 100644 index 000000000..c7f09f97d --- /dev/null +++ b/src/helper/flame-installer.cc @@ -0,0 +1,73 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#include "ns3/flame-installer.h" +#include "ns3/flame-protocol.h" +#include "ns3/wifi-net-device.h" +#include "ns3/mesh-wifi-interface-mac.h" + +namespace ns3 +{ +using namespace flame; +NS_OBJECT_ENSURE_REGISTERED (FlameStack); +TypeId +FlameStack::GetTypeId () +{ + static TypeId tid = TypeId ("ns3::FlameStack") + .SetParent () + .AddConstructor (); + return tid; +} +FlameStack::FlameStack () +{ +} +FlameStack::~FlameStack () +{ +} +void +FlameStack::DoDispose () +{ +} +bool +FlameStack::InstallStack (Ptr mp) +{ + Ptr flame = CreateObject (); + return flame->Install (mp); +} +void +FlameStack::Report (const Ptr mp, std::ostream& os) +{ + mp->Report (os); + // TODO report flame counters + Ptr flame = mp->GetObject (); + NS_ASSERT (flame != 0); + flame->Report (os); +} +void +FlameStack::ResetStats (const Ptr mp) +{ + mp->ResetStats (); + // TODO reset flame counters + Ptr flame = mp->GetObject (); + NS_ASSERT (flame != 0); + + flame->ResetStats (); +} +} //namespace ns3 diff --git a/src/helper/flame-installer.h b/src/helper/flame-installer.h new file mode 100644 index 000000000..12b71e713 --- /dev/null +++ b/src/helper/flame-installer.h @@ -0,0 +1,45 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + +#ifndef FLAME_STACK_INSTALLER_H +#define FLAME_STACK_INSTALLER_H +#include "ns3/mesh-stack-installer.h" +namespace ns3 { +/** + * \ingroup flame + * + * \brief FLAME mesh stack (actually single protocol in this stack) + */ +class FlameStack : public MeshStack +{ + public: + static TypeId GetTypeId (); + FlameStack (); + ~FlameStack (); + void DoDispose (); + + /// Installs flame stack on given mesh point device. + bool InstallStack (Ptr mp); + void Report (const Ptr mp, std::ostream&); + void ResetStats (const Ptr mp); +}; +} //namespace ns3 +#endif + diff --git a/src/helper/flow-monitor-helper.cc b/src/helper/flow-monitor-helper.cc new file mode 100644 index 000000000..72c2bc0d0 --- /dev/null +++ b/src/helper/flow-monitor-helper.cc @@ -0,0 +1,110 @@ +// -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// + +#include "flow-monitor-helper.h" + +#include "ns3/flow-monitor.h" +#include "ns3/ipv4-flow-classifier.h" +#include "ns3/ipv4-flow-probe.h" +#include "ns3/ipv4-l3-protocol.h" +#include "ns3/node.h" +#include "ns3/node-list.h" + + +namespace ns3 { + +FlowMonitorHelper::FlowMonitorHelper () +{ + m_monitorFactory.SetTypeId ("ns3::FlowMonitor"); +} + +void +FlowMonitorHelper::SetMonitorAttribute (std::string n1, const AttributeValue &v1) +{ + m_monitorFactory.Set (n1, v1); +} + + +Ptr +FlowMonitorHelper::GetMonitor () +{ + if (!m_flowMonitor) + { + m_flowMonitor = m_monitorFactory.Create (); + m_flowClassifier = Create (); + m_flowMonitor->SetFlowClassifier (m_flowClassifier); + } + return m_flowMonitor; +} + + +Ptr +FlowMonitorHelper::GetClassifier () +{ + if (!m_flowClassifier) + { + m_flowClassifier = Create (); + } + return m_flowClassifier; +} + + +Ptr +FlowMonitorHelper::Install (Ptr node) +{ + Ptr monitor = GetMonitor (); + Ptr classifier = GetClassifier (); + Ptr probe = Create (monitor, + DynamicCast (classifier), + node); + return m_flowMonitor; +} + + +Ptr +FlowMonitorHelper::Install (NodeContainer nodes) +{ + for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i) + { + Ptr node = *i; + if (node->GetObject ()) + { + Install (node); + } + } + return m_flowMonitor; +} + +Ptr +FlowMonitorHelper::InstallAll () +{ + for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); ++i) + { + Ptr node = *i; + if (node->GetObject ()) + { + Install (node); + } + } + return m_flowMonitor; +} + + +} // namespace ns3 diff --git a/src/helper/flow-monitor-helper.h b/src/helper/flow-monitor-helper.h new file mode 100644 index 000000000..1b5ed2d68 --- /dev/null +++ b/src/helper/flow-monitor-helper.h @@ -0,0 +1,66 @@ +// -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- +// +// Copyright (c) 2009 INESC Porto +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: Gustavo J. A. M. Carneiro +// +#ifndef FLOW_MONITOR_HELPER_H +#define FLOW_MONITOR_HELPER_H + +#include "node-container.h" +#include "ns3/object-factory.h" +#include "ns3/flow-monitor.h" +#include "ns3/flow-classifier.h" +#include + +namespace ns3 { + +class AttributeValue; +class Ipv4FlowClassifier; + +/// \brief Helper to enable IPv4 flow monitoring on a set of Nodes +class FlowMonitorHelper +{ +public: + FlowMonitorHelper (); + + + /// \brief Set an attribute for the to-be-created FlowMonitor object + void SetMonitorAttribute (std::string n1, const AttributeValue &v1); + + /// \brief Enable flow monitoring on a set of nodes + Ptr Install (NodeContainer nodes); + /// \brief Enable flow monitoring on a single node + Ptr Install (Ptr node); + /// \brief Enable flow monitoring on all nodes + Ptr InstallAll (); + + /// \brief Retrieve the FlowMonitor object created by the Install* methods + Ptr GetMonitor (); + + /// \brief Retrieve the FlowClassifier object created by the Install* methods + Ptr GetClassifier (); + +private: + ObjectFactory m_monitorFactory; + Ptr m_flowMonitor; + Ptr m_flowClassifier; +}; + +} // namespace ns3 + + +#endif /* FLOW_MONITOR_HELPER_H */ diff --git a/src/helper/internet-stack-helper.cc b/src/helper/internet-stack-helper.cc index 4a074ba2d..23ee1a5d8 100644 --- a/src/helper/internet-stack-helper.cc +++ b/src/helper/internet-stack-helper.cc @@ -338,13 +338,13 @@ InternetStackHelper::EnableAscii (std::ostream &os, NodeContainer n) { Ptr node = *i; oss << "/NodeList/" << node->GetId () << "/$ns3::Ipv4L3Protocol/Drop"; - Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEvent, writer)); + Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEventIpv4, writer)); oss.str (""); oss << "/NodeList/" << node->GetId () << "/$ns3::ArpL3Protocol/Drop"; - Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEvent, writer)); + Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEventArp, writer)); oss.str (""); oss << "/NodeList/" << node->GetId () << "/$ns3::Ipv6L3Protocol/Drop"; - Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEvent, writer)); + Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEventIpv6, writer)); oss.str (""); } } @@ -428,9 +428,29 @@ InternetStackHelper::GetStream (uint32_t nodeId, uint32_t interfaceId) } void -InternetStackHelper::AsciiDropEvent (Ptr writer, std::string path, Ptr packet) +InternetStackHelper::AsciiDropEventArp (Ptr writer, std::string path, Ptr packet) { writer->WritePacket (AsciiWriter::DROP, path, packet); } +void +InternetStackHelper::AsciiDropEventIpv4 (Ptr writer, std::string path, + Ipv4Header const &header, Ptr packet, + Ipv4L3Protocol::DropReason reason, uint32_t interface) +{ + Ptr p = packet->Copy (); + p->AddHeader (header); + writer->WritePacket (AsciiWriter::DROP, path, p); +} + +void +InternetStackHelper::AsciiDropEventIpv6 (Ptr writer, std::string path, + Ipv6Header const &header, Ptr packet, + Ipv6L3Protocol::DropReason reason, uint32_t interface) +{ + Ptr p = packet->Copy (); + p->AddHeader (header); + writer->WritePacket (AsciiWriter::DROP, path, p); +} + } // namespace ns3 diff --git a/src/helper/internet-stack-helper.h b/src/helper/internet-stack-helper.h index b66c1645f..ff96d22d2 100644 --- a/src/helper/internet-stack-helper.h +++ b/src/helper/internet-stack-helper.h @@ -26,6 +26,10 @@ #include "ns3/packet.h" #include "ns3/ptr.h" #include "ns3/object-factory.h" +#include "ns3/pcap-writer.h" +#include "ns3/ascii-writer.h" +#include "ns3/ipv4-l3-protocol.h" +#include "ns3/ipv6-l3-protocol.h" namespace ns3 { @@ -196,7 +200,14 @@ private: uint32_t interfaceId; Ptr writer; }; - static void AsciiDropEvent (Ptr writer, std::string path, Ptr packet); + + static void AsciiDropEventIpv4 (Ptr writer, std::string path, + Ipv4Header const &header, Ptr packet, + Ipv4L3Protocol::DropReason reason, uint32_t interface); + static void AsciiDropEventArp (Ptr writer, std::string path, Ptr packet); + static void AsciiDropEventIpv6 (Ptr writer, std::string path, + Ipv6Header const &header, Ptr packet, + Ipv6L3Protocol::DropReason reason, uint32_t interface); static std::string m_pcapBaseFilename; static uint32_t GetNodeIndex (std::string context); static std::vector m_traces; diff --git a/src/helper/ipv4-address-helper.cc b/src/helper/ipv4-address-helper.cc index b0ae54691..5ec6efb82 100644 --- a/src/helper/ipv4-address-helper.cc +++ b/src/helper/ipv4-address-helper.cc @@ -46,6 +46,15 @@ Ipv4AddressHelper::Ipv4AddressHelper () m_max = 0xffffffff; } +Ipv4AddressHelper::Ipv4AddressHelper ( + const Ipv4Address network, + const Ipv4Mask mask, + const Ipv4Address address) +{ + NS_LOG_FUNCTION_NOARGS (); + SetBase (network, mask, address); +} + void Ipv4AddressHelper::SetBase ( const Ipv4Address network, diff --git a/src/helper/ipv4-address-helper.h b/src/helper/ipv4-address-helper.h index 761a15576..c1fd7ef70 100644 --- a/src/helper/ipv4-address-helper.h +++ b/src/helper/ipv4-address-helper.h @@ -51,6 +51,14 @@ public: */ Ipv4AddressHelper (); +/** + * @brief Construct a helper class to make life easier while doing simple IPv4 + * address assignment in scripts. This version sets the base and mask + * in the constructor + */ + Ipv4AddressHelper (Ipv4Address network, Ipv4Mask mask, + Ipv4Address base = "0.0.0.1"); + /** * @brief Set the base network mumber, network mask and base address. * diff --git a/src/helper/ipv4-interface-container.cc b/src/helper/ipv4-interface-container.cc index 1666e5ae3..31e4e57c8 100644 --- a/src/helper/ipv4-interface-container.cc +++ b/src/helper/ipv4-interface-container.cc @@ -42,6 +42,10 @@ Ipv4InterfaceContainer::Add (Ptr ipv4, uint32_t interface) { m_interfaces.push_back (std::make_pair (ipv4, interface)); } +void Ipv4InterfaceContainer::Add (std::pair, uint32_t> a) + { + Add (a.first, a.second); + } void Ipv4InterfaceContainer::Add (std::string ipv4Name, uint32_t interface) { @@ -49,4 +53,11 @@ Ipv4InterfaceContainer::Add (std::string ipv4Name, uint32_t interface) m_interfaces.push_back (std::make_pair (ipv4, interface)); } + std::pair, uint32_t> +Ipv4InterfaceContainer::Get(uint32_t i) const + { + return m_interfaces[i]; + } + + } // namespace ns3 diff --git a/src/helper/ipv4-interface-container.h b/src/helper/ipv4-interface-container.h index dd495f3e2..c92dd33b4 100644 --- a/src/helper/ipv4-interface-container.h +++ b/src/helper/ipv4-interface-container.h @@ -22,6 +22,7 @@ public: /** * Concatenate the entries in the other container with ours. + * \param other container */ void Add (Ipv4InterfaceContainer other); @@ -31,6 +32,8 @@ public: uint32_t GetN (void) const; /** + * \param i interface index + * \param j interface address index (if interface has multiple addresses) * \returns the IPv4 address of the j'th address of the interface * corresponding to index i. * @@ -46,8 +49,11 @@ public: * \param interface interface index of the Ipv4Interface to add to the container */ void Add (Ptr ipv4, uint32_t interface); + void Add (std::pair, uint32_t>); void Add (std::string ipv4Name, uint32_t interface); + std::pair, uint32_t> Get (uint32_t) const; + private: typedef std::vector,uint32_t> > InterfaceVector; diff --git a/src/helper/ipv4-nix-vector-helper.cc b/src/helper/ipv4-nix-vector-helper.cc new file mode 100644 index 000000000..3ac2d1eda --- /dev/null +++ b/src/helper/ipv4-nix-vector-helper.cc @@ -0,0 +1,39 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 The Georgia Institute of Technology + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Josh Pelkey + */ + +#include "ipv4-nix-vector-helper.h" +#include "ns3/ipv4-nix-vector-routing.h" + +namespace ns3 { + +Ipv4NixVectorHelper::Ipv4NixVectorHelper () +{ + m_agentFactory.SetTypeId ("ns3::Ipv4NixVectorRouting"); +} + +Ptr +Ipv4NixVectorHelper::Create (Ptr node) const +{ + Ptr agent = m_agentFactory.Create (); + agent->SetNode(node); + node->AggregateObject (agent); + return agent; +} +} // namespace ns3 diff --git a/src/helper/ipv4-nix-vector-helper.h b/src/helper/ipv4-nix-vector-helper.h new file mode 100644 index 000000000..c524cb03f --- /dev/null +++ b/src/helper/ipv4-nix-vector-helper.h @@ -0,0 +1,55 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 The Georgia Institute of Technology + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Josh Pelkey + */ + +#ifndef IPV4_NIX_VECTOR_HELPER_H +#define IPV4_NIX_VECTOR_HELPER_H + +#include "ns3/object-factory.h" +#include "ns3/ipv4-routing-helper.h" + +namespace ns3 { + +/** + * \brief Helper class that adds Nix-vector routing to nodes. + * + * This class is expected to be used in conjunction with + * ns3::InternetStackHelper::SetRoutingHelper + * + */ + +class Ipv4NixVectorHelper : public Ipv4RoutingHelper +{ +public: + Ipv4NixVectorHelper (); + + /** + * \param node the node on which the routing protocol will run + * \returns a newly-created routing protocol + * + * This method will be called by ns3::InternetStackHelper::Install + */ + virtual Ptr Create (Ptr node) const; + +private: + ObjectFactory m_agentFactory; +}; +} // namespace ns3 + +#endif /* IPV4_NIX_VECTOR_HELPER_H */ diff --git a/src/helper/ipv4-static-routing-helper.h b/src/helper/ipv4-static-routing-helper.h index 2092900e4..06907eff6 100644 --- a/src/helper/ipv4-static-routing-helper.h +++ b/src/helper/ipv4-static-routing-helper.h @@ -67,6 +67,8 @@ public: * * Functionally equivalent to: * route add 224.0.0.0 netmask 240.0.0.0 dev nd + * \param n node + * \param nd device of the node to add default route */ void SetDefaultMulticastRoute (Ptr n, Ptr nd); void SetDefaultMulticastRoute (Ptr n, std::string ndName); diff --git a/src/helper/ipv6-address-helper.h b/src/helper/ipv6-address-helper.h index 5f0c147db..f52788efa 100644 --- a/src/helper/ipv6-address-helper.h +++ b/src/helper/ipv6-address-helper.h @@ -24,6 +24,7 @@ #include #include "ns3/ipv6-address.h" + #include "net-device-container.h" #include "ipv6-interface-container.h" diff --git a/src/helper/ipv6-interface-container.h b/src/helper/ipv6-interface-container.h index 875aeae8a..754051fa6 100644 --- a/src/helper/ipv6-interface-container.h +++ b/src/helper/ipv6-interface-container.h @@ -22,7 +22,9 @@ #define IPV6_INTERFACE_CONTAINER_H #include + #include + #include "ns3/ipv6.h" #include "ns3/ipv6-address.h" @@ -31,7 +33,7 @@ namespace ns3 /** * \class Ipv6InterfaceContainer - * \brief keep track of a set of IPv6 interfaces. + * \brief Keep track of a set of IPv6 interfaces. */ class Ipv6InterfaceContainer { diff --git a/src/helper/ipv6-list-routing-helper.cc b/src/helper/ipv6-list-routing-helper.cc index c62d20d58..006b63954 100644 --- a/src/helper/ipv6-list-routing-helper.cc +++ b/src/helper/ipv6-list-routing-helper.cc @@ -17,10 +17,12 @@ * * Author: Mathieu Lacage */ -#include "ipv6-list-routing-helper.h" + #include "ns3/ipv6-list-routing.h" #include "ns3/node.h" +#include "ipv6-list-routing-helper.h" + namespace ns3 { Ipv6ListRoutingHelper::Ipv6ListRoutingHelper () diff --git a/src/helper/ipv6-list-routing-helper.h b/src/helper/ipv6-list-routing-helper.h index 5eda5d9e3..81fd725eb 100644 --- a/src/helper/ipv6-list-routing-helper.h +++ b/src/helper/ipv6-list-routing-helper.h @@ -20,10 +20,12 @@ #ifndef IPV6_LIST_ROUTING_HELPER_H #define IPV6_LIST_ROUTING_HELPER_H -#include "ipv6-routing-helper.h" #include + #include +#include "ipv6-routing-helper.h" + namespace ns3 { /** diff --git a/src/helper/ipv6-routing-helper.h b/src/helper/ipv6-routing-helper.h index 2341928f4..8da0abce4 100644 --- a/src/helper/ipv6-routing-helper.h +++ b/src/helper/ipv6-routing-helper.h @@ -17,6 +17,7 @@ * * Author: Mathieu Lacage */ + #ifndef IPV6_ROUTING_HELPER_H #define IPV6_ROUTING_HELPER_H @@ -28,7 +29,7 @@ class Ipv6RoutingProtocol; class Node; /** - * \brief a factory to create ns3::Ipv6RoutingProtocol objects + * \brief A factory to create ns3::Ipv6RoutingProtocol objects * * For each new routing protocol created as a subclass of * ns3::Ipv6RoutingProtocol, you need to create a subclass of diff --git a/src/helper/ipv6-static-routing-helper.cc b/src/helper/ipv6-static-routing-helper.cc index 278217691..793e2b993 100644 --- a/src/helper/ipv6-static-routing-helper.cc +++ b/src/helper/ipv6-static-routing-helper.cc @@ -17,6 +17,7 @@ */ #include + #include "ns3/log.h" #include "ns3/ptr.h" #include "ns3/names.h" @@ -27,6 +28,7 @@ #include "ns3/assert.h" #include "ns3/ipv6-address.h" #include "ns3/ipv6-routing-protocol.h" + #include "ipv6-static-routing-helper.h" NS_LOG_COMPONENT_DEFINE ("Ipv6StaticRoutingHelper"); diff --git a/src/helper/ipv6-static-routing-helper.h b/src/helper/ipv6-static-routing-helper.h index 6b43fe494..700dc86dd 100644 --- a/src/helper/ipv6-static-routing-helper.h +++ b/src/helper/ipv6-static-routing-helper.h @@ -25,9 +25,10 @@ #include "ns3/ipv6-address.h" #include "ns3/node.h" #include "ns3/net-device.h" -#include "ipv6-routing-helper.h" + #include "node-container.h" #include "net-device-container.h" +#include "ipv6-routing-helper.h" namespace ns3 { @@ -40,6 +41,9 @@ namespace ns3 { class Ipv6StaticRoutingHelper : public Ipv6RoutingHelper { public: + /** + * \brief Constructor. + */ Ipv6StaticRoutingHelper (); /** @@ -50,6 +54,11 @@ public: */ virtual Ptr Create (Ptr node) const; + /** + * \brief Get Ipv6StaticRouting pointer from IPv6 stack. + * \param ipv6 Ipv6 pointer + * \return Ipv6StaticRouting pointer or 0 if not exist + */ Ptr GetStaticRouting (Ptr ipv6) const; void AddMulticastRoute (Ptr n, Ipv6Address source, Ipv6Address group, diff --git a/src/helper/mesh-helper.cc b/src/helper/mesh-helper.cc new file mode 100644 index 000000000..876afb00f --- /dev/null +++ b/src/helper/mesh-helper.cc @@ -0,0 +1,207 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + * Pavel Boyko + */ +#include "mesh-helper.h" +#include "ns3/simulator.h" +#include "ns3/mesh-point-device.h" +#include "ns3/wifi-net-device.h" +#include "ns3/mesh-wifi-interface-mac.h" +namespace ns3 +{ +MeshHelper::MeshHelper () : + m_nInterfaces (1), + m_spreadChannelPolicy (ZERO_CHANNEL), + m_stack (0), + m_standard (WIFI_PHY_STANDARD_80211a) +{ +} +void +MeshHelper::SetSpreadInterfaceChannels (enum ChannelPolicy policy) +{ + m_spreadChannelPolicy = policy; +} +void +MeshHelper::SetStackInstaller (std::string type, + std::string n0, const AttributeValue &v0, + std::string n1, const AttributeValue &v1, + std::string n2, const AttributeValue &v2, + std::string n3, const AttributeValue &v3, + std::string n4, const AttributeValue &v4, + std::string n5, const AttributeValue &v5, + std::string n6, const AttributeValue &v6, + std::string n7, const AttributeValue &v7) +{ + m_stackFactory.SetTypeId (type); + m_stackFactory.Set (n0, v0); + m_stackFactory.Set (n1, v1); + m_stackFactory.Set (n2, v2); + m_stackFactory.Set (n3, v3); + m_stackFactory.Set (n4, v4); + m_stackFactory.Set (n5, v5); + m_stackFactory.Set (n6, v6); + m_stackFactory.Set (n7, v7); + + m_stack = m_stackFactory.Create (); + if (m_stack == 0) + { + NS_FATAL_ERROR ("Stack has not been created: " << type); + } +} + +void +MeshHelper::SetNumberOfInterfaces (uint32_t nInterfaces) +{ + m_nInterfaces = nInterfaces; +} +NetDeviceContainer +MeshHelper::Install (const WifiPhyHelper &phyHelper, NodeContainer c) const +{ + NetDeviceContainer devices; + NS_ASSERT (m_stack != 0); + for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i) + { + Ptr node = *i; + // Create a mesh point device + Ptr mp = CreateObject (); + node->AddDevice (mp); + // Create wifi interfaces (single interface by default) + for (uint32_t i = 0; i < m_nInterfaces; ++i) + { + uint32_t channel = 0; + if (m_spreadChannelPolicy == ZERO_CHANNEL) + { + channel = 0; + } + if (m_spreadChannelPolicy == SPREAD_CHANNELS) + { + channel = i * 5; + } + Ptr iface = CreateInterface (phyHelper, node, channel); + mp->AddInterface (iface); + } + if (!m_stack->InstallStack (mp)) + { + NS_FATAL_ERROR ("Stack is not installed!"); + } + devices.Add (mp); + } + return devices; +} +MeshHelper +MeshHelper::Default (void) +{ + MeshHelper helper; + helper.SetMacType (); + helper.SetRemoteStationManager ("ns3::ArfWifiManager"); + helper.SetSpreadInterfaceChannels (SPREAD_CHANNELS); + return helper; +} + +void +MeshHelper::SetMacType (std::string n0, const AttributeValue &v0, + std::string n1, const AttributeValue &v1, + std::string n2, const AttributeValue &v2, + std::string n3, const AttributeValue &v3, + std::string n4, const AttributeValue &v4, + std::string n5, const AttributeValue &v5, + std::string n6, const AttributeValue &v6, + std::string n7, const AttributeValue &v7) +{ + m_mac.SetTypeId ("ns3::MeshWifiInterfaceMac"); + m_mac.Set (n0, v0); + m_mac.Set (n1, v1); + m_mac.Set (n2, v2); + m_mac.Set (n3, v3); + m_mac.Set (n4, v4); + m_mac.Set (n5, v5); + m_mac.Set (n6, v6); + m_mac.Set (n7, v7); +} +void +MeshHelper::SetRemoteStationManager (std::string type, + std::string n0, const AttributeValue &v0, + std::string n1, const AttributeValue &v1, + std::string n2, const AttributeValue &v2, + std::string n3, const AttributeValue &v3, + std::string n4, const AttributeValue &v4, + std::string n5, const AttributeValue &v5, + std::string n6, const AttributeValue &v6, + std::string n7, const AttributeValue &v7) +{ + m_stationManager = ObjectFactory (); + m_stationManager.SetTypeId (type); + m_stationManager.Set (n0, v0); + m_stationManager.Set (n1, v1); + m_stationManager.Set (n2, v2); + m_stationManager.Set (n3, v3); + m_stationManager.Set (n4, v4); + m_stationManager.Set (n5, v5); + m_stationManager.Set (n6, v6); + m_stationManager.Set (n7, v7); +} +void +MeshHelper::SetStandard (enum WifiPhyStandard standard) +{ + m_standard = standard; +} + +Ptr +MeshHelper::CreateInterface (const WifiPhyHelper &phyHelper, Ptr node, uint16_t channelId) const +{ + Ptr device = CreateObject (); + + Ptr mac = m_mac.Create (); + NS_ASSERT (mac != 0); + mac->SetSsid (Ssid ()); + Ptr manager = m_stationManager.Create (); + NS_ASSERT (manager != 0); + Ptr phy = phyHelper.Create (node, device); + mac->SetAddress (Mac48Address::Allocate ()); + mac->ConfigureStandard (m_standard); + phy->ConfigureStandard (m_standard); + device->SetMac (mac); + device->SetPhy (phy); + device->SetRemoteStationManager (manager); + node->AddDevice (device); + mac->SwitchFrequencyChannel (channelId); + return device; +} +void +MeshHelper::Report (const ns3::Ptr& device, std::ostream& os) +{ + NS_ASSERT (m_stack != 0); + Ptr mp = device->GetObject (); + NS_ASSERT (mp != 0); + std::vector > ifaces = mp->GetInterfaces (); + os << "GetAddress ()) << "\">\n"; + m_stack->Report (mp, os); + os << "\n"; +} +void +MeshHelper::ResetStats (const ns3::Ptr& device) +{ + NS_ASSERT (m_stack != 0); + Ptr mp = device->GetObject (); + NS_ASSERT (mp != 0); + m_stack->ResetStats (mp); +} +} //namespace ns3 + diff --git a/src/helper/mesh-helper.h b/src/helper/mesh-helper.h new file mode 100644 index 000000000..c148632e5 --- /dev/null +++ b/src/helper/mesh-helper.h @@ -0,0 +1,187 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Kirill Andreev + * Pavel Boyko + */ + + +#ifndef MESH_HELPER_H +#define MESH_HELPER_H + +#include "ns3/wifi-helper.h" +#include "ns3/mesh-stack-installer.h" + +namespace ns3 { + +class WifiChannel; + +/** + * \ingroup dot11s + * + * \brief Helper to create IEEE 802.11s mesh networks + */ +class MeshHelper +{ +public: + MeshHelper (); + static MeshHelper + Default (); + /** + * \param n0 the name of the attribute to set + * \param v0 the value of the attribute to set + * \param n1 the name of the attribute to set + * \param v1 the value of the attribute to set + * \param n2 the name of the attribute to set + * \param v2 the value of the attribute to set + * \param n3 the name of the attribute to set + * \param v3 the value of the attribute to set + * \param n4 the name of the attribute to set + * \param v4 the value of the attribute to set + * \param n5 the name of the attribute to set + * \param v5 the value of the attribute to set + * \param n6 the name of the attribute to set + * \param v6 the value of the attribute to set + * \param n7 the name of the attribute to set + * \param v7 the value of the attribute to set + * + * All the attributes specified in this method should exist + * in the requested mac. + */ + void SetMacType (std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), + std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), + std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), + std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), + std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), + std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), + std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), + std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); + /** + * \param type the type of ns3::WifiRemoteStationManager to create. + * \param n0 the name of the attribute to set + * \param v0 the value of the attribute to set + * \param n1 the name of the attribute to set + * \param v1 the value of the attribute to set + * \param n2 the name of the attribute to set + * \param v2 the value of the attribute to set + * \param n3 the name of the attribute to set + * \param v3 the value of the attribute to set + * \param n4 the name of the attribute to set + * \param v4 the value of the attribute to set + * \param n5 the name of the attribute to set + * \param v5 the value of the attribute to set + * \param n6 the name of the attribute to set + * \param v6 the value of the attribute to set + * \param n7 the name of the attribute to set + * \param v7 the value of the attribute to set + * + * All the attributes specified in this method should exist + * in the requested station manager. + */ + void + SetRemoteStationManager (std::string type, + std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), + std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), + std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), + std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), + std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), + std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), + std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), + std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); + /** + * Set PHY standard + */ + void SetStandard (enum WifiPhyStandard standard); + //void SetMeshId (std::string s); // XXX + /** + * \brief Spread/not spread frequency channels of MP interfaces. + * + * If set to true different non-overlaping 20MHz frequency + * channels will be assigned to different mesh point interfaces. + */ + enum ChannelPolicy + { + SPREAD_CHANNELS, + ZERO_CHANNEL + }; + void SetSpreadInterfaceChannels (ChannelPolicy); + /** + * \brief Set a number of interfaces in a mesh network + * \param nInterfaces is the number of interfaces + */ + void SetNumberOfInterfaces (uint32_t nInterfaces); + + /** + * \brief Install 802.11s mesh device & protocols on given node list + * + * \param phyHelper Wifi PHY helper + * \param c List of nodes to install + * + * \return list of created mesh point devices, see MeshPointDevice + */ + NetDeviceContainer + Install (const WifiPhyHelper &phyHelper, NodeContainer c) const; + /** + * \param type the type of ns3::MeshStack. + * \param n0 the name of the attribute to set + * \param v0 the value of the attribute to set + * \param n1 the name of the attribute to set + * \param v1 the value of the attribute to set + * \param n2 the name of the attribute to set + * \param v2 the value of the attribute to set + * \param n3 the name of the attribute to set + * \param v3 the value of the attribute to set + * \param n4 the name of the attribute to set + * \param v4 the value of the attribute to set + * \param n5 the name of the attribute to set + * \param v5 the value of the attribute to set + * \param n6 the name of the attribute to set + * \param v6 the value of the attribute to set + * \param n7 the name of the attribute to set + * \param v7 the value of the attribute to set + */ + void SetStackInstaller (std::string type, + std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), + std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), + std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), + std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), + std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), + std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), + std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), + std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); + void Report (const ns3::Ptr&, std::ostream&); + void ResetStats (const ns3::Ptr&); +private: + /** + * \returns a WifiNetDevice with ready-to-use interface + */ + Ptr CreateInterface (const WifiPhyHelper &phyHelper, Ptr node, uint16_t channelId) const; + uint32_t m_nInterfaces; + ChannelPolicy m_spreadChannelPolicy; + Ptr m_stack; + ObjectFactory m_stackFactory; + ///\name Interface factory + ///\{ + ObjectFactory m_mac; + ObjectFactory m_stationManager; + enum WifiPhyStandard m_standard; + ///\} +}; +} //namespace ns3 + +#endif /* MESH_HELPER_H */ + diff --git a/src/helper/mesh-stack-installer.h b/src/helper/mesh-stack-installer.h new file mode 100644 index 000000000..fdd3ea7fc --- /dev/null +++ b/src/helper/mesh-stack-installer.h @@ -0,0 +1,46 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008,2009 IITP RAS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Kirill Andreev + */ + + +#ifndef MESH_STACK_INSTALLER_H +#define MESH_STACK_INSTALLER_H +#include "ns3/mesh-point-device.h" +namespace ns3 { +/** + * \ingroup mesh + * + * \brief Prototype for class, which helps to install MAC-layer + * routing stack to ns3::MeshPointDevice + * \details You need to create a MeshPointDevice and attach all + * interfaces to it, than call Install method + */ +class MeshStack : public Object +{ + public: + ///\brief Installs mesh stack. needed by helper only + virtual bool InstallStack (Ptr mp) = 0; + /// Report statistics of a given mesh point + virtual void Report (const Ptr mp, std::ostream&) = 0; + /// Reset statistics of a given mesh point + virtual void ResetStats (const Ptr mp) = 0; +}; +} +#endif + diff --git a/src/helper/ping6-helper.h b/src/helper/ping6-helper.h index e1365fbd7..c1911b916 100644 --- a/src/helper/ping6-helper.h +++ b/src/helper/ping6-helper.h @@ -22,11 +22,13 @@ #define PING6_HELPER_H #include -#include "application-container.h" -#include "node-container.h" + #include "ns3/object-factory.h" #include "ns3/ipv6-address.h" +#include "application-container.h" +#include "node-container.h" + namespace ns3 { /** diff --git a/src/helper/wscript b/src/helper/wscript index d8233db20..c580bb59a 100644 --- a/src/helper/wscript +++ b/src/helper/wscript @@ -29,6 +29,9 @@ def build(bld): 'ipv4-list-routing-helper.cc', 'ipv4-routing-helper.cc', 'aodv-helper.cc', + 'mesh-helper.cc', + 'dot11s-installer.cc', + 'flame-installer.cc', 'athstats-helper.cc', 'ipv6-address-helper.cc', 'ipv6-interface-container.cc', @@ -36,6 +39,7 @@ def build(bld): 'ipv6-list-routing-helper.cc', 'ipv6-routing-helper.cc', 'ping6-helper.cc', + 'flow-monitor-helper.cc', ] headers = bld.new_task_gen('ns3header') @@ -67,6 +71,10 @@ def build(bld): 'ipv4-list-routing-helper.h', 'ipv4-routing-helper.h', 'aodv-helper.h', + 'mesh-helper.h', + 'mesh-stack-installer.h', + 'dot11s-intaller.h', + 'flame-installer.h', 'athstats-helper.h', 'ipv6-address-helper.h', 'ipv6-interface-container.h', @@ -74,6 +82,7 @@ def build(bld): 'ipv6-list-routing-helper.h', 'ipv6-routing-helper.h', 'ping6-helper.h', + 'flow-monitor-helper.h', ] env = bld.env_of_name('default') diff --git a/src/internet-stack/icmpv6-header.cc b/src/internet-stack/icmpv6-header.cc index b7e8d76d8..afee64aec 100644 --- a/src/internet-stack/icmpv6-header.cc +++ b/src/internet-stack/icmpv6-header.cc @@ -22,9 +22,10 @@ #include "ns3/assert.h" #include "ns3/address-utils.h" -#include "icmpv6-header.h" #include "ns3/log.h" +#include "icmpv6-header.h" + namespace ns3 { @@ -666,7 +667,7 @@ void Icmpv6RS::SetReserved (uint32_t reserved) m_reserved = reserved; } -void Icmpv6RS::Print (std::ostream& os) +void Icmpv6RS::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (RS) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")"; } @@ -771,7 +772,7 @@ void Icmpv6Redirection::SetDestination (Ipv6Address destination) m_destination = destination; } -void Icmpv6Redirection::Print (std::ostream& os) +void Icmpv6Redirection::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Redirection) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " target = " << m_target << " destination = " << m_destination << ")"; } @@ -970,7 +971,7 @@ void Icmpv6DestinationUnreachable::SetPacket (Ptr p) m_packet = p; } -void Icmpv6DestinationUnreachable::Print (std::ostream& os) +void Icmpv6DestinationUnreachable::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")"; } @@ -1065,7 +1066,7 @@ void Icmpv6TooBig::SetMtu (uint32_t mtu) m_mtu = mtu; } -void Icmpv6TooBig::Print (std::ostream& os) +void Icmpv6TooBig::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Too Big) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " mtu = " << (uint32_t)GetMtu () << ")"; } @@ -1149,7 +1150,7 @@ void Icmpv6TimeExceeded::SetPacket (Ptr p) m_packet = p; } -void Icmpv6TimeExceeded::Print (std::ostream& os) +void Icmpv6TimeExceeded::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")"; } @@ -1244,7 +1245,7 @@ void Icmpv6ParameterError::SetPtr (uint32_t ptr) m_ptr = ptr; } -void Icmpv6ParameterError::Print (std::ostream& os) +void Icmpv6ParameterError::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " ptr = " << (uint32_t)GetPtr () << ")"; } diff --git a/src/internet-stack/icmpv6-header.h b/src/internet-stack/icmpv6-header.h index 8cf5027f3..786ac4ca1 100644 --- a/src/internet-stack/icmpv6-header.h +++ b/src/internet-stack/icmpv6-header.h @@ -384,8 +384,8 @@ class Icmpv6NS : public Icmpv6Header void SetIpv6Target (Ipv6Address target); /** - * \brief Get the IPv6 target field. - * \return IPv6 address + * \brief Print informations. + * \param os output stream */ virtual void Print (std::ostream& os) const; @@ -799,7 +799,7 @@ class Icmpv6RS : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -884,7 +884,7 @@ class Icmpv6Redirection : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -1075,7 +1075,7 @@ class Icmpv6DestinationUnreachable : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -1160,7 +1160,7 @@ class Icmpv6TooBig : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -1239,7 +1239,7 @@ class Icmpv6TimeExceeded : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -1325,7 +1325,7 @@ class Icmpv6ParameterError : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. diff --git a/src/internet-stack/icmpv6-l4-protocol.cc b/src/internet-stack/icmpv6-l4-protocol.cc index b783c6a93..ee035c252 100644 --- a/src/internet-stack/icmpv6-l4-protocol.cc +++ b/src/internet-stack/icmpv6-l4-protocol.cc @@ -24,16 +24,15 @@ #include "ns3/assert.h" #include "ns3/packet.h" #include "ns3/node.h" +#include "ns3/boolean.h" #include "ns3/ipv6-routing-protocol.h" #include "ns3/ipv6-route.h" #include "ipv6-raw-socket-factory-impl.h" -#include "icmpv6-l4-protocol.h" -#include "icmpv6-header.h" #include "ipv6-l3-protocol.h" -#include "ipv6-end-point.h" - -#include "ns3/ipv6-static-routing-helper.h" +#include "ipv6-interface.h" +#include "icmpv6-l4-protocol.h" +#include "ndisc-cache.h" namespace ns3 { @@ -69,6 +68,10 @@ TypeId Icmpv6L4Protocol::GetTypeId () static TypeId tid = TypeId ("ns3::Icmpv6L4Protocol") .SetParent () .AddConstructor () + .AddAttribute ("DAD", "Always do DAD check.", + BooleanValue (true), + MakeBooleanAccessor (&Icmpv6L4Protocol::m_alwaysDad), + MakeBooleanChecker ()) ; return tid; } @@ -144,14 +147,24 @@ int Icmpv6L4Protocol::GetVersion () const return 1; } +bool Icmpv6L4Protocol::IsAlwaysDad () const +{ + return m_alwaysDad; +} + void Icmpv6L4Protocol::DoDAD (Ipv6Address target, Ptr interface) { NS_LOG_FUNCTION (this << target << interface); Ipv6Address addr; - Ptr ipv6 = m_node->GetObject (); + NS_ASSERT (ipv6); + if(!m_alwaysDad) + { + return; + } + /* TODO : disable multicast loopback to prevent NS probing to be received by the sender */ Ptr p = ForgeNS ("::" ,Ipv6Address::MakeSolicitedAddress (target), target, interface->GetDevice ()->GetAddress ()); diff --git a/src/internet-stack/icmpv6-l4-protocol.h b/src/internet-stack/icmpv6-l4-protocol.h index 4fecb747d..c1fb1ceab 100644 --- a/src/internet-stack/icmpv6-l4-protocol.h +++ b/src/internet-stack/icmpv6-l4-protocol.h @@ -24,14 +24,10 @@ #define ICMPV6_L4_PROTOCOL_H #include + #include "ns3/ipv6-address.h" -#include "ns3/ptr.h" -#include "ns3/socket.h" -#include "ns3/buffer.h" #include "icmpv6-header.h" #include "ipv6-l4-protocol.h" -#include "ndisc-cache.h" -#include "ipv6-l3-protocol.h" namespace ns3 { @@ -40,6 +36,7 @@ class NetDevice; class Node; class Packet; class TraceContext; +class NdiscCache; /** * \class Icmpv6L4Protocol @@ -387,6 +384,12 @@ class Icmpv6L4Protocol : public Ipv6L4Protocol */ Ptr CreateCache (Ptr device, Ptr interface); + /** + * \brief Is the node must do DAD. + * \return true if node has to do DAD. + */ + bool IsAlwaysDad () const; + protected: /** * \brief Dispose this object. @@ -407,6 +410,11 @@ class Icmpv6L4Protocol : public Ipv6L4Protocol */ CacheList m_cacheList; + /** + * \brief Always do DAD ? + */ + bool m_alwaysDad; + /** * \brief Receive Neighbor Solicitation method. * \param p the packet diff --git a/src/internet-stack/ipv4-l3-protocol.cc b/src/internet-stack/ipv4-l3-protocol.cc index adf8816ae..951520682 100644 --- a/src/internet-stack/ipv4-l3-protocol.cc +++ b/src/internet-stack/ipv4-l3-protocol.cc @@ -69,6 +69,14 @@ Ipv4L3Protocol::GetTypeId (void) ObjectVectorValue (), MakeObjectVectorAccessor (&Ipv4L3Protocol::m_interfaces), MakeObjectVectorChecker ()) + + .AddTraceSource ("SendOutgoing", "A newly-generated by this node ipv4 packet is about to be queued for transmission", + MakeTraceSourceAccessor (&Ipv4L3Protocol::m_sendOutgoingTrace)) + .AddTraceSource ("UnicastForward", "A unicast ipv4 packet was received by this node and is being forwarded to another node", + MakeTraceSourceAccessor (&Ipv4L3Protocol::m_unicastForwardTrace)) + .AddTraceSource ("LocalDeliver", "An ipv4 packet was received by/for this node, and it is being forward up the stack", + MakeTraceSourceAccessor (&Ipv4L3Protocol::m_localDeliverTrace)) + ; return tid; } @@ -369,7 +377,7 @@ Ipv4L3Protocol::Receive( Ptr device, Ptr p, uint16_t pr Ptr ipv4Interface; for (Ipv4InterfaceList::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); - i++) + i++, interface++) { ipv4Interface = *i; if (ipv4Interface->GetDevice () == device) @@ -382,11 +390,12 @@ Ipv4L3Protocol::Receive( Ptr device, Ptr p, uint16_t pr else { NS_LOG_LOGIC ("Dropping received packet-- interface is down"); - m_dropTrace (packet); + Ipv4Header ipHeader; + packet->RemoveHeader (ipHeader); + m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); return; } } - interface++; } Ipv4Header ipHeader; @@ -398,7 +407,7 @@ Ipv4L3Protocol::Receive( Ptr device, Ptr p, uint16_t pr if (!ipHeader.IsChecksumOk ()) { - m_dropTrace (packet); + m_dropTrace (ipHeader, packet, DROP_BAD_CHECKSUM, interface); return; } @@ -477,6 +486,8 @@ Ipv4L3Protocol::Send (Ptr packet, Ptr packetCopy = packet->Copy (); NS_ASSERT (packetCopy->GetSize () <= outInterface->GetDevice()->GetMtu ()); + + m_sendOutgoingTrace (ipHeader, packetCopy, ifaceIndex); packetCopy->AddHeader (ipHeader); m_txTrace (packetCopy, ifaceIndex); outInterface->Send (packetCopy, destination); @@ -500,6 +511,7 @@ Ipv4L3Protocol::Send (Ptr packet, NS_LOG_LOGIC ("Ipv4L3Protocol::Send case 2: subnet directed bcast to " << ifAddr.GetLocal ()); ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment); Ptr packetCopy = packet->Copy (); + m_sendOutgoingTrace (ipHeader, packetCopy, ifaceIndex); packetCopy->AddHeader (ipHeader); m_txTrace (packetCopy, ifaceIndex); outInterface->Send (packetCopy, destination); @@ -514,6 +526,8 @@ Ipv4L3Protocol::Send (Ptr packet, { NS_LOG_LOGIC ("Ipv4L3Protocol::Send case 3: passed in with route"); ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment); + int32_t interface = GetInterfaceForDevice (route->GetOutputDevice ()); + m_sendOutgoingTrace (ipHeader, packet, interface); SendRealOut (route, packet, ipHeader); return; } @@ -534,12 +548,14 @@ Ipv4L3Protocol::Send (Ptr packet, Ptr newRoute = m_routingProtocol->RouteOutput (packet, ipHeader, oif, errno_); if (newRoute) { + int32_t interface = GetInterfaceForDevice (newRoute->GetOutputDevice ()); + m_sendOutgoingTrace (ipHeader, packet, interface); SendRealOut (newRoute, packet, ipHeader); } else { NS_LOG_WARN ("No route to host. Drop."); - m_dropTrace (packet); + m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, 0); } } @@ -589,16 +605,13 @@ Ipv4L3Protocol::SendRealOut (Ptr route, { NS_LOG_FUNCTION (this << packet << &ipHeader); - // We add a header regardless of whether there is a route, since - // we may want to drop trace - packet->AddHeader (ipHeader); if (route == 0) { NS_LOG_WARN ("No route to host. Drop."); - m_dropTrace (packet); + m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, 0); return; } - + packet->AddHeader (ipHeader); Ptr outDev = route->GetOutputDevice (); int32_t interface = GetInterfaceForDevice (outDev); NS_ASSERT (interface >= 0); @@ -617,7 +630,9 @@ Ipv4L3Protocol::SendRealOut (Ptr route, else { NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << route->GetGateway ()); - m_dropTrace (packet); + Ipv4Header ipHeader; + packet->RemoveHeader (ipHeader); + m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); } } else @@ -631,7 +646,9 @@ Ipv4L3Protocol::SendRealOut (Ptr route, else { NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << ipHeader.GetDestination ()); - m_dropTrace (packet); + Ipv4Header ipHeader; + packet->RemoveHeader (ipHeader); + m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); } } } @@ -654,7 +671,7 @@ Ipv4L3Protocol::IpMulticastForward (Ptr mrtentry, Ptr rtentry, Ptr p, const Ip // Forwarding Ipv4Header ipHeader = header; Ptr packet = p->Copy (); + int32_t interface = GetInterfaceForDevice (rtentry->GetOutputDevice ()); ipHeader.SetTtl (ipHeader.GetTtl () - 1); if (ipHeader.GetTtl () == 0) { @@ -690,9 +708,10 @@ Ipv4L3Protocol::IpForward (Ptr rtentry, Ptr p, const Ip icmp->SendTimeExceededTtl (ipHeader, packet); } NS_LOG_WARN ("TTL exceeded. Drop."); - m_dropTrace (packet); + m_dropTrace (header, packet, DROP_TTL_EXPIRED, interface); return; } + m_unicastForwardTrace (ipHeader, packet, interface); SendRealOut (rtentry, packet, ipHeader); } @@ -702,6 +721,8 @@ Ipv4L3Protocol::LocalDeliver (Ptr packet, Ipv4Header const&ip, uin NS_LOG_FUNCTION (this << packet << &ip); Ptr p = packet->Copy (); // need to pass a non-const packet up + m_localDeliverTrace (ip, packet, iif); + Ptr protocol = GetProtocol (ip.GetProtocol ()); if (protocol != 0) { @@ -890,7 +911,7 @@ Ipv4L3Protocol::RouteInputError (Ptr p, const Ipv4Header & ipHeade { NS_LOG_FUNCTION (this << p << ipHeader << sockErrno); NS_LOG_LOGIC ("Route input failure-- dropping packet to " << ipHeader << " with errno " << sockErrno); - m_dropTrace (p); + m_dropTrace (ipHeader, p, DROP_ROUTE_ERROR, 0); } diff --git a/src/internet-stack/ipv4-l3-protocol.h b/src/internet-stack/ipv4-l3-protocol.h index a95999778..7e2a53a2f 100644 --- a/src/internet-stack/ipv4-l3-protocol.h +++ b/src/internet-stack/ipv4-l3-protocol.h @@ -63,6 +63,19 @@ public: Ipv4L3Protocol(); virtual ~Ipv4L3Protocol (); + /** + * \enum DropReason + * \brief Reason why a packet has been dropped. + */ + enum DropReason + { + DROP_TTL_EXPIRED = 1, /**< Packet TTL has expired */ + DROP_NO_ROUTE, /**< No route to host */ + DROP_BAD_CHECKSUM, /**< Bad checksum */ + DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */ + DROP_ROUTE_ERROR, /**< Route error */ + }; + void SetNode (Ptr node); // functions defined in base class Ipv4 @@ -116,6 +129,12 @@ public: * packet is coming to: * - implement a per-NetDevice ARP cache * - send back arp replies on the right device + * \param device network device + * \param p the packet + * \param protocol protocol value + * \param from address of the correspondant + * \param to address of the destination + * \param packetType type of the packet */ void Receive( Ptr device, Ptr p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType); @@ -215,9 +234,15 @@ private: uint8_t m_defaultTtl; uint16_t m_identification; Ptr m_node; + + TracedCallback, uint32_t> m_sendOutgoingTrace; + TracedCallback, uint32_t> m_unicastForwardTrace; + TracedCallback, uint32_t> m_localDeliverTrace; + TracedCallback, uint32_t> m_txTrace; TracedCallback, uint32_t> m_rxTrace; - TracedCallback > m_dropTrace; + // (ifindex not valid if reason is DROP_NO_ROUTE) + TracedCallback, DropReason, uint32_t> m_dropTrace; Ptr m_routingProtocol; diff --git a/src/internet-stack/ipv4-raw-socket-factory-impl.cc b/src/internet-stack/ipv4-raw-socket-factory-impl.cc index 244ce7ee1..e3ea9476a 100644 --- a/src/internet-stack/ipv4-raw-socket-factory-impl.cc +++ b/src/internet-stack/ipv4-raw-socket-factory-impl.cc @@ -1,3 +1,23 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008 INRIA + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Mathieu Lacage + */ + #include "ipv4-raw-socket-factory-impl.h" #include "ipv4-l3-protocol.h" #include "ns3/socket.h" diff --git a/src/internet-stack/ipv4-raw-socket-factory-impl.h b/src/internet-stack/ipv4-raw-socket-factory-impl.h index 89f526258..d89d1412c 100644 --- a/src/internet-stack/ipv4-raw-socket-factory-impl.h +++ b/src/internet-stack/ipv4-raw-socket-factory-impl.h @@ -1,3 +1,23 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008 INRIA + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Mathieu Lacage + */ + #ifndef IPV4_RAW_SOCKET_FACTORY_IMPL_H #define IPV4_RAW_SOCKET_FACTORY_IMPL_H diff --git a/src/internet-stack/ipv6-autoconfigured-prefix.cc b/src/internet-stack/ipv6-autoconfigured-prefix.cc index 7782a40c0..7bbe16405 100644 --- a/src/internet-stack/ipv6-autoconfigured-prefix.cc +++ b/src/internet-stack/ipv6-autoconfigured-prefix.cc @@ -18,11 +18,10 @@ * Author: Mehdi Benamor */ -#include #include "ns3/log.h" -#include "ns3/packet.h" #include "ns3/node.h" +#include "ipv6-l3-protocol.h" #include "ipv6-autoconfigured-prefix.h" NS_LOG_COMPONENT_DEFINE ("Ipv6AutoconfiguredPrefix"); diff --git a/src/internet-stack/ipv6-autoconfigured-prefix.h b/src/internet-stack/ipv6-autoconfigured-prefix.h index 05576e75d..85d81e57e 100644 --- a/src/internet-stack/ipv6-autoconfigured-prefix.h +++ b/src/internet-stack/ipv6-autoconfigured-prefix.h @@ -21,14 +21,14 @@ #ifndef IPV6_AUTOCONFIGURED_PREFIX_H #define IPV6_AUTOCONFIGURED_PREFIX_H +#include + #include #include #include #include "ns3/timer.h" #include "ns3/ipv6-address.h" -#include "ipv6-l3-protocol.h" -#include "ipv6-interface.h" namespace ns3 { @@ -100,13 +100,13 @@ class Ipv6AutoconfiguredPrefix : public Object uint32_t GetValidLifeTime (void) const; /** - * \brief Set the prefix valid life time + * \brief Set the prefix valid life time. * \param v the prefix valid life time */ void SetValidLifeTime (uint32_t v); /** - * \brief Test if the prefix is preferred + * \brief Test if the prefix is preferred. * \return true if prefix is in preferred state, false otherwise */ bool IsPreferred () const; @@ -118,74 +118,74 @@ class Ipv6AutoconfiguredPrefix : public Object bool IsValid () const; /** - * \brief Set the prefix as preferred + * \brief Set the prefix as preferred. */ void SetPreferred (); /** - * \brief Set the prefix as valid + * \brief Set the prefix as valid. */ void SetValid (); /** - * \brief Start the preferred timer + * \brief Start the preferred timer. */ void StartPreferredTimer (); /** - * \brief Start the valid timer + * \brief Start the valid timer. */ void StartValidTimer (); /** - * \brief Stop the preferred timer + * \brief Stop the preferred timer. */ void StopPreferredTimer (); /** - * \brief Stop the valid timer + * \brief Stop the valid timer. */ void StopValidTimer (); /** - * \brief Set the prefix as preferred + * \brief Set the prefix as preferred. */ void MarkPreferredTime (); /** - * \brief Set the prefix as valid + * \brief Set the prefix as valid. */ void MarkValidTime (); /** - * \brief Signal that the preferred time expired and start the valid timer + * \brief Signal that the preferred time expired and start the valid timer. */ void FunctionPreferredTimeout (); /** - * \brief Signal that the valid time expired + * \brief Signal that the valid time expired. */ void FunctionValidTimeout (); /** - * \brief Remove this prefix from the prefix list + * \brief Remove this prefix from the prefix list. */ void RemoveMe (); /** - * \brief Get the prefix identificator + * \brief Get the prefix identifier. * \return id of the prefix. */ uint32_t GetId () const; /** - * \brief Get the prefix address + * \brief Get the prefix address. * \return prefix address */ Ipv6Address GetPrefix () const; /** - * \brief Set the prefix address + * \brief Set the prefix address. * \param prefix prefix address to set */ void SetPrefix (Ipv6Address prefix); @@ -229,7 +229,8 @@ class Ipv6AutoconfiguredPrefix : public Object Ipv6Prefix m_mask; /** - * \brief Default gateway router + * \brief Default gateway router. + * * If the RA received also configured the default gateway, * this variable has the link-local address. Otherwise this * is "::" diff --git a/src/internet-stack/ipv6-end-point-demux.h b/src/internet-stack/ipv6-end-point-demux.h index a8bfe1a46..00e3bbe24 100644 --- a/src/internet-stack/ipv6-end-point-demux.h +++ b/src/internet-stack/ipv6-end-point-demux.h @@ -95,7 +95,8 @@ class Ipv6EndPointDemux /** * \brief Allocate a Ipv6EndPoint. - * \return an empty Ipv6EndPoint instance + * \param address IPv6 address + * \return an Ipv6EndPoint instance */ Ipv6EndPoint *Allocate (Ipv6Address address); diff --git a/src/internet-stack/ipv6-end-point.cc b/src/internet-stack/ipv6-end-point.cc index 54d77c0ed..aed517411 100644 --- a/src/internet-stack/ipv6-end-point.cc +++ b/src/internet-stack/ipv6-end-point.cc @@ -18,11 +18,12 @@ * Author: Sebastien Vincent */ -#include "ipv6-end-point.h" #include "ns3/packet.h" #include "ns3/log.h" #include "ns3/simulator.h" +#include "ipv6-end-point.h" + namespace ns3 { diff --git a/src/internet-stack/ipv6-end-point.h b/src/internet-stack/ipv6-end-point.h index 98de8d4eb..148d8ab15 100644 --- a/src/internet-stack/ipv6-end-point.h +++ b/src/internet-stack/ipv6-end-point.h @@ -22,6 +22,7 @@ #define IPV6_END_POINT_H #include + #include "ns3/ipv6-address.h" #include "ns3/callback.h" diff --git a/src/internet-stack/ipv6-interface.cc b/src/internet-stack/ipv6-interface.cc index 9c07ec984..712b33d10 100644 --- a/src/internet-stack/ipv6-interface.cc +++ b/src/internet-stack/ipv6-interface.cc @@ -18,14 +18,16 @@ * Author: Sebastien Vincent */ +#include "ns3/log.h" +#include "ns3/node.h" +#include "ns3/packet.h" + #include "ipv6-interface.h" #include "ns3/net-device.h" #include "loopback-net-device.h" -#include "ns3/log.h" -#include "ns3/node.h" -#include - +#include "ipv6-l3-protocol.h" #include "icmpv6-l4-protocol.h" +#include "ndisc-cache.h" namespace ns3 { @@ -196,7 +198,7 @@ bool Ipv6Interface::AddAddress (Ipv6InterfaceAddress iface) /* DAD handling */ Ptr icmpv6 = m_node->GetObject ()->GetIcmpv6 (); - if (icmpv6) + if (icmpv6 && icmpv6->IsAlwaysDad ()) { Simulator::Schedule (Seconds (0.), &Icmpv6L4Protocol::DoDAD, icmpv6, addr, this); Simulator::Schedule (Seconds (1.), &Icmpv6L4Protocol::FunctionDadTimeout, icmpv6, this, addr); diff --git a/src/internet-stack/ipv6-interface.h b/src/internet-stack/ipv6-interface.h index ee93ef845..e1a73ee3d 100644 --- a/src/internet-stack/ipv6-interface.h +++ b/src/internet-stack/ipv6-interface.h @@ -29,14 +29,13 @@ #include "ns3/object.h" #include "ns3/timer.h" -#include "ndisc-cache.h" - namespace ns3 { class NetDevice; class Packet; class Node; +class NdiscCache; /** * \class Ipv6Interface diff --git a/src/internet-stack/ipv6-l3-protocol.cc b/src/internet-stack/ipv6-l3-protocol.cc index 1bdf10012..b4d9ad772 100644 --- a/src/internet-stack/ipv6-l3-protocol.cc +++ b/src/internet-stack/ipv6-l3-protocol.cc @@ -35,6 +35,7 @@ #include "ipv6-raw-socket-impl.h" #include "ipv6-autoconfigured-prefix.h" #include "icmpv6-l4-protocol.h" +#include "ndisc-cache.h" namespace ns3 { @@ -646,7 +647,7 @@ void Ipv6L3Protocol::Send (Ptr packet, Ipv6Address source, Ipv6Address d else { NS_LOG_WARN ("No route to host, drop!"); - m_dropTrace (packet); + m_dropTrace (hdr, packet, DROP_NO_ROUTE, oif); } } @@ -672,7 +673,9 @@ void Ipv6L3Protocol::Receive (Ptr device, Ptr p, uint16 else { NS_LOG_LOGIC ("Dropping received packet-- interface is down"); - m_dropTrace (packet); + Ipv6Header hdr; + packet->RemoveHeader (hdr); + m_dropTrace (hdr, packet, DROP_INTERFACE_DOWN, interface); return; } } @@ -701,8 +704,6 @@ void Ipv6L3Protocol::SendRealOut (Ptr route, Ptr packet, Ipv6 { NS_LOG_FUNCTION (this << route << packet << ipHeader); - packet->AddHeader (ipHeader); - if (!route) { NS_LOG_LOGIC ("No route to host, drop!."); @@ -716,20 +717,20 @@ void Ipv6L3Protocol::SendRealOut (Ptr route, Ptr packet, Ipv6 Ptr outInterface = GetInterface (interface); NS_LOG_LOGIC ("Send via NetDevice ifIndex " << dev->GetIfIndex () << " Ipv6InterfaceIndex " << interface); - NS_ASSERT (packet->GetSize () <= outInterface->GetDevice ()->GetMtu ()); - if (!route->GetGateway ().IsEqual (Ipv6Address::GetAny ())) { if (outInterface->IsUp ()) { NS_LOG_LOGIC ("Send to gateway " << route->GetGateway ()); + packet->AddHeader (ipHeader); + NS_ASSERT (packet->GetSize () <= outInterface->GetDevice ()->GetMtu ()); m_txTrace (packet, interface); outInterface->Send (packet, route->GetGateway ()); } else { NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << route->GetGateway ()); - m_dropTrace (packet); + m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); } } else @@ -737,13 +738,15 @@ void Ipv6L3Protocol::SendRealOut (Ptr route, Ptr packet, Ipv6 if (outInterface->IsUp ()) { NS_LOG_LOGIC ("Send to destination " << ipHeader.GetDestinationAddress ()); + packet->AddHeader (ipHeader); + NS_ASSERT (packet->GetSize () <= outInterface->GetDevice ()->GetMtu ()); m_txTrace (packet, interface); outInterface->Send (packet, ipHeader.GetDestinationAddress ()); } else { NS_LOG_LOGIC ("Dropping-- outgoing interface is down: " << ipHeader.GetDestinationAddress ()); - m_dropTrace (packet); + m_dropTrace (ipHeader, packet, DROP_INTERFACE_DOWN, interface); } } } @@ -766,6 +769,8 @@ void Ipv6L3Protocol::IpForward (Ptr rtentry, Ptr p, con if (ipHeader.GetHopLimit () == 0) { + NS_LOG_WARN ("TTL exceeded. Drop."); + m_dropTrace (ipHeader, packet, DROP_TTL_EXPIRED, 0); // Do not reply to ICMPv6 or to multicast IPv6 address if (ipHeader.GetNextHeader () != Icmpv6L4Protocol::PROT_NUMBER && ipHeader.GetDestinationAddress ().IsMulticast () == false) @@ -773,8 +778,6 @@ void Ipv6L3Protocol::IpForward (Ptr rtentry, Ptr p, con packet->AddHeader (ipHeader); GetIcmpv6 ()->SendErrorTimeExceeded (packet, ipHeader.GetSourceAddress (), Icmpv6Header::ICMPV6_HOPLIMIT); } - NS_LOG_WARN ("TTL exceeded. Drop."); - m_dropTrace (packet); return; } @@ -832,7 +835,7 @@ void Ipv6L3Protocol::IpMulticastForward (Ptr mrtentry, Ptr p, const Ipv6Header& ipH { NS_LOG_FUNCTION (this << p << ipHeader << sockErrno); NS_LOG_LOGIC ("Route input failure-- dropping packet to " << ipHeader << " with errno " << sockErrno); - m_dropTrace (p); + m_dropTrace (ipHeader, p, DROP_ROUTE_ERROR, 0); } Ipv6Header Ipv6L3Protocol::BuildHeader (Ipv6Address src, Ipv6Address dst, uint8_t protocol, uint16_t payloadSize, uint8_t ttl) diff --git a/src/internet-stack/ipv6-l3-protocol.h b/src/internet-stack/ipv6-l3-protocol.h index 0d213c793..f79eccc26 100644 --- a/src/internet-stack/ipv6-l3-protocol.h +++ b/src/internet-stack/ipv6-l3-protocol.h @@ -24,7 +24,6 @@ #include #include "ns3/traced-callback.h" - #include "ns3/net-device.h" #include "ns3/ipv6.h" #include "ns3/ipv6-address.h" @@ -59,6 +58,18 @@ class Ipv6L3Protocol : public Ipv6 * \brief The protocol number for IPv6 (0x86DD). */ static const uint16_t PROT_NUMBER; + + /** + * \enum DropReason + * \brief Reason why a packet has been dropped. + */ + enum DropReason + { + DROP_TTL_EXPIRED = 1, /**< Packet TTL has expired */ + DROP_NO_ROUTE, /**< No route to host */ + DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */ + DROP_ROUTE_ERROR, /**< Route error */ + }; /** * \brief Constructor. @@ -208,6 +219,7 @@ class Ipv6L3Protocol : public Ipv6 /** * \brief Get number of address for an interface. + * \param interface interface index * \return number of address */ uint32_t GetNAddresses (uint32_t interface) const; @@ -344,7 +356,7 @@ class Ipv6L3Protocol : public Ipv6 /** * \brief Callback to trace drop packets. */ - TracedCallback > m_dropTrace; + TracedCallback, DropReason, uint32_t> m_dropTrace; /** * \brief Copy constructor. diff --git a/src/internet-stack/ipv6-l4-protocol.cc b/src/internet-stack/ipv6-l4-protocol.cc index 91a421316..430166e77 100644 --- a/src/internet-stack/ipv6-l4-protocol.cc +++ b/src/internet-stack/ipv6-l4-protocol.cc @@ -18,9 +18,10 @@ * Author: Sebastien Vincent */ -#include "ipv6-l4-protocol.h" #include "ns3/uinteger.h" +#include "ipv6-l4-protocol.h" + namespace ns3 { diff --git a/src/internet-stack/ipv6-l4-protocol.h b/src/internet-stack/ipv6-l4-protocol.h index f743a139a..095dfa3ca 100644 --- a/src/internet-stack/ipv6-l4-protocol.h +++ b/src/internet-stack/ipv6-l4-protocol.h @@ -22,14 +22,14 @@ #define IPV6_L4_PROTOCOL_H #include "ns3/object.h" -#include "ipv6-interface.h" +#include "ns3/ipv6-header.h" namespace ns3 { class Packet; class Ipv6Address; -class TraceContext; +class Ipv6Interface; /** * \class Ipv6L4Protocol @@ -44,14 +44,14 @@ class Ipv6L4Protocol : public Object */ enum RxStatus_e { - RX_OK, - RX_CSUM_FAILED, - RX_ENDPOINT_UNREACH + RX_OK, /**< Receive OK */ + RX_CSUM_FAILED, /**< Checksum of layer 4 protocol failed */ + RX_ENDPOINT_UNREACH /**< Destination unreachable */ }; /** - * \brief Get the type identificator. - * \return type identificator + * \brief Get the type identifier. + * \return type identifier */ static TypeId GetTypeId (void); @@ -77,9 +77,12 @@ class Ipv6L4Protocol : public Object * \param incomingInterface the Ipv6Interface on which the packet arrived * \return status (OK, destination unreachable or checksum failed) */ - virtual enum RxStatus_e Receive (Ptr p, Ipv6Address const &src, Ipv6Address const &dst, Ptr incomingInterface) = 0; + virtual enum RxStatus_e Receive (Ptr p, Ipv6Address const &src, + Ipv6Address const &dst, + Ptr incomingInterface) = 0; /** + * \brief ICMPv6 receive method. * \param icmpSource the source address of the ICMPv6 message * \param icmpTtl the ttl of the ICMPv6 message * \param icmpType the 'type' field of the ICMPv6 message @@ -94,9 +97,9 @@ class Ipv6L4Protocol : public Object * which triggered the ICMPv6 message. */ virtual void ReceiveIcmp (Ipv6Address icmpSource, uint8_t icmpTtl, - uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, - Ipv6Address payloadSource, Ipv6Address payloadDestination, - const uint8_t* payload); + uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, + Ipv6Address payloadSource, Ipv6Address payloadDestination, + const uint8_t* payload); }; diff --git a/src/internet-stack/ipv6-raw-socket-factory-impl.cc b/src/internet-stack/ipv6-raw-socket-factory-impl.cc index b880fb779..086a48603 100644 --- a/src/internet-stack/ipv6-raw-socket-factory-impl.cc +++ b/src/internet-stack/ipv6-raw-socket-factory-impl.cc @@ -1,6 +1,27 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008 INRIA + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Mathieu Lacage + */ + +#include "ns3/socket.h" + #include "ipv6-raw-socket-factory-impl.h" #include "ipv6-l3-protocol.h" -#include "ns3/socket.h" namespace ns3 { diff --git a/src/internet-stack/ipv6-raw-socket-factory-impl.h b/src/internet-stack/ipv6-raw-socket-factory-impl.h index 0fc03901d..91d53ed35 100644 --- a/src/internet-stack/ipv6-raw-socket-factory-impl.h +++ b/src/internet-stack/ipv6-raw-socket-factory-impl.h @@ -1,3 +1,23 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2008 INRIA + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Mathieu Lacage + */ + #ifndef IPV6_RAW_SOCKET_FACTORY_IMPL_H #define IPV6_RAW_SOCKET_FACTORY_IMPL_H diff --git a/src/internet-stack/ipv6-raw-socket-impl.cc b/src/internet-stack/ipv6-raw-socket-impl.cc index 19ee54aa3..137a7caef 100644 --- a/src/internet-stack/ipv6-raw-socket-impl.cc +++ b/src/internet-stack/ipv6-raw-socket-impl.cc @@ -27,10 +27,9 @@ #include "ns3/ipv6-routing-protocol.h" #include "ipv6-l3-protocol.h" - +#include "ipv6-raw-socket-impl.h" #include "icmpv6-header.h" #include "icmpv6-l4-protocol.h" -#include "ipv6-raw-socket-impl.h" namespace ns3 { diff --git a/src/internet-stack/ipv6-test.cc b/src/internet-stack/ipv6-test.cc index 4f3de3892..57b5fe289 100644 --- a/src/internet-stack/ipv6-test.cc +++ b/src/internet-stack/ipv6-test.cc @@ -23,12 +23,14 @@ #include "ns3/simulator.h" #include "ns3/test.h" #include "ns3/log.h" +#include "ns3/boolean.h" #include "ns3/inet6-socket-address.h" #include "ns3/node.h" #include "ns3/csma-net-device.h" -#include "icmpv6-l4-protocol.h" #include "ipv6-interface.h" +#include "ipv6-l3-protocol.h" +#include "icmpv6-l4-protocol.h" namespace ns3 { @@ -78,6 +80,7 @@ bool Ipv6L3ProtocolTest::RunTests () uint32_t index = 0; /* init */ + icmpv6->SetAttribute ("DAD", BooleanValue (false)); node->AggregateObject (ipv6); node->AggregateObject (icmpv6); ipv6->Insert (icmpv6); diff --git a/src/internet-stack/ndisc-cache.cc b/src/internet-stack/ndisc-cache.cc index db3405be9..b2ac6040a 100644 --- a/src/internet-stack/ndisc-cache.cc +++ b/src/internet-stack/ndisc-cache.cc @@ -25,6 +25,7 @@ #include "ipv6-l3-protocol.h" #include "icmpv6-l4-protocol.h" #include "ndisc-cache.h" +#include "ipv6-interface.h" namespace ns3 { diff --git a/src/internet-stack/ndisc-cache.h b/src/internet-stack/ndisc-cache.h index 5c7c049dd..569be145a 100644 --- a/src/internet-stack/ndisc-cache.h +++ b/src/internet-stack/ndisc-cache.h @@ -33,8 +33,6 @@ #include "ns3/timer.h" #include "ns3/sgi-hashmap.h" -#include "ipv6-interface.h" - namespace ns3 { @@ -417,6 +415,18 @@ class NdiscCache : public Object typedef sgi::hash_map Cache; typedef sgi::hash_map::iterator CacheI; + /** + * \brief Copy constructor. + * \param a cache to copy + */ + NdiscCache (NdiscCache const &a); + + /** + * \brief Equal operator. + * \param a cache to copy + */ + NdiscCache& operator= (NdiscCache const &a); + /** * \brief Dispose this object. */ @@ -433,7 +443,7 @@ class NdiscCache : public Object Ptr m_interface; /** - * A list of Entry. + * \brief A list of Entry. */ Cache m_ndCache; diff --git a/src/internet-stack/wscript b/src/internet-stack/wscript index ca98be206..7970ed397 100644 --- a/src/internet-stack/wscript +++ b/src/internet-stack/wscript @@ -8,7 +8,7 @@ import Utils import Task # Required NSC version -NSC_RELEASE_NAME = "nsc-0.5.0" +NSC_RELEASE_NAME = "nsc-0.5.1" def set_options(opt): @@ -124,12 +124,16 @@ def build(bld): # used by routing 'ipv4-interface.h', 'ipv4-l3-protocol.h', + 'ipv6-l3-protocol.h', 'arp-l3-protocol.h', 'udp-l4-protocol.h', 'tcp-l4-protocol.h', 'icmpv4-l4-protocol.h', 'ipv4-l4-protocol.h', 'arp-cache.h', + 'icmpv6-l4-protocol.h', + 'ipv6-l4-protocol.h', + 'ndisc-cache.h', ] if bld.env['NSC_ENABLED']: diff --git a/src/mobility/hierarchical-mobility-model.h b/src/mobility/hierarchical-mobility-model.h index 5ef664863..f78ec185e 100644 --- a/src/mobility/hierarchical-mobility-model.h +++ b/src/mobility/hierarchical-mobility-model.h @@ -80,6 +80,7 @@ public: * already existed a child model, then the child mobility model * current position is also modified to ensure that the composite * position is preserved. + * \param model new mobility model child */ void SetChild (Ptr model); /** @@ -87,6 +88,7 @@ public: * already existed a child model, then the child mobility model * current position is also modified to ensure that the composite * position is preserved. + * \param model new mobility model parent */ void SetParent (Ptr model); diff --git a/src/node/channel-list.cc b/src/node/channel-list.cc new file mode 100644 index 000000000..06e3cd73b --- /dev/null +++ b/src/node/channel-list.cc @@ -0,0 +1,182 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ns3/simulator.h" +#include "ns3/object-vector.h" +#include "ns3/config.h" +#include "ns3/log.h" +#include "ns3/assert.h" +#include "channel-list.h" +#include "channel.h" + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("ChannelList"); + +/** + * \brief private implementation detail of the ChannelList API. + */ +class ChannelListPriv : public Object +{ +public: + static TypeId GetTypeId (void); + ChannelListPriv (); + ~ChannelListPriv (); + + uint32_t Add (Ptr channel); + + ChannelList::Iterator Begin (void) const; + ChannelList::Iterator End (void) const; + + Ptr GetChannel (uint32_t n); + uint32_t GetNChannels (void); + + static Ptr Get (void); + +private: + static Ptr *DoGet (void); + static void Delete (void); + std::vector > m_channels; +}; + +NS_OBJECT_ENSURE_REGISTERED (ChannelListPriv); + +TypeId +ChannelListPriv::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::ChannelListPriv") + .SetParent () + .AddAttribute ("ChannelList", "The list of all channels created during the simulation.", + ObjectVectorValue (), + MakeObjectVectorAccessor (&ChannelListPriv::m_channels), + MakeObjectVectorChecker ()) + ; + return tid; +} + +Ptr +ChannelListPriv::Get (void) +{ + return *DoGet (); +} + +Ptr * +ChannelListPriv::DoGet (void) +{ + static Ptr ptr = 0; + if (ptr == 0) + { + ptr = CreateObject (); + Config::RegisterRootNamespaceObject (ptr); + Simulator::ScheduleDestroy (&ChannelListPriv::Delete); + } + return &ptr; +} + +void +ChannelListPriv::Delete (void) +{ + NS_LOG_FUNCTION_NOARGS (); + Config::UnregisterRootNamespaceObject (Get ()); + (*DoGet ()) = 0; +} + +ChannelListPriv::ChannelListPriv () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +ChannelListPriv::~ChannelListPriv () +{ + NS_LOG_FUNCTION_NOARGS (); + for (std::vector >::iterator i = m_channels.begin (); + i != m_channels.end (); i++) + { + Ptr channel = *i; + channel->Dispose (); + *i = 0; + } + m_channels.erase (m_channels.begin (), m_channels.end ()); +} + +uint32_t +ChannelListPriv::Add (Ptr channel) +{ + uint32_t index = m_channels.size (); + m_channels.push_back (channel); + return index; + +} + +ChannelList::Iterator +ChannelListPriv::Begin (void) const +{ + return m_channels.begin (); +} + +ChannelList::Iterator +ChannelListPriv::End (void) const +{ + return m_channels.end (); +} + +uint32_t +ChannelListPriv::GetNChannels (void) +{ + return m_channels.size (); +} + +Ptr +ChannelListPriv::GetChannel (uint32_t n) +{ + NS_ASSERT_MSG (n < m_channels.size (), "Channel index " << n << + " is out of range (only have " << m_channels.size () << " channels)."); + return m_channels[n]; +} + +uint32_t +ChannelList::Add (Ptr channel) +{ + return ChannelListPriv::Get ()->Add (channel); +} + +ChannelList::Iterator +ChannelList::Begin (void) +{ + return ChannelListPriv::Get ()->Begin (); +} + +ChannelList::Iterator +ChannelList::End (void) +{ + return ChannelListPriv::Get ()->End (); +} + +Ptr +ChannelList::GetChannel (uint32_t n) +{ + return ChannelListPriv::Get ()->GetChannel (n); +} + +uint32_t +ChannelList::GetNChannels (void) +{ + return ChannelListPriv::Get ()->GetNChannels (); +} + +} //namespace ns3 diff --git a/src/node/channel-list.h b/src/node/channel-list.h new file mode 100644 index 000000000..f3b9629ba --- /dev/null +++ b/src/node/channel-list.h @@ -0,0 +1,74 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef CHANNEL_LIST_H +#define CHANNEL_LIST_H + +#include +#include "ns3/ptr.h" + +namespace ns3 { + +class Channel; +class CallbackBase; + + +/** + * \ingroup node + * + * \brief the list of simulation channels. + * + * Every Channel created is automatically added to this list. + */ +class ChannelList +{ +public: + typedef std::vector< Ptr >::const_iterator Iterator; + + /** + * \param channel channel to add + * \returns index of channel in list. + * + * This method is called automatically from Channel::Channel so + * the user has little reason to call it himself. + */ + static uint32_t Add (Ptr channel); + /** + * \returns a C++ iterator located at the beginning of this + * list. + */ + static Iterator Begin (void); + /** + * \returns a C++ iterator located at the end of this + * list. + */ + static Iterator End (void); + /** + * \param n index of requested channel. + * \returns the Channel associated to index n. + */ + static Ptr GetChannel (uint32_t n); + /** + * \returns the number of channels currently in the list. + */ + static uint32_t GetNChannels (void); +}; + +}//namespace ns3 + +#endif /* CHANNEL_LIST_H */ diff --git a/src/node/channel.cc b/src/node/channel.cc index e85503c66..be32b65bd 100644 --- a/src/node/channel.cc +++ b/src/node/channel.cc @@ -16,10 +16,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "ns3/log.h" #include "channel.h" +#include "channel-list.h" #include "net-device.h" +#include "ns3/log.h" +#include "ns3/uinteger.h" + NS_LOG_COMPONENT_DEFINE ("Channel"); namespace ns3 { @@ -30,19 +33,31 @@ TypeId Channel::GetTypeId (void) { static TypeId tid = TypeId ("ns3::Channel") - .SetParent (); + .SetParent () + .AddAttribute ("Id", "The id (unique integer) of this Channel.", + TypeId::ATTR_GET, + UintegerValue (0), + MakeUintegerAccessor (&Channel::m_id), + MakeUintegerChecker ()); return tid; } Channel::Channel () + : m_id(0) { NS_LOG_FUNCTION_NOARGS (); + m_id = ChannelList::Add (this); } - Channel::~Channel () { NS_LOG_FUNCTION_NOARGS (); } +uint32_t +Channel::GetId (void) const +{ + return m_id; +} + } // namespace ns3 diff --git a/src/node/channel.h b/src/node/channel.h index 68f8d3175..67fd082a9 100644 --- a/src/node/channel.h +++ b/src/node/channel.h @@ -45,6 +45,14 @@ public: Channel (); virtual ~Channel (); + /** + * \returns the unique id of this channel + * + * This unique id happens to be also the index of the Channel into + * the ChannelList. + */ + uint32_t GetId (void) const; + /** * \returns the number of NetDevices connected to this Channel. * @@ -59,6 +67,8 @@ public: */ virtual Ptr GetDevice (uint32_t i) const = 0; +private: + uint32_t m_id; // Channel id for this channel }; } // namespace ns3 diff --git a/src/node/inet-socket-address.h b/src/node/inet-socket-address.h index b775c1387..9f02e9fa0 100644 --- a/src/node/inet-socket-address.h +++ b/src/node/inet-socket-address.h @@ -87,6 +87,7 @@ public: void SetIpv4 (Ipv4Address address); /** + * \param address address to test * \returns true if the address matches, false otherwise. */ static bool IsMatchingType (const Address &address); diff --git a/src/node/inet6-socket-address.cc b/src/node/inet6-socket-address.cc index f15d64dd4..59fdb705e 100644 --- a/src/node/inet6-socket-address.cc +++ b/src/node/inet6-socket-address.cc @@ -18,10 +18,12 @@ * Author: Sebastien Vincent */ -#include "inet6-socket-address.h" #include "ns3/assert.h" -namespace ns3 { +#include "inet6-socket-address.h" + +namespace ns3 +{ Inet6SocketAddress::Inet6SocketAddress (Ipv6Address ipv6, uint16_t port) : m_ipv6(ipv6), diff --git a/src/node/inet6-socket-address.h b/src/node/inet6-socket-address.h index 3ebd41f70..0e022486b 100644 --- a/src/node/inet6-socket-address.h +++ b/src/node/inet6-socket-address.h @@ -21,9 +21,10 @@ #ifndef INET6_SOCKET_ADDRESS_H #define INET6_SOCKET_ADDRESS_H +#include + #include "address.h" #include "ipv6-address.h" -#include namespace ns3 { diff --git a/src/node/ipv4-address.h b/src/node/ipv4-address.h index 5ce91964f..c691ffc3c 100644 --- a/src/node/ipv4-address.h +++ b/src/node/ipv4-address.h @@ -210,7 +210,7 @@ public: */ Ipv4Mask (); /** - * param mask bitwise integer representation of the mask + * \param mask bitwise integer representation of the mask * * For example, the integer input 0xffffff00 yields a 24-bit mask */ diff --git a/src/node/ipv6-address.cc b/src/node/ipv6-address.cc index 818cb3a16..b2c10209d 100644 --- a/src/node/ipv6-address.cc +++ b/src/node/ipv6-address.cc @@ -18,14 +18,13 @@ * Author: Sebastien Vincent */ -#include +#include #include "ns3/log.h" -#include "ipv6-address.h" #include "ns3/assert.h" -#include "mac48-address.h" -#include +#include "mac48-address.h" +#include "ipv6-address.h" NS_LOG_COMPONENT_DEFINE ("Ipv6Address"); diff --git a/src/node/ipv6-address.h b/src/node/ipv6-address.h index 1adf8b0e2..291d1dbe5 100644 --- a/src/node/ipv6-address.h +++ b/src/node/ipv6-address.h @@ -26,9 +26,10 @@ #include -#include "address.h" #include "ns3/attribute-helper.h" +#include "address.h" + namespace ns3 { class Ipv6Prefix; @@ -213,7 +214,8 @@ class Ipv6Address operator Address () const; /** - * \brief Convert the Address object into an Ipv6Address one. + * \brief Convert the Address object into an Ipv6Address ones. + * \param address address to convert * \return an Ipv6Address */ static Ipv6Address ConvertFrom (const Address& address); @@ -402,13 +404,13 @@ class Ipv6Prefix /** * \class ns3::Ipv6AddressValue - * \brief hold objects of type ns3::Ipv6Address + * \brief Hold objects of type ns3::Ipv6Address */ ATTRIBUTE_HELPER_HEADER (Ipv6Address); /** * \class ns3::Ipv6PrefixValue - * \brief hold objects of type ns3::Ipv6Prefix + * \brief Hold objects of type ns3::Ipv6Prefix */ ATTRIBUTE_HELPER_HEADER (Ipv6Prefix); @@ -432,9 +434,17 @@ inline bool operator < (const Ipv6Address& a, const Ipv6Address& b) return (memcmp (a.m_address, b.m_address, 16) < 0); } +/** + * \class Ipv6AddressHash + * \brief Hash function class for IPv6 addresses. + */ class Ipv6AddressHash : public std::unary_function { public: + /** + * \brief Unary operator to hash IPv6 address. + * \param x IPv6 address to hash + */ size_t operator () (Ipv6Address const &x) const; }; diff --git a/src/node/ipv6-header.cc b/src/node/ipv6-header.cc index 886243d7f..2cf251b62 100644 --- a/src/node/ipv6-header.cc +++ b/src/node/ipv6-header.cc @@ -21,6 +21,7 @@ #include "ns3/assert.h" #include "ns3/log.h" #include "ns3/header.h" + #include "address-utils.h" #include "ipv6-header.h" diff --git a/src/node/ipv6-interface-address.cc b/src/node/ipv6-interface-address.cc index ee2cc45d8..90393a50b 100644 --- a/src/node/ipv6-interface-address.cc +++ b/src/node/ipv6-interface-address.cc @@ -22,6 +22,7 @@ #include "ns3/log.h" #include "ns3/assert.h" + #include "ipv6-interface-address.h" namespace ns3 diff --git a/src/node/ipv6-interface-address.h b/src/node/ipv6-interface-address.h index 1e6d0bb6e..20648da82 100644 --- a/src/node/ipv6-interface-address.h +++ b/src/node/ipv6-interface-address.h @@ -190,7 +190,7 @@ class Ipv6InterfaceAddress std::ostream& operator<< (std::ostream& os, const Ipv6InterfaceAddress &addr); -/* follow Ipv6InterfaceAddress way, maybe not inline them */ +/* follow Ipv4InterfaceAddress way, maybe not inline them */ inline bool operator == (const Ipv6InterfaceAddress& a, const Ipv6InterfaceAddress& b) { return (a.m_address == b.m_address && a.m_prefix == b.m_prefix && diff --git a/src/node/ipv6-raw-socket-factory.cc b/src/node/ipv6-raw-socket-factory.cc index c15caf12f..529ba6088 100644 --- a/src/node/ipv6-raw-socket-factory.cc +++ b/src/node/ipv6-raw-socket-factory.cc @@ -18,9 +18,10 @@ * Author: Mathieu Lacage */ -#include "ipv6-raw-socket-factory.h" #include "ns3/uinteger.h" +#include "ipv6-raw-socket-factory.h" + namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (Ipv6RawSocketFactory); diff --git a/src/node/ipv6-route.cc b/src/node/ipv6-route.cc index 8ce5fc57c..573d63452 100644 --- a/src/node/ipv6-route.cc +++ b/src/node/ipv6-route.cc @@ -21,7 +21,6 @@ #include #include "net-device.h" - #include "ipv6-route.h" namespace ns3 diff --git a/src/node/ipv6-route.h b/src/node/ipv6-route.h index 1269f1c22..0b7c37ec7 100644 --- a/src/node/ipv6-route.h +++ b/src/node/ipv6-route.h @@ -26,6 +26,7 @@ #include #include "ns3/ref-count-base.h" + #include "ipv6-address.h" namespace ns3 @@ -176,22 +177,26 @@ class Ipv6MulticastRoute : public RefCountBase Ipv6Address GetOrigin (void) const; /** + * \brief Set parent for this route. * \param iif Parent (input interface) for this route */ void SetParent (uint32_t iif); + /** + * \brief Get parent for this route. * \return Parent (input interface) for this route */ uint32_t GetParent (void) const; /** + * \brief set output TTL for this route. * \param oif Outgoing interface index * \param ttl time-to-live for this route */ void SetOutputTtl (uint32_t oif, uint32_t ttl); /** - * \brief Get output TTL. + * \brief Get output TTL for this route. * \param oif outgoing interface * \return TTL for this route */ @@ -214,7 +219,7 @@ class Ipv6MulticastRoute : public RefCountBase uint32_t m_parent; /** - * \brief TTLs; + * \brief TTLs. */ std::vector m_ttls; }; diff --git a/src/node/ipv6-routing-protocol.cc b/src/node/ipv6-routing-protocol.cc index 539b3b76b..fa33d406f 100644 --- a/src/node/ipv6-routing-protocol.cc +++ b/src/node/ipv6-routing-protocol.cc @@ -19,6 +19,7 @@ /* taken from src/node/ipv4-routing-protocol.cc and adapted to IPv6 */ #include "ns3/assert.h" + #include "ipv6-route.h" #include "ipv6-routing-protocol.h" diff --git a/src/node/ipv6-routing-protocol.h b/src/node/ipv6-routing-protocol.h index 34b7627f6..3341f662c 100644 --- a/src/node/ipv6-routing-protocol.h +++ b/src/node/ipv6-routing-protocol.h @@ -25,6 +25,7 @@ #include "ns3/callback.h" #include "ns3/object.h" #include "ns3/socket.h" + #include "ipv6-header.h" #include "ipv6-interface-address.h" #include "ipv6.h" @@ -39,6 +40,7 @@ class NetDevice; * \ingroup node * \defgroup ipv6Routing Ipv6RoutingProtocol */ + /** * \ingroup ipv6Routing * \brief Abstract base class for Ipv6 routing protocols. @@ -102,37 +104,42 @@ public: LocalDeliverCallback lcb, ErrorCallback ecb) = 0; /** - * \param interface the index of the interface we are being notified about + * \brief Notify when specified interface goes UP. * * Protocols are expected to implement this method to be notified of the state change of * an interface in a node. + * \param interface the index of the interface we are being notified about */ virtual void NotifyInterfaceUp (uint32_t interface) = 0; + /** - * \param interface the index of the interface we are being notified about + * \brief Notify when specified interface goes DOWN. * * Protocols are expected to implement this method to be notified of the state change of * an interface in a node. + * \param interface the index of the interface we are being notified about */ virtual void NotifyInterfaceDown (uint32_t interface) = 0; /** - * \param interface the index of the interface we are being notified about - * \param address a new address being added to an interface + * \brief Notify when specified interface add an address. * * Protocols are expected to implement this method to be notified whenever * a new address is added to an interface. Typically used to add a 'network route' on an * interface. Can be invoked on an up or down interface. + * \param interface the index of the interface we are being notified about + * \param address a new address being added to an interface */ virtual void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) = 0; /** - * \param interface the index of the interface we are being notified about - * \param address a new address being added to an interface + * \brief Notify when specified interface add an address. * * Protocols are expected to implement this method to be notified whenever * a new address is removed from an interface. Typically used to remove the 'network route' of an * interface. Can be invoked on an up or down interface. + * \param interface the index of the interface we are being notified about + * \param address a new address being added to an interface */ virtual void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) = 0; @@ -160,9 +167,8 @@ public: virtual void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ()) = 0; /** + * \brief Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol * \param ipv6 the ipv6 object this routing protocol is being associated with - * - * Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol */ virtual void SetIpv6 (Ptr ipv6) = 0; }; diff --git a/src/node/ipv6.cc b/src/node/ipv6.cc index c21ef2383..b8d7266c3 100644 --- a/src/node/ipv6.cc +++ b/src/node/ipv6.cc @@ -23,6 +23,7 @@ #include "ns3/assert.h" #include "ns3/node.h" #include "ns3/boolean.h" + #include "ipv6.h" namespace ns3 diff --git a/src/node/ipv6.h b/src/node/ipv6.h index 495bf4379..f5fc6c50f 100644 --- a/src/node/ipv6.h +++ b/src/node/ipv6.h @@ -24,9 +24,11 @@ #define IPV6_H #include + #include "ns3/object.h" #include "ns3/socket.h" #include "ns3/callback.h" + #include "ipv6-address.h" #include "ipv6-interface-address.h" @@ -108,17 +110,19 @@ public: virtual Ptr GetRoutingProtocol (void) const = 0; /** - * \param device device to add to the list of IPv6 interfaces - * which can be used as output interfaces during packet forwarding. - * \returns the index of the IPv6 interface added. + * \brief Add a NetDevice interface. * * Once a device has been added, it can never be removed: if you want * to disable it, you can invoke Ipv6::SetDown which will * make sure that it is never used during packet forwarding. + * \param device device to add to the list of IPv6 interfaces + * which can be used as output interfaces during packet forwarding. + * \returns the index of the IPv6 interface added. */ virtual uint32_t AddInterface (Ptr device) = 0; /** + * \brief Get number of interfaces. * \returns the number of interfaces added by the user. */ virtual uint32_t GetNInterfaces (void) const = 0; @@ -159,18 +163,21 @@ public: Ipv6Prefix mask) const = 0; /** + * \brief Get the NetDevice of the specified interface number. * \param interface The interface number of an IPv6 interface. * \returns The NetDevice associated with the IPv6 interface number. */ virtual Ptr GetNetDevice (uint32_t interface) = 0; /** + * \brief Get the interface index of the specified NetDevice. * \param device The NetDevice for an Ipv6Interface * \returns The interface number of an IPv6 interface or -1 if not found. */ virtual int32_t GetInterfaceForDevice (Ptr device) const = 0; /** + * \brief Add an address on the specified IPv6 interface. * \param interface Interface number of an IPv6 interface * \param address Ipv6InterfaceAddress address to associate with the underlying IPv6 interface * \returns true if the operation succeeded @@ -178,12 +185,15 @@ public: virtual bool AddAddress (uint32_t interface, Ipv6InterfaceAddress address) = 0; /** + * \brief Get number of addresses on specified IPv6 interface. * \param interface Interface number of an IPv6 interface * \returns the number of Ipv6InterfaceAddress entries for the interface. */ virtual uint32_t GetNAddresses (uint32_t interface) const = 0; /** + * \brief Get IPv6 address on specified IPv6 interface. + * * Because addresses can be removed, the addressIndex is not guaranteed * to be static across calls to this method. * @@ -194,6 +204,8 @@ public: virtual Ipv6InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const = 0; /** + * \brief Remove an address on specified IPv6 interface. + * * Remove the address at addressIndex on named interface. The addressIndex * for all higher indices will decrement by one after this method is called; * so, for example, to remove 5 addresses from an interface i, one could @@ -206,6 +218,8 @@ public: virtual bool RemoveAddress (uint32_t interface, uint32_t addressIndex) = 0; /** + * \brief Set metric on specified Ipv6 interface. + * * \param interface The interface number of an IPv6 interface * \param metric routing metric (cost) associated to the underlying * IPv6 interface @@ -213,6 +227,8 @@ public: virtual void SetMetric (uint32_t interface, uint16_t metric) = 0; /** + * \brief Get metric for the specified IPv6 interface. + * * \param interface The interface number of an IPv6 interface * \returns routing metric (cost) associated to the underlying * IPv6 interface @@ -220,6 +236,7 @@ public: virtual uint16_t GetMetric (uint32_t interface) const = 0; /** + * \brief Get MTU for the specified IPv6 interface. * \param interface Interface number of IPv6 interface * \returns the Maximum Transmission Unit (in bytes) associated * to the underlying IPv6 interface @@ -227,6 +244,7 @@ public: virtual uint16_t GetMtu (uint32_t interface) const = 0; /** + * \brief If the specified interface index is in "up" state. * \param interface Interface number of IPv6 interface * \returns true if the underlying interface is in the "up" state, * false otherwise. @@ -234,28 +252,30 @@ public: virtual bool IsUp (uint32_t interface) const = 0; /** + * \brief Set the interface into the "up" state. + * + * In this state, it is considered valid during IPv6 forwarding. * \param interface Interface number of IPv6 interface - * - * Set the interface into the "up" state. In this state, it is - * considered valid during IPv6 forwarding. */ virtual void SetUp (uint32_t interface) = 0; /** - * \param interface Interface number of IPv6 interface + * \brief Set the interface into the "down" state. * - * Set the interface into the "down" state. In this state, it is - * ignored during IPv6 forwarding. + * In this state, it is ignored during IPv6 forwarding. + * \param interface Interface number of IPv6 interface */ virtual void SetDown (uint32_t interface) = 0; /** + * \brief If the specified IPv6 interface has forwarding enabled. * \param interface Interface number of IPv6 interface * \returns true if IPv6 forwarding enabled for input datagrams on this device */ virtual bool IsForwarding (uint32_t interface) const = 0; /** + * \brief Set forwarding on specified IPv6 interface. * \param interface Interface number of IPv6 interface * \param val Value to set the forwarding flag * diff --git a/src/node/mac48-address.h b/src/node/mac48-address.h index 45a79c597..e55015013 100644 --- a/src/node/mac48-address.h +++ b/src/node/mac48-address.h @@ -78,6 +78,7 @@ public: */ static Mac48Address ConvertFrom (const Address &address); /** + * \param address address to test * \returns true if the address matches, false otherwise. */ static bool IsMatchingType (const Address &address); @@ -102,12 +103,14 @@ public: static Mac48Address GetBroadcast (void); /** + * \param address base IPv4 address * \returns a multicast address */ static Mac48Address GetMulticast (Ipv4Address address); /** * \brief Get multicast address from IPv6 address. + * \param address base IPv6 address * \returns a multicast address */ static Mac48Address GetMulticast (Ipv6Address address); diff --git a/src/node/mac64-address.h b/src/node/mac64-address.h index 8d28e5efe..f4509243d 100644 --- a/src/node/mac64-address.h +++ b/src/node/mac64-address.h @@ -73,6 +73,7 @@ public: */ static Mac64Address ConvertFrom (const Address &address); /** + * \param address address to test * \returns true if the address matches, false otherwise. */ static bool IsMatchingType (const Address &address); diff --git a/src/node/net-device.h b/src/node/net-device.h index 787dab714..17e290d0b 100644 --- a/src/node/net-device.h +++ b/src/node/net-device.h @@ -99,6 +99,7 @@ public: /** * Set the address of this interface + * \param address address to set */ virtual void SetAddress (Address address) = 0; diff --git a/src/node/packet-socket-address.h b/src/node/packet-socket-address.h index 9f99a9a63..4ea350daf 100644 --- a/src/node/packet-socket-address.h +++ b/src/node/packet-socket-address.h @@ -64,6 +64,7 @@ class PacketSocketAddress */ static PacketSocketAddress ConvertFrom (const Address &address); /** + * \param address address to test * \returns true if the address matches, false otherwise. */ static bool IsMatchingType (const Address &address); diff --git a/src/node/packetbb-test-suite.cc b/src/node/packetbb-test-suite.cc new file mode 100644 index 000000000..87b39138f --- /dev/null +++ b/src/node/packetbb-test-suite.cc @@ -0,0 +1,3830 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* vim: set ts=2 sw=2 sta expandtab ai si cin: */ +/* + * Copyright (c) 2009 Drexel University + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Tom Wambold + */ + +#include +#include +#include "ns3/test.h" +#include "ns3/ptr.h" +#include "ns3/ipv4-address.h" +#include "ns3/ipv6-address.h" +#include "ns3/packetbb.h" + +using namespace ns3; + +class PbbTestCase : public TestCase +{ +public: + PbbTestCase (std::string name, Ptr packet, + uint8_t * buffer, uint32_t size); + virtual ~PbbTestCase (void); + +protected: + virtual bool DoRun (void); + +private: + bool TestSerialize (void); + bool TestDeserialize (void); + + Ptr m_refPacket; + Buffer m_refBuffer; +}; + +PbbTestCase::PbbTestCase (std::string name, Ptr packet, + uint8_t * buffer, uint32_t size) + : TestCase (name) +{ + m_refPacket = packet; + + m_refBuffer.AddAtStart (size); + m_refBuffer.Begin ().Write (buffer, size); +} + +PbbTestCase::~PbbTestCase (void) +{ + return; +} + +bool +PbbTestCase::DoRun (void) +{ + NS_TEST_ASSERT_MSG_EQ (TestSerialize (), false, + "serialization failed"); + NS_TEST_ASSERT_MSG_EQ (TestDeserialize (), false, + "deserialization failed"); + return GetErrorStatus (); +} + +bool +PbbTestCase::TestSerialize (void) +{ + Buffer newBuffer; + newBuffer.AddAtStart (m_refPacket->GetSerializedSize ()); + m_refPacket->Serialize (newBuffer.Begin ()); + + NS_TEST_ASSERT_MSG_EQ (newBuffer.GetSize (), m_refBuffer.GetSize (), + "serialization failed, buffers have different sizes"); + + int memrv = memcmp (newBuffer.PeekData (), m_refBuffer.PeekData (), + newBuffer.GetSize ()); + + NS_TEST_ASSERT_MSG_EQ (memrv, 0, + "serialization faled, buffers differ"); + + return GetErrorStatus (); +} + +bool +PbbTestCase::TestDeserialize (void) +{ + Ptr newPacket = Create (); + uint32_t numbytes = newPacket->Deserialize (m_refBuffer.Begin ()); + + NS_TEST_ASSERT_MSG_EQ (numbytes, m_refBuffer.GetSize (), + "deserialization failed, did not use all bytes"); + + NS_TEST_ASSERT_MSG_EQ (*newPacket, *m_refPacket, + "deserialization failed, objects do not match"); + + return GetErrorStatus (); +} + +class PbbTestSuite : public TestSuite +{ +public: + PbbTestSuite (); +}; + +PbbTestSuite::PbbTestSuite () + : TestSuite ("packetbb-test-suite", UNIT) +{ + /* Test 1 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * `------------------ + */ + { + Ptr packet = Create (); + uint8_t buffer[] = {0x00}; + AddTestCase (new PbbTestCase ("1", packet, buffer, sizeof(buffer))); + } + + /* Test 2 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 8 + * | * Packet seq number: 2 + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (2); + uint8_t buffer[] = {0x08, 0x00, 0x02}; + AddTestCase (new PbbTestCase ("2", packet, buffer, sizeof(buffer))); + } + + /* Test 3 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 3 + * `------------------ + * This test has the phastlv flag set to 1 with no tlvs. + * I'll come back to this one later. + */ +#if 0 + { + Ptr packet = Create (); + packet->SetSequenceNumber (3); + uint8_t buffer[] = {0x0c, 0x00, 0x03, 0x00, 0x00}; + AddTestCase (new PbbTestCase ("3", packet, buffer, sizeof(buffer))); + } +#endif + + /* Test 4 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 4 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (4); + + Ptr tlv = Create(); + tlv->SetType (1); + + packet->TlvPushBack (tlv); + uint8_t buffer[] = { + 0x0c, 0x00, 0x04, 0x00, + 0x02, 0x01, 0x00 + }; + AddTestCase (new PbbTestCase ("4", packet, buffer, sizeof(buffer))); + } + + /* Test 5 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 5 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | | - TLV + * | | Flags = 128 + * | | Type = 2; Type ext. = 100; Value = (warning: parameter is NULL) + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (5); + + Ptr tlv1 = Create(); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr tlv2 = Create(); + tlv2->SetType (2); + tlv2->SetTypeExt (100); + packet->TlvPushBack (tlv2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x05, 0x00, + 0x05, 0x01, 0x00, 0x02, + 0x80, 0x64 + }; + AddTestCase (new PbbTestCase ("5", packet, buffer, sizeof(buffer))); + } + + /* Test 6 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 6 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | | - TLV + * | | Flags = 144 + * | | Type = 2; Type ext. = 100; Value = 01 02 03 04 + * | | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (6); + + Ptr tlv1 = Create(); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr tlv2 = Create(); + tlv2->SetType (2); + tlv2->SetTypeExt (100); + + uint8_t tlv2val[] = {1, 2, 3, 4}; + tlv2->SetValue(tlv2val, sizeof(tlv2val)); + + packet->TlvPushBack (tlv2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x06, 0x00, + 0x0a, 0x01, 0x00, 0x02, + 0x90, 0x64, 0x04, 0x01, + 0x02, 0x03, 0x04 + }; + AddTestCase (new PbbTestCase ("6", packet, buffer, sizeof(buffer))); + } + + /* Test 7 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 7 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | | - TLV + * | | Flags = 152 + * | | Type = 2; Type ext. = 100; Value = 00 01 02 03 + * | | 04 05 06 07 + * | | 08 09 0a 0b + * | | 0c 0d 0e 0f + * | | 10 11 12 13 + * | | 14 15 16 17 + * | | 18 19 1a 1b + * | | 1c 1d 1e 1f + * | | 20 21 22 23 + * | | 24 25 26 27 + * | | 28 29 2a 2b + * | | 2c 2d 2e 2f + * | | 30 31 32 33 + * | | 34 35 36 37 + * | | 38 39 3a 3b + * | | 3c 3d 3e 3f + * | | 40 41 42 43 + * | | 44 45 46 47 + * | | 48 49 4a 4b + * | | 4c 4d 4e 4f + * | | 50 51 52 53 + * | | 54 55 56 57 + * | | 58 59 5a 5b + * | | 5c 5d 5e 5f + * | | 60 61 62 63 + * | | 64 65 66 67 + * | | 68 69 6a 6b + * | | 6c 6d 6e 6f + * | | 70 71 72 73 + * | | 74 75 76 77 + * | | 78 79 7a 7b + * | | 7c 7d 7e 7f + * | | 80 81 82 83 + * | | 84 85 86 87 + * | | 88 89 8a 8b + * | | 8c 8d 8e 8f + * | | 90 91 92 93 + * | | 94 95 96 97 + * | | 98 99 9a 9b + * | | 9c 9d 9e 9f + * | | a0 a1 a2 a3 + * | | a4 a5 a6 a7 + * | | a8 a9 aa ab + * | | ac ad ae af + * | | b0 b1 b2 b3 + * | | b4 b5 b6 b7 + * | | b8 b9 ba bb + * | | bc bd be bf + * | | c0 c1 c2 c3 + * | | c4 c5 c6 c7 + * | | c8 c9 ca cb + * | | cc cd ce cf + * | | d0 d1 d2 d3 + * | | d4 d5 d6 d7 + * | | d8 d9 da db + * | | dc dd de df + * | | e0 e1 e2 e3 + * | | e4 e5 e6 e7 + * | | e8 e9 ea eb + * | | ec ed ee ef + * | | f0 f1 f2 f3 + * | | f4 f5 f6 f7 + * | | f8 f9 fa fb + * | | fc fd fe 00 + * | | 01 02 03 04 + * | | 05 06 07 08 + * | | 09 0a 0b 0c + * | | 0d 0e 0f 10 + * | | 11 12 13 14 + * | | 15 16 17 18 + * | | 19 1a 1b 1c + * | | 1d 1e 1f 20 + * | | 21 22 23 24 + * | | 25 26 27 28 + * | | 29 2a 2b 2c + * | | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (7); + + Ptr tlv1 = Create(); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr tlv2 = Create(); + tlv2->SetType (2); + tlv2->SetTypeExt (100); + + uint8_t tlv2val[] = { + 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, + 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, + 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, + 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, + 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, + 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, + 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, + 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, + 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, + 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, + 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, + 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, + 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, + 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, + 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, + 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, + 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, + 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, + 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, + 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, + 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, + 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, + 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, + 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, + 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, + 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xfe, 0x00, + 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, + 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c + }; + tlv2->SetValue(tlv2val, sizeof(tlv2val)); + + packet->TlvPushBack (tlv2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x07, 0x01, + 0x33, 0x01, 0x00, 0x02, + 0x98, 0x64, 0x01, 0x2c, + 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, + 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, + 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, + 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, + 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, + 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, + 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, + 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, + 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, + 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, + 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, + 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, + 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, + 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, + 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, + 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, + 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, + 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, + 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, + 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, + 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, + 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, + 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, + 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, + 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, + 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xfe, 0x00, + 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, + 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c + }; + AddTestCase (new PbbTestCase ("7", packet, buffer, sizeof(buffer))); + } + + /* Test 8 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 8 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (8); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + packet->MessagePushBack (msg1); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x06, 0x00, + 0x00 + }; + AddTestCase (new PbbTestCase ("8", packet, buffer, sizeof(buffer))); + } + + /* Test 9 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 9 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 128 + * | | * Originator address: 10.0.0.1 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (9); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1")); + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x09, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x06, 0x00, + 0x00, 0x02, 0x83, 0x00, /* [14] used to be 0x80 */ + 0x0a, 0x0a, 0x00, 0x00, + 0x01, 0x00, 0x00 + }; + AddTestCase (new PbbTestCase ("9", packet, buffer, sizeof(buffer))); + } + + /* Test 10 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 10 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 160 + * | | * Originator address: 10.0.0.1 + * | | * Hop count: 1 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (10); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1")); + msg2->SetHopCount (1); + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x0a, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x06, 0x00, + 0x00, 0x02, 0xa3, 0x00, /* [14] used to be 0xa0 */ + 0x0b, 0x0a, 0x00, 0x00, + 0x01, 0x01, 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("10", packet, buffer, sizeof(buffer))); + } + + /* Test 11 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 11 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 224 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (11); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x0b, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x06, 0x00, + 0x00, 0x02, 0xe3, 0x00, /* [14] used to be 0xe0 */ + 0x0c, 0x0a, 0x00, 0x00, + 0x01, 0xff, 0x01, 0x00, + 0x00 + }; + AddTestCase (new PbbTestCase ("11", packet, buffer, sizeof(buffer))); + } + + /* Test 12 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 12 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (12); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x0c, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x06, 0x00, + 0x00, 0x02, 0xf3, 0x00, /* [14] - 0xf0 */ + 0x0e, 0x0a, 0x00, 0x00, + 0x01, 0xff, 0x01, 0x30, + 0x39, 0x00, 0x00 + }; + AddTestCase (new PbbTestCase ("12", packet, buffer, sizeof(buffer))); + } + + /* Test 13 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 13 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (13); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x0d, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x06, 0x00, + 0x00, 0x02, 0xf3, 0x00, /* [14] - 0xf0 */ + 0x0e, 0x0a, 0x00, 0x00, + 0x01, 0xff, 0x01, 0x30, + 0x39, 0x00, 0x00 + }; + AddTestCase (new PbbTestCase ("13", packet, buffer, sizeof(buffer))); + } + + /* Test 14 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 14 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (14); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x0e, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x0e, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00 + }; + AddTestCase (new PbbTestCase ("14", packet, buffer, sizeof(buffer))); + } + + /* Test 15 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 15 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 0.0.0.0/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (15); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("0.0.0.0")); + msg2->AddressBlockPushBack (msg2a1); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x0f, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00 + }; + AddTestCase (new PbbTestCase ("15", packet, buffer, sizeof(buffer))); + } + + /* Test 16 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 16 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 255.255.255.255/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (16); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("255.255.255.255")); + msg2->AddressBlockPushBack (msg2a1); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x10, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x01, 0x00, 0xff, + 0xff, 0xff, 0xff, 0x00, + 0x00, + }; + AddTestCase (new PbbTestCase ("16", packet, buffer, sizeof(buffer))); + } + + /* Test 17 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 17 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 0.0.0.1/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (17); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("0.0.0.1")); + msg2->AddressBlockPushBack (msg2a1); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x11, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, + 0x00, + }; + AddTestCase (new PbbTestCase ("17", packet, buffer, sizeof(buffer))); + } + + /* Test 18 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 18 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 10.0.0.0/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (18); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.0")); + msg2->AddressBlockPushBack (msg2a1); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x12, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x01, 0x00, 0x0a, + 0x00, 0x00, 0x00, 0x00, + 0x00, + }; + AddTestCase (new PbbTestCase ("18", packet, buffer, sizeof(buffer))); + } + + /* Test 19 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 19 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 10.0.0.1/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (19); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.1")); + msg2->AddressBlockPushBack (msg2a1); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x13, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x01, 0x00, 0x0a, + 0x00, 0x00, 0x01, 0x00, + 0x00, + }; + AddTestCase (new PbbTestCase ("19", packet, buffer, sizeof(buffer))); + } + + /* Test 20 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 20 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.1/32 + * | | - 10.0.0.2/32 + * | | - Flags = 128 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (20); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.1")); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2->AddressBlockPushBack (msg2a1); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x14, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x18, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0x80, 0x03, + 0x0a, 0x00, 0x00, 0x01, + 0x02, 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("20", packet, buffer, sizeof(buffer))); + } + + /* Test 21 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 21 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (21); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + msg2->AddressBlockPushBack (msg2a1); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x15, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x1a, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, + }; + AddTestCase (new PbbTestCase ("21", packet, buffer, sizeof(buffer))); + } + + /* Test 22 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 22 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (2 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - Flags = 32 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (22); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + msg2->AddressBlockPushBack (msg2a1); + + Ptr msg2a2 = Create (); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + msg2->AddressBlockPushBack (msg2a2); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x16, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x21, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x02, 0x20, 0x03, + 0x0a, 0x0b, 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("22", packet, buffer, sizeof(buffer))); + } + + /* Test 23 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 23 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (23); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + msg2->AddressBlockPushBack (msg2a1); + + Ptr msg2a2 = Create (); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.5")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.6")); + + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (16); + msg2a2->PrefixPushBack (24); + + msg2->AddressBlockPushBack (msg2a2); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x17, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x32, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x04, 0x08, 0x0a, + 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x05, 0x0a, + 0x00, 0x00, 0x06, 0x20, + 0x20, 0x10, 0x18, 0x00, + 0x00, + }; + AddTestCase (new PbbTestCase ("23", packet, buffer, sizeof(buffer))); + } + + /* Test 24 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 24 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (24); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + msg2->AddressBlockPushBack (msg2a1); + + Ptr msg2a2 = Create (); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.5")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.6")); + + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (16); + msg2a2->PrefixPushBack (24); + + Ptr msg2a2tlv1 = Create (); + msg2a2tlv1->SetType (1); + msg2a2->TlvPushBack (msg2a2tlv1); + + msg2->AddressBlockPushBack (msg2a2); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x18, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x34, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x04, 0x08, 0x0a, + 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x05, 0x0a, + 0x00, 0x00, 0x06, 0x20, + 0x20, 0x10, 0x18, 0x00, + 0x02, 0x01, 0x00, + }; + AddTestCase (new PbbTestCase ("24", packet, buffer, sizeof(buffer))); + } + + /* Test 25 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 25 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 64 + * | | Index-start = 1 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (25); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + msg2->AddressBlockPushBack (msg2a1); + + Ptr msg2a2 = Create (); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.5")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.6")); + + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (16); + msg2a2->PrefixPushBack (24); + + Ptr msg2a2tlv1 = Create (); + msg2a2tlv1->SetType (1); + msg2a2tlv1->SetIndexStart (1); + msg2a2->TlvPushBack (msg2a2tlv1); + + msg2->AddressBlockPushBack (msg2a2); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x19, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x35, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x04, 0x08, 0x0a, + 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x05, 0x0a, + 0x00, 0x00, 0x06, 0x20, + 0x20, 0x10, 0x18, 0x00, + 0x03, 0x01, 0x40, 0x01, + }; + AddTestCase (new PbbTestCase ("25", packet, buffer, sizeof(buffer))); + } + + /* Test 26 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 26 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 32 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (26); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + msg2->AddressBlockPushBack (msg2a1); + + Ptr msg2a2 = Create (); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.5")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.6")); + + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (16); + msg2a2->PrefixPushBack (24); + + Ptr msg2a2tlv1 = Create (); + msg2a2tlv1->SetType (1); + msg2a2tlv1->SetIndexStart (1); + msg2a2tlv1->SetIndexStop (3); + msg2a2->TlvPushBack (msg2a2tlv1); + + msg2->AddressBlockPushBack (msg2a2); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x1a, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x36, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x04, 0x08, 0x0a, + 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x05, 0x0a, + 0x00, 0x00, 0x06, 0x20, + 0x20, 0x10, 0x18, 0x00, + 0x04, 0x01, 0x20, 0x01, + 0x03, + }; + AddTestCase (new PbbTestCase ("26", packet, buffer, sizeof(buffer))); + } + + /* Test 27 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 27 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 52 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = 01 02 03 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (27); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + msg2->AddressBlockPushBack (msg2a1); + + Ptr msg2a2 = Create (); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.5")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.6")); + + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (16); + msg2a2->PrefixPushBack (24); + + Ptr msg2a2tlv1 = Create (); + msg2a2tlv1->SetType (1); + msg2a2tlv1->SetIndexStart (1); + msg2a2tlv1->SetIndexStop (3); + + uint8_t value[] = {1, 2, 3}; + msg2a2tlv1->SetValue(value, sizeof (value)); + msg2a2tlv1->SetMultivalue (true); + + msg2a2->TlvPushBack (msg2a2tlv1); + + msg2->AddressBlockPushBack (msg2a2); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x1b, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x00, 0x3a, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x04, 0x08, 0x0a, + 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x05, 0x0a, + 0x00, 0x00, 0x06, 0x20, + 0x20, 0x10, 0x18, 0x00, + 0x08, 0x01, 0x34, 0x01, + 0x03, 0x03, 0x01, 0x02, + 0x03, + }; + AddTestCase (new PbbTestCase ("27", packet, buffer, sizeof(buffer))); + } + + /* Test 28 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 28 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 56 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = 00 01 02 03 + * | | 04 05 06 07 + * | | 08 09 0a 0b + * | | 0c 0d 0e 0f + * | | 10 11 12 13 + * | | 14 15 16 17 + * | | 18 19 1a 1b + * | | 1c 1d 1e 1f + * | | 20 21 22 23 + * | | 24 25 26 27 + * | | 28 29 2a 2b + * | | 2c 2d 2e 2f + * | | 30 31 32 33 + * | | 34 35 36 37 + * | | 38 39 3a 3b + * | | 3c 3d 3e 3f + * | | 40 41 42 43 + * | | 44 45 46 47 + * | | 48 49 4a 4b + * | | 4c 4d 4e 4f + * | | 50 51 52 53 + * | | 54 55 56 57 + * | | 58 59 5a 5b + * | | 5c 5d 5e 5f + * | | 60 61 62 63 + * | | 64 65 66 67 + * | | 68 69 6a 6b + * | | 6c 6d 6e 6f + * | | 70 71 72 73 + * | | 74 75 76 77 + * | | 78 79 7a 7b + * | | 7c 7d 7e 7f + * | | 80 81 82 83 + * | | 84 85 86 87 + * | | 88 89 8a 8b + * | | 8c 8d 8e 8f + * | | 90 91 92 93 + * | | 94 95 96 97 + * | | 98 99 9a 9b + * | | 9c 9d 9e 9f + * | | a0 a1 a2 a3 + * | | a4 a5 a6 a7 + * | | a8 a9 aa ab + * | | ac ad ae af + * | | b0 b1 b2 b3 + * | | b4 b5 b6 b7 + * | | b8 b9 ba bb + * | | bc bd be bf + * | | c0 c1 c2 c3 + * | | c4 c5 c6 c7 + * | | c8 c9 ca cb + * | | cc cd ce cf + * | | d0 d1 d2 d3 + * | | d4 d5 d6 d7 + * | | d8 d9 da db + * | | dc dd de df + * | | e0 e1 e2 e3 + * | | e4 e5 e6 e7 + * | | e8 e9 ea eb + * | | ec ed ee ef + * | | f0 f1 f2 f3 + * | | f4 f5 f6 f7 + * | | f8 f9 fa fb + * | | fc fd fe 00 + * | | 01 02 03 04 + * | | 05 06 07 08 + * | | 09 0a 0b 0c + * | | 0d 0e 0f 10 + * | | 11 12 13 14 + * | | 15 16 17 18 + * | | 19 1a 1b 1c + * | | 1d 1e 1f 20 + * | | 21 22 23 24 + * | | 25 26 27 28 + * | | 29 2a 2b 2c + * | | + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (28); + + Ptr tlv1 = Create (); + tlv1->SetType (1); + packet->TlvPushBack (tlv1); + + Ptr msg1 = Create (); + msg1->SetType (1); + + Ptr msg1tlv1 = Create (); + msg1tlv1->SetType (1); + msg1->TlvPushBack (msg1tlv1); + + packet->MessagePushBack (msg1); + + Ptr msg2 = Create (); + msg2->SetType (2); + msg2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + msg2->SetHopLimit (255); + msg2->SetHopCount (1); + msg2->SetSequenceNumber (12345); + + Ptr msg2a1 = Create (); + msg2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + msg2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + msg2->AddressBlockPushBack (msg2a1); + + Ptr msg2a2 = Create (); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.5")); + msg2a2->AddressPushBack (Ipv4Address ("10.0.0.6")); + + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (32); + msg2a2->PrefixPushBack (16); + msg2a2->PrefixPushBack (24); + + Ptr msg2a2tlv1 = Create (); + msg2a2tlv1->SetType (1); + msg2a2tlv1->SetIndexStart (1); + msg2a2tlv1->SetIndexStop (3); + + uint8_t value[] = { + 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, + 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, + 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, + 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, + 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, + 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, + 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, + 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, + 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, + 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, + 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, + 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, + 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, + 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, + 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, + 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, + 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, + 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, + 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, + 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, + 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, + 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, + 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, + 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, + 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, + 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xfe, 0x00, + 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, + 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, + }; + msg2a2tlv1->SetValue(value, sizeof (value)); + + msg2a2->TlvPushBack (msg2a2tlv1); + + msg2->AddressBlockPushBack (msg2a2); + + packet->MessagePushBack (msg2); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x1c, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x03, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x01, 0x64, 0x0a, /* [16] - 0xf0 */ + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x04, 0x08, 0x0a, + 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x05, 0x0a, + 0x00, 0x00, 0x06, 0x20, + 0x20, 0x10, 0x18, 0x01, + 0x32, 0x01, 0x38, 0x01, + 0x03, 0x01, 0x2c, 0x00, + 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, + 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, + 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, 0x33, 0x34, + 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x3b, 0x3c, + 0x3d, 0x3e, 0x3f, 0x40, + 0x41, 0x42, 0x43, 0x44, + 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x4b, 0x4c, + 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0x53, 0x54, + 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x5b, 0x5c, + 0x5d, 0x5e, 0x5f, 0x60, + 0x61, 0x62, 0x63, 0x64, + 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x6b, 0x6c, + 0x6d, 0x6e, 0x6f, 0x70, + 0x71, 0x72, 0x73, 0x74, + 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x7b, 0x7c, + 0x7d, 0x7e, 0x7f, 0x80, + 0x81, 0x82, 0x83, 0x84, + 0x85, 0x86, 0x87, 0x88, + 0x89, 0x8a, 0x8b, 0x8c, + 0x8d, 0x8e, 0x8f, 0x90, + 0x91, 0x92, 0x93, 0x94, + 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0x9b, 0x9c, + 0x9d, 0x9e, 0x9f, 0xa0, + 0xa1, 0xa2, 0xa3, 0xa4, + 0xa5, 0xa6, 0xa7, 0xa8, + 0xa9, 0xaa, 0xab, 0xac, + 0xad, 0xae, 0xaf, 0xb0, + 0xb1, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, + 0xb9, 0xba, 0xbb, 0xbc, + 0xbd, 0xbe, 0xbf, 0xc0, + 0xc1, 0xc2, 0xc3, 0xc4, + 0xc5, 0xc6, 0xc7, 0xc8, + 0xc9, 0xca, 0xcb, 0xcc, + 0xcd, 0xce, 0xcf, 0xd0, + 0xd1, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, + 0xd9, 0xda, 0xdb, 0xdc, + 0xdd, 0xde, 0xdf, 0xe0, + 0xe1, 0xe2, 0xe3, 0xe4, + 0xe5, 0xe6, 0xe7, 0xe8, + 0xe9, 0xea, 0xeb, 0xec, + 0xed, 0xee, 0xef, 0xf0, + 0xf1, 0xf2, 0xf3, 0xf4, + 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa, 0xfb, 0xfc, + 0xfd, 0xfe, 0x00, 0x01, + 0x02, 0x03, 0x04, 0x05, + 0x06, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x10, 0x11, + 0x12, 0x13, 0x14, 0x15, + 0x16, 0x17, 0x18, 0x19, + 0x1a, 0x1b, 0x1c, 0x1d, + 0x1e, 0x1f, 0x20, 0x21, + 0x22, 0x23, 0x24, 0x25, + 0x26, 0x27, 0x28, 0x29, + 0x2a, 0x2b, 0x2c + }; + AddTestCase (new PbbTestCase ("28", packet, buffer, sizeof(buffer))); + } + + /* Test 29 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 1 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + + Ptr m1 = Create (); + m1->SetType(1); + + packet->MessagePushBack (m1); + + uint8_t buffer[] = { + 0x00, 0x01, 0x0f, 0x00, + 0x06, 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("29", packet, buffer, sizeof(buffer))); + } + + /* Test 30 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + + Ptr m1 = Create (); + m1->SetType(1); + m1->SetOriginatorAddress (Ipv6Address("abcd::1")); + + packet->MessagePushBack (m1); + + uint8_t buffer[] = { + 0x00, 0x01, 0x8f, 0x00, + 0x16, 0xab, 0xcd, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00 + }; + AddTestCase (new PbbTestCase ("30", packet, buffer, sizeof(buffer))); + } + + /* Test 31 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (1 addresses) + * | | - 10::1/128 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + + Ptr m1 = Create (); + m1->SetType(1); + m1->SetOriginatorAddress (Ipv6Address("abcd::1")); + + Ptr m1a1 = Create (); + m1a1->AddressPushBack (Ipv6Address ("10::1")); + m1->AddressBlockPushBack (m1a1); + + packet->MessagePushBack (m1); + + uint8_t buffer[] = { + 0x00, 0x01, 0x8f, 0x00, + 0x2a, 0xab, 0xcd, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("31", packet, buffer, sizeof(buffer))); + } + + /* Test 32 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::1/128 + * | | - 10::2/128 + * | | - Flags = 128 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + + Ptr m1 = Create (); + m1->SetType(1); + m1->SetOriginatorAddress (Ipv6Address("abcd::1")); + + Ptr m1a1 = Create (); + m1a1->AddressPushBack (Ipv6Address ("10::1")); + m1a1->AddressPushBack (Ipv6Address ("10::2")); + m1->AddressBlockPushBack (m1a1); + + packet->MessagePushBack (m1); + + uint8_t buffer[] = { + 0x00, 0x01, 0x8f, 0x00, + 0x2c, 0xab, 0xcd, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x02, + 0x80, 0x0f, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x00, + 0x00, + }; + AddTestCase (new PbbTestCase ("32", packet, buffer, sizeof(buffer))); + } + + /* Test 33 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + + Ptr m1 = Create (); + m1->SetType(1); + m1->SetOriginatorAddress (Ipv6Address("abcd::1")); + + Ptr m1a1 = Create (); + m1a1->AddressPushBack (Ipv6Address ("10::2")); + m1a1->AddressPushBack (Ipv6Address ("10::11:2")); + m1->AddressBlockPushBack (m1a1); + + packet->MessagePushBack (m1); + + uint8_t buffer[] = { + 0x00, 0x01, 0x8f, 0x00, + 0x2d, 0xab, 0xcd, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x02, + 0xc0, 0x0d, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x11, + 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("33", packet, buffer, sizeof(buffer))); + } + + /* Test 34 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (2 addresses) + * | | - 10::/128 + * | | - 11::/128 + * | | - Flags = 160 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + + Ptr m1 = Create (); + m1->SetType(1); + m1->SetOriginatorAddress (Ipv6Address("abcd::1")); + + Ptr m1a1 = Create (); + m1a1->AddressPushBack (Ipv6Address ("10::2")); + m1a1->AddressPushBack (Ipv6Address ("10::11:2")); + m1->AddressBlockPushBack (m1a1); + + Ptr m1a2 = Create (); + m1a2->AddressPushBack (Ipv6Address ("10::")); + m1a2->AddressPushBack (Ipv6Address ("11::")); + m1->AddressBlockPushBack (m1a2); + + packet->MessagePushBack (m1); + + uint8_t buffer[] = { + 0x00, 0x01, 0x8f, 0x00, + 0x36, 0xab, 0xcd, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x02, + 0xc0, 0x0d, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x11, + 0x00, 0x00, 0x02, 0xa0, + 0x01, 0x00, 0x0e, 0x10, + 0x11, 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("34", packet, buffer, sizeof(buffer))); + } + + /* Test 35 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10::/128 + * | | - 11::/128 + * | | - 10::5/64 + * | | - 10::6/48 + * | | - Flags = 136 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + + Ptr m1 = Create (); + m1->SetType(1); + m1->SetOriginatorAddress (Ipv6Address("abcd::1")); + + Ptr m1a1 = Create (); + m1a1->AddressPushBack (Ipv6Address ("10::2")); + m1a1->AddressPushBack (Ipv6Address ("10::11:2")); + m1->AddressBlockPushBack (m1a1); + + Ptr m1a2 = Create (); + m1a2->AddressPushBack (Ipv6Address ("10::")); + m1a2->AddressPushBack (Ipv6Address ("11::")); + m1a2->AddressPushBack (Ipv6Address ("10::5")); + m1a2->AddressPushBack (Ipv6Address ("10::6")); + m1a2->PrefixPushBack (128); + m1a2->PrefixPushBack (128); + m1a2->PrefixPushBack (64); + m1a2->PrefixPushBack (48); + m1->AddressBlockPushBack (m1a2); + + packet->MessagePushBack (m1); + + uint8_t buffer[] = { + 0x00, 0x01, 0x8f, 0x00, + 0x73, 0xab, 0xcd, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x02, + 0xc0, 0x0d, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x11, + 0x00, 0x00, 0x04, 0x88, + 0x01, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x11, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x05, 0x10, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x80, 0x80, + 0x40, 0x30, 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("35", packet, buffer, sizeof(buffer))); + } + + /* Test 36 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 29 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 56 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = 00 01 02 03 + * | | 04 05 06 07 + * | | 08 09 0a 0b + * | | 0c 0d 0e 0f + * | | 10 11 12 13 + * | | 14 15 16 17 + * | | 18 19 1a 1b + * | | 1c 1d 1e 1f + * | | 20 21 22 23 + * | | 24 25 26 27 + * | | 28 29 2a 2b + * | | 2c 2d 2e 2f + * | | 30 31 32 33 + * | | 34 35 36 37 + * | | 38 39 3a 3b + * | | 3c 3d 3e 3f + * | | 40 41 42 43 + * | | 44 45 46 47 + * | | 48 49 4a 4b + * | | 4c 4d 4e 4f + * | | 50 51 52 53 + * | | 54 55 56 57 + * | | 58 59 5a 5b + * | | 5c 5d 5e 5f + * | | 60 61 62 63 + * | | 64 65 66 67 + * | | 68 69 6a 6b + * | | 6c 6d 6e 6f + * | | 70 71 72 73 + * | | 74 75 76 77 + * | | 78 79 7a 7b + * | | 7c 7d 7e 7f + * | | 80 81 82 83 + * | | 84 85 86 87 + * | | 88 89 8a 8b + * | | 8c 8d 8e 8f + * | | 90 91 92 93 + * | | 94 95 96 97 + * | | 98 99 9a 9b + * | | 9c 9d 9e 9f + * | | a0 a1 a2 a3 + * | | a4 a5 a6 a7 + * | | a8 a9 aa ab + * | | ac ad ae af + * | | b0 b1 b2 b3 + * | | b4 b5 b6 b7 + * | | b8 b9 ba bb + * | | bc bd be bf + * | | c0 c1 c2 c3 + * | | c4 c5 c6 c7 + * | | c8 c9 ca cb + * | | cc cd ce cf + * | | d0 d1 d2 d3 + * | | d4 d5 d6 d7 + * | | d8 d9 da db + * | | dc dd de df + * | | e0 e1 e2 e3 + * | | e4 e5 e6 e7 + * | | e8 e9 ea eb + * | | ec ed ee ef + * | | f0 f1 f2 f3 + * | | f4 f5 f6 f7 + * | | f8 f9 fa fb + * | | fc fd fe 00 + * | | 01 02 03 04 + * | | 05 06 07 08 + * | | 09 0a 0b 0c + * | | 0d 0e 0f 10 + * | | 11 12 13 14 + * | | 15 16 17 18 + * | | 19 1a 1b 1c + * | | 1d 1e 1f 20 + * | | 21 22 23 24 + * | | 25 26 27 28 + * | | 29 2a 2b 2c + * | | + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10::/128 + * | | - 11::/128 + * | | - 10::5/64 + * | | - 10::6/48 + * | | - Flags = 136 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (29); + + Ptr ptlv1 = Create (); + ptlv1->SetType (1); + packet->TlvPushBack (ptlv1); + + Ptr m1 = Create (); + m1->SetType (1); + + Ptr m1tlv1 = Create (); + m1tlv1->SetType (1); + m1->TlvPushBack (m1tlv1); + packet->MessagePushBack (m1); + + Ptr m2 = Create (); + m2->SetType (2); + m2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + m2->SetHopLimit (255); + m2->SetHopCount (1); + m2->SetSequenceNumber (12345); + + Ptr m2a1 = Create (); + m2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + m2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + m2->AddressBlockPushBack (m2a1); + + Ptr m2a2 = Create (); + m2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + m2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + m2a2->AddressPushBack (Ipv4Address ("10.0.0.5")); + m2a2->AddressPushBack (Ipv4Address ("10.0.0.6")); + m2a2->PrefixPushBack (32); + m2a2->PrefixPushBack (32); + m2a2->PrefixPushBack (16); + m2a2->PrefixPushBack (24); + + Ptr m2a2tlv1 = Create (); + m2a2tlv1->SetType (1); + m2a2tlv1->SetIndexStart (1); + m2a2tlv1->SetIndexStop (3); + + uint8_t value[] = { + 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, + 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, + 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, + 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, + 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, + 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, + 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, + 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, + 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, + 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, + 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, + 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, + 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, + 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, + 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, + 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, + 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, + 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, + 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, + 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, + 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, + 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, + 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, + 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, + 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, + 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xfe, 0x00, + 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, + 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, + }; + m2a2tlv1->SetValue (value, sizeof(value)); + m2a2->TlvPushBack (m2a2tlv1); + + m2->AddressBlockPushBack (m2a2); + packet->MessagePushBack (m2); + + Ptr m3 = Create (); + m3->SetType (1); + m3->SetOriginatorAddress (Ipv6Address ("abcd::1")); + + Ptr m3a1 = Create (); + m3a1->AddressPushBack (Ipv6Address ("10::2")); + m3a1->AddressPushBack (Ipv6Address ("10::11:2")); + m3->AddressBlockPushBack (m3a1); + + Ptr m3a2 = Create (); + m3a2->AddressPushBack (Ipv6Address ("10::")); + m3a2->AddressPushBack (Ipv6Address ("11::")); + m3a2->AddressPushBack (Ipv6Address ("10::5")); + m3a2->AddressPushBack (Ipv6Address ("10::6")); + m3a2->PrefixPushBack (128); + m3a2->PrefixPushBack (128); + m3a2->PrefixPushBack (64); + m3a2->PrefixPushBack (48); + + m3->AddressBlockPushBack (m3a2); + packet->MessagePushBack (m3); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x1d, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x0f, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x01, 0x64, 0x0a, + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x04, 0x08, 0x0a, + 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x05, 0x0a, + 0x00, 0x00, 0x06, 0x20, + 0x20, 0x10, 0x18, 0x01, + 0x32, 0x01, 0x38, 0x01, + 0x03, 0x01, 0x2c, 0x00, + 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, + 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, + 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, 0x33, 0x34, + 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x3b, 0x3c, + 0x3d, 0x3e, 0x3f, 0x40, + 0x41, 0x42, 0x43, 0x44, + 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x4b, 0x4c, + 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0x53, 0x54, + 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x5b, 0x5c, + 0x5d, 0x5e, 0x5f, 0x60, + 0x61, 0x62, 0x63, 0x64, + 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x6b, 0x6c, + 0x6d, 0x6e, 0x6f, 0x70, + 0x71, 0x72, 0x73, 0x74, + 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x7b, 0x7c, + 0x7d, 0x7e, 0x7f, 0x80, + 0x81, 0x82, 0x83, 0x84, + 0x85, 0x86, 0x87, 0x88, + 0x89, 0x8a, 0x8b, 0x8c, + 0x8d, 0x8e, 0x8f, 0x90, + 0x91, 0x92, 0x93, 0x94, + 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0x9b, 0x9c, + 0x9d, 0x9e, 0x9f, 0xa0, + 0xa1, 0xa2, 0xa3, 0xa4, + 0xa5, 0xa6, 0xa7, 0xa8, + 0xa9, 0xaa, 0xab, 0xac, + 0xad, 0xae, 0xaf, 0xb0, + 0xb1, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, + 0xb9, 0xba, 0xbb, 0xbc, + 0xbd, 0xbe, 0xbf, 0xc0, + 0xc1, 0xc2, 0xc3, 0xc4, + 0xc5, 0xc6, 0xc7, 0xc8, + 0xc9, 0xca, 0xcb, 0xcc, + 0xcd, 0xce, 0xcf, 0xd0, + 0xd1, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, + 0xd9, 0xda, 0xdb, 0xdc, + 0xdd, 0xde, 0xdf, 0xe0, + 0xe1, 0xe2, 0xe3, 0xe4, + 0xe5, 0xe6, 0xe7, 0xe8, + 0xe9, 0xea, 0xeb, 0xec, + 0xed, 0xee, 0xef, 0xf0, + 0xf1, 0xf2, 0xf3, 0xf4, + 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa, 0xfb, 0xfc, + 0xfd, 0xfe, 0x00, 0x01, + 0x02, 0x03, 0x04, 0x05, + 0x06, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x10, 0x11, + 0x12, 0x13, 0x14, 0x15, + 0x16, 0x17, 0x18, 0x19, + 0x1a, 0x1b, 0x1c, 0x1d, + 0x1e, 0x1f, 0x20, 0x21, + 0x22, 0x23, 0x24, 0x25, + 0x26, 0x27, 0x28, 0x29, + 0x2a, 0x2b, 0x2c, 0x01, + 0x8f, 0x00, 0x73, 0xab, + 0xcd, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, + 0x00, 0x02, 0xc0, 0x0d, + 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x02, + 0x00, 0x11, 0x00, 0x00, + 0x04, 0x88, 0x01, 0x00, + 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x05, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, + 0x80, 0x80, 0x40, 0x30, + 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("36", packet, buffer, sizeof(buffer))); + } + + /* Test 37 + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 30 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 56 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = 00 01 02 03 + * | | 04 05 06 07 + * | | 08 09 0a 0b + * | | 0c 0d 0e 0f + * | | 10 11 12 13 + * | | 14 15 16 17 + * | | 18 19 1a 1b + * | | 1c 1d 1e 1f + * | | 20 21 22 23 + * | | 24 25 26 27 + * | | 28 29 2a 2b + * | | 2c 2d 2e 2f + * | | 30 31 32 33 + * | | 34 35 36 37 + * | | 38 39 3a 3b + * | | 3c 3d 3e 3f + * | | 40 41 42 43 + * | | 44 45 46 47 + * | | 48 49 4a 4b + * | | 4c 4d 4e 4f + * | | 50 51 52 53 + * | | 54 55 56 57 + * | | 58 59 5a 5b + * | | 5c 5d 5e 5f + * | | 60 61 62 63 + * | | 64 65 66 67 + * | | 68 69 6a 6b + * | | 6c 6d 6e 6f + * | | 70 71 72 73 + * | | 74 75 76 77 + * | | 78 79 7a 7b + * | | 7c 7d 7e 7f + * | | 80 81 82 83 + * | | 84 85 86 87 + * | | 88 89 8a 8b + * | | 8c 8d 8e 8f + * | | 90 91 92 93 + * | | 94 95 96 97 + * | | 98 99 9a 9b + * | | 9c 9d 9e 9f + * | | a0 a1 a2 a3 + * | | a4 a5 a6 a7 + * | | a8 a9 aa ab + * | | ac ad ae af + * | | b0 b1 b2 b3 + * | | b4 b5 b6 b7 + * | | b8 b9 ba bb + * | | bc bd be bf + * | | c0 c1 c2 c3 + * | | c4 c5 c6 c7 + * | | c8 c9 ca cb + * | | cc cd ce cf + * | | d0 d1 d2 d3 + * | | d4 d5 d6 d7 + * | | d8 d9 da db + * | | dc dd de df + * | | e0 e1 e2 e3 + * | | e4 e5 e6 e7 + * | | e8 e9 ea eb + * | | ec ed ee ef + * | | f0 f1 f2 f3 + * | | f4 f5 f6 f7 + * | | f8 f9 fa fb + * | | fc fd fe 00 + * | | 01 02 03 04 + * | | 05 06 07 08 + * | | 09 0a 0b 0c + * | | 0d 0e 0f 10 + * | | 11 12 13 14 + * | | 15 16 17 18 + * | | 19 1a 1b 1c + * | | 1d 1e 1f 20 + * | | 21 22 23 24 + * | | 25 26 27 28 + * | | 29 2a 2b 2c + * | | + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10::/128 + * | | - 11::/128 + * | | - 10::5/64 + * | | - 10::6/48 + * | | - Flags = 136 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ + */ + { + Ptr packet = Create (); + packet->SetSequenceNumber (30); + + Ptr ptlv1 = Create (); + ptlv1->SetType (1); + packet->TlvPushBack (ptlv1); + + Ptr m1 = Create (); + m1->SetType (1); + + Ptr m1tlv1 = Create (); + m1tlv1->SetType (1); + m1->TlvPushBack (m1tlv1); + packet->MessagePushBack (m1); + + Ptr m2 = Create (); + m2->SetType (2); + m2->SetOriginatorAddress (Ipv4Address ("10.0.0.1")); + m2->SetHopLimit (255); + m2->SetHopCount (1); + m2->SetSequenceNumber (12345); + + Ptr m2a1 = Create (); + m2a1->AddressPushBack (Ipv4Address ("10.0.0.2")); + m2a1->AddressPushBack (Ipv4Address ("10.1.1.2")); + m2->AddressBlockPushBack (m2a1); + + Ptr m2a2 = Create (); + m2a2->AddressPushBack (Ipv4Address ("10.0.0.0")); + m2a2->AddressPushBack (Ipv4Address ("11.0.0.0")); + m2a2->AddressPushBack (Ipv4Address ("10.0.0.5")); + m2a2->AddressPushBack (Ipv4Address ("10.0.0.6")); + m2a2->PrefixPushBack (32); + m2a2->PrefixPushBack (32); + m2a2->PrefixPushBack (16); + m2a2->PrefixPushBack (24); + + Ptr m2a2tlv1 = Create (); + m2a2tlv1->SetType (1); + m2a2tlv1->SetIndexStart (1); + m2a2tlv1->SetIndexStop (3); + + uint8_t value[] = { + 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, + 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, + 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, + 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, + 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, + 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, + 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, + 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, + 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, + 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, + 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, + 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, + 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, + 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, + 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, + 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, + 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, + 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, + 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, + 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, + 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, + 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, + 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, + 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, + 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, + 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xfe, 0x00, + 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, + 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, + }; + m2a2tlv1->SetValue (value, sizeof(value)); + m2a2->TlvPushBack (m2a2tlv1); + + m2->AddressBlockPushBack (m2a2); + packet->MessagePushBack (m2); + + Ptr m3 = Create (); + m3->SetType (1); + m3->SetOriginatorAddress (Ipv6Address ("abcd::1")); + + Ptr m3a1 = Create (); + m3a1->AddressPushBack (Ipv6Address ("10::2")); + m3a1->AddressPushBack (Ipv6Address ("10::11:2")); + m3->AddressBlockPushBack (m3a1); + + Ptr m3a2 = Create (); + m3a2->AddressPushBack (Ipv6Address ("10::")); + m3a2->AddressPushBack (Ipv6Address ("11::")); + m3a2->AddressPushBack (Ipv6Address ("10::5")); + m3a2->AddressPushBack (Ipv6Address ("10::6")); + m3a2->PrefixPushBack (128); + m3a2->PrefixPushBack (128); + m3a2->PrefixPushBack (64); + m3a2->PrefixPushBack (48); + + m3->AddressBlockPushBack (m3a2); + packet->MessagePushBack (m3); + + uint8_t buffer[] = { + 0x0c, 0x00, 0x1e, 0x00, + 0x02, 0x01, 0x00, 0x01, + 0x0f, 0x00, 0x08, 0x00, + 0x02, 0x01, 0x00, 0x02, + 0xf3, 0x01, 0x64, 0x0a, + 0x00, 0x00, 0x01, 0xff, + 0x01, 0x30, 0x39, 0x00, + 0x00, 0x02, 0xc0, 0x01, + 0x0a, 0x01, 0x02, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x00, 0x04, 0x08, 0x0a, + 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x05, 0x0a, + 0x00, 0x00, 0x06, 0x20, + 0x20, 0x10, 0x18, 0x01, + 0x32, 0x01, 0x38, 0x01, + 0x03, 0x01, 0x2c, 0x00, + 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, + 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, + 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, 0x33, 0x34, + 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x3b, 0x3c, + 0x3d, 0x3e, 0x3f, 0x40, + 0x41, 0x42, 0x43, 0x44, + 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x4b, 0x4c, + 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0x53, 0x54, + 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x5b, 0x5c, + 0x5d, 0x5e, 0x5f, 0x60, + 0x61, 0x62, 0x63, 0x64, + 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x6b, 0x6c, + 0x6d, 0x6e, 0x6f, 0x70, + 0x71, 0x72, 0x73, 0x74, + 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x7b, 0x7c, + 0x7d, 0x7e, 0x7f, 0x80, + 0x81, 0x82, 0x83, 0x84, + 0x85, 0x86, 0x87, 0x88, + 0x89, 0x8a, 0x8b, 0x8c, + 0x8d, 0x8e, 0x8f, 0x90, + 0x91, 0x92, 0x93, 0x94, + 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0x9b, 0x9c, + 0x9d, 0x9e, 0x9f, 0xa0, + 0xa1, 0xa2, 0xa3, 0xa4, + 0xa5, 0xa6, 0xa7, 0xa8, + 0xa9, 0xaa, 0xab, 0xac, + 0xad, 0xae, 0xaf, 0xb0, + 0xb1, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, + 0xb9, 0xba, 0xbb, 0xbc, + 0xbd, 0xbe, 0xbf, 0xc0, + 0xc1, 0xc2, 0xc3, 0xc4, + 0xc5, 0xc6, 0xc7, 0xc8, + 0xc9, 0xca, 0xcb, 0xcc, + 0xcd, 0xce, 0xcf, 0xd0, + 0xd1, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, + 0xd9, 0xda, 0xdb, 0xdc, + 0xdd, 0xde, 0xdf, 0xe0, + 0xe1, 0xe2, 0xe3, 0xe4, + 0xe5, 0xe6, 0xe7, 0xe8, + 0xe9, 0xea, 0xeb, 0xec, + 0xed, 0xee, 0xef, 0xf0, + 0xf1, 0xf2, 0xf3, 0xf4, + 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa, 0xfb, 0xfc, + 0xfd, 0xfe, 0x00, 0x01, + 0x02, 0x03, 0x04, 0x05, + 0x06, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x10, 0x11, + 0x12, 0x13, 0x14, 0x15, + 0x16, 0x17, 0x18, 0x19, + 0x1a, 0x1b, 0x1c, 0x1d, + 0x1e, 0x1f, 0x20, 0x21, + 0x22, 0x23, 0x24, 0x25, + 0x26, 0x27, 0x28, 0x29, + 0x2a, 0x2b, 0x2c, 0x01, + 0x8f, 0x00, 0x73, 0xab, + 0xcd, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, + 0x00, 0x02, 0xc0, 0x0d, + 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x02, + 0x00, 0x11, 0x00, 0x00, + 0x04, 0x88, 0x01, 0x00, + 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x05, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, + 0x80, 0x80, 0x40, 0x30, + 0x00, 0x00, + }; + AddTestCase (new PbbTestCase ("37", packet, buffer, sizeof(buffer))); + } +} + +PbbTestSuite pbbTestSuite; diff --git a/src/node/packetbb.cc b/src/node/packetbb.cc new file mode 100644 index 000000000..27292f253 --- /dev/null +++ b/src/node/packetbb.cc @@ -0,0 +1,2873 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* vim: set ts=2 sw=2 sta expandtab ai si cin: */ +/* + * Copyright (c) 2009 Drexel University + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Tom Wambold + */ +/* These classes implement RFC 5444 - The Generalized Mobile Ad Hoc Network + * (MANET) Packet/PbbMessage Format + * See: http://tools.ietf.org/html/rfc5444 for details */ + +#include "ns3/ipv4-address.h" +#include "ns3/ipv6-address.h" +#include "ns3/assert.h" + +#include "packetbb.h" + +static const uint8_t VERSION = 0; +/* Packet flags */ +static const uint8_t PHAS_SEQ_NUM = 0x8; +static const uint8_t PHAS_TLV = 0x4; + +/* PbbMessage flags */ +static const uint8_t MHAS_ORIG = 0x80; +static const uint8_t MHAS_HOP_LIMIT = 0x40; +static const uint8_t MHAS_HOP_COUNT = 0x20; +static const uint8_t MHAS_SEQ_NUM = 0x10; + +/* Address block flags */ +static const uint8_t AHAS_HEAD = 0x80; +static const uint8_t AHAS_FULL_TAIL = 0x40; +static const uint8_t AHAS_ZERO_TAIL = 0x20; +static const uint8_t AHAS_SINGLE_PRE_LEN = 0x10; +static const uint8_t AHAS_MULTI_PRE_LEN = 0x08; + +/* TLV Flags */ +static const uint8_t THAS_TYPE_EXT = 0x80; +static const uint8_t THAS_SINGLE_INDEX = 0x40; +static const uint8_t THAS_MULTI_INDEX = 0x20; +static const uint8_t THAS_VALUE = 0x10; +static const uint8_t THAS_EXT_LEN = 0x08; +static const uint8_t TIS_MULTIVALUE = 0x04; + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (PbbPacket); + +PbbTlvBlock::PbbTlvBlock (void) +{ + return; +} + +PbbTlvBlock::~PbbTlvBlock (void) +{ + Clear (); +} + +PbbTlvBlock::Iterator +PbbTlvBlock::Begin (void) +{ + return m_tlvList.begin (); +} + +PbbTlvBlock::ConstIterator +PbbTlvBlock::Begin (void) const +{ + return m_tlvList.begin (); +} + +PbbTlvBlock::Iterator +PbbTlvBlock::End (void) +{ + return m_tlvList.end (); +} + +PbbTlvBlock::ConstIterator +PbbTlvBlock::End (void) const +{ + return m_tlvList.end (); +} + +int +PbbTlvBlock::Size (void) const +{ + return m_tlvList.size (); +} + +bool +PbbTlvBlock::Empty (void) const +{ + return m_tlvList.empty (); +} + +Ptr +PbbTlvBlock::Front (void) const +{ + return m_tlvList.front (); +} + +Ptr +PbbTlvBlock::Back (void) const +{ + return m_tlvList.back (); +} + +void +PbbTlvBlock::PushFront (Ptr tlv) +{ + m_tlvList.push_front (tlv); +} + +void +PbbTlvBlock::PopFront (void) +{ + m_tlvList.pop_front (); +} + +void +PbbTlvBlock::PushBack (Ptr tlv) +{ + m_tlvList.push_back (tlv); +} + +void +PbbTlvBlock::PopBack (void) +{ + m_tlvList.pop_back (); +} + +PbbTlvBlock::Iterator +PbbTlvBlock::Insert (PbbTlvBlock::Iterator position, const Ptr tlv) +{ + return m_tlvList.insert (position, tlv); +} + +PbbTlvBlock::Iterator +PbbTlvBlock::Erase (PbbTlvBlock::Iterator position) +{ + return m_tlvList.erase (position); +} + +PbbTlvBlock::Iterator +PbbTlvBlock::Erase (PbbTlvBlock::Iterator first, PbbTlvBlock::Iterator last) +{ + return m_tlvList.erase (first, last); +} + +void +PbbTlvBlock::Clear (void) +{ + for (Iterator iter = Begin (); iter != End (); iter++) + { + *iter = 0; + } + m_tlvList.clear (); +} + +uint32_t +PbbTlvBlock::GetSerializedSize (void) const +{ + /* tlv size */ + uint32_t size = 2; + for (ConstIterator iter = Begin (); iter != End (); iter++) + { + size += (*iter)->GetSerializedSize (); + } + return size; +} + +void +PbbTlvBlock::Serialize (Buffer::Iterator &start) const +{ + if (Empty ()) + { + start.WriteHtonU16 (0); + return; + } + + /* We need to write the size of the TLV block in front, so save its + * position. */ + Buffer::Iterator tlvsize = start; + start.Next (2); + for (ConstIterator iter = Begin (); iter != End (); iter++) + { + (*iter)->Serialize (start); + } + /* - 2 to not include the size field */ + uint16_t size = start.GetDistanceFrom (tlvsize) - 2; + tlvsize.WriteHtonU16 (size); +} + +void +PbbTlvBlock::Deserialize (Buffer::Iterator &start) +{ + uint16_t size = start.ReadNtohU16 (); + + Buffer::Iterator tlvstart = start; + if (size > 0) + { + while (start.GetDistanceFrom (tlvstart) < size) + { + Ptr newtlv = Create (); + newtlv->Deserialize (start); + PushBack (newtlv); + } + } +} + +void +PbbTlvBlock::Print (std::ostream &os) const +{ + Print (os, 0); +} + +void +PbbTlvBlock::Print (std::ostream &os, int level) const +{ + std::string prefix = ""; + for (int i = 0; i < level; i++) + { + prefix.append("\t"); + } + + os << prefix << "TLV Block {" << std::endl; + os << prefix << "\tsize = " << Size () << std::endl; + os << prefix << "\tmembers [" << std::endl; + + for (ConstIterator iter = Begin (); iter != End (); iter++) + { + (*iter)->Print (os, level+2); + } + + os << prefix << "\t]" << std::endl; + os << prefix << "}" << std::endl; +} + +bool +PbbTlvBlock::operator== (const PbbTlvBlock &other) const +{ + if (Size () != other.Size ()) + { + return false; + } + + ConstIterator ti, oi; + for (ti = Begin (), oi = other.Begin (); + ti != End () && oi != other.End (); + ti++, oi++) + { + if (**ti != **oi) + { + return false; + } + } + return true; +} + +bool +PbbTlvBlock::operator!= (const PbbTlvBlock &other) const +{ + return !(*this == other); +} + +/* End PbbTlvBlock class */ + +PbbAddressTlvBlock::PbbAddressTlvBlock (void) +{ + return; +} + +PbbAddressTlvBlock::~PbbAddressTlvBlock (void) +{ + Clear (); +} + +PbbAddressTlvBlock::Iterator +PbbAddressTlvBlock::Begin (void) +{ + return m_tlvList.begin (); +} + +PbbAddressTlvBlock::ConstIterator +PbbAddressTlvBlock::Begin (void) const +{ + return m_tlvList.begin (); +} + +PbbAddressTlvBlock::Iterator +PbbAddressTlvBlock::End (void) +{ + return m_tlvList.end (); +} + +PbbAddressTlvBlock::ConstIterator +PbbAddressTlvBlock::End (void) const +{ + return m_tlvList.end (); +} + +int +PbbAddressTlvBlock::Size (void) const +{ + return m_tlvList.size (); +} + +bool +PbbAddressTlvBlock::Empty (void) const +{ + return m_tlvList.empty (); +} + +Ptr +PbbAddressTlvBlock::Front (void) const +{ + return m_tlvList.front (); +} + +Ptr +PbbAddressTlvBlock::Back (void) const +{ + return m_tlvList.back (); +} + +void +PbbAddressTlvBlock::PushFront (Ptr tlv) +{ + m_tlvList.push_front (tlv); +} + +void +PbbAddressTlvBlock::PopFront (void) +{ + m_tlvList.pop_front (); +} + +void +PbbAddressTlvBlock::PushBack (Ptr tlv) +{ + m_tlvList.push_back (tlv); +} + +void +PbbAddressTlvBlock::PopBack (void) +{ + m_tlvList.pop_back (); +} + +PbbAddressTlvBlock::Iterator +PbbAddressTlvBlock::Insert (PbbAddressTlvBlock::Iterator position, const Ptr tlv) +{ + return m_tlvList.insert (position, tlv); +} + +PbbAddressTlvBlock::Iterator +PbbAddressTlvBlock::Erase (PbbAddressTlvBlock::Iterator position) +{ + return m_tlvList.erase (position); +} + +PbbAddressTlvBlock::Iterator +PbbAddressTlvBlock::Erase (PbbAddressTlvBlock::Iterator first, PbbAddressTlvBlock::Iterator last) +{ + return m_tlvList.erase (first, last); +} + +void +PbbAddressTlvBlock::Clear (void) +{ + for (Iterator iter = Begin (); iter != End (); iter++) + { + *iter = 0; + } + m_tlvList.clear (); +} + +uint32_t +PbbAddressTlvBlock::GetSerializedSize (void) const +{ + /* tlv size */ + uint32_t size = 2; + for (ConstIterator iter = Begin (); iter != End (); iter++) + { + size += (*iter)->GetSerializedSize (); + } + return size; +} + +void +PbbAddressTlvBlock::Serialize (Buffer::Iterator &start) const +{ + if (Empty ()) + { + start.WriteHtonU16 (0); + return; + } + + /* We need to write the size of the TLV block in front, so save its + * position. */ + Buffer::Iterator tlvsize = start; + start.Next (2); + for (ConstIterator iter = Begin (); iter != End (); iter++) + { + (*iter)->Serialize (start); + } + /* - 2 to not include the size field */ + uint16_t size = start.GetDistanceFrom (tlvsize) - 2; + tlvsize.WriteHtonU16 (size); +} + +void +PbbAddressTlvBlock::Deserialize (Buffer::Iterator &start) +{ + uint16_t size = start.ReadNtohU16 (); + + Buffer::Iterator tlvstart = start; + if (size > 0) + { + while (start.GetDistanceFrom (tlvstart) < size) + { + Ptr newtlv = Create (); + newtlv->Deserialize (start); + PushBack (newtlv); + } + } +} + +void +PbbAddressTlvBlock::Print (std::ostream &os) const +{ + Print (os, 0); +} + +void +PbbAddressTlvBlock::Print (std::ostream &os, int level) const +{ + std::string prefix = ""; + for (int i = 0; i < level; i++) + { + prefix.append("\t"); + } + + os << prefix << "TLV Block {" << std::endl; + os << prefix << "\tsize = " << Size () << std::endl; + os << prefix << "\tmembers [" << std::endl; + + for (ConstIterator iter = Begin (); iter != End (); iter++) + { + (*iter)->Print (os, level+2); + } + + os << prefix << "\t]" << std::endl; + os << prefix << "}" << std::endl; +} + +bool +PbbAddressTlvBlock::operator== (const PbbAddressTlvBlock &other) const +{ + if (Size () != other.Size ()) + { + return false; + } + + ConstIterator it, ot; + for (it = Begin (), ot = other.Begin (); + it != End () && ot != other.End (); + it++, ot++) + { + if (**it != **ot) + { + return false; + } + } + return true; +} + +bool +PbbAddressTlvBlock::operator!= (const PbbAddressTlvBlock &other) const +{ + return !(*this == other); +} + + +/* End PbbAddressTlvBlock Class */ + +PbbPacket::PbbPacket (void) +{ + m_refCount = 1; + m_version = VERSION; + m_hasseqnum = false; +} + +PbbPacket::~PbbPacket (void) +{ + MessageClear (); +} + +uint8_t +PbbPacket::GetVersion (void) const +{ + return m_version; +} + +void +PbbPacket::SetSequenceNumber (uint16_t number) +{ + m_seqnum = number; + m_hasseqnum = true; +} + +uint16_t +PbbPacket::GetSequenceNumber (void) const +{ + NS_ASSERT (HasSequenceNumber ()); + return m_seqnum; +} + +bool +PbbPacket::HasSequenceNumber (void) const +{ + return m_hasseqnum; +} + +/* Manipulating Packet TLVs */ + +PbbPacket::TlvIterator +PbbPacket::TlvBegin (void) +{ + return m_tlvList.Begin (); +} + +PbbPacket::ConstTlvIterator +PbbPacket::TlvBegin (void) const +{ + return m_tlvList.Begin (); +} + +PbbPacket::TlvIterator +PbbPacket::TlvEnd (void) +{ + return m_tlvList.End (); +} + +PbbPacket::ConstTlvIterator +PbbPacket::TlvEnd (void) const +{ + return m_tlvList.End (); +} + +int +PbbPacket::TlvSize (void) const +{ + return m_tlvList.Size (); +} + +bool +PbbPacket::TlvEmpty (void) const +{ + return m_tlvList.Empty (); +} + +Ptr +PbbPacket::TlvFront (void) +{ + return m_tlvList.Front (); +} + +const Ptr +PbbPacket::TlvFront (void) const +{ + return m_tlvList.Front (); +} + +Ptr +PbbPacket::TlvBack (void) +{ + return m_tlvList.Back (); +} + +const Ptr +PbbPacket::TlvBack (void) const +{ + return m_tlvList.Back (); +} + +void +PbbPacket::TlvPushFront (Ptr tlv) +{ + m_tlvList.PushFront (tlv); +} + +void +PbbPacket::TlvPopFront (void) +{ + m_tlvList.PopFront (); +} + +void +PbbPacket::TlvPushBack (Ptr tlv) +{ + m_tlvList.PushBack (tlv); +} + +void +PbbPacket::TlvPopBack (void) +{ + m_tlvList.PopBack (); +} + +PbbPacket::TlvIterator +PbbPacket::Erase (PbbPacket::TlvIterator position) +{ + return m_tlvList.Erase (position); +} + +PbbPacket::TlvIterator +PbbPacket::Erase (PbbPacket::TlvIterator first, PbbPacket::TlvIterator last) +{ + return m_tlvList.Erase (first, last); +} + +void +PbbPacket::TlvClear (void) +{ + m_tlvList.Clear (); +} + +/* Manipulating Packet Messages */ + +PbbPacket::MessageIterator +PbbPacket::MessageBegin (void) +{ + return m_messageList.begin (); +} + +PbbPacket::ConstMessageIterator +PbbPacket::MessageBegin (void) const +{ + return m_messageList.begin (); +} + +PbbPacket::MessageIterator +PbbPacket::MessageEnd (void) +{ + return m_messageList.end (); +} + +PbbPacket::ConstMessageIterator +PbbPacket::MessageEnd (void) const +{ + return m_messageList.end (); +} + +int +PbbPacket::MessageSize (void) const +{ + return m_messageList.size (); +} + +bool +PbbPacket::MessageEmpty (void) const +{ + return m_messageList.empty (); +} + +Ptr +PbbPacket::MessageFront (void) +{ + return m_messageList.front (); +} + +const Ptr +PbbPacket::MessageFront (void) const +{ + return m_messageList.front (); +} + +Ptr +PbbPacket::MessageBack (void) +{ + return m_messageList.back (); +} + +const Ptr +PbbPacket::MessageBack (void) const +{ + return m_messageList.back (); +} + +void +PbbPacket::MessagePushFront (Ptr tlv) +{ + m_messageList.push_front (tlv); +} + +void +PbbPacket::MessagePopFront (void) +{ + m_messageList.pop_front (); +} + +void +PbbPacket::MessagePushBack (Ptr tlv) +{ + m_messageList.push_back (tlv); +} + +void +PbbPacket::MessagePopBack (void) +{ + m_messageList.pop_back (); +} + +PbbPacket::MessageIterator +PbbPacket::Erase (PbbPacket::MessageIterator position) +{ + return m_messageList.erase (position); +} + +PbbPacket::MessageIterator +PbbPacket::Erase (PbbPacket::MessageIterator first, + PbbPacket::MessageIterator last) +{ + return m_messageList.erase (first, last); +} + +void +PbbPacket::MessageClear (void) +{ + for (MessageIterator iter = MessageBegin (); iter != MessageEnd (); iter++) + { + *iter = 0; + } + m_messageList.clear (); +} + +void +PbbPacket::Ref (void) const +{ + m_refCount++; +} + +void +PbbPacket::Unref (void) const +{ + m_refCount--; + if (m_refCount == 0) + { + delete this; + } +} + +TypeId +PbbPacket::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::PbbPacket") + .SetParent
    () + .AddConstructor () + ; + return tid; +} + +TypeId +PbbPacket::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} + +uint32_t +PbbPacket::GetSerializedSize (void) const +{ + /* Version number + flags */ + uint32_t size = 1; + + if (HasSequenceNumber()) + { + size += 2; + } + + if (!TlvEmpty ()) + { + size += m_tlvList.GetSerializedSize (); + } + + for (ConstMessageIterator iter = MessageBegin (); + iter != MessageEnd (); + iter++) + { + size += (*iter)->GetSerializedSize (); + } + + return size; +} + +void +PbbPacket::Serialize (Buffer::Iterator start) const +{ + /* We remember the start, so we can write the flags after we check for a + * sequence number and TLV. */ + Buffer::Iterator bufref = start; + start.Next (); + + uint8_t flags = VERSION; + /* Make room for 4 bit flags */ + flags <<= 4; + + if (HasSequenceNumber ()) + { + flags |= PHAS_SEQ_NUM; + start.WriteHtonU16 (GetSequenceNumber ()); + } + + if (!TlvEmpty ()) + { + flags |= PHAS_TLV; + m_tlvList.Serialize (start); + } + + bufref.WriteU8(flags); + + for (ConstMessageIterator iter = MessageBegin (); + iter != MessageEnd (); + iter++) + { + (*iter)->Serialize (start); + } +} + +uint32_t +PbbPacket::Deserialize (Buffer::Iterator start) +{ + Buffer::Iterator begin = start; + + uint8_t flags = start.ReadU8 (); + + if (flags & PHAS_SEQ_NUM) + { + SetSequenceNumber (start.ReadNtohU16 ()); + } + + if (flags & PHAS_TLV) + { + m_tlvList.Deserialize (start); + } + + while (!start.IsEnd()) + { + Ptr newmsg = PbbMessage::DeserializeMessage (start); + if (newmsg == 0) + { + return start.GetDistanceFrom (begin); + } + MessagePushBack (newmsg); + } + + flags >>= 4; + m_version = flags; + + return start.GetDistanceFrom (begin); +} + +void +PbbPacket::Print (std::ostream &os) const +{ + os << "PbbPacket {" << std::endl; + + if (HasSequenceNumber ()) + { + os << "\tsequence number = " << GetSequenceNumber (); + } + + os << std::endl; + + m_tlvList.Print (os, 1); + + for (ConstMessageIterator iter = MessageBegin (); + iter != MessageEnd (); + iter++) + { + (*iter)->Print (os, 1); + } + + os << "}" << std::endl; +} + +bool +PbbPacket::operator== (const PbbPacket &other) const +{ + if (GetVersion () != other.GetVersion ()) + { + return false; + } + + if (HasSequenceNumber () != other.HasSequenceNumber ()) + { + return false; + } + + if (HasSequenceNumber ()) + { + if (GetSequenceNumber () != other.GetSequenceNumber ()) + return false; + } + + if (m_tlvList != other.m_tlvList) + { + return false; + } + + if (MessageSize () != other.MessageSize ()) + { + return false; + } + + ConstMessageIterator tmi, omi; + for (tmi = MessageBegin (), omi = other.MessageBegin (); + tmi != MessageEnd () && omi != other.MessageEnd (); + tmi++, omi++) + { + if (**tmi != **omi) + { + return false; + } + } + return true; +} + +bool +PbbPacket::operator!= (const PbbPacket &other) const +{ + return !(*this == other); +} + +/* End PbbPacket class */ + +PbbMessage::PbbMessage () +{ + m_refCount = 1; + /* Default to IPv4 */ + m_addrSize = IPV4; + m_hasOriginatorAddress = false; + m_hasHopLimit = false; + m_hasHopCount = false; + m_hasSequenceNumber = false; +} + +PbbMessage::~PbbMessage () +{ + AddressBlockClear (); +} + +void +PbbMessage::SetType (uint8_t type) +{ + m_type = type; +} + +uint8_t +PbbMessage::GetType (void) const +{ + return m_type; +} + +PbbAddressLength +PbbMessage::GetAddressLength (void) const +{ + return m_addrSize; +} + +void +PbbMessage::SetOriginatorAddress (Address address) +{ + m_originatorAddress = address; + m_hasOriginatorAddress = true; +} + +Address +PbbMessage::GetOriginatorAddress (void) const +{ + NS_ASSERT (HasOriginatorAddress ()); + return m_originatorAddress; +} + +bool +PbbMessage::HasOriginatorAddress (void) const +{ + return m_hasOriginatorAddress; +} + +void +PbbMessage::SetHopLimit (uint8_t hopLimit) +{ + m_hopLimit = hopLimit; + m_hasHopLimit = true; +} + +uint8_t +PbbMessage::GetHopLimit (void) const +{ + NS_ASSERT (HasHopLimit ()); + return m_hopLimit; +} + +bool +PbbMessage::HasHopLimit (void) const +{ + return m_hasHopLimit; +} + +void +PbbMessage::SetHopCount (uint8_t hopCount) +{ + m_hopCount = hopCount; + m_hasHopCount = true; +} + +uint8_t +PbbMessage::GetHopCount (void) const +{ + NS_ASSERT (HasHopCount ()); + return m_hopCount; +} + +bool +PbbMessage::HasHopCount (void) const +{ + return m_hasHopCount; +} + +void +PbbMessage::SetSequenceNumber (uint16_t sequenceNumber) +{ + m_sequenceNumber = sequenceNumber; + m_hasSequenceNumber = true; +} + +uint16_t +PbbMessage::GetSequenceNumber (void) const +{ + NS_ASSERT (HasSequenceNumber ()); + return m_sequenceNumber; +} + +bool +PbbMessage::HasSequenceNumber (void) const +{ + return m_hasSequenceNumber; +} + +/* Manipulating PbbMessage TLVs */ + +PbbMessage::TlvIterator +PbbMessage::TlvBegin (void) +{ + return m_tlvList.Begin(); +} + +PbbMessage::ConstTlvIterator +PbbMessage::TlvBegin (void) const +{ + return m_tlvList.Begin(); +} + +PbbMessage::TlvIterator +PbbMessage::TlvEnd (void) +{ + return m_tlvList.End(); +} + +PbbMessage::ConstTlvIterator +PbbMessage::TlvEnd (void) const +{ + return m_tlvList.End(); +} + +int +PbbMessage::TlvSize (void) const +{ + return m_tlvList.Size(); +} + +bool +PbbMessage::TlvEmpty (void) const +{ + return m_tlvList.Empty(); +} + +Ptr +PbbMessage::TlvFront (void) +{ + return m_tlvList.Front(); +} + +const Ptr +PbbMessage::TlvFront (void) const +{ + return m_tlvList.Front(); +} + +Ptr +PbbMessage::TlvBack (void) +{ + return m_tlvList.Back(); +} + +const Ptr +PbbMessage::TlvBack (void) const +{ + return m_tlvList.Back(); +} + +void +PbbMessage::TlvPushFront (Ptr tlv) +{ + m_tlvList.PushFront(tlv); +} + +void +PbbMessage::TlvPopFront (void) +{ + m_tlvList.PopFront(); +} + +void +PbbMessage::TlvPushBack (Ptr tlv) +{ + m_tlvList.PushBack(tlv); +} + +void +PbbMessage::TlvPopBack (void) +{ + m_tlvList.PopBack(); +} + +PbbMessage::TlvIterator +PbbMessage::TlvErase (PbbMessage::TlvIterator position) +{ + return m_tlvList.Erase(position); +} + +PbbMessage::TlvIterator +PbbMessage::TlvErase (PbbMessage::TlvIterator first, PbbMessage::TlvIterator last) +{ + return m_tlvList.Erase(first, last); +} + +void +PbbMessage::TlvClear (void) +{ + m_tlvList.Clear(); +} + +/* Manipulating Address Block and Address TLV pairs */ + +PbbMessage::AddressBlockIterator +PbbMessage::AddressBlockBegin (void) +{ + return m_addressBlockList.begin(); +} + +PbbMessage::ConstAddressBlockIterator +PbbMessage::AddressBlockBegin (void) const +{ + return m_addressBlockList.begin(); +} + +PbbMessage::AddressBlockIterator +PbbMessage::AddressBlockEnd (void) +{ + return m_addressBlockList.end(); +} + +PbbMessage::ConstAddressBlockIterator +PbbMessage::AddressBlockEnd (void) const +{ + return m_addressBlockList.end(); +} + +int +PbbMessage::AddressBlockSize (void) const +{ + return m_addressBlockList.size(); +} + +bool +PbbMessage::AddressBlockEmpty (void) const +{ + return m_addressBlockList.empty(); +} + +Ptr +PbbMessage::AddressBlockFront (void) +{ + return m_addressBlockList.front(); +} + +const Ptr +PbbMessage::AddressBlockFront (void) const +{ + return m_addressBlockList.front(); +} + +Ptr +PbbMessage::AddressBlockBack (void) +{ + return m_addressBlockList.back(); +} + +const Ptr +PbbMessage::AddressBlockBack (void) const +{ + return m_addressBlockList.back(); +} + +void +PbbMessage::AddressBlockPushFront (Ptr tlv) +{ + m_addressBlockList.push_front(tlv); +} + +void +PbbMessage::AddressBlockPopFront (void) +{ + m_addressBlockList.pop_front(); +} + +void +PbbMessage::AddressBlockPushBack (Ptr tlv) +{ + m_addressBlockList.push_back(tlv); +} + +void +PbbMessage::AddressBlockPopBack (void) +{ + m_addressBlockList.pop_back(); +} + +PbbMessage::AddressBlockIterator +PbbMessage::AddressBlockErase (PbbMessage::AddressBlockIterator position) +{ + return m_addressBlockList.erase(position); +} + +PbbMessage::AddressBlockIterator +PbbMessage::AddressBlockErase (PbbMessage::AddressBlockIterator first, + PbbMessage::AddressBlockIterator last) +{ + return m_addressBlockList.erase(first, last); +} + +void +PbbMessage::AddressBlockClear (void) +{ + for (AddressBlockIterator iter = AddressBlockBegin (); + iter != AddressBlockEnd (); + iter++) + { + *iter = 0; + } + return m_addressBlockList.clear(); +} + +void +PbbMessage::Ref (void) const +{ + m_refCount++; +} + +void +PbbMessage::Unref (void) const +{ + m_refCount--; + if (m_refCount == 0) + { + delete this; + } +} + +uint32_t +PbbMessage::GetSerializedSize (void) const +{ + /* msg-type + (msg-flags + msg-addr-length) + 2msg-size */ + uint32_t size = 4; + + if (HasOriginatorAddress()) + { + size += GetAddressLength() + 1; + } + + if (HasHopLimit()) + { + size++; + } + + if (HasHopCount()) + { + size++; + } + + if (HasSequenceNumber()) + { + size += 2; + } + + size += m_tlvList.GetSerializedSize (); + + for (ConstAddressBlockIterator iter = AddressBlockBegin (); + iter != AddressBlockEnd (); + iter++) + { + size += (*iter)->GetSerializedSize (); + } + + return size; +} + +void +PbbMessage::Serialize (Buffer::Iterator &start) const +{ + Buffer::Iterator front = start; + + start.WriteU8 (GetType()); + + /* Save a reference to the spot where we will later write the flags */ + Buffer::Iterator bufref = start; + start.Next (1); + + uint8_t flags = 0; + + flags = GetAddressLength (); + + Buffer::Iterator sizeref = start; + start.Next (2); + + if (HasOriginatorAddress ()) + { + flags |= MHAS_ORIG; + SerializeOriginatorAddress (start); + } + + if (HasHopLimit ()) + { + flags |= MHAS_HOP_LIMIT; + start.WriteU8 (GetHopLimit ()); + } + + if (HasHopCount ()) + { + flags |= MHAS_HOP_COUNT; + start.WriteU8 (GetHopCount ()); + } + + if (HasSequenceNumber ()) + { + flags |= MHAS_SEQ_NUM; + start.WriteHtonU16 (GetSequenceNumber ()); + } + + bufref.WriteU8(flags); + + m_tlvList.Serialize (start); + + for (ConstAddressBlockIterator iter = AddressBlockBegin (); + iter != AddressBlockEnd (); + iter++) + { + (*iter)->Serialize (start); + } + + sizeref.WriteHtonU16 (front.GetDistanceFrom (start)); +} + +Ptr +PbbMessage::DeserializeMessage (Buffer::Iterator &start) +{ + /* We need to read the msg-addr-len field to determine what kind of object to + * construct. */ + start.Next (); + uint8_t addrlen = start.ReadU8 (); + start.Prev (2); /* Go back to the start */ + + /* The first four bytes of the flag is the address length. Set the last four + * bytes to 0 to read it. */ + addrlen = (addrlen & 0xf); + + Ptr newmsg; + + switch (addrlen) + { + case 0: + case IPV4: + newmsg = Create (); + break; + case IPV6: + newmsg = Create (); + break; + default: + return 0; + break; + } + newmsg->Deserialize (start); + return newmsg; +} + +void +PbbMessage::Deserialize (Buffer::Iterator &start) +{ + Buffer::Iterator front = start; + SetType (start.ReadU8 ()); + uint8_t flags = start.ReadU8 (); + + uint16_t size = start.ReadNtohU16 (); + + if (flags & MHAS_ORIG) + { + SetOriginatorAddress (DeserializeOriginatorAddress (start)); + } + + if (flags & MHAS_HOP_LIMIT) + { + SetHopLimit (start.ReadU8 ()); + } + + if (flags & MHAS_HOP_COUNT) + { + SetHopCount (start.ReadU8 ()); + } + + if (flags & MHAS_SEQ_NUM) + { + SetSequenceNumber (start.ReadNtohU16 ()); + } + + m_tlvList.Deserialize (start); + + if (size > 0) + { + while (start.GetDistanceFrom(front) < size) + { + Ptr newab = AddressBlockDeserialize (start); + AddressBlockPushBack (newab); + } + } +} + +void +PbbMessage::Print (std::ostream &os) const +{ + Print (os, 0); +} + +void +PbbMessage::Print (std::ostream &os, int level) const +{ + std::string prefix = ""; + for (int i = 0; i < level; i++) + { + prefix.append ("\t"); + } + + os << prefix << "PbbMessage {" << std::endl; + + os << prefix << "\tmessage type = " << (int)GetType () << std::endl; + os << prefix << "\taddress size = " << GetAddressLength () << std::endl; + + if (HasOriginatorAddress ()) + { + os << prefix << "\toriginator address = "; + PrintOriginatorAddress (os); + os << std::endl; + } + + if (HasHopLimit ()) + { + os << prefix << "\thop limit = " << (int)GetHopLimit () << std::endl; + } + + if (HasHopCount ()) + { + os << prefix << "\thop count = " << (int)GetHopCount () << std::endl; + } + + if (HasSequenceNumber ()) + { + os << prefix << "\tseqnum = " << GetSequenceNumber () << std::endl; + } + + m_tlvList.Print (os, level+1); + + for (ConstAddressBlockIterator iter = AddressBlockBegin (); + iter != AddressBlockEnd (); + iter++) + { + (*iter)->Print (os, level+1); + } + os << prefix << "}" << std::endl; +} + +bool +PbbMessage::operator== (const PbbMessage &other) const +{ + if (GetAddressLength () != other.GetAddressLength ()) + { + return false; + } + + if (GetType () != other.GetType ()) + { + return false; + } + + if (HasOriginatorAddress () != other.HasOriginatorAddress ()) + { + return false; + } + + if (HasOriginatorAddress ()) + { + if (GetOriginatorAddress () != other.GetOriginatorAddress ()) + { + return false; + } + } + + if (HasHopLimit () != other.HasHopLimit ()) + { + return false; + } + + if (HasHopLimit ()) + { + if (GetHopLimit () != other.GetHopLimit ()) + { + return false; + } + } + + if (HasHopCount () != other.HasHopCount ()) + { + return false; + } + + if (HasHopCount ()) + { + if (GetHopCount () != other.GetHopCount ()) + { + return false; + } + } + + if (HasSequenceNumber () != other.HasSequenceNumber ()) + { + return false; + } + + if (HasSequenceNumber ()) + { + if (GetSequenceNumber () != other.GetSequenceNumber ()) + { + return false; + } + } + + if (m_tlvList != other.m_tlvList) + { + return false; + } + + if (AddressBlockSize () != other.AddressBlockSize ()) + { + return false; + } + + ConstAddressBlockIterator tai, oai; + for (tai = AddressBlockBegin (), oai = other.AddressBlockBegin (); + tai != AddressBlockEnd () && oai != other.AddressBlockEnd (); + tai++, oai++) + { + if (**tai != **oai) + { + return false; + } + } + return true; +} + +bool +PbbMessage::operator!= (const PbbMessage &other) const +{ + return !(*this == other); +} + +/* End PbbMessage Class */ + +PbbMessageIpv4::PbbMessageIpv4 () +{ +} + +PbbMessageIpv4::~PbbMessageIpv4 () +{ +} + +PbbAddressLength +PbbMessageIpv4::GetAddressLength (void) const +{ + return IPV4; +} + +void +PbbMessageIpv4::SerializeOriginatorAddress (Buffer::Iterator &start) const +{ + uint8_t buffer[GetAddressLength () + 1]; + Ipv4Address::ConvertFrom (GetOriginatorAddress ()).Serialize(buffer); + start.Write (buffer, GetAddressLength () + 1); +} + +Address +PbbMessageIpv4::DeserializeOriginatorAddress (Buffer::Iterator &start) const +{ + uint8_t buffer[GetAddressLength () + 1]; + start.Read(buffer, GetAddressLength () + 1); + return Ipv4Address::Deserialize (buffer); +} + +void +PbbMessageIpv4::PrintOriginatorAddress (std::ostream &os) const +{ + Ipv4Address::ConvertFrom (GetOriginatorAddress ()).Print (os); +} + +Ptr +PbbMessageIpv4::AddressBlockDeserialize (Buffer::Iterator &start) const +{ + Ptr newab = Create (); + newab->Deserialize (start); + return newab; +} + +/* End PbbMessageIpv4 Class */ + +PbbMessageIpv6::PbbMessageIpv6 () +{ +} + +PbbMessageIpv6::~PbbMessageIpv6 () +{ +} + +PbbAddressLength +PbbMessageIpv6::GetAddressLength (void) const +{ + return IPV6; +} + +void +PbbMessageIpv6::SerializeOriginatorAddress (Buffer::Iterator &start) const +{ + uint8_t buffer[GetAddressLength () + 1]; + Ipv6Address::ConvertFrom (GetOriginatorAddress ()).Serialize(buffer); + start.Write (buffer, GetAddressLength () + 1); +} + +Address +PbbMessageIpv6::DeserializeOriginatorAddress (Buffer::Iterator &start) const +{ + uint8_t buffer[GetAddressLength () + 1]; + start.Read(buffer, GetAddressLength () + 1); + return Ipv6Address::Deserialize (buffer); +} + +void +PbbMessageIpv6::PrintOriginatorAddress (std::ostream &os) const +{ + Ipv6Address::ConvertFrom (GetOriginatorAddress ()).Print (os); +} + +Ptr +PbbMessageIpv6::AddressBlockDeserialize (Buffer::Iterator &start) const +{ + Ptr newab = Create (); + newab->Deserialize (start); + return newab; +} + +/* End PbbMessageIpv6 Class */ + +PbbAddressBlock::PbbAddressBlock () +{ + m_refCount = 1; +} + +PbbAddressBlock::~PbbAddressBlock () +{ +} + +/* Manipulating the address block */ + +PbbAddressBlock::AddressIterator +PbbAddressBlock::AddressBegin (void) +{ + return m_addressList.begin(); +} + +PbbAddressBlock::ConstAddressIterator +PbbAddressBlock::AddressBegin (void) const +{ + return m_addressList.begin(); +} + +PbbAddressBlock::AddressIterator +PbbAddressBlock::AddressEnd (void) +{ + return m_addressList.end(); +} + +PbbAddressBlock::ConstAddressIterator +PbbAddressBlock::AddressEnd (void) const +{ + return m_addressList.end(); +} + +int +PbbAddressBlock::AddressSize (void) const +{ + return m_addressList.size(); +} + +bool +PbbAddressBlock::AddressEmpty (void) const +{ + return m_addressList.empty(); +} + +Address +PbbAddressBlock::AddressFront (void) const +{ + return m_addressList.front(); +} + +Address +PbbAddressBlock::AddressBack (void) const +{ + return m_addressList.back(); +} + +void +PbbAddressBlock::AddressPushFront (Address tlv) +{ + m_addressList.push_front(tlv); +} + +void +PbbAddressBlock::AddressPopFront (void) +{ + m_addressList.pop_front(); +} + +void +PbbAddressBlock::AddressPushBack (Address tlv) +{ + m_addressList.push_back(tlv); +} + +void +PbbAddressBlock::AddressPopBack (void) +{ + m_addressList.pop_back(); +} + +PbbAddressBlock::AddressIterator +PbbAddressBlock::AddressErase (PbbAddressBlock::AddressIterator position) +{ + return m_addressList.erase(position); +} + +PbbAddressBlock::AddressIterator +PbbAddressBlock::AddressErase (PbbAddressBlock::AddressIterator first, + PbbAddressBlock::AddressIterator last) +{ + return m_addressList.erase(first, last); +} + + void +PbbAddressBlock::AddressClear (void) +{ + return m_addressList.clear(); +} + +/* Manipulating the prefix list */ + +PbbAddressBlock::PrefixIterator +PbbAddressBlock::PrefixBegin (void) +{ + return m_prefixList.begin (); +} + +PbbAddressBlock::ConstPrefixIterator +PbbAddressBlock::PrefixBegin (void) const +{ + return m_prefixList.begin (); +} + +PbbAddressBlock::PrefixIterator +PbbAddressBlock::PrefixEnd (void) +{ + return m_prefixList.end (); +} + +PbbAddressBlock::ConstPrefixIterator +PbbAddressBlock::PrefixEnd (void) const +{ + return m_prefixList.end (); +} + +int +PbbAddressBlock::PrefixSize (void) const +{ + return m_prefixList.size (); +} + +bool +PbbAddressBlock::PrefixEmpty (void) const +{ + return m_prefixList.empty (); +} + +uint8_t +PbbAddressBlock::PrefixFront (void) const +{ + return m_prefixList.front (); +} + +uint8_t +PbbAddressBlock::PrefixBack (void) const +{ + return m_prefixList.back (); +} + +void +PbbAddressBlock::PrefixPushFront (uint8_t prefix) +{ + m_prefixList.push_front (prefix); +} + +void +PbbAddressBlock::PrefixPopFront (void) +{ + m_prefixList.pop_front (); +} + +void +PbbAddressBlock::PrefixPushBack (uint8_t prefix) +{ + m_prefixList.push_back (prefix); +} + +void +PbbAddressBlock::PrefixPopBack (void) +{ + m_prefixList.pop_back (); +} + +PbbAddressBlock::PrefixIterator +PbbAddressBlock::PrefixInsert (PbbAddressBlock::PrefixIterator position, const uint8_t value) +{ + return m_prefixList.insert (position, value); +} + +PbbAddressBlock::PrefixIterator +PbbAddressBlock::PrefixErase (PbbAddressBlock::PrefixIterator position) +{ + return m_prefixList.erase (position); +} + +PbbAddressBlock::PrefixIterator +PbbAddressBlock::PrefixErase (PbbAddressBlock::PrefixIterator first, PbbAddressBlock::PrefixIterator last) +{ + return m_prefixList.erase (first, last); +} + +void +PbbAddressBlock::PrefixClear (void) +{ + m_prefixList.clear (); +} + +/* Manipulating the TLV block */ + +PbbAddressBlock::TlvIterator +PbbAddressBlock::TlvBegin (void) +{ + return m_addressTlvList.Begin(); +} + +PbbAddressBlock::ConstTlvIterator +PbbAddressBlock::TlvBegin (void) const +{ + return m_addressTlvList.Begin(); +} + +PbbAddressBlock::TlvIterator +PbbAddressBlock::TlvEnd (void) +{ + return m_addressTlvList.End(); +} + +PbbAddressBlock::ConstTlvIterator +PbbAddressBlock::TlvEnd (void) const +{ + return m_addressTlvList.End(); +} + +int +PbbAddressBlock::TlvSize (void) const +{ + return m_addressTlvList.Size(); +} + +bool +PbbAddressBlock::TlvEmpty (void) const +{ + return m_addressTlvList.Empty(); +} + +Ptr +PbbAddressBlock::TlvFront (void) +{ + return m_addressTlvList.Front(); +} + +const Ptr +PbbAddressBlock::TlvFront (void) const +{ + return m_addressTlvList.Front(); +} + +Ptr +PbbAddressBlock::TlvBack (void) +{ + return m_addressTlvList.Back(); +} + +const Ptr +PbbAddressBlock::TlvBack (void) const +{ + return m_addressTlvList.Back(); +} + +void +PbbAddressBlock::TlvPushFront (Ptr tlv) +{ + m_addressTlvList.PushFront(tlv); +} + +void +PbbAddressBlock::TlvPopFront (void) +{ + m_addressTlvList.PopFront(); +} + +void +PbbAddressBlock::TlvPushBack (Ptr tlv) +{ + m_addressTlvList.PushBack(tlv); +} + +void +PbbAddressBlock::TlvPopBack (void) +{ + m_addressTlvList.PopBack(); +} + +PbbAddressBlock::TlvIterator +PbbAddressBlock::TlvErase (PbbAddressBlock::TlvIterator position) +{ + return m_addressTlvList.Erase(position); +} + +PbbAddressBlock::TlvIterator +PbbAddressBlock::TlvErase (PbbAddressBlock::TlvIterator first, + PbbAddressBlock::TlvIterator last) +{ + return m_addressTlvList.Erase(first, last); +} + +void +PbbAddressBlock::TlvClear (void) +{ + m_addressTlvList.Clear(); +} + +void +PbbAddressBlock::Ref (void) const +{ + m_refCount++; +} + +void +PbbAddressBlock::Unref (void) const +{ + m_refCount--; + if (m_refCount == 0) + { + delete this; + } +} + +uint32_t +PbbAddressBlock::GetSerializedSize (void) const +{ + /* num-addr + flags */ + uint32_t size = 2; + + if (AddressSize () == 1) + { + size += GetAddressLength () + PrefixSize(); + } + else if (AddressSize () > 0) + { + uint8_t head[GetAddressLength ()]; + uint8_t headlen = 0; + uint8_t tail[GetAddressLength ()]; + uint8_t taillen = 0; + + GetHeadTail (head, headlen, tail, taillen); + + if (headlen > 0) + { + size += 1 + headlen; + } + + if (taillen > 0) + { + size++; + if (!HasZeroTail (tail, taillen)) + { + size += taillen; + } + } + + /* mid size */ + size += (GetAddressLength () - headlen - taillen) * AddressSize (); + + size += PrefixSize (); + } + + size += m_addressTlvList.GetSerializedSize (); + + return size; +} + +void +PbbAddressBlock::Serialize (Buffer::Iterator &start) const +{ + start.WriteU8 (AddressSize ()); + + if (AddressSize () == 1) + { + start.WriteU8 (0); + + uint8_t buf[GetAddressLength ()]; + SerializeAddress (buf, AddressBegin ()); + start.Write (buf, GetAddressLength ()); + + if (PrefixSize () == 1) + { + start.WriteU8 (PrefixFront ()); + } + } + else if (AddressSize () > 0) + { + Buffer::Iterator bufref = start; + uint8_t flags = 0; + start.Next (); + + uint8_t head[GetAddressLength ()]; + uint8_t tail[GetAddressLength ()]; + uint8_t headlen = 0; + uint8_t taillen = 0; + + GetHeadTail (head, headlen, tail, taillen); + + if (headlen > 0) + { + flags |= AHAS_HEAD; + start.WriteU8 (headlen); + start.Write (head, headlen); + } + + if (taillen > 0) + { + start.WriteU8 (taillen); + + if (HasZeroTail (tail, taillen)) + { + flags |= AHAS_ZERO_TAIL; + } + else + { + flags |= AHAS_FULL_TAIL; + start.Write (tail, taillen); + } + } + + if (headlen + taillen < GetAddressLength ()) + { + uint8_t mid[GetAddressLength ()]; + for (PbbAddressBlock::ConstAddressIterator iter = AddressBegin (); + iter != AddressEnd (); + iter++) + { + SerializeAddress (mid, iter); + start.Write (mid + headlen, GetAddressLength () - headlen - taillen); + } + } + + flags |= GetPrefixFlags (); + bufref.WriteU8 (flags); + + for (ConstPrefixIterator iter = PrefixBegin (); + iter != PrefixEnd (); + iter++) + { + start.WriteU8 (*iter); + } + } + + m_addressTlvList.Serialize (start); +} + +void +PbbAddressBlock::Deserialize (Buffer::Iterator &start) +{ + uint8_t numaddr = start.ReadU8 (); + uint8_t flags = start.ReadU8 (); + + if (numaddr > 0) + { + uint8_t headlen = 0; + uint8_t taillen = 0; + uint8_t addrtmp[GetAddressLength ()]; + memset(addrtmp, 0, GetAddressLength ()); + + if (flags & AHAS_HEAD) + { + headlen = start.ReadU8 (); + start.Read (addrtmp, headlen); + } + + if ((flags & AHAS_FULL_TAIL) ^ (flags & AHAS_ZERO_TAIL)) + { + taillen = start.ReadU8 (); + + if (flags & AHAS_FULL_TAIL) + { + start.Read (addrtmp + GetAddressLength () - taillen, taillen); + } + } + + for (int i = 0; i < numaddr; i++) + { + start.Read (addrtmp + headlen, GetAddressLength () - headlen - taillen); + AddressPushBack (DeserializeAddress (addrtmp)); + } + + if (flags & AHAS_SINGLE_PRE_LEN) + { + PrefixPushBack (start.ReadU8 ()); + } + else if (flags & AHAS_MULTI_PRE_LEN) + { + for (int i = 0; i < numaddr; i++) + { + PrefixPushBack (start.ReadU8 ()); + } + } + } + + m_addressTlvList.Deserialize (start); +} + +void +PbbAddressBlock::Print (std::ostream &os) const +{ + Print (os, 0); +} + +void +PbbAddressBlock::Print (std::ostream &os, int level) const +{ + std::string prefix = ""; + for (int i = 0; i < level; i++) + { + prefix.append ("\t"); + } + + os << prefix << "PbbAddressBlock {" << std::endl; + os << prefix << "\taddresses = " << std::endl; + for (ConstAddressIterator iter = AddressBegin (); + iter != AddressEnd (); + iter++) + { + os << prefix << "\t\t"; + PrintAddress(os, iter); + os << std::endl; + } + + os << prefix << "\tprefixes = " << std::endl; + for (ConstPrefixIterator iter = PrefixBegin (); + iter != PrefixEnd (); + iter++) + { + os << prefix << "\t\t" << (int)(*iter) << std::endl; + } + + m_addressTlvList.Print (os, level+1); +} + +bool +PbbAddressBlock::operator== (const PbbAddressBlock &other) const +{ + if (AddressSize () != other.AddressSize ()) + { + return false; + } + + ConstAddressIterator tai, oai; + for (tai = AddressBegin (), oai = other.AddressBegin (); + tai != AddressEnd () && oai != other.AddressEnd (); + tai++, oai++) + { + if (*tai != *oai) + { + return false; + } + } + + if (PrefixSize () != other.PrefixSize ()) + { + return false; + } + + ConstPrefixIterator tpi, opi; + for (tpi = PrefixBegin (), opi = other.PrefixBegin (); + tpi != PrefixEnd () && opi != other.PrefixEnd (); + tpi++, opi++) + { + if (*tpi != *opi) + { + return false; + } + } + + if (m_addressTlvList != other.m_addressTlvList) + { + return false; + } + + return true; +} + +bool +PbbAddressBlock::operator!= (const PbbAddressBlock &other) const +{ + return !(*this == other); +} + +uint8_t +PbbAddressBlock::GetPrefixFlags (void) const +{ + switch (PrefixSize ()) + { + case 0: + return 0; + break; + case 1: + return AHAS_SINGLE_PRE_LEN; + break; + default: + return AHAS_MULTI_PRE_LEN; + break; + } + + /* Quiet compiler */ + return 0; +} + +void +PbbAddressBlock::GetHeadTail (uint8_t *head, uint8_t &headlen, + uint8_t *tail, uint8_t &taillen) const +{ + headlen = GetAddressLength (); + taillen = headlen; + + /* Temporary automatic buffers to store serialized addresses */ + uint8_t * buflast = new uint8_t[GetAddressLength ()]; + uint8_t * bufcur = new uint8_t[GetAddressLength ()]; + uint8_t * tmp; + + SerializeAddress (buflast, AddressBegin ()); + + /* Skip the first item */ + for (PbbAddressBlock::ConstAddressIterator iter = AddressBegin ()++; + iter != AddressEnd (); + iter++) + { + SerializeAddress (bufcur, iter); + + int i; + for (i = 0; i < headlen; i++) + { + if (buflast[i] != bufcur[i]) + { + headlen = i; + break; + } + } + + /* If headlen == fulllen - 1, then tail is 0 */ + if (headlen <= GetAddressLength () - 1) + { + for (i = GetAddressLength () - 1; + GetAddressLength () - 1 - i <= taillen && i > headlen; + i--) + { + if (buflast[i] != bufcur[i]) + { + break; + } + } + taillen = GetAddressLength () - 1 - i; + } + else if (headlen == 0) + { + taillen = 0; + break; + } + + tmp = buflast; + buflast = bufcur; + bufcur = tmp; + } + + memcpy(head, bufcur, headlen); + memcpy(tail, bufcur + (GetAddressLength () - taillen), taillen); + + delete[] buflast; + delete[] bufcur; +} + +bool +PbbAddressBlock::HasZeroTail (const uint8_t *tail, uint8_t taillen) const +{ + int i; + for (i = 0; i < taillen; i++) + { + if (tail[i] != 0) + { + break; + } + } + return i == taillen; +} + +/* End PbbAddressBlock Class */ + +PbbAddressBlockIpv4::PbbAddressBlockIpv4 () +{ +} + +PbbAddressBlockIpv4::~PbbAddressBlockIpv4 () +{ +} + +uint8_t +PbbAddressBlockIpv4::GetAddressLength (void) const +{ + return 4; +} + +void +PbbAddressBlockIpv4::SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const +{ + Ipv4Address::ConvertFrom (*iter).Serialize (buffer); +} + +Address +PbbAddressBlockIpv4::DeserializeAddress (uint8_t *buffer) const +{ + return Ipv4Address::Deserialize (buffer); +} + +void +PbbAddressBlockIpv4::PrintAddress (std::ostream &os, ConstAddressIterator iter) const +{ + Ipv4Address::ConvertFrom (*iter).Print (os); +} + +/* End PbbAddressBlockIpv4 Class */ + +PbbAddressBlockIpv6::PbbAddressBlockIpv6 () +{ +} + +PbbAddressBlockIpv6::~PbbAddressBlockIpv6 () +{ +} + +uint8_t +PbbAddressBlockIpv6::GetAddressLength (void) const +{ + return 16; +} + +void +PbbAddressBlockIpv6::SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const +{ + Ipv6Address::ConvertFrom (*iter).Serialize (buffer); +} + +Address +PbbAddressBlockIpv6::DeserializeAddress (uint8_t *buffer) const +{ + return Ipv6Address::Deserialize (buffer); +} + +void +PbbAddressBlockIpv6::PrintAddress (std::ostream &os, ConstAddressIterator iter) const +{ + Ipv6Address::ConvertFrom (*iter).Print (os); +} + +/* End PbbAddressBlockIpv6 Class */ + +PbbTlv::PbbTlv (void) +{ + m_refCount = 1; + m_hasTypeExt = false; + m_hasIndexStart = false; + m_hasIndexStop = false; + m_isMultivalue = false; + m_hasValue = false; +} + +PbbTlv::~PbbTlv (void) +{ + m_value.RemoveAtEnd (m_value.GetSize ()); +} + +void +PbbTlv::SetType (uint8_t type) +{ + m_type = type; +} + +uint8_t +PbbTlv::GetType (void) const +{ + return m_type; +} + +void +PbbTlv::SetTypeExt (uint8_t typeExt) +{ + m_typeExt = typeExt; + m_hasTypeExt = true; +} + +uint8_t +PbbTlv::GetTypeExt (void) const +{ + NS_ASSERT (HasTypeExt ()); + return m_typeExt; +} + +bool +PbbTlv::HasTypeExt (void) const +{ + return m_hasTypeExt; +} + +void +PbbTlv::SetIndexStart (uint8_t index) +{ + m_indexStart = index; + m_hasIndexStart = true; +} + +uint8_t +PbbTlv::GetIndexStart (void) const +{ + NS_ASSERT (HasIndexStart ()); + return m_indexStart; +} + +bool +PbbTlv::HasIndexStart (void) const +{ + return m_hasIndexStart; +} + +void +PbbTlv::SetIndexStop (uint8_t index) +{ + m_indexStop = index; + m_hasIndexStop = true; +} + +uint8_t +PbbTlv::GetIndexStop (void) const +{ + NS_ASSERT (HasIndexStop ()); + return m_indexStop; +} + +bool +PbbTlv::HasIndexStop (void) const +{ + return m_hasIndexStop; +} + +void +PbbTlv::SetMultivalue (bool isMultivalue) +{ + m_isMultivalue = isMultivalue; +} + +bool +PbbTlv::IsMultivalue (void) const +{ + return m_isMultivalue; +} + +void +PbbTlv::SetValue (Buffer start) +{ + m_hasValue = true; + m_value = start; +} + +void +PbbTlv::SetValue (const uint8_t * buffer, uint32_t size) +{ + m_hasValue = true; + m_value.AddAtStart (size); + m_value.Begin ().Write (buffer, size); +} + +Buffer +PbbTlv::GetValue (void) const +{ + NS_ASSERT (HasValue ()); + return m_value; +} + +bool +PbbTlv::HasValue (void) const +{ + return m_hasValue; +} + +void +PbbTlv::Ref (void) const +{ + m_refCount++; +} + +void +PbbTlv::Unref (void) const +{ + m_refCount--; + if (m_refCount == 0) + { + delete this; + } +} + +uint32_t +PbbTlv::GetSerializedSize (void) const +{ + /* type + flags */ + uint32_t size = 2; + + if (HasTypeExt ()) + { + size++; + } + + if (HasIndexStart ()) + { + size++; + } + + if (HasIndexStop ()) + { + size++; + } + + if (HasValue ()) + { + if (GetValue ().GetSize () > 255) + { + size += 2; + } + else + { + size++; + } + size += GetValue ().GetSize (); + } + + return size; +} + +void +PbbTlv::Serialize (Buffer::Iterator &start) const +{ + start.WriteU8 (GetType ()); + + Buffer::Iterator bufref = start; + uint8_t flags = 0; + start.Next(); + + if (HasTypeExt()) + { + flags |= THAS_TYPE_EXT; + start.WriteU8 (GetTypeExt ()); + } + + if (HasIndexStart ()) + { + start.WriteU8 (GetIndexStart ()); + + if (HasIndexStop ()) + { + flags |= THAS_MULTI_INDEX; + start.WriteU8 (GetIndexStop ()); + } + else + { + flags |= THAS_SINGLE_INDEX; + } + } + + if (HasValue ()) + { + flags |= THAS_VALUE; + + uint32_t size = GetValue ().GetSize (); + if (size > 255) + { + flags |= THAS_EXT_LEN; + start.WriteHtonU16 (size); + } + else + { + start.WriteU8 (size); + } + + if (IsMultivalue ()) + { + flags |= TIS_MULTIVALUE; + } + + start.Write(GetValue ().Begin (), GetValue ().End ()); + } + + bufref.WriteU8 (flags); +} + +void +PbbTlv::Deserialize (Buffer::Iterator &start) +{ + SetType (start.ReadU8 ()); + + uint8_t flags = start.ReadU8 (); + + if (flags & THAS_TYPE_EXT) + { + SetTypeExt (start.ReadU8 ()); + } + + if (flags & THAS_MULTI_INDEX) + { + SetIndexStart (start.ReadU8 ()); + SetIndexStop (start.ReadU8 ()); + } + else if (flags & THAS_SINGLE_INDEX) + { + SetIndexStart (start.ReadU8 ()); + } + + if (flags & THAS_VALUE) + { + uint16_t len = 0; + + if (flags & THAS_EXT_LEN) + { + len = start.ReadNtohU16 (); + } + else + { + len = start.ReadU8 (); + } + + m_value.AddAtStart (len); + + Buffer::Iterator valueStart = start; + start.Next (len); + m_value.Begin ().Write (valueStart, start); + m_hasValue = true; + } +} + +void +PbbTlv::Print (std::ostream &os) const +{ + Print (os, 0); +} + +void +PbbTlv::Print (std::ostream &os, int level) const +{ + std::string prefix = ""; + for (int i = 0; i < level; i++) + { + prefix.append ("\t"); + } + + os << prefix << "PbbTlv {" << std::endl; + os << prefix << "\ttype = " << (int)GetType () << std::endl; + + if (HasTypeExt ()) + { + os << prefix << "\ttypeext = " << (int)GetTypeExt () << std::endl; + } + + if (HasIndexStart ()) + { + os << prefix << "\tindexStart = " << (int)GetIndexStart () << std::endl; + } + + if (HasIndexStop ()) + { + os << prefix << "\tindexStop = " << (int)GetIndexStop () << std::endl; + } + + os << prefix << "\tisMultivalue = " << IsMultivalue () << std::endl; + + if (HasValue ()) + { + os << prefix << "\thas value; size = " << GetValue (). GetSize () << std::endl; + } + + os << prefix << "}" << std::endl; +} + +bool +PbbTlv::operator== (const PbbTlv &other) const +{ + if (GetType () != other.GetType ()) + { + return false; + } + + if (HasTypeExt () != other.HasTypeExt ()) + { + return false; + } + + if (HasTypeExt ()) + { + if (GetTypeExt () != other.GetTypeExt ()) + { + return false; + } + } + + if (HasValue () != other.HasValue ()) + { + return false; + } + + if (HasValue ()) + { + Buffer tv = GetValue (); + Buffer ov = other.GetValue (); + if (tv.GetSize () != ov.GetSize ()) + { + return false; + } + + /* The docs say I probably shouldn't use Buffer::PeekData, but I think it + * is justified in this case. */ + if (memcmp (tv.PeekData (), ov.PeekData (), tv.GetSize ()) != 0) + { + return false; + } + } + return true; +} + +bool +PbbTlv::operator!= (const PbbTlv &other) const +{ + return !(*this == other); +} + +/* End PbbTlv Class */ + +void +PbbAddressTlv::SetIndexStart (uint8_t index) +{ + PbbTlv::SetIndexStart (index); +} + +uint8_t +PbbAddressTlv::GetIndexStart (void) const +{ + return PbbTlv::GetIndexStart (); +} + +bool +PbbAddressTlv::HasIndexStart (void) const +{ + return PbbTlv::HasIndexStart (); +} + +void +PbbAddressTlv::SetIndexStop (uint8_t index) +{ + PbbTlv::SetIndexStop (index); +} + +uint8_t +PbbAddressTlv::GetIndexStop (void) const +{ + return PbbTlv::GetIndexStop (); +} + +bool +PbbAddressTlv::HasIndexStop (void) const +{ + return PbbTlv::HasIndexStop (); +} + +void +PbbAddressTlv::SetMultivalue (bool isMultivalue) +{ + PbbTlv::SetMultivalue (isMultivalue); +} + +bool +PbbAddressTlv::IsMultivalue (void) const +{ + return PbbTlv::IsMultivalue (); +} + +} /* namespace ns3 */ diff --git a/src/node/packetbb.h b/src/node/packetbb.h new file mode 100644 index 000000000..1ee3014dc --- /dev/null +++ b/src/node/packetbb.h @@ -0,0 +1,1754 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* vim: set ts=2 sw=2 sta expandtab ai si cin: */ +/* + * Copyright (c) 2009 Drexel University + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Tom Wambold + */ +/* These classes implement RFC 5444 - The Generalized Mobile Ad Hoc Network + * (MANET) Packet/PbbMessage Format + * See: http://tools.ietf.org/html/rfc5444 for details */ + +#ifndef PACKETBB_H +#define PACKETBB_H + +#include + +#include "ns3/ptr.h" +#include "ns3/address.h" +#include "ns3/header.h" +#include "ns3/buffer.h" + +namespace ns3 { + +/* Forward declare objects */ +class PbbMessage; +class PbbAddressBlock; +class PbbTlv; +class PbbAddressTlv; + +/** Used in Messages to determine whether it contains IPv4 or IPv6 addresses */ +enum PbbAddressLength { + IPV4 = 3, + IPV6 = 15, +}; + +/** + * \brief A block of packet or message TLVs (PbbTlv). + * + * Acts similar to a C++ STL container. Should not be used for Address TLVs. + */ +class PbbTlvBlock +{ +public: + typedef std::list< Ptr >::iterator Iterator; + typedef std::list< Ptr >::const_iterator ConstIterator; + + PbbTlvBlock (void); + ~PbbTlvBlock (void); + + /** + * \return an iterator to the first TLV in this block. + */ + Iterator Begin (void); + + /** + * \return a const iterator to the first TLV in this block. + */ + ConstIterator Begin (void) const; + + /** + * \return an iterator to the past-the-end element in this block. + */ + Iterator End (void); + + /** + * \return a const iterator to the past-the-end element in this block. + */ + ConstIterator End (void) const; + + /** + * \return the number of TLVs in this block. + */ + int Size (void) const; + + /** + * \return true if there are no TLVs in this block, false otherwise. + */ + bool Empty (void) const; + + /** + * \return a smart pointer to the first TLV in this block. + */ + Ptr Front (void) const; + + /** + * \return a smart pointer to the last TLV in this block. + */ + Ptr Back (void) const; + + /** + * \brief Prepends a TLV to the front of this block. + * \param tlv a smart pointer to the TLV to prepend. + */ + void PushFront (Ptr tlv); + + /** + * \brief Removes a TLV from the front of this block. + */ + void PopFront (void); + + /** + * \brief Appends a TLV to the back of this block. + * \param tlv a smart pointer to the TLV to append. + */ + void PushBack (Ptr tlv); + + /** + * \brief Removes a TLV from the back of this block. + */ + void PopBack (void); + + /** + * \brief Inserts a TLV at the specified position in this block. + * \param position an Iterator pointing to the position in this block to + * insert the TLV. + * \param tlv a smart pointer to the TLV to insert. + * \return An iterator pointing to the newly inserted TLV. + */ + Iterator Insert (Iterator position, const Ptr tlv); + + /** + * \brief Removes the TLV at the specified position. + * \param position an Iterator pointing to the TLV to erase. + * \return an iterator pointing to the next TLV in the block. + */ + Iterator Erase (Iterator position); + + /** + * \brief Removes all TLVs from [first, last) (includes first, not includes + * last). + * \param first an Iterator pointing to the first TLV to erase (inclusive). + * \param last an Iterator pointing to the element past the last TLV to erase. + * \return an iterator pointing to the next TLV in the block. + */ + Iterator Erase (Iterator first, Iterator last); + + /** + * \brief Removes all TLVs from this block. + */ + void Clear (void); + + /** + * \return The size (in bytes) needed to serialize this block. + */ + uint32_t GetSerializedSize (void) const; + + /** + * \brief Serializes this block into the specified buffer. + * \param start a reference to the point in a buffer to begin serializing. + * + * Users should not need to call this. Blocks will be serialized by their + * containing packet. + */ + void Serialize (Buffer::Iterator &start) const; + + /** + * \brief Deserializes a block from the specified buffer. + * \param start a reference to the point in a buffer to begin deserializing. + * + * Users should not need to call this. Blocks will be deserialized by their + * containing packet. + */ + void Deserialize (Buffer::Iterator &start); + + /** + * \brief Pretty-prints the contents of this block. + * \param os a stream object to print to. + */ + void Print (std::ostream &os) const; + + /** + * \brief Pretty-prints the contents of this block, with specified indentation. + * \param os a stream object to print to. + * \param level level of indentation. + * + * This probably never needs to be called by users. This is used when + * recursively printing sub-objects. + */ + void Print (std::ostream &os, int level) const; + + bool operator== (const PbbTlvBlock &other) const; + bool operator!= (const PbbTlvBlock &other) const; + +private: + std::list< Ptr > m_tlvList; +}; + +/** + * \brief A block of Address TLVs (PbbAddressTlv). + * + * Acts similar to a C++ STL container. + */ +class PbbAddressTlvBlock +{ +public: + typedef std::list< Ptr >::iterator Iterator; + typedef std::list< Ptr >::const_iterator ConstIterator; + + PbbAddressTlvBlock (void); + ~PbbAddressTlvBlock (void); + + /** + * \return an iterator to the first Address TLV in this block. + */ + Iterator Begin (void); + + /** + * \return a const iterator to the first Address TLV in this block. + */ + ConstIterator Begin (void) const; + + /** + * \return an iterator to the past-the-end element in this block. + */ + Iterator End (void); + + /** + * \return a const iterator to the past-the-end element in this block. + */ + ConstIterator End (void) const; + + /** + * \return the number of Address TLVs in this block. + */ + int Size (void) const; + + /** + * \return true if there are no Address TLVs in this block, false otherwise. + */ + bool Empty (void) const; + + /** + * \return the first Address TLV in this block. + */ + Ptr Front (void) const; + + /** + * \return the last AddressTLV in this block. + */ + Ptr Back (void) const; + + /** + * \brief Prepends an Address TLV to the front of this block. + * \param tlv a smart pointer to the Address TLV to prepend. + */ + void PushFront (Ptr tlv); + + /** + * \brief Removes an AddressTLV from the front of this block. + */ + void PopFront (void); + + /** + * \brief Appends an Address TLV to the back of this block. + * \param tlv a smart pointer to the Address TLV to append. + */ + void PushBack (Ptr tlv); + + /** + * \brief Removes an Address TLV from the back of this block. + */ + void PopBack (void); + + /** + * \brief Inserts an Address TLV at the specified position in this block. + * \param position an Iterator pointing to the position in this block to + * insert the Address TLV. + * \param tlv a smart pointer to the Address TLV to insert. + * \return An iterator pointing to the newly inserted Address TLV. + */ + Iterator Insert (Iterator position, const Ptr tlv); + + /** + * \brief Removes the Address TLV at the specified position. + * \param position an Iterator pointing to the Address TLV to erase. + * \return an iterator pointing to the next Address TLV in the block. + */ + Iterator Erase (Iterator position); + + /** + * \brief Removes all Address TLVs from [first, last) (includes first, not + * includes last). + * \param first an Iterator pointing to the first Address TLV to erase + * (inclusive). + * \param last an Iterator pointing to the element past the last Address TLV + * to erase. + * \return an iterator pointing to the next Address TLV in the block. + */ + Iterator Erase (Iterator first, Iterator last); + + /** + * \brief Removes all Address TLVs from this block. + */ + void Clear (void); + + /** + * \return The size (in bytes) needed to serialize this block. + */ + uint32_t GetSerializedSize (void) const; + + /** + * \brief Serializes this block into the specified buffer. + * \param start a reference to the point in a buffer to begin serializing. + * + * Users should not need to call this. Blocks will be serialized by their + * containing packet. + */ + void Serialize (Buffer::Iterator &start) const; + + /** + * \brief Deserializes a block from the specified buffer. + * \param start a reference to the point in a buffer to begin deserializing. + * + * Users should not need to call this. Blocks will be deserialized by their + * containing packet. + */ + void Deserialize (Buffer::Iterator &start); + + /** + * \brief Pretty-prints the contents of this block. + * \param os a stream object to print to. + */ + void Print (std::ostream &os) const; + + /** + * \brief Pretty-prints the contents of this block, with specified indentation. + * \param os a stream object to print to. + * \param level level of indentation. + * + * This probably never needs to be called by users. This is used when + * recursively printing sub-objects. + */ + void Print (std::ostream &os, int level) const; + + bool operator== (const PbbAddressTlvBlock &other) const; + bool operator!= (const PbbAddressTlvBlock &other) const; + +private: + std::list< Ptr > m_tlvList; +}; + +/** + * \brief Main PacketBB Packet object. + * + * A PacketBB packet is made up of zero or more packet TLVs (PbbTlv), and zero + * or more messages (PbbMessage). + * + * See: http://tools.ietf.org/html/rfc5444 for details. + */ +class PbbPacket : public Header +{ +public: + typedef std::list< Ptr >::iterator TlvIterator; + typedef std::list< Ptr >::const_iterator ConstTlvIterator; + typedef std::list< Ptr >::iterator MessageIterator; + typedef std::list< Ptr >::const_iterator ConstMessageIterator; + + PbbPacket (void); + ~PbbPacket (void); + + /** + * \return the version of PacketBB that constructed this packet. + * + * This will always return 0 for packets constructed using this API. + */ + uint8_t GetVersion (void) const; + + /** + * \brief Sets the sequence number of this packet. + * \param number the sequence number. + */ + void SetSequenceNumber (uint16_t number); + + /** + * \return the sequence number of this packet. + * + * Calling this while HasSequenceNumber is False is undefined. Make sure you + * check it first. This will be checked by an assert in debug builds. + */ + uint16_t GetSequenceNumber (void) const; + + /** + * \brief Tests whether or not this packet has a sequence number. + * \return true if this packet has a sequence number, false otherwise. + * + * This should be called before calling GetSequenceNumber to make sure there + * actually is one. + */ + bool HasSequenceNumber (void) const; + + /* Manipulating Packet TLVs */ + + /** + * \return an iterator to the first Packet TLV in this packet. + */ + TlvIterator TlvBegin (void); + + /** + * \return a const iterator to the first Packet TLV in this packet. + */ + ConstTlvIterator TlvBegin (void) const; + + /** + * \return an iterator to the past-the-end element in this packet TLV block. + */ + TlvIterator TlvEnd (void); + + /** + * \return a const iterator to the past-the-end element in this packet TLV + * block. + */ + ConstTlvIterator TlvEnd (void) const; + + /** + * \return the number of packet TLVs in this packet. + */ + int TlvSize (void) const; + + /** + * \return true if there are no packet TLVs in this packet, false otherwise. + */ + bool TlvEmpty (void) const; + + /** + * \return a smart pointer to the first packet TLV in this packet. + */ + Ptr TlvFront (void); + + /** + * \return a const smart pointer to the first packet TLV in this packet. + */ + const Ptr TlvFront (void) const; + + /** + * \return a smart pointer to the last packet TLV in this packet. + */ + Ptr TlvBack (void); + + /** + * \return a const smart pointer to the last packet TLV in this packet. + */ + const Ptr TlvBack (void) const; + + /** + * \brief Prepends a packet TLV to the front of this packet. + * \param tlv a smart pointer to the packet TLV to prepend. + */ + void TlvPushFront (Ptr tlv); + + /** + * \brief Removes a packet TLV from the front of this packet. + */ + void TlvPopFront (void); + + /** + * \brief Appends a packet TLV to the back of this packet. + * \param tlv a smart pointer to the packet TLV to append. + */ + void TlvPushBack (Ptr tlv); + + /** + * \brief Removes a packet TLV from the back of this block. + */ + void TlvPopBack (void); + + /** + * \brief Removes the packet TLV at the specified position. + * \param position an Iterator pointing to the packet TLV to erase. + * \return an iterator pointing to the next packet TLV in the block. + */ + TlvIterator Erase (TlvIterator position); + + /** + * \brief Removes all packet TLVs from [first, last) (includes first, not + * includes last). + * \param first an Iterator pointing to the first packet TLV to erase + * (inclusive). + * \param last an Iterator pointing to the element past the last packet TLV + * to erase. + * \return an iterator pointing to the next packet TLV in the block. + */ + TlvIterator Erase (TlvIterator first, TlvIterator last); + + /** + * \brief Removes all packet TLVs from this packet. + */ + void TlvClear (void); + + /* Manipulating Packet Messages */ + + /** + * \return an iterator to the first message in this packet. + */ + MessageIterator MessageBegin (void); + + /** + * \return a const iterator to the first message in this packet. + */ + ConstMessageIterator MessageBegin (void) const; + + /** + * \return an iterator to the past-the-end element in this message block. + */ + MessageIterator MessageEnd (void); + + /** + * \return a const iterator to the past-the-end element in this message + * block. + */ + ConstMessageIterator MessageEnd (void) const; + + /** + * \return the number of messages in this packet. + */ + int MessageSize (void) const; + + /** + * \return true if there are no messages in this packet, false otherwise. + */ + bool MessageEmpty (void) const; + + /** + * \return a smart pointer to the first message in this packet. + */ + Ptr MessageFront (void); + + /** + * \return a cosnt smart pointer to the first message in this packet. + */ + const Ptr MessageFront (void) const; + + /** + * \return a smart pointer to the last message in this packet. + */ + Ptr MessageBack (void); + + /** + * \return a cosnt smart pointer to the last message in this packet. + */ + const Ptr MessageBack (void) const; + + /** + * \brief Prepends a message to the front of this packet. + * \param message a smart pointer to the message to prepend. + */ + void MessagePushFront (Ptr message); + + /** + * \brief Removes a message from the front of this packet. + */ + void MessagePopFront (void); + + /** + * \brief Appends a message to the back of this packet. + * \param message a smart pointer to the message to append. + */ + void MessagePushBack (Ptr message); + + /** + * \brief Removes a message from the back of this packet. + */ + void MessagePopBack (void); + + /** + * \brief Removes the message at the specified position. + * \param position an Iterator pointing to the message to erase. + * \return an iterator pointing to the next message in the packet. + */ + MessageIterator Erase (MessageIterator position); + + /** + * \brief Removes all messages from [first, last) (includes first, not + * includes last). + * \param first an Iterator pointing to the first message to erase (inclusive). + * \param last an Iterator pointing to the element past the last message to erase. + * \return an iterator pointing to the next message in the block. + */ + MessageIterator Erase (MessageIterator first, MessageIterator last); + + /** + * \brief Removes all messages from this packet. + */ + void MessageClear (void); + + /* Smart pointer methods */ + void Ref (void) const; + void Unref (void) const; + + /* Methods implemented by all headers */ + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + + /** + * \return The size (in bytes) needed to serialize this packet. + */ + virtual uint32_t GetSerializedSize (void) const; + + /** + * \brief Serializes this packet into the specified buffer. + * \param start a reference to the point in a buffer to begin serializing. + */ + virtual void Serialize (Buffer::Iterator start) const; + + /** + * \brief Deserializes a packet from the specified buffer. + * \param start start offset + * \return the number of bytes deserialized + * + * If this returns a number smaller than the total number of bytes in the + * buffer, there was an error. + */ + virtual uint32_t Deserialize (Buffer::Iterator start); + + /** + * \brief Pretty-prints the contents of this block. + * \param os a stream object to print to. + */ + virtual void Print (std::ostream &os) const; + + bool operator== (const PbbPacket &other) const; + bool operator!= (const PbbPacket &other) const; + +protected: + void SerializePacketTlv (Buffer::Iterator &start) const; + +private: + PbbTlvBlock m_tlvList; + std::list< Ptr > m_messageList; + + uint8_t m_version; + + bool m_hasseqnum; + uint16_t m_seqnum; + + mutable uint32_t m_refCount; +}; + +/** + * \brief A message within a PbbPacket packet. + * + * There may be any number of messages in one packet packet. This is a pure + * virtual base class, when creating a message, you should instantiate either + * PbbMessageIpv4 or PbbMessageIpv6. + */ +class PbbMessage +{ +public: + typedef std::list< Ptr >::iterator TlvIterator; + typedef std::list< Ptr >::const_iterator ConstTlvIterator; + typedef std::list< Ptr >::iterator AddressBlockIterator; + typedef std::list< Ptr >::const_iterator ConstAddressBlockIterator; + + PbbMessage (); + virtual ~PbbMessage (); + + /** + * \brief Sets the type for this message. + * \param type the type to set. + */ + void SetType (uint8_t type); + + /** + * \return the type assigned to this packet + */ + uint8_t GetType (void) const; + + /** + * \brief Sets the address for the node that created this packet. + * \param address the originator address. + */ + void SetOriginatorAddress (Address address); + + /** + * \return the address of the node that created this packet. + * + * Calling this while HasOriginatorAddress is False is undefined. Make sure + * you check it first. This will be checked by an assert in debug builds. + */ + Address GetOriginatorAddress (void) const; + + /** + * \brief Tests whether or not this message has an originator address. + * \return true if this message has an originator address, false otherwise. + */ + bool HasOriginatorAddress (void) const; + + /** + * \brief Sets the maximum number of hops this message should travel + * \param hoplimit the limit to set + */ + void SetHopLimit (uint8_t hoplimit); + + /** + * \return the maximum number of hops this message should travel. + * + * Calling this while HasHopLimit is False is undefined. Make sure you check + * it first. This will be checked by an assert in debug builds. + */ + uint8_t GetHopLimit (void) const; + + /** + * \brief Tests whether or not this message has a hop limit. + * \return true if this message has a hop limit, false otherwise. + * + * If this is set, messages should not hop further than this limit. + */ + bool HasHopLimit (void) const; + + /** + * \brief Sets the current number of hops this message has traveled. + * \param hopcount the current number of hops + */ + void SetHopCount (uint8_t hopcount); + + /** + * \return the current number of hops this message has traveled. + * + * Calling this while HasHopCount is False is undefined. Make sure you check + * it first. This will be checked by an assert in debug builds. + */ + uint8_t GetHopCount (void) const; + + /** + * \brief Tests whether or not this message has a hop count. + * \return true if this message has a hop limit, false otherwise. + */ + bool HasHopCount (void) const; + + /** + * \brief Sets the sequence number of this message. + * \param seqnum the sequence number to set. + */ + void SetSequenceNumber (uint16_t seqnum); + + /** + * \return the sequence number of this message. + * + * Calling this while HasSequenceNumber is False is undefined. Make sure you + * check it first. This will be checked by an assert in debug builds. + */ + uint16_t GetSequenceNumber (void) const; + + /** + * \brief Tests whether or not this message has a sequence number. + * \return true if this message has a sequence number, false otherwise. + */ + bool HasSequenceNumber (void) const; + + /* Manipulating PbbMessage TLVs */ + + /** + * \return an iterator to the first message TLV in this message. + */ + TlvIterator TlvBegin (); + + /** + * \return a const iterator to the first message TLV in this message. + */ + ConstTlvIterator TlvBegin () const; + + /** + * \return an iterator to the past-the-end message TLV element in this + * message. + */ + TlvIterator TlvEnd (); + + /** + * \return a const iterator to the past-the-end message TLV element in this + * message. + */ + ConstTlvIterator TlvEnd () const; + + /** + * \return the number of message TLVs in this message. + */ + int TlvSize (void) const; + + /** + * \return true if there are no message TLVs in this message, false otherwise. + */ + bool TlvEmpty (void) const; + + /** + * \return a smart pointer to the first message TLV in this message. + */ + Ptr TlvFront (void); + + /** + * \return a const smart pointer to the first message TLV in this message. + */ + const Ptr TlvFront (void) const; + + /** + * \return a smart pointer to the last message TLV in this message. + */ + Ptr TlvBack (void); + + /** + * \return a const smart pointer to the last message TLV in this message. + */ + const Ptr TlvBack (void) const; + + /** + * \brief Prepends a message TLV to the front of this message. + * \param tlv a smart pointer to the message TLV to prepend. + */ + void TlvPushFront (Ptr tlv); + + /** + * \brief Removes a message TLV from the front of this message. + */ + void TlvPopFront (void); + + /** + * \brief Appends a message TLV to the back of this message. + * \param tlv a smart pointer to the message TLV to append. + */ + void TlvPushBack (Ptr tlv); + + /** + * \brief Removes a message TLV from the back of this message. + */ + void TlvPopBack (void); + + /** + * \brief Removes the message TLV at the specified position. + * \param position an Iterator pointing to the message TLV to erase. + * \return an iterator pointing to the next TLV in the block. + */ + TlvIterator TlvErase (TlvIterator position); + + /** + * \brief Removes all message TLVs from [first, last) (includes first, not + * includes last). + * \param first an Iterator pointing to the first message TLV to erase + * (inclusive). + * \param last an Iterator pointing to the element past the last message TLV + * to erase. + * \return an iterator pointing to the next message TLV in the message. + */ + TlvIterator TlvErase (TlvIterator first, TlvIterator last); + + /** + * \brief Removes all message TLVs from this block. + */ + void TlvClear (void); + + /* Manipulating Address Block and Address TLV pairs */ + + /** + * \return an iterator to the first address block in this message. + */ + AddressBlockIterator AddressBlockBegin (); + + /** + * \return a const iterator to the first address block in this message. + */ + ConstAddressBlockIterator AddressBlockBegin () const; + + /** + * \return an iterator to the past-the-end address block element in this + * message. + */ + AddressBlockIterator AddressBlockEnd (); + + /** + * \return a const iterator to the past-the-end address block element in this + * message. + */ + ConstAddressBlockIterator AddressBlockEnd () const; + + /** + * \return the number of address blocks in this message. + */ + int AddressBlockSize (void) const; + + /** + * \return true if there are no address blocks in this message, false + * otherwise. + */ + bool AddressBlockEmpty (void) const; + + /** + * \return a smart pointer to the first address block in this message. + */ + Ptr AddressBlockFront (void); + + /** + * \return a const smart pointer to the first address block in this message. + */ + const Ptr AddressBlockFront (void) const; + + /** + * \return a smart pointer to the last address block in this message. + */ + Ptr AddressBlockBack (void); + + /** + * \return a const smart pointer to the last address block in this message. + */ + const Ptr AddressBlockBack (void) const; + + /** + * \brief Prepends an address block to the front of this message. + * \param block a smart pointer to the address block to prepend. + */ + void AddressBlockPushFront (Ptr block); + + /** + * \brief Removes an address block from the front of this message. + */ + void AddressBlockPopFront (void); + + /** + * \brief Appends an address block to the front of this message. + * \param block a smart pointer to the address block to append. + */ + void AddressBlockPushBack (Ptr block); + + /** + * \brief Removes an address block from the back of this message. + */ + void AddressBlockPopBack (void); + + /** + * \brief Removes the address block at the specified position. + * \param position an Iterator pointing to the address block to erase. + * \return an iterator pointing to the next address block in the message. + */ + AddressBlockIterator AddressBlockErase (AddressBlockIterator position); + + /** + * \brief Removes all address blocks from [first, last) (includes first, not + * includes last). + * \param first an Iterator pointing to the first address block to erase + * (inclusive). + * \param last an Iterator pointing to the element past the last address + * block to erase. + * \return an iterator pointing to the next address block in the message. + */ + AddressBlockIterator AddressBlockErase (AddressBlockIterator first, + AddressBlockIterator last); + + /** + * \brief Removes all address blocks from this message. + */ + void AddressBlockClear (void); + + /* Smart pointer methods */ + void Ref (void) const; + void Unref (void) const; + + /** + * \brief Deserializes a message, returning the correct object depending on + * whether it is an IPv4 message or an IPv6 message. + * \param start a reference to the point in a buffer to begin deserializing. + * \return A pointer to the deserialized message, or 0 on error. + * + * Users should not need to call this. Blocks will be deserialized by their + * containing packet. + */ + static Ptr DeserializeMessage (Buffer::Iterator &start); + + /** + * \return The size (in bytes) needed to serialize this message. + */ + uint32_t GetSerializedSize (void) const; + + /** + * \brief Serializes this message into the specified buffer. + * \param start a reference to the point in a buffer to begin serializing. + * + * Users should not need to call this. Blocks will be deserialized by their + * containing packet. + */ + void Serialize (Buffer::Iterator &start) const; + + /** + * \brief Deserializes a message from the specified buffer. + * \param start a reference to the point in a buffer to begin deserializing. + * + * Users should not need to call this. Blocks will be deserialized by their + * containing packet. + */ + void Deserialize (Buffer::Iterator &start); + + /** + * \brief Pretty-prints the contents of this message. + * \param os a stream object to print to. + */ + void Print (std::ostream &os) const; + + /** + * \brief Pretty-prints the contents of this message, with specified + * indentation. + * \param os a stream object to print to. + * \param level level of indentation. + * + * This probably never needs to be called by users. This is used when + * recursively printing sub-objects. + */ + void Print (std::ostream &os, int level) const; + + bool operator== (const PbbMessage &other) const; + bool operator!= (const PbbMessage &other) const; + +protected: + /* PbbMessage size in bytes - 1. + * + * IPv4 = 4 - 1 = 3, IPv6 = 16 - 1 = 15 + */ + virtual PbbAddressLength GetAddressLength (void) const = 0; + + virtual void SerializeOriginatorAddress (Buffer::Iterator &start) const = 0; + virtual Address DeserializeOriginatorAddress (Buffer::Iterator &start) const = 0; + virtual void PrintOriginatorAddress (std::ostream &os) const = 0; + + virtual Ptr AddressBlockDeserialize (Buffer::Iterator &start) const = 0; + +private: + PbbTlvBlock m_tlvList; + std::list< Ptr > m_addressBlockList; + + uint8_t m_type; + PbbAddressLength m_addrSize; + + bool m_hasOriginatorAddress; + Address m_originatorAddress; + + bool m_hasHopLimit; + uint8_t m_hopLimit; + + bool m_hasHopCount; + uint8_t m_hopCount; + + bool m_hasSequenceNumber; + uint16_t m_sequenceNumber; + + mutable uint32_t m_refCount; +}; + +/** + * \brief Concrete IPv4 specific PbbMessage. + * + * This message will only contain IPv4 addresses. + */ +class PbbMessageIpv4 : public PbbMessage { +public: + PbbMessageIpv4 (); + virtual ~PbbMessageIpv4 (); + +protected: + virtual PbbAddressLength GetAddressLength (void) const; + + virtual void SerializeOriginatorAddress (Buffer::Iterator &start) const; + virtual Address DeserializeOriginatorAddress (Buffer::Iterator &start) const; + virtual void PrintOriginatorAddress (std::ostream &os) const; + + virtual Ptr AddressBlockDeserialize (Buffer::Iterator &start) const; +}; + +/** + * \brief Concrete IPv6 specific PbbMessage class. + * + * This message will only contain IPv6 addresses. + */ +class PbbMessageIpv6 : public PbbMessage { +public: + PbbMessageIpv6 (); + virtual ~PbbMessageIpv6 (); + +protected: + virtual PbbAddressLength GetAddressLength (void) const; + + virtual void SerializeOriginatorAddress (Buffer::Iterator &start) const; + virtual Address DeserializeOriginatorAddress (Buffer::Iterator &start) const; + virtual void PrintOriginatorAddress (std::ostream &os) const; + + virtual Ptr AddressBlockDeserialize (Buffer::Iterator &start) const; +}; + +/** + * \brief An Address Block and its associated Address TLV Blocks. + * + * This is a pure virtual base class, when creating address blocks, you should + * instantiate either PbbAddressBlockIpv4 or PbbAddressBlockIpv6. + */ +class PbbAddressBlock +{ +public: + typedef std::list< Address >::iterator AddressIterator; + typedef std::list< Address >::const_iterator ConstAddressIterator; + + typedef std::list::iterator PrefixIterator; + typedef std::list::const_iterator ConstPrefixIterator; + + typedef PbbAddressTlvBlock::Iterator TlvIterator; + typedef PbbAddressTlvBlock::ConstIterator ConstTlvIterator; + + PbbAddressBlock (); + virtual ~PbbAddressBlock (); + + /* Manipulating the address block */ + + /** + * \return an iterator to the first address in this block. + */ + AddressIterator AddressBegin (void); + + /** + * \return a const iterator to the first address in this block. + */ + ConstAddressIterator AddressBegin (void) const; + + /** + * \return an iterator to the last address in this block. + */ + AddressIterator AddressEnd (void); + + /** + * \return a const iterator to the last address in this block. + */ + ConstAddressIterator AddressEnd (void) const; + + /** + * \return the number of addresses in this block. + */ + int AddressSize (void) const; + + /** + * \return true if there are no addresses in this block, false otherwise. + */ + bool AddressEmpty (void) const; + + /** + * \return the first address in this block. + */ + Address AddressFront (void) const; + + /** + * \return the last address in this block. + */ + Address AddressBack (void) const; + + /** + * \brief Prepends an address to the front of this block. + * \param address the address to prepend. + */ + void AddressPushFront (Address address); + + /** + * \brief Removes an address from the front of this block. + */ + void AddressPopFront (void); + + /** + * \brief Appends an address to the back of this block. + * \param address the address to append. + */ + void AddressPushBack (Address address); + + /** + * \brief Removes an address from the back of this block. + */ + void AddressPopBack (void); + + /** + * \brief Inserts an address at the specified position in this block. + * \param position an Iterator pointing to the position in this block to + * insert the address. + * \param value the address to insert. + * \return An iterator pointing to the newly inserted address. + */ + AddressIterator AddressInsert (AddressIterator position, + const Address value); + + /** + * \brief Removes the address at the specified position. + * \param position an Iterator pointing to the address to erase. + * \return an iterator pointing to the next address in the block. + */ + AddressIterator AddressErase (AddressIterator position); + + /** + * \brief Removes all addresses from [first, last) (includes first, not + * includes last). + * \param first an Iterator pointing to the first address to erase + * (inclusive). + * \param last an Iterator pointing to the element past the last address to + * erase. + * \return an iterator pointing to the next address in the block. + */ + AddressIterator AddressErase (AddressIterator first, AddressIterator last); + + /** + * \brief Removes all addresses from this block. + */ + void AddressClear (void); + + /* Prefix methods */ + + /** + * \return an iterator to the first prefix in this block. + */ + PrefixIterator PrefixBegin (void); + + /** + * \return a const iterator to the first prefix in this block. + */ + ConstPrefixIterator PrefixBegin (void) const; + + /** + * \return an iterator to the last prefix in this block. + */ + PrefixIterator PrefixEnd (void); + + /** + * \return a const iterator to the last prefix in this block. + */ + ConstPrefixIterator PrefixEnd (void) const; + + /** + * \return the number of prefixes in this block. + */ + int PrefixSize (void) const; + + /** + * \return true if there are no prefixes in this block, false otherwise. + */ + bool PrefixEmpty (void) const; + + /** + * \return the first prefix in this block. + */ + uint8_t PrefixFront (void) const; + + /** + * \return the last prefix in this block. + */ + uint8_t PrefixBack (void) const; + + /** + * \brief Prepends a prefix to the front of this block. + * \param prefix the prefix to prepend. + */ + void PrefixPushFront (uint8_t prefix); + + /** + * \brief Removes a prefix from the front of this block. + */ + void PrefixPopFront (void); + + /** + * \brief Appends a prefix to the back of this block. + * \param prefix the prefix to append. + */ + void PrefixPushBack (uint8_t prefix); + + /** + * \brief Removes a prefix from the back of this block. + */ + void PrefixPopBack (void); + + /** + * \brief Inserts a prefix at the specified position in this block. + * \param position an Iterator pointing to the position in this block to + * insert the prefix. + * \param value the prefix to insert. + * \return An iterator pointing to the newly inserted prefix. + */ + PrefixIterator PrefixInsert (PrefixIterator position, const uint8_t value); + + /** + * \brief Removes the prefix at the specified position. + * \param position an Iterator pointing to the prefix to erase. + * \return an iterator pointing to the next prefix in the block. + */ + PrefixIterator PrefixErase (PrefixIterator position); + + /** + * \brief Removes all prefixes from [first, last) (includes first, not + * includes last). + * \param first an Iterator pointing to the first prefix to erase + * (inclusive). + * \param last an Iterator pointing to the element past the last prefix to + * erase. + * \return an iterator pointing to the next prefix in the block. + */ + PrefixIterator PrefixErase (PrefixIterator first, PrefixIterator last); + + /** + * \brief Removes all prefixes from this block. + */ + void PrefixClear (void); + + /* Manipulating the TLV block */ + + /** + * \return an iterator to the first address TLV in this block. + */ + TlvIterator TlvBegin (void); + + /** + * \return a const iterator to the first address TLV in this block. + */ + ConstTlvIterator TlvBegin (void) const; + + /** + * \return an iterator to the last address TLV in this block. + */ + TlvIterator TlvEnd (void); + + /** + * \return a const iterator to the last address TLV in this block. + */ + ConstTlvIterator TlvEnd (void) const; + + /** + * \return the number of address TLVs in this block. + */ + int TlvSize (void) const; + + /** + * \return true if there are no address TLVs in this block, false otherwise. + */ + bool TlvEmpty (void) const; + + /** + * \return a smart pointer to the first address TLV in this block. + */ + Ptr TlvFront (void); + + /** + * \return a const smart pointer to the first address TLV in this message. + */ + const Ptr TlvFront (void) const; + + /** + * \return a smart pointer to the last address TLV in this message. + */ + Ptr TlvBack (void); + + /** + * \return a const smart pointer to the last address TLV in this message. + */ + const Ptr TlvBack (void) const; + + /** + * \brief Prepends an address TLV to the front of this message. + * \param address a smart pointer to the address TLV to prepend. + */ + void TlvPushFront (Ptr address); + + /** + * \brief Removes an address TLV from the front of this message. + */ + void TlvPopFront (void); + + /** + * \brief Appends an address TLV to the back of this message. + * \param address a smart pointer to the address TLV to append. + */ + void TlvPushBack (Ptr address); + + /** + * \brief Removes an address TLV from the back of this message. + */ + void TlvPopBack (void); + + /** + * \brief Inserts an address TLV at the specified position in this block. + * \param position an Iterator pointing to the position in this block to + * insert the address TLV. + * \param value the prefix to insert. + * \return An iterator pointing to the newly inserted address TLV. + */ + TlvIterator TlvInsert (TlvIterator position, const Ptr value); + + /** + * \brief Removes the address TLV at the specified position. + * \param position an Iterator pointing to the address TLV to erase. + * \return an iterator pointing to the next address TLV in the block. + */ + TlvIterator TlvErase (TlvIterator position); + + /** + * \brief Removes all address TLVs from [first, last) (includes first, not + * includes last). + * \param first an Iterator pointing to the first address TLV to erase + * (inclusive). + * \param last an Iterator pointing to the element past the last address TLV + * to erase. + * \return an iterator pointing to the next address TLV in the message. + */ + TlvIterator TlvErase (TlvIterator first, TlvIterator last); + + /** + * \brief Removes all address TLVs from this block. + */ + void TlvClear (void); + + /* Smart pointer methods */ + void Ref (void) const; + void Unref (void) const; + + /** + * \return The size (in bytes) needed to serialize this address block. + */ + uint32_t GetSerializedSize (void) const; + + /** + * \brief Serializes this address block into the specified buffer. + * \param start a reference to the point in a buffer to begin serializing. + * + * Users should not need to call this. Blocks will be deserialized by their + * containing packet. + */ + void Serialize (Buffer::Iterator &start) const; + + /** + * \brief Deserializes an address block from the specified buffer. + * \param start a reference to the point in a buffer to begin deserializing. + * + * Users should not need to call this. Blocks will be deserialized by their + * containing packet. + */ + void Deserialize (Buffer::Iterator &start); + + /** + * \brief Pretty-prints the contents of this address block. + * \param os a stream object to print to. + */ + void Print (std::ostream &os) const; + + /** + * \brief Pretty-prints the contents of this address block, with specified + * indentation. + * \param os a stream object to print to. + * \param level level of indentation. + * + * This probably never needs to be called by users. This is used when + * recursively printing sub-objects. + */ + void Print (std::ostream &os, int level) const; + + bool operator== (const PbbAddressBlock &other) const; + bool operator!= (const PbbAddressBlock &other) const; + +protected: + virtual uint8_t GetAddressLength (void) const = 0; + + virtual void SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const = 0; + virtual Address DeserializeAddress (uint8_t *buffer) const = 0; + virtual void PrintAddress (std::ostream &os, ConstAddressIterator iter) const = 0; + +private: + uint8_t GetPrefixFlags (void) const; + void GetHeadTail (uint8_t *head, uint8_t &headlen, + uint8_t *tail, uint8_t &taillen) const; + bool HasZeroTail (const uint8_t *tail, uint8_t taillen) const; + + std::list
    m_addressList; + std::list m_prefixList; + PbbAddressTlvBlock m_addressTlvList; + + mutable uint32_t m_refCount; +}; + +/** + * \brief Concrete IPv4 specific PbbAddressBlock. + * + * This address block will only contain IPv4 addresses. + */ +class PbbAddressBlockIpv4 : public PbbAddressBlock +{ +public: + PbbAddressBlockIpv4 (); + virtual ~PbbAddressBlockIpv4 (); + +protected: + virtual uint8_t GetAddressLength (void) const; + + virtual void SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const; + virtual Address DeserializeAddress (uint8_t *buffer) const; + virtual void PrintAddress (std::ostream &os, ConstAddressIterator iter) const; +}; + +/** + * \brief Concrete IPv6 specific PbbAddressBlock. + * + * This address block will only contain IPv6 addresses. + */ +class PbbAddressBlockIpv6 : public PbbAddressBlock +{ +public: + PbbAddressBlockIpv6 (); + virtual ~PbbAddressBlockIpv6 (); + +protected: + virtual uint8_t GetAddressLength (void) const; + + virtual void SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const; + virtual Address DeserializeAddress (uint8_t *buffer) const; + virtual void PrintAddress (std::ostream &os, ConstAddressIterator iter) const; +}; + +/** + * \brief A packet or message TLV + */ +class PbbTlv +{ +public: + PbbTlv (void); + ~PbbTlv (void); + + /** + * \brief Sets the type of this TLV. + * \param type the type value to set. + */ + void SetType (uint8_t type); + + /** + * \return the type of this TLV. + */ + uint8_t GetType (void) const; + + /** + * \brief Sets the type extension of this TLV. + * \param type the type extension value to set. + * + * The type extension is like a sub-type used to further distinguish between + * TLVs of the same type. + */ + void SetTypeExt (uint8_t type); + + /** + * \return the type extension for this TLV. + * + * Calling this while HasTypeExt is False is undefined. Make sure you check + * it first. This will be checked by an assert in debug builds. + */ + uint8_t GetTypeExt (void) const; + + /** + * \brief Tests whether or not this TLV has a type extension. + * \return true if this TLV has a type extension, false otherwise. + * + * This should be called before calling GetTypeExt to make sure there + * actually is one. + */ + bool HasTypeExt (void) const; + + /** + * \brief Sets the value of this message to the specified buffer. + * \param start a buffer instance. + * + * The buffer is _not_ copied until this TLV is serialized. You should not + * change the contents of the buffer you pass in to this function. + */ + void SetValue (Buffer start); + + /** + * \brief Sets the value of this message to a buffer with the specified data. + * \param buffer a pointer to data to put in the TLVs buffer. + * \param size the size of the buffer. + * + * The buffer *is copied* into a *new buffer instance*. You can free the + * data in the buffer provided anytime you wish. + */ + void SetValue (const uint8_t * buffer, uint32_t size); + + /** + * \return a Buffer pointing to the value of this TLV. + * + * Calling this while HasValue is False is undefined. Make sure you check it + * first. This will be checked by an assert in debug builds. + */ + Buffer GetValue (void) const; + + /** + * \brief Tests whether or not this TLV has a value. + * \return true if this tlv has a TLV, false otherwise. + * + * This should be called before calling GetTypeExt to make sure there + * actually is one. + */ + bool HasValue (void) const; + + /* Smart pointer methods */ + void Ref (void) const; + void Unref (void) const; + + /** + * \return The size (in bytes) needed to serialize this TLV. + */ + uint32_t GetSerializedSize (void) const; + + /** + * \brief Serializes this TLV into the specified buffer. + * \param start a reference to the point in a buffer to begin serializing. + * + * Users should not need to call this. TLVs will be serialized by their + * containing blocks. + */ + void Serialize (Buffer::Iterator &start) const; + + /** + * \brief Deserializes a TLV from the specified buffer. + * \param start a reference to the point in a buffer to begin deserializing. + * + * Users should not need to call this. TLVs will be deserialized by their + * containing blocks. + */ + void Deserialize (Buffer::Iterator &start); + + /** + * \brief Pretty-prints the contents of this TLV. + * \param os a stream object to print to. + */ + void Print (std::ostream &os) const; + + /** + * \brief Pretty-prints the contents of this TLV, with specified indentation. + * \param os a stream object to print to. + * \param level level of indentation. + * + * This probably never needs to be called by users. This is used when + * recursively printing sub-objects. + */ + void Print (std::ostream &os, int level) const; + + bool operator== (const PbbTlv &other) const; + bool operator!= (const PbbTlv &other) const; + +protected: + void SetIndexStart (uint8_t index); + uint8_t GetIndexStart (void) const; + bool HasIndexStart (void) const; + + void SetIndexStop (uint8_t index); + uint8_t GetIndexStop (void) const; + bool HasIndexStop (void) const; + + void SetMultivalue (bool isMultivalue); + bool IsMultivalue (void) const; + +private: + uint8_t m_type; + + bool m_hasTypeExt; + uint8_t m_typeExt; + + bool m_hasIndexStart; + uint8_t m_indexStart; + + bool m_hasIndexStop; + uint8_t m_indexStop; + + bool m_isMultivalue; + bool m_hasValue; + Buffer m_value; + + mutable uint32_t m_refCount; +}; + +/** + * \brief An Address TLV + */ +class PbbAddressTlv : public PbbTlv +{ +public: + /** + * \brief Sets the index of the first address in the associated address block + * that this address TLV applies to. + * \param index the index of the first address. + */ + void SetIndexStart (uint8_t index); + + /** + * \return the first (inclusive) index of the address in the corresponding + * address block that this TLV applies to. + * + * Calling this while HasIndexStart is False is undefined. Make sure you + * check it first. This will be checked by an assert in debug builds. + */ + uint8_t GetIndexStart (void) const; + + /** + * \brief Tests whether or not this address TLV has a start index. + * \return true if this address TLV has a start index, false otherwise. + * + * This should be called before calling GetIndexStart to make sure there + * actually is one. + */ + bool HasIndexStart (void) const; + + /** + * \brief Sets the index of the last address in the associated address block + * that this address TLV applies to. + * \param index the index of the last address. + */ + void SetIndexStop (uint8_t index); + + /** + * \return the last (inclusive) index of the address in the corresponding + * PbbAddressBlock that this TLV applies to. + * + * Calling this while HasIndexStop is False is undefined. Make sure you + * check it first. This will be checked by an assert in debug builds. + */ + uint8_t GetIndexStop (void) const; + + /** + * \brief Tests whether or not this address TLV has a stop index. + * \return true if this address TLV has a stop index, false otherwise. + * + * This should be called before calling GetIndexStop to make sure there + * actually is one. + */ + bool HasIndexStop (void) const; + + /** + * \brief Sets whether or not this address TLV is "multivalue" + * \param isMultivalue whether or not this address TLV should be multivalue. + * + * If true, this means the value associated with this TLV should be divided + * evenly into (GetIndexStop() - GetIndexStart() + 1) values. Otherwise, the + * value is one single value that applies to each address in the range. + */ + void SetMultivalue (bool isMultivalue); + + /** + * \brief Tests whether or not this address TLV is "multivalue" + * \return whether this address TLV is multivalue or not. + */ + bool IsMultivalue (void) const; +}; + +} /* namespace ns3 */ + +#endif /* PACKETBB_H */ diff --git a/src/node/queue.h b/src/node/queue.h index d12f60068..a9315ef16 100644 --- a/src/node/queue.h +++ b/src/node/queue.h @@ -56,6 +56,7 @@ public: bool IsEmpty (void) const; /** * Place a packet into the rear of the Queue + * \param p packet to enqueue * \return True if the operation was successful; false otherwise */ bool Enqueue (Ptr p); diff --git a/src/node/socket.h b/src/node/socket.h index ef529adeb..7bfb66616 100644 --- a/src/node/socket.h +++ b/src/node/socket.h @@ -487,8 +487,9 @@ public: */ int RecvFrom (uint8_t* buf, uint32_t size, uint32_t flags, Address &fromAddress); - /** - * \returns the address name this socket is associated with. + /** + * \param address the address name this socket is associated with. + * \returns 0 if success, -1 otherwise */ virtual int GetSockName (Address &address) const = 0; diff --git a/src/node/wscript b/src/node/wscript index 1430e63ef..723abf6a2 100644 --- a/src/node/wscript +++ b/src/node/wscript @@ -24,6 +24,7 @@ def build(bld): 'drop-tail-queue.cc', 'channel.cc', 'node-list.cc', + 'channel-list.cc', 'socket.cc', 'socket-factory.cc', 'packet-socket-factory.cc', @@ -45,6 +46,8 @@ def build(bld): 'ipv6.cc', 'ipv6-raw-socket-factory.cc', 'ipv6-routing-protocol.cc', + 'packetbb.cc', + 'packetbb-test-suite.cc', ] headers = bld.new_task_gen('ns3header') @@ -71,6 +74,7 @@ def build(bld): 'ethernet-trailer.h', 'channel.h', 'node-list.h', + 'channel-list.h', 'socket.h', 'socket-factory.h', 'packet-socket-factory.h', @@ -91,4 +95,5 @@ def build(bld): 'ipv6.h', 'ipv6-raw-socket-factory.h', 'ipv6-routing-protocol.h', + 'packetbb.h', ] diff --git a/src/routing/global-routing/candidate-queue.h b/src/routing/global-routing/candidate-queue.h index c8b900e44..c6e6af577 100644 --- a/src/routing/global-routing/candidate-queue.h +++ b/src/routing/global-routing/candidate-queue.h @@ -167,6 +167,7 @@ private: * Candidate Queue copy construction is disallowed (not implemented) to * prevent the compiler from slipping in incorrect versions that don't * properly deal with deep copies. + * \param sr object to copy */ CandidateQueue (CandidateQueue& sr); @@ -174,6 +175,7 @@ private: * Candidate Queue assignment operator is disallowed (not implemented) to * prevent the compiler from slipping in incorrect versions that don't * properly deal with deep copies. + * \param sr object to assign */ CandidateQueue& operator= (CandidateQueue& sr); diff --git a/src/routing/global-routing/global-router-interface.h b/src/routing/global-routing/global-router-interface.h index c8d541ced..342d40f5a 100644 --- a/src/routing/global-routing/global-router-interface.h +++ b/src/routing/global-routing/global-router-interface.h @@ -401,7 +401,7 @@ public: /** * @brief Set the Link State ID is defined by the OSPF spec. We always set it * to the router ID of the router making the advertisement. - * + * @param addr IPv4 address which will act as ID * @see RoutingEnvironment::AllocateRouterId () * @see GlobalRouting::GetRouterId () */ @@ -421,6 +421,7 @@ public: * @brief Set the Advertising Router as defined by the OSPF spec. We always * set it to the router ID of the router making the advertisement. * + * @param rtr ID of the router making advertisement * @see RoutingEnvironment::AllocateRouterId () * @see GlobalRouting::GetRouterId () */ @@ -473,7 +474,7 @@ public: /** * @brief Set the SPF status of the advertisement - * + * @param status SPF status to set * @see SPFStatus */ void SetStatus (SPFStatus status); diff --git a/src/routing/list-routing/ipv6-list-routing.h b/src/routing/list-routing/ipv6-list-routing.h index 03db18704..fb0527e79 100644 --- a/src/routing/list-routing/ipv6-list-routing.h +++ b/src/routing/list-routing/ipv6-list-routing.h @@ -28,8 +28,11 @@ namespace ns3 { * \ingroup routing * \defgroup ipv6ListRouting Ipv6 List Routing */ + /** * \ingroup ipv6ListRouting + * \class Ipv6ListRouting + * \brief Hold list of Ipv6RoutingProtocol objects. * * This class is a specialization of Ipv6RoutingProtocol that allows * other instances of Ipv6RoutingProtocol to be inserted in a @@ -44,33 +47,46 @@ namespace ns3 { class Ipv6ListRouting : public Ipv6RoutingProtocol { public: + /** + * \brief Get the type ID of this class. + * \return type ID + */ static TypeId GetTypeId (void); + /** + * \brief Constructor. + */ Ipv6ListRouting (); + + /** + * \brief Destructor. + */ virtual ~Ipv6ListRouting (); /** * \brief Register a new routing protocol to be used in this IPv4 stack - * * \param routingProtocol new routing protocol implementation object * \param priority priority to give to this routing protocol. * Values may range between -32768 and +32767. */ virtual void AddRoutingProtocol (Ptr routingProtocol, int16_t priority); + /** + * \brief Get the number of routing protocols. * \return number of routing protocols in the list */ virtual uint32_t GetNRoutingProtocols (void) const; + /** - * Return pointer to routing protocol stored at index, with the - * first protocol (index 0) the highest priority, the next one (index 1) + * \brief Get pointer to routing protocol stored at index, + * + * The first protocol (index 0) the highest priority, the next one (index 1) * the second highest priority, and so on. The priority parameter is an * output parameter and it returns the integer priority of the protocol. - * - * \return pointer to routing protocol indexed by * \param index index of protocol to return * \param priority output parameter, set to the priority of the protocol - being returned + * being returned + * \return pointer to routing protocol indexed by */ virtual Ptr GetRoutingProtocol (uint32_t index, int16_t& priority) const; @@ -89,14 +105,32 @@ public: virtual void SetIpv6 (Ptr ipv6); protected: + /** + * \brief Dispose this object. + */ void DoDispose (void); + private: typedef std::pair > Ipv6RoutingProtocolEntry; typedef std::list Ipv6RoutingProtocolList; - Ipv6RoutingProtocolList m_routingProtocols; - static bool Compare (const Ipv6RoutingProtocolEntry& a, const Ipv6RoutingProtocolEntry& b); - Ptr m_ipv6; + /** + * \brief Compare two routing protocols. + * \param a first object to compare + * \param b second object to compare + * \return true if they are the same, false otherwise + */ + static bool Compare (const Ipv6RoutingProtocolEntry& a, const Ipv6RoutingProtocolEntry& b); + + /** + * \brief List of routing protocols. + */ + Ipv6RoutingProtocolList m_routingProtocols; + + /** + * \brief Ipv6 reference. + */ + Ptr m_ipv6; }; } //namespace ns3 diff --git a/src/routing/nix-vector-routing/ipv4-nix-vector-routing.cc b/src/routing/nix-vector-routing/ipv4-nix-vector-routing.cc new file mode 100644 index 000000000..c6e65de7c --- /dev/null +++ b/src/routing/nix-vector-routing/ipv4-nix-vector-routing.cc @@ -0,0 +1,840 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 The Georgia Institute of Technology + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Josh Pelkey + */ + +#include + +#include "ns3/log.h" +#include "ns3/abort.h" +#include "ns3/ipv4-list-routing.h" + +#include "ipv4-nix-vector-routing.h" + +NS_LOG_COMPONENT_DEFINE ("Ipv4NixVectorRouting"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (Ipv4NixVectorRouting); + +TypeId +Ipv4NixVectorRouting::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::Ipv4NixVectorRouting") + .SetParent () + .AddConstructor () + ; + return tid; +} + +Ipv4NixVectorRouting::Ipv4NixVectorRouting () +:m_totalNeighbors (0) +{ + NS_LOG_FUNCTION_NOARGS (); +} + +Ipv4NixVectorRouting::~Ipv4NixVectorRouting () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +void +Ipv4NixVectorRouting::SetIpv4 (Ptr ipv4) +{ + NS_ASSERT (ipv4 != 0); + NS_ASSERT (m_ipv4 == 0); + NS_LOG_DEBUG ("Created Ipv4NixVectorProtocol"); + + m_ipv4 = ipv4; +} + +void +Ipv4NixVectorRouting::DoDispose () +{ + NS_LOG_FUNCTION_NOARGS (); + + m_node = 0; + m_ipv4 = 0; + + Ipv4RoutingProtocol::DoDispose (); +} + + +void +Ipv4NixVectorRouting::SetNode (Ptr node) +{ + NS_LOG_FUNCTION_NOARGS (); + + m_node = node; +} + +void +Ipv4NixVectorRouting::FlushGlobalNixRoutingCache () +{ + NS_LOG_FUNCTION_NOARGS (); + NodeList::Iterator listEnd = NodeList::End (); + for (NodeList::Iterator i = NodeList::Begin (); i != listEnd; i++) + { + Ptr node = *i; + Ptr rp = node->GetObject (); + if (!rp) + { + continue; + } + NS_LOG_LOGIC ("Flushing Nix caches."); + rp->FlushNixCache (); + rp->FlushIpv4RouteCache (); + } +} + +void +Ipv4NixVectorRouting::FlushNixCache () +{ + NS_LOG_FUNCTION_NOARGS (); + m_nixCache.clear (); +} + +void +Ipv4NixVectorRouting::FlushIpv4RouteCache () +{ + NS_LOG_FUNCTION_NOARGS (); + m_ipv4RouteCache.clear (); +} + +Ptr +Ipv4NixVectorRouting::GetNixVector (Ptr source, Ipv4Address dest) +{ + NS_LOG_FUNCTION_NOARGS (); + + Ptr nixVector = CreateObject (); + + // not in cache, must build the nix vector + // First, we have to figure out the nodes + // associated with these IPs + Ptr destNode = GetNodeByIp (dest); + if (destNode == 0) + { + NS_LOG_ERROR ("No routing path exists"); + return 0; + } + + // if source == dest, then we have a special case + // because the node is sending to itself. have to + // build the nix vector a little differently + if (source == destNode) + { + BuildNixVectorLocal(nixVector); + return nixVector; + } + else + { + // otherwise proceed as normal + // and build the nix vector + std::vector< Ptr > parentVector; + BFS (NodeList::GetNNodes (), source, destNode, parentVector); + + if (BuildNixVector (parentVector, source->GetId (), destNode->GetId (), nixVector)) + { + return nixVector; + } + else + { + NS_LOG_ERROR ("No routing path exists"); + return 0; + } + } +} + +Ptr +Ipv4NixVectorRouting::GetNixVectorInCache (Ipv4Address address) +{ + NS_LOG_FUNCTION_NOARGS (); + + NixMap_t::iterator iter = m_nixCache.find (address); + if (iter != m_nixCache.end ()) + { + NS_LOG_LOGIC ("Found Nix-vector in cache."); + return iter->second; + } + + // not in cache + return 0; +} + +Ptr +Ipv4NixVectorRouting::GetIpv4RouteInCache (Ipv4Address address) +{ + NS_LOG_FUNCTION_NOARGS (); + + Ipv4RouteMap_t::iterator iter = m_ipv4RouteCache.find (address); + if (iter != m_ipv4RouteCache.end ()) + { + NS_LOG_LOGIC ("Found Ipv4Route in cache."); + return iter->second; + } + + // not in cache + return 0; +} + +bool +Ipv4NixVectorRouting::BuildNixVectorLocal (Ptr nixVector) +{ + NS_LOG_FUNCTION_NOARGS (); + + uint32_t numberOfDevices = m_node->GetNDevices (); + + // here we are building a nix vector to + // ourself, so we need to find the loopback + // interface and add that to the nix vector + Ipv4Address loopback ("127.0.0.1"); + for (uint32_t i = 0; i < numberOfDevices; i++) + { + uint32_t interfaceIndex = (m_ipv4)->GetInterfaceForDevice(m_node->GetDevice(i)); + Ipv4InterfaceAddress ifAddr = m_ipv4->GetAddress (interfaceIndex, 0); + if (ifAddr.GetLocal() == loopback) + { + NS_LOG_LOGIC ("Adding loopback to nix."); + NS_LOG_LOGIC ("Adding Nix: " << i << " with " << nixVector->BitCount (numberOfDevices) + << " bits, for node " << m_node->GetId()); + nixVector->AddNeighborIndex (i, nixVector->BitCount (numberOfDevices)); + return true; + } + } + return false; +} + +bool +Ipv4NixVectorRouting::BuildNixVector (const std::vector< Ptr > & parentVector, uint32_t source, uint32_t dest, Ptr nixVector) +{ + NS_LOG_FUNCTION_NOARGS (); + + if (source == dest) + { + return true; + } + + if (parentVector.at (dest) == 0) + { + return false; + } + + Ptr parentNode = parentVector.at (dest); + + uint32_t numberOfDevices = parentNode->GetNDevices (); + uint32_t destId = 0; + uint32_t totalNeighbors = 0; + + // scan through the net devices on the parent node + // and then look at the nodes adjacent to them + for (uint32_t i = 0; i < numberOfDevices; i++) + { + // Get a net device from the node + // as well as the channel, and figure + // out the adjacent net devices + Ptr localNetDevice = parentNode->GetDevice (i); + if (localNetDevice->IsBridge ()) + { + continue; + } + Ptr channel = localNetDevice->GetChannel (); + if (channel == 0) + { + continue; + } + + // this function takes in the local net dev, and channnel, and + // writes to the netDeviceContainer the adjacent net devs + NetDeviceContainer netDeviceContainer; + GetAdjacentNetDevices (localNetDevice, channel, netDeviceContainer); + + // Finally we can get the adjacent nodes + // and scan through them. If we find the + // node that matches "dest" then we can add + // the index to the nix vector. + // the index corresponds to the neighbor index + uint32_t offset = 0; + for (NetDeviceContainer::Iterator iter = netDeviceContainer.Begin (); iter != netDeviceContainer.End (); iter++) + { + Ptr remoteNode = (*iter)->GetNode (); + + if (remoteNode->GetId () == dest) + { + destId = totalNeighbors + offset; + } + offset += 1; + } + + totalNeighbors += netDeviceContainer.GetN (); + } + NS_LOG_LOGIC ("Adding Nix: " << destId << " with " + << nixVector->BitCount (totalNeighbors) << " bits, for node " << parentNode->GetId()); + nixVector->AddNeighborIndex (destId, nixVector->BitCount (totalNeighbors)); + + // recurse through parent vector, grabbing the path + // and building the nix vector + BuildNixVector (parentVector, source, (parentVector.at (dest))->GetId (), nixVector); + return true; +} + +void +Ipv4NixVectorRouting::GetAdjacentNetDevices (Ptr netDevice, Ptr channel, NetDeviceContainer & netDeviceContainer) +{ + NS_LOG_FUNCTION_NOARGS (); + + for (uint32_t i = 0; i < channel->GetNDevices (); i++) + { + Ptr remoteDevice = channel->GetDevice (i); + if (remoteDevice != netDevice) + { + Ptr bd = NetDeviceIsBridged (remoteDevice); + // we have a bridged device, we need to add all + // bridged devices + if (bd) + { + NS_LOG_LOGIC ("Looking through bridge ports of bridge net device " << bd); + for (uint32_t j = 0; j < bd->GetNBridgePorts (); ++j) + { + Ptr ndBridged = bd->GetBridgePort (j); + if (ndBridged == remoteDevice) + { + NS_LOG_LOGIC ("That bridge port is me, don't walk backward"); + continue; + } + Ptr chBridged = ndBridged->GetChannel (); + if (channel == 0) + { + continue; + } + GetAdjacentNetDevices (ndBridged, chBridged, netDeviceContainer); + } + } + else + { + netDeviceContainer.Add (channel->GetDevice (i)); + } + } + } +} + +Ptr +Ipv4NixVectorRouting::GetNodeByIp (Ipv4Address dest) +{ + NS_LOG_FUNCTION_NOARGS (); + + NodeContainer allNodes = NodeContainer::GetGlobal (); + Ptr destNode; + + for (NodeContainer::Iterator i = allNodes.Begin (); i != allNodes.End (); ++i) + { + Ptr node = *i; + Ptr ipv4 = node->GetObject (); + if (ipv4->GetInterfaceForAddress (dest) != -1) + { + destNode = node; + break; + } + } + + if (!destNode) + { + NS_LOG_ERROR ("Couldn't find dest node given the IP" << dest); + return 0; + } + + return destNode; +} + +uint32_t +Ipv4NixVectorRouting::FindTotalNeighbors () +{ + uint32_t numberOfDevices = m_node->GetNDevices (); + uint32_t totalNeighbors = 0; + + // scan through the net devices on the parent node + // and then look at the nodes adjacent to them + for (uint32_t i = 0; i < numberOfDevices; i++) + { + // Get a net device from the node + // as well as the channel, and figure + // out the adjacent net devices + Ptr localNetDevice = m_node->GetDevice (i); + Ptr channel = localNetDevice->GetChannel (); + if (channel == 0) + { + continue; + } + + // this function takes in the local net dev, and channnel, and + // writes to the netDeviceContainer the adjacent net devs + NetDeviceContainer netDeviceContainer; + GetAdjacentNetDevices (localNetDevice, channel, netDeviceContainer); + + totalNeighbors += netDeviceContainer.GetN (); + } + + return totalNeighbors; +} + +Ptr +Ipv4NixVectorRouting::NetDeviceIsBridged (Ptr nd) const +{ + NS_LOG_FUNCTION (nd); + + Ptr node = nd->GetNode (); + uint32_t nDevices = node->GetNDevices(); + + // + // There is no bit on a net device that says it is being bridged, so we have + // to look for bridges on the node to which the device is attached. If we + // find a bridge, we need to look through its bridge ports (the devices it + // bridges) to see if we find the device in question. + // + for (uint32_t i = 0; i < nDevices; ++i) + { + Ptr ndTest = node->GetDevice(i); + NS_LOG_LOGIC ("Examine device " << i << " " << ndTest); + + if (ndTest->IsBridge ()) + { + NS_LOG_LOGIC ("device " << i << " is a bridge net device"); + Ptr bnd = ndTest->GetObject (); + NS_ABORT_MSG_UNLESS (bnd, "Ipv4NixVectorRouting::NetDeviceIsBridged (): GetObject for failed"); + + for (uint32_t j = 0; j < bnd->GetNBridgePorts (); ++j) + { + NS_LOG_LOGIC ("Examine bridge port " << j << " " << bnd->GetBridgePort (j)); + if (bnd->GetBridgePort (j) == nd) + { + NS_LOG_LOGIC ("Net device " << nd << " is bridged by " << bnd); + return bnd; + } + } + } + } + NS_LOG_LOGIC ("Net device " << nd << " is not bridged"); + return 0; +} + +uint32_t +Ipv4NixVectorRouting::FindNetDeviceForNixIndex (uint32_t nodeIndex, Ipv4Address & gatewayIp) +{ + uint32_t numberOfDevices = m_node->GetNDevices (); + uint32_t index = 0; + uint32_t totalNeighbors = 0; + + // scan through the net devices on the parent node + // and then look at the nodes adjacent to them + for (uint32_t i = 0; i < numberOfDevices; i++) + { + // Get a net device from the node + // as well as the channel, and figure + // out the adjacent net devices + Ptr localNetDevice = m_node->GetDevice (i); + Ptr channel = localNetDevice->GetChannel (); + if (channel == 0) + { + continue; + } + + // this function takes in the local net dev, and channnel, and + // writes to the netDeviceContainer the adjacent net devs + NetDeviceContainer netDeviceContainer; + GetAdjacentNetDevices (localNetDevice, channel, netDeviceContainer); + + // check how many neighbors we have + if (nodeIndex < (totalNeighbors + netDeviceContainer.GetN ())) + { + // found the proper net device + index = i; + Ptr gatewayDevice = netDeviceContainer.Get (nodeIndex-totalNeighbors); + Ptr gatewayNode = gatewayDevice->GetNode (); + Ptr ipv4 = gatewayNode->GetObject (); + + uint32_t interfaceIndex = (ipv4)->GetInterfaceForDevice(gatewayDevice); + Ipv4InterfaceAddress ifAddr = ipv4->GetAddress (interfaceIndex, 0); + gatewayIp = ifAddr.GetLocal (); + break; + } + totalNeighbors += netDeviceContainer.GetN (); + } + + return index; +} + +Ptr +Ipv4NixVectorRouting::RouteOutput (Ptr p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr) +{ + NS_LOG_FUNCTION_NOARGS (); + Ptr rtentry; + Ptr nixVectorInCache; + Ptr nixVectorForPacket; + + NS_LOG_DEBUG ("Dest IP from header: " << header.GetDestination ()); + // check if cache + nixVectorInCache = GetNixVectorInCache(header.GetDestination ()); + + // not in cache + if (!nixVectorInCache) + { + NS_LOG_LOGIC ("Nix-vector not in cache, build: "); + // Build the nix-vector, given this node and the + // dest IP address + nixVectorInCache = GetNixVector (m_node, header.GetDestination ()); + + // cache it + m_nixCache.insert (NixMap_t::value_type (header.GetDestination (), nixVectorInCache)); + } + + // path exists + if (nixVectorInCache) + { + NS_LOG_LOGIC ("Nix-vector contents: " << *nixVectorInCache); + + // create a new nix vector to be used, + // we want to keep the cached version clean + nixVectorForPacket = CreateObject (); + nixVectorForPacket = nixVectorInCache->Copy(); + + // Get the interface number that we go out of, by extracting + // from the nix-vector + if (m_totalNeighbors == 0) + { + m_totalNeighbors = FindTotalNeighbors (); + } + + // Get the interface number that we go out of, by extracting + // from the nix-vector + uint32_t numberOfBits = nixVectorForPacket->BitCount (m_totalNeighbors); + uint32_t nodeIndex = nixVectorForPacket->ExtractNeighborIndex (numberOfBits); + + // Possibly search here in a cache for this node index + // and look for a Ipv4Route. If we have it, don't + // need to do the next 3 lines. + rtentry = GetIpv4RouteInCache (header.GetDestination ()); + // not in cache + if (!rtentry) + { + NS_LOG_LOGIC ("Ipv4Route not in cache, build: "); + Ipv4Address gatewayIp; + uint32_t index = FindNetDeviceForNixIndex (nodeIndex, gatewayIp); + + uint32_t interfaceIndex = (m_ipv4)->GetInterfaceForDevice(m_node->GetDevice(index)); + Ipv4InterfaceAddress ifAddr = m_ipv4->GetAddress (interfaceIndex, 0); + + // start filling in the Ipv4Route info + rtentry = Create (); + rtentry->SetSource (ifAddr.GetLocal ()); + + rtentry->SetGateway (gatewayIp); + rtentry->SetDestination (header.GetDestination ()); + rtentry->SetOutputDevice (m_ipv4->GetNetDevice (interfaceIndex)); + + sockerr = Socket::ERROR_NOTERROR; + + // add rtentry to cache + m_ipv4RouteCache.insert(Ipv4RouteMap_t::value_type(header.GetDestination (), rtentry)); + } + + NS_LOG_LOGIC ("Nix-vector contents: " << *nixVectorInCache << " : Remaining bits: " << nixVectorForPacket->GetRemainingBits()); + + // Add nix-vector in the packet class + // make sure the packet exists first + if (p) + { + NS_LOG_LOGIC ("Adding Nix-vector to packet: " << *nixVectorForPacket); + p->SetNixVector (nixVectorForPacket); + } + } + else // path doesn't exist + { + NS_LOG_ERROR ("No path to the dest: " << header.GetDestination ()); + sockerr = Socket::ERROR_NOROUTETOHOST; + } + + return rtentry; +} + +bool +Ipv4NixVectorRouting::RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + UnicastForwardCallback ucb, MulticastForwardCallback mcb, + LocalDeliverCallback lcb, ErrorCallback ecb) +{ + NS_LOG_FUNCTION_NOARGS (); + + Ptr rtentry; + + // Get the nix-vector from the packet + Ptr nixVector = p->GetNixVector(); + + // make sure it exists, if not something + // went wrong + if (!nixVector) + { + NS_LOG_ERROR ("Nix-vector wasn't in the packet! Rebuild."); + + Ptr nixVectorInCache; + + NS_LOG_DEBUG ("Dest IP from header: " << header.GetDestination ()); + + // check if cache + nixVectorInCache = GetNixVectorInCache(header.GetDestination ()); + + // not in cache + if (!nixVectorInCache) + { + NS_LOG_LOGIC ("RouteInput(): Nix-vector not in cache, build: "); + + // Build the nix-vector, given this node and the + // dest IP address + nixVectorInCache = GetNixVector (m_node, header.GetDestination ()); + } + + // path exists + if (nixVectorInCache) + { + NS_LOG_LOGIC ("Nix-vector contents: " << *nixVectorInCache); + + // cache it + m_nixCache.insert(NixMap_t::value_type(header.GetDestination (), nixVectorInCache)); + + // create a new nix vector to be used, + // we want to keep the cached version clean + Ptr nixVectorForPacket; + nixVectorForPacket = CreateObject (); + nixVectorForPacket = nixVectorInCache->Copy(); + + // Get the interface number that we go out of, by extracting + // from the nix-vector + if (m_totalNeighbors == 0) + { + m_totalNeighbors = FindTotalNeighbors (); + } + uint32_t numberOfBits = nixVectorForPacket->BitCount (m_totalNeighbors); + uint32_t nodeIndex = nixVectorForPacket->ExtractNeighborIndex (numberOfBits); + + rtentry = GetIpv4RouteInCache (header.GetDestination ()); + // not in cache + if (!rtentry) + { + NS_LOG_LOGIC ("Ipv4Route not in cache, build: "); + Ipv4Address gatewayIp; + uint32_t index = FindNetDeviceForNixIndex (nodeIndex, gatewayIp); + + uint32_t interfaceIndex = (m_ipv4)->GetInterfaceForDevice(m_node->GetDevice(index)); + Ipv4InterfaceAddress ifAddr = m_ipv4->GetAddress (interfaceIndex, 0); + + // start filling in the Ipv4Route info + rtentry = Create (); + rtentry->SetSource (ifAddr.GetLocal ()); + + rtentry->SetGateway (Ipv4Address(gatewayIp)); + rtentry->SetDestination (header.GetDestination ()); + rtentry->SetOutputDevice (m_ipv4->GetNetDevice (interfaceIndex)); + + // add rtentry to cache + m_ipv4RouteCache.insert(Ipv4RouteMap_t::value_type(header.GetDestination (), rtentry)); + } + + NS_LOG_LOGIC ("Nix-vector contents: " << *nixVectorInCache << " : Remaining bits: " << nixVectorForPacket->GetRemainingBits()); + + // Add nix-vector in the packet class + // have to copy the packet first b/c + // it is const + Ptr newPacket = Create (); + newPacket = p->Copy(); + + NS_LOG_LOGIC ("Adding Nix-vector to packet: " << *nixVectorForPacket); + newPacket->SetNixVector(nixVectorForPacket); + + // call the unicast callback + // local deliver is handled by Ipv4StaticRoutingImpl + // so this code is never even called if the packet is + // destined for this node. + ucb (rtentry, newPacket, header); + return true; + } + else // path doesn't exist + { + NS_LOG_ERROR ("No path to the dest: " << header.GetDestination ()); + return false; + } + } + else + { + // Get the interface number that we go out of, by extracting + // from the nix-vector + if (m_totalNeighbors == 0) + { + m_totalNeighbors = FindTotalNeighbors (); + } + uint32_t numberOfBits = nixVector->BitCount (m_totalNeighbors); + uint32_t nodeIndex = nixVector->ExtractNeighborIndex (numberOfBits); + + rtentry = GetIpv4RouteInCache (header.GetDestination ()); + // not in cache + if (!rtentry) + { + NS_LOG_LOGIC ("Ipv4Route not in cache, build: "); + Ipv4Address gatewayIp; + uint32_t index = FindNetDeviceForNixIndex (nodeIndex, gatewayIp); + uint32_t interfaceIndex = (m_ipv4)->GetInterfaceForDevice(m_node->GetDevice(index)); + Ipv4InterfaceAddress ifAddr = m_ipv4->GetAddress (interfaceIndex, 0); + + // start filling in the Ipv4Route info + rtentry = Create (); + rtentry->SetSource (ifAddr.GetLocal ()); + + rtentry->SetGateway (gatewayIp); + rtentry->SetDestination (header.GetDestination ()); + rtentry->SetOutputDevice (m_ipv4->GetNetDevice (interfaceIndex)); + + // add rtentry to cache + m_ipv4RouteCache.insert(Ipv4RouteMap_t::value_type(header.GetDestination (), rtentry)); + } + + NS_LOG_LOGIC ("At Node " << m_node->GetId() << ", Extracting " << numberOfBits << + " bits from Nix-vector: " << nixVector << " : " << *nixVector); + + // call the unicast callback + // local deliver is handled by Ipv4StaticRoutingImpl + // so this code is never even called if the packet is + // destined for this node. + ucb (rtentry, p, header); + + return true; + } +} + +// virtual functions from Ipv4RoutingProtocol +void +Ipv4NixVectorRouting::NotifyInterfaceUp (uint32_t i) +{ + FlushGlobalNixRoutingCache (); +} +void +Ipv4NixVectorRouting::NotifyInterfaceDown (uint32_t i) +{ + FlushGlobalNixRoutingCache (); +} +void +Ipv4NixVectorRouting::NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address) +{ + FlushGlobalNixRoutingCache (); +} +void +Ipv4NixVectorRouting::NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address) +{ + FlushGlobalNixRoutingCache (); +} + +bool +Ipv4NixVectorRouting::BFS (uint32_t numberOfNodes, Ptr source, Ptr dest, std::vector< Ptr > & parentVector) +{ + NS_LOG_FUNCTION_NOARGS (); + + NS_LOG_LOGIC ("Going from Node " << source->GetId() << " to Node " << dest->GetId()); + std::queue< Ptr > greyNodeList; // discovered nodes with unexplored children + + // reset the parent vector + parentVector.clear (); + parentVector.reserve (sizeof (Ptr)*numberOfNodes); + parentVector.insert (parentVector.begin (), sizeof (Ptr)*numberOfNodes, 0); // initialize to 0 + + // Add the source node to the queue, set its parent to itself + greyNodeList.push (source); + parentVector.at (source->GetId()) = source; + + // BFS loop + while (greyNodeList.size () != 0) + { + Ptr currNode = greyNodeList.front (); + Ptr ipv4 = currNode->GetObject (); + + if (currNode == dest) + { + NS_LOG_LOGIC ("Made it to Node " << currNode->GetId()); + return true; + } + + + // Iterate over the current node's adjacent vertices + // and push them into the queue + for (uint32_t i = 0; i < (currNode->GetNDevices ()); i++) + { + // Get a net device from the node + // as well as the channel, and figure + // out the adjacent net device + Ptr localNetDevice = currNode->GetDevice (i); + + // make sure that we can go this way + if (ipv4) + { + uint32_t interfaceIndex = (ipv4)->GetInterfaceForDevice(currNode->GetDevice(i)); + if (!(ipv4->IsUp (interfaceIndex))) + { + NS_LOG_LOGIC ("Ipv4Interface is down"); + continue; + } + } + if (!(localNetDevice->IsLinkUp ())) + { + NS_LOG_LOGIC ("Link is down."); + continue; + } + Ptr channel = localNetDevice->GetChannel (); + if (channel == 0) + { + continue; + } + + // this function takes in the local net dev, and channnel, and + // writes to the netDeviceContainer the adjacent net devs + NetDeviceContainer netDeviceContainer; + GetAdjacentNetDevices (localNetDevice, channel, netDeviceContainer); + + // Finally we can get the adjacent nodes + // and scan through them. We push them + // to the greyNode queue, if they aren't + // already there. + for (NetDeviceContainer::Iterator iter = netDeviceContainer.Begin (); iter != netDeviceContainer.End (); iter++) + { + Ptr remoteNode = (*iter)->GetNode (); + + // check to see if this node has been pushed before + // by checking to see if it has a parent + // if it doesn't (null or 0), then set its parent and + // push to the queue + if (parentVector.at (remoteNode->GetId ()) == 0) + { + parentVector.at (remoteNode->GetId ()) = currNode; + greyNodeList.push (remoteNode); + } + } + } + + // Pop off the head grey node. We have all its children. + // It is now black. + greyNodeList.pop (); + } + + // Didn't find the dest... + return false; +} + +} // namespace ns3 diff --git a/src/routing/nix-vector-routing/ipv4-nix-vector-routing.h b/src/routing/nix-vector-routing/ipv4-nix-vector-routing.h new file mode 100644 index 000000000..d4792bccf --- /dev/null +++ b/src/routing/nix-vector-routing/ipv4-nix-vector-routing.h @@ -0,0 +1,157 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 The Georgia Institute of Technology + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Josh Pelkey + */ + +#ifndef __IPV4_NIX_VECTOR_ROUTING_H__ +#define __IPV4_NIX_VECTOR_ROUTING_H__ + +#include + +#include "ns3/channel.h" +#include "ns3/node-container.h" +#include "ns3/node-list.h" +#include "ns3/net-device-container.h" +#include "ns3/ipv4-routing-protocol.h" +#include "ns3/ipv4-route.h" +#include "ns3/bridge-net-device.h" + +namespace ns3 { + +typedef std::map > NixMap_t; +typedef std::map > Ipv4RouteMap_t; + +class Ipv4NixVectorRouting : public Ipv4RoutingProtocol +{ + public: + Ipv4NixVectorRouting (); + ~Ipv4NixVectorRouting (); + /** + * @brief The Interface ID of the Global Router interface. + * + * @see Object::GetObject () + */ + static TypeId GetTypeId (void); + /** + * @brief Set the Node pointer of the node for which this + * routing protocol is to be placed + * + * @param node Node pointer + */ + void SetNode (Ptr); + + /** + * @brief Called when run-time link topology change occurs + * which iterates through the node list and flushes any + * nix vector caches + * + */ + void FlushGlobalNixRoutingCache (void); + + private: + /* flushes the cache which stores nix-vector based on + * destination IP */ + void FlushNixCache (void); + + /* flushes the cache which stores the Ipv4 route + * based on the destination IP */ + void FlushIpv4RouteCache (void); + + /* upon a run-time topology change caches are + * flushed and the total number of neighbors is + * reset to zero */ + void ResetTotalNeighbors (void); + + /* takes in the source node and dest IP and calls GetNodeByIp, + * BFS, and BuildNixVector to finally return the built + * nix-vector */ + Ptr GetNixVector (Ptr, Ipv4Address); + + /* checks the cache based on dest IP for the nix-vector */ + Ptr GetNixVectorInCache (Ipv4Address); + + /* checks the cache based on dest IP for the Ipv4Route */ + Ptr GetIpv4RouteInCache (Ipv4Address); + + /* given a net-device returns all the adjacent net-devices, + * essentially getting the neighbors on that channel */ + void GetAdjacentNetDevices (Ptr, Ptr, NetDeviceContainer &); + + /* iterates through the node list and finds the one + * corresponding to the given Ipv4Address */ + Ptr GetNodeByIp (Ipv4Address); + + /* Recurses the parent vector, created by BFS and actually builds the nixvector */ + bool BuildNixVector (const std::vector< Ptr > & parentVector, uint32_t source, uint32_t dest, Ptr nixVector); + + /* special variation of BuildNixVector for when a node is sending to itself */ + bool BuildNixVectorLocal (Ptr nixVector); + + /* simple iterates through the nodes net-devices and determines + * how many neighbors it has */ + uint32_t FindTotalNeighbors (void); + + /* determine if the netdevice is bridged */ + Ptr NetDeviceIsBridged (Ptr nd) const; + + + /* Nix index is with respect to the neighbors. The net-device index must be + * derived from this */ + uint32_t FindNetDeviceForNixIndex (uint32_t nodeIndex, Ipv4Address & gatewayIp); + + /* Breadth first search algorithm + * Param1: Vector containing all nodes in the graph + * Param2: Source Node + * Param3: Dest Node + * Param4: (returned) Parent vector for retracing routes + * Returns: false if dest not found, true o.w. + */ + bool BFS (uint32_t numberOfNodes, + Ptr source, + Ptr dest, + std::vector< Ptr > & parentVector); + + void DoDispose (void); + + /* From Ipv4RoutingProtocol */ + virtual Ptr RouteOutput (Ptr p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr); + virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + UnicastForwardCallback ucb, MulticastForwardCallback mcb, + LocalDeliverCallback lcb, ErrorCallback ecb); + virtual void NotifyInterfaceUp (uint32_t interface); + virtual void NotifyInterfaceDown (uint32_t interface); + virtual void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address); + virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address); + virtual void SetIpv4 (Ptr ipv4); + + + /* cache stores nix-vectors based on destination ip */ + NixMap_t m_nixCache; + + /* cache stores Ipv4Routes based on destination ip */ + Ipv4RouteMap_t m_ipv4RouteCache; + + Ptr m_ipv4; + Ptr m_node; + + /* total neighbors used for nix-vector to determine + * number of bits */ + uint32_t m_totalNeighbors; +}; +} // namepace ns3 +#endif diff --git a/src/routing/nix-vector-routing/nix-vector-routing.h b/src/routing/nix-vector-routing/nix-vector-routing.h new file mode 100644 index 000000000..2c0ef3e94 --- /dev/null +++ b/src/routing/nix-vector-routing/nix-vector-routing.h @@ -0,0 +1,71 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 The Georgia Institute of Technology + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Josh Pelkey + */ + +/** + * \ingroup routing + * \defgroup nixvectorrouting Nix-vector Routing + * + * \section model Model + * + * Nix-vector routing is a simulation specific routing protocol and is + * intended for large network topologies. The on-demand nature of this + * protocol as well as the low-memory footprint of the nix-vector provides + * improved performance in terms of memory usage and simulation run time + * when dealing with a large number of nodes. + * + * Currently, the ns-3 model of nix-vector routing supports IPv4 p2p links + * as well as CSMA links. It does not (yet) provide support for + * efficient adaptation to link failures. It simply flushes all nix-vector + * routing caches. Finally, IPv6 is not supported. + * + * \section api API and Usage + * + * Nix-vector routing has been rolled into a helper class. In order to + * utilize these helper functions, users must include ns3/helper-module.h. + * The Nix-vector routing protocol must be added to a list of routing + * protocols. It is important that list routing is utilized. + * + * Example: + * + * Ipv4NixVectorHelper nixRouting; + * Ipv4StaticRoutingHelper staticRouting; + * + * Ipv4ListRoutingHelper list; + * list.Add (staticRouting, 0); + * list.Add (nixRouting, 10); + * + * InternetStackHelper stack; + * stack.SetRoutingHelper (list); + * stack.Install (allNodes); + * + * \section impl Implementation + * + * ns-3 nix-vector-routing performs on-demand route computation using + * a breadth-first search and an efficient route-storage data structure + * known as a nix-vector. When a packet is generated at a node for + * transmission, the route is calculated, and the nix-vector is built. + * The nix-vector stores an index for each hop along the path, which + * corresponds to the neighbor-index. This index is used to determine + * which net-device and gateway should be used. To route a packet, the + * nix-vector must be transmitted with the packet. At each hop, the + * current node extracts the appropriate neighbor-index from the + * nix-vector and transmits the packet through the corresponding + * net-device. This continues until the packet reaches the destination. + * */ diff --git a/src/routing/nix-vector-routing/waf b/src/routing/nix-vector-routing/waf new file mode 100644 index 000000000..4283ec141 --- /dev/null +++ b/src/routing/nix-vector-routing/waf @@ -0,0 +1 @@ +exec "`dirname "$0"`"/../../../waf "$@" diff --git a/src/routing/nix-vector-routing/wscript b/src/routing/nix-vector-routing/wscript new file mode 100644 index 000000000..d126d2510 --- /dev/null +++ b/src/routing/nix-vector-routing/wscript @@ -0,0 +1,15 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + module = bld.create_ns3_module('nix-vector-routing', ['internet-stack', 'contrib']) + module.includes = '.' + module.source = [ + 'ipv4-nix-vector-routing.cc', + ] + + headers = bld.new_task_gen('ns3header') + headers.module = 'nix-vector-routing' + headers.source = [ + 'ipv4-nix-vector-routing.h', + ] + diff --git a/src/routing/static-routing/ipv4-routing-table-entry.h b/src/routing/static-routing/ipv4-routing-table-entry.h index f5f8cde89..74a8894d1 100644 --- a/src/routing/static-routing/ipv4-routing-table-entry.h +++ b/src/routing/static-routing/ipv4-routing-table-entry.h @@ -193,6 +193,7 @@ public: */ uint32_t GetNOutputInterfaces (void) const; /** + * \param n interface index * \return A specified output interface. */ uint32_t GetOutputInterface (uint32_t n) const; diff --git a/src/routing/static-routing/ipv6-routing-table-entry.cc b/src/routing/static-routing/ipv6-routing-table-entry.cc index a5c8381b4..c003021c9 100644 --- a/src/routing/static-routing/ipv6-routing-table-entry.cc +++ b/src/routing/static-routing/ipv6-routing-table-entry.cc @@ -18,9 +18,10 @@ * Author: Sebastien Vincent */ -#include "ipv6-routing-table-entry.h" #include "ns3/assert.h" +#include "ipv6-routing-table-entry.h" + namespace ns3 { diff --git a/src/routing/static-routing/ipv6-static-routing.h b/src/routing/static-routing/ipv6-static-routing.h index 363b14012..155f10852 100644 --- a/src/routing/static-routing/ipv6-static-routing.h +++ b/src/routing/static-routing/ipv6-static-routing.h @@ -21,9 +21,10 @@ #ifndef IPV6_STATIC_ROUTING_H #define IPV6_STATIC_ROUTING_H -#include #include +#include + #include "ns3/ptr.h" #include "ns3/ipv6-address.h" #include "ns3/ipv6.h" @@ -57,7 +58,7 @@ class Ipv6StaticRouting : public Ipv6RoutingProtocol public: /** * \brief The interface Id associated with this class. - * \return type identificator + * \return type identifier */ static TypeId GetTypeId (); diff --git a/src/simulator/nstime.h b/src/simulator/nstime.h index 310e27989..314f757f6 100644 --- a/src/simulator/nstime.h +++ b/src/simulator/nstime.h @@ -535,6 +535,7 @@ std::istream& operator>> (std::istream& is, Time & time); * Time t = Seconds (2.0); * Simulator::Schedule (NanoSeconds (5.0), ...); * \endcode + * \param seconds seconds value */ Time Seconds (double seconds); @@ -546,6 +547,7 @@ Time Seconds (double seconds); * Time t = MilliSeconds (2); * Simulator::Schedule (MilliSeconds (5), ...); * \endcode + * \param ms milliseconds value */ Time MilliSeconds (uint64_t ms); /** @@ -556,6 +558,7 @@ Time MilliSeconds (uint64_t ms); * Time t = MicroSeconds (2); * Simulator::Schedule (MicroSeconds (5), ...); * \endcode + * \param us microseconds value */ Time MicroSeconds (uint64_t us); /** @@ -566,6 +569,7 @@ Time MicroSeconds (uint64_t us); * Time t = NanoSeconds (2); * Simulator::Schedule (NanoSeconds (5), ...); * \endcode + * \param ns nanoseconds value */ Time NanoSeconds (uint64_t ns); /** @@ -576,6 +580,7 @@ Time NanoSeconds (uint64_t ns); * Time t = PicoSeconds (2); * Simulator::Schedule (PicoSeconds (5), ...); * \endcode + * \param ps picoseconds value */ Time PicoSeconds (uint64_t ps); /** @@ -586,6 +591,7 @@ Time PicoSeconds (uint64_t ps); * Time t = FemtoSeconds (2); * Simulator::Schedule (FemtoSeconds (5), ...); * \endcode + * \param fs femtoseconds value */ Time FemtoSeconds (uint64_t fs); diff --git a/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc b/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc new file mode 100644 index 000000000..f18576caa --- /dev/null +++ b/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc @@ -0,0 +1,381 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ns3/log.h" +#include "ns3/abort.h" +#include "ns3/test.h" +#include "ns3/pcap-file.h" +#include "ns3/config.h" +#include "ns3/string.h" +#include "ns3/uinteger.h" +#include "ns3/data-rate.h" +#include "ns3/inet-socket-address.h" +#include "ns3/point-to-point-helper.h" +#include "ns3/internet-stack-helper.h" +#include "ns3/ipv4-address-helper.h" +#include "ns3/packet-sink-helper.h" +#include "ns3/tcp-socket-factory.h" +#include "ns3/simulator.h" + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("Ns3CwndTest"); + +// =========================================================================== +// This is a simple test to demonstrate how a known good model (a reference +// implementation) may be used to test another model without resorting to +// storing stimulus or response vectors. +// +// Node zero contains the model under test, in this case the ns-3 TCP +// implementation. Node one contains the reference implementation that we +// assume will generate good test vectors for us. In this case, a Linux +// TCP implementation is used to stimulate the ns-3 TCP model with what we +// assume are perfectly good packets. We watch the ns-3 implementation to +// see what it does in the presence of these assumed good stimuli. +// +// The test is arranged as a typical ns-3 script, but we use the trace system +// to peek into the running system and monitor the ns-3 TCP. +// +// The topology is just two nodes communicating over a point-to-point network. +// The point-to-point network is chosen because it is simple and allows us to +// easily generate pcap traces we can use to separately verify that the ns-3 +// implementation is responding correctly. Once the oopration is verified, we +// enter a list of responses that capture the response succinctly. +// +// node 0 node 1 +// +----------------+ +----------------+ +// | ns-3 TCP | | Linux TCP | +// +----------------+ +----------------+ +// | 10.1.1.1 | | 10.1.1.2 | +// +----------------+ +----------------+ +// | point-to-point | | point-to-point | +// +----------------+ +----------------+ +// | | +// +---------------------+ +// 5 Mbps, 2 ms +// +// =========================================================================== +// +class SimpleSource : public Application +{ +public: + + SimpleSource (); + virtual ~SimpleSource(); + + void Setup (Ptr socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate); + +private: + virtual void StartApplication (void); + virtual void StopApplication (void); + + void ScheduleTx (void); + void SendPacket (void); + + Ptr m_socket; + Address m_peer; + uint32_t m_packetSize; + uint32_t m_nPackets; + DataRate m_dataRate; + EventId m_sendEvent; + bool m_running; + uint32_t m_packetsSent; +}; + +SimpleSource::SimpleSource () + : m_socket (0), + m_peer (), + m_packetSize (0), + m_nPackets (0), + m_dataRate (0), + m_sendEvent (), + m_running (false), + m_packetsSent (0) +{ +} + +SimpleSource::~SimpleSource() +{ + m_socket = 0; +} + +void +SimpleSource::Setup (Ptr socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate) +{ + m_socket = socket; + m_peer = address; + m_packetSize = packetSize; + m_nPackets = nPackets; + m_dataRate = dataRate; +} + +void +SimpleSource::StartApplication (void) +{ + m_running = true; + m_packetsSent = 0; + m_socket->Bind (); + m_socket->Connect (m_peer); + SendPacket (); +} + +void +SimpleSource::StopApplication (void) +{ + m_running = false; + + if (m_sendEvent.IsRunning ()) + { + Simulator::Cancel (m_sendEvent); + } + + if (m_socket) + { + m_socket->Close (); + } +} + +void +SimpleSource::SendPacket (void) +{ + Ptr packet = Create (m_packetSize); + m_socket->Send (packet); + + if (++m_packetsSent < m_nPackets) + { + ScheduleTx (); + } +} + +void +SimpleSource::ScheduleTx (void) +{ + if (m_running) + { + Time tNext (Seconds (m_packetSize * 8 / static_cast (m_dataRate.GetBitRate ()))); + m_sendEvent = Simulator::Schedule (tNext, &SimpleSource::SendPacket, this); + } +} + +class Ns3TcpCwndTestCase : public TestCase +{ +public: + Ns3TcpCwndTestCase (); + virtual ~Ns3TcpCwndTestCase (); + +private: + virtual bool DoRun (void); + bool m_writeResults; + + class CwndEvent { + public: + uint32_t m_oldCwnd; + uint32_t m_newCwnd; + }; + + TestVectors m_responses; + + void CwndChange (uint32_t oldCwnd, uint32_t newCwnd); +}; + +Ns3TcpCwndTestCase::Ns3TcpCwndTestCase () + : TestCase ("Check to see that the ns-3 TCP congestion window works as expected against liblinux2.6.26.so"), + m_writeResults (false) +{ +} + +Ns3TcpCwndTestCase::~Ns3TcpCwndTestCase () +{ +} + +void +Ns3TcpCwndTestCase::CwndChange (uint32_t oldCwnd, uint32_t newCwnd) +{ + CwndEvent event; + + event.m_oldCwnd = oldCwnd; + event.m_newCwnd = newCwnd; + + m_responses.Add (event); +} + +bool +Ns3TcpCwndTestCase::DoRun (void) +{ + // + // Just create two nodes. One (node zero) will be the node with the TCP + // under test which is the ns-3 TCP implementation. The other node (node + // one) will be the node with the reference implementation we use to drive + // the tests. + // + NodeContainer nodes; + nodes.Create (2); + + // + // For this test we'll use a point-to-point net device. It's not as simple + // as a simple-net-device, but it provides nice places to hook trace events + // so we can see what's moving between our nodes. + // + PointToPointHelper pointToPoint; + pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); + pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); + + // + // Install the point-to-point devices on both nodes and connec them up. + // + NetDeviceContainer devices; + devices = pointToPoint.Install (nodes); + + // + // Install two variants of the internet stack. The first, on node zero + // uses the TCP under test, which is the default ns-3 TCP implementation. + // + InternetStackHelper stack; + stack.Install (nodes.Get (0)); + + // + // The other node, node one, is going to be set up to use a Linux TCP + // implementation that we consider a known good TCP. + // + std::string nscStack = "liblinux2.6.26.so"; + stack.SetTcp ("ns3::NscTcpL4Protocol", "Library", StringValue("liblinux2.6.26.so")); + stack.Install (nodes.Get (1)); + + // + // Assign the address 10.1.1.1 to the TCP implementation under test (index + // zero) and 10.1.1.2 to the reference implementation (index one). + // + Ipv4AddressHelper address; + address.SetBase ("10.1.1.0", "255.255.255.252"); + Ipv4InterfaceContainer interfaces = address.Assign (devices); + + // + // We need a place to send our TCP data on the node with the reference TCP + // implementation. We aren't really concerned about what happens there, so + // just create a sink. + // + uint16_t sinkPort = 8080; + Address sinkAddress (InetSocketAddress(interfaces.GetAddress (1), sinkPort)); + PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), sinkPort)); + ApplicationContainer sinkApps = packetSinkHelper.Install (nodes.Get (1)); + sinkApps.Start (Seconds (0.)); + sinkApps.Stop (Seconds (1.1)); + + // + // We want to look at changes in the ns-3 TCP congestion window. The + // congestion window is flow clontrol imposed by the sender, so we need + // to crank up a flow from the ns-3 TCP node to the NSC TCP node and hook the + // CongestionWindow attribute on the socket. Normally one would use an on-off + // application to generate a flow, but this has a couple of problems. First, + // the socket of the on-off application is not created until Application Start + // time, so we wouldn't be able to hook the socket now at configuration time. + // Second, even if we could arrange a call after start time, the socket is not + // public. + // + // So, we can cook up a simple version of the on-off application that does what + // we want. On the plus side we don't need all of the complexity of the on-off + // application. On the minus side, we don't have a helper, so we have to get + // a little more involved in the details, but this is trivial. + // + // So first, we create a socket and do the trace connect on it; then we pass this + // socket into the constructor of our simple application which we then install + // in the node with the ns-3 TCP. + // + Ptr ns3TcpSocket = Socket::CreateSocket (nodes.Get (0), TcpSocketFactory::GetTypeId ()); + ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", MakeCallback (&Ns3TcpCwndTestCase::CwndChange, this)); + + Ptr app = CreateObject (); + app->Setup (ns3TcpSocket, sinkAddress, 1040, 10, DataRate ("5Mbps")); + nodes.Get (0)->AddApplication (app); + app->Start (Seconds (1.)); + app->Stop (Seconds (1.1)); + + // + // The idea here is that someone will look very closely at the all of the + // communications between the reference TCP and the TCP under test in this + // simulation and determine that all of the responses are correct. We expect + // that this means generating a pcap trace file from the point-to-point link + // and examining the packets closely using tcpdump, wireshark or some such + // program. So we provide the ability to generate a pcap trace of the + // test execution for your perusal. + // + // Once the validation test is determined to be running exactly as exptected, + // the set of congestion window changes is collected and hard coded into the + // test results which will then be checked during the actual execution of the + // test. + // + + if (m_writeResults) + { + PointToPointHelper::EnablePcapAll ("tcp-cwnd"); + } + + Simulator::Stop (Seconds(2)); + Simulator::Run (); + Simulator::Destroy (); + + // + // As new acks are received by the TCP under test, the congestion window + // should be opened up by one segment (MSS bytes) each time. This should + // trigger a congestion window change event which we hooked and saved above. + // We should now be able to look through the saved response vectors and follow + // the congestion window as it opens up when the ns-3 TCP under test + // transmits its bits + // + // From inspecting the results, we know that we should see N_EVENTS congestion + // window change events. The window should expand N_EVENTS - 1 times (each + // time by MSS bytes) until it gets to its largest value. Then the application + // sending stops and the window should be slammed shut, with the last event + // reflecting the change from LARGEST_CWND back to MSS + // + const uint32_t MSS = 536; + const uint32_t N_EVENTS = 21; + const uint32_t LARGEST_CWND = MSS * N_EVENTS; + + CwndEvent event; + + NS_TEST_ASSERT_MSG_EQ (m_responses.GetN (), N_EVENTS, "Unexpectedly low number of cwnd change events"); + + + for (uint32_t i = 0, from = 536, to = 1072; i < N_EVENTS - 1; ++i, from += 536, to += 536) + { + event = m_responses.Get (i); + NS_TEST_ASSERT_MSG_EQ (event.m_oldCwnd, from, "Wrong old cwnd value in cwnd change event " << i); + NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, to, "Wrong new cwnd value in cwnd change event " << i); + } + + event = m_responses.Get (N_EVENTS - 1); + NS_TEST_ASSERT_MSG_EQ (event.m_oldCwnd, LARGEST_CWND, "Wrong old cwnd value in cwnd change event " << N_EVENTS - 1); + NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, MSS, "Wrong new cwnd value in cwnd change event " << N_EVENTS - 1); + + return GetErrorStatus (); +} + +class Ns3TcpCwndTestSuite : public TestSuite +{ +public: + Ns3TcpCwndTestSuite (); +}; + +Ns3TcpCwndTestSuite::Ns3TcpCwndTestSuite () + : TestSuite ("ns3-tcp-cwnd", SYSTEM) +{ + AddTestCase (new Ns3TcpCwndTestCase); +} + +Ns3TcpCwndTestSuite ns3TcpCwndTestSuite; diff --git a/src/test/ns3tcp/ns3tcp-interop-response-vectors.pcap b/src/test/ns3tcp/ns3tcp-interop-response-vectors.pcap new file mode 100644 index 000000000..8280e07d1 Binary files /dev/null and b/src/test/ns3tcp/ns3tcp-interop-response-vectors.pcap differ diff --git a/src/test/ns3tcp/ns3tcp-interop-test-suite.cc b/src/test/ns3tcp/ns3tcp-interop-test-suite.cc new file mode 100644 index 000000000..c70dbd6fe --- /dev/null +++ b/src/test/ns3tcp/ns3tcp-interop-test-suite.cc @@ -0,0 +1,307 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ns3/log.h" +#include "ns3/abort.h" +#include "ns3/test.h" +#include "ns3/pcap-file.h" +#include "ns3/config.h" +#include "ns3/string.h" +#include "ns3/uinteger.h" +#include "ns3/inet-socket-address.h" +#include "ns3/point-to-point-helper.h" +#include "ns3/internet-stack-helper.h" +#include "ns3/ipv4-address-helper.h" +#include "ns3/ipv4-header.h" +#include "ns3/packet-sink-helper.h" +#include "ns3/on-off-helper.h" +#include "ns3/simulator.h" + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("Ns3TcpInteropTest"); + +const bool WRITE_VECTORS = false; // hack hack hack +const uint32_t PCAP_LINK_TYPE = 1187373553; // Some large random number -- we use to verify data was written by this program +const uint32_t PCAP_SNAPLEN = 64; // Don't bother to save much data + + +// =========================================================================== +// This is a simple test to demonstrate how a known good model (a reference +// implementation) may be used to test another model in a relatively simple +// way. +// +// Node zero contains the model under test, in this case the ns-3 TCP +// implementation. Node one contains the reference implementation that we +// assume will generate good test vectors for us. In this case, a Linux +// TCP implementation is used to stimulate the ns-3 TCP model with what we +// assume are perfectly good packets. We watch the ns-3 implementation to +// see what it does in the presence of these assumed good stimuli. +// +// The test is arranged as a typical ns-3 script, but we use the trace system +// to peek into the running system and monitor the ns-3 TCP. +// +// The topology is just two nodes communicating over a point-to-point network. +// The point-to-point network is chosen because it is simple and allows us to +// easily generate pcap traces we can use to separately verify that the ns-3 +// implementation is responding correctly. Once the opration is verified, we +// capture a set of response vectors that are then checked in the test to +// ensure that the ns-3 TCP continues to respond correctly over time. +// +// node 0 node 1 +// +----------------+ +----------------+ +// | ns-3 TCP | | Linux TCP | +// +----------------+ +----------------+ +// | 10.1.1.1 | | 10.1.1.2 | +// +----------------+ +----------------+ +// | point-to-point | | point-to-point | +// +----------------+ +----------------+ +// | | +// +---------------------+ +// 5 Mbps, 2 ms +// +// =========================================================================== +class Ns3TcpInteroperabilityTestCase : public TestCase +{ +public: + Ns3TcpInteroperabilityTestCase (); + virtual ~Ns3TcpInteroperabilityTestCase (); + +private: + virtual void DoSetup (void); + virtual bool DoRun (void); + virtual void DoTeardown (void); + + void Ipv4L3Tx (std::string context, Ptr packet, uint32_t interfaceIndex); + + std::string m_pcapFilename; + PcapFile m_pcapFile; + bool m_writeVectors; +}; + +Ns3TcpInteroperabilityTestCase::Ns3TcpInteroperabilityTestCase () + : TestCase ("Check to see that the ns-3 TCP can work with liblinux2.6.26.so"), m_writeVectors(WRITE_VECTORS) +{ +} + +Ns3TcpInteroperabilityTestCase::~Ns3TcpInteroperabilityTestCase () +{ +} + +void +Ns3TcpInteroperabilityTestCase::DoSetup (void) +{ + // + // We expect there to be a file called tcp-interop-response-vectors.pcap" in + // the source directory of this file. + // + m_pcapFilename = NS_TEST_SOURCEDIR + "ns3tcp-interop-response-vectors.pcap"; + + if (m_writeVectors) + { + m_pcapFile.Open (m_pcapFilename, "w"); + m_pcapFile.Init(PCAP_LINK_TYPE, PCAP_SNAPLEN); + } + else + { + m_pcapFile.Open (m_pcapFilename, "r"); + NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE, "Wrong response vectors in directory"); + } +} + +void +Ns3TcpInteroperabilityTestCase::DoTeardown (void) +{ + m_pcapFile.Close (); +} + +void +Ns3TcpInteroperabilityTestCase::Ipv4L3Tx (std::string context, Ptr packet, uint32_t interfaceIndex) +{ + // + // We're not testing IP so remove and toss the header. In order to do this, + // though, we need to copy the packet since we have a const version. + // + Ptr p = packet->Copy (); + Ipv4Header ipHeader; + p->RemoveHeader (ipHeader); + + // + // What is left is the TCP header and any data that may be sent. We aren't + // sending any TCP data, so we expect what remains is only TCP header, which + // is a small thing to save. + // + if (m_writeVectors) + { + // + // Save the TCP under test response for later testing. + // + Time tNow = Simulator::Now (); + int64_t tMicroSeconds = tNow.GetMicroSeconds (); + m_pcapFile.Write (uint32_t (tMicroSeconds / 1000000), + uint32_t (tMicroSeconds % 1000000), + p->PeekData(), + p->GetSize ()); + } + else + { + // + // Read the TCP under test expected response from the expected vector + // file and see if it still does the right thing. + // + uint8_t expected[PCAP_SNAPLEN]; + uint32_t tsSec, tsUsec, inclLen, origLen, readLen; + m_pcapFile.Read (expected, sizeof(expected), tsSec, tsUsec, inclLen, origLen, readLen); + + uint8_t const *actual = p->PeekData(); + + uint32_t result = memcmp(actual, expected, readLen); + + // + // Avoid streams of errors -- only report the first. + // + if (GetErrorStatus () == false) + { + NS_TEST_EXPECT_MSG_EQ (result, 0, "Expected data comparison error"); + } + } +} + +bool +Ns3TcpInteroperabilityTestCase::DoRun (void) +{ + // + // Just create two nodes. One (node zero) will be the node with the TCP + // under test which is the ns-3 TCP implementation. The other node (node + // one) will be the node with the reference implementation we use to drive + // the tests. + // + NodeContainer nodes; + nodes.Create (2); + + // + // For this test we'll use a point-to-point net device. It's not as simple + // as a simple-net-device, but it provides nice places to hook trace events + // so we can see what's moving between our nodes. + // + PointToPointHelper pointToPoint; + pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); + pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); + + // + // Install the point-to-point devices on both nodes and connec them up. + // + NetDeviceContainer devices; + devices = pointToPoint.Install (nodes); + + // + // Install two variants of the internet stack. The first, on node zero + // uses the TCP under test, which is the default ns-3 TCP implementation. + // + InternetStackHelper stack; + stack.Install (nodes.Get (0)); + + // + // The other node, node one, is going to be set up to use a Linux TCP + // implementation that we consider a known good TCP. + // + std::string nscStack = "liblinux2.6.26.so"; + stack.SetTcp ("ns3::NscTcpL4Protocol", "Library", StringValue("liblinux2.6.26.so")); + stack.Install (nodes.Get (1)); + + // + // Assign the address 10.1.1.1 to the TCP implementation under test (index + // zero) and 10.1.1.2 to the reference implementation (index one). + // + Ipv4AddressHelper address; + address.SetBase ("10.1.1.0", "255.255.255.252"); + Ipv4InterfaceContainer interfaces = address.Assign (devices); + + // + // We need a place for the TCP data to go on the node with the TCP under + // test, so just create a sink on node zero. + // + uint16_t sinkPort = 8080; + Address sinkAddress (InetSocketAddress(interfaces.GetAddress (0), sinkPort)); + PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), sinkPort)); + ApplicationContainer sinkApps = packetSinkHelper.Install (nodes.Get (0)); + sinkApps.Start (Seconds (0.)); + + // + // We need something to shove data down the pipe, so we create an on-off + // application on the soure node with the reference TCP implementation. + // The default behavior is to send for one second, then go quiet for one + // second, and repeat. + // + OnOffHelper onOffHelper ("ns3::TcpSocketFactory", sinkAddress); + onOffHelper.SetAttribute ("MaxBytes", UintegerValue (100000)); + ApplicationContainer sourceApps = onOffHelper.Install(nodes.Get(1)); + sourceApps.Start (Seconds (1.)); + sourceApps.Stop (Seconds (10.)); + + // + // There are currently a limited number of trace hooks in the ns-3 TCP code. + // Rather than editing TCP to insert a bunch of trace hooks, we can just + // intercept the packets at the IPv4 layer. See internet-stack-helper.cc + // for complete description of the trace hooks. We're interested in the + // responses of the TCP under test, which implies we need to hook the node + // zero Ipv4 layer three transmit trace source. We'll then get all of the + // responses we need + // + Config::Connect ("/NodeList/0/$ns3::Ipv4L3Protocol/Tx", + MakeCallback (&Ns3TcpInteroperabilityTestCase::Ipv4L3Tx, this)); + + // + // The idea here is that someone will look very closely at the all of the + // communications between the reference TCP and the TCP under test in this + // simulation and determine that all of the responses are correct. We expect + // that this means generating a pcap trace file from the point-to-point link + // and examining the packets closely using tcpdump, wireshark or some such + // program. So we provide the ability to generate a pcap trace of the + // test execution for your perusal. + // + // Once the validation test is determined to be running exactly as exptected, + // we allow you to generate a file that contains the response vectors that + // will be checked during the actual execution of the test. + // + + if (m_writeVectors) + { + PointToPointHelper::EnablePcapAll ("tcp-interop"); + } + + Simulator::Stop (Seconds(20)); + Simulator::Run (); + Simulator::Destroy (); + + return GetErrorStatus (); +} + +class Ns3TcpInteroperabilityTestSuite : public TestSuite +{ +public: + Ns3TcpInteroperabilityTestSuite (); +}; + +Ns3TcpInteroperabilityTestSuite::Ns3TcpInteroperabilityTestSuite () + : TestSuite ("ns3-tcp-interoperability", SYSTEM) +{ + AddTestCase (new Ns3TcpInteroperabilityTestCase); +} + +Ns3TcpInteroperabilityTestSuite ns3TcpInteroperabilityTestSuite; diff --git a/src/test/ns3tcp/ns3tcp.h b/src/test/ns3tcp/ns3tcp.h new file mode 100644 index 000000000..30189c605 --- /dev/null +++ b/src/test/ns3tcp/ns3tcp.h @@ -0,0 +1,8 @@ +/** + * \ingroup tests + * \defgroup Ns3TcpTests ns-3 TCP Implementation Tests + * + * \section Ns3TcpTestsOverview ns-3 Tcp Implementation Tests Overview + * + * ns-3 has a TCP implemtation and we test it a litte. + */ diff --git a/src/test/ns3tcp/waf b/src/test/ns3tcp/waf new file mode 100644 index 000000000..4283ec141 --- /dev/null +++ b/src/test/ns3tcp/waf @@ -0,0 +1 @@ +exec "`dirname "$0"`"/../../../waf "$@" diff --git a/src/test/ns3tcp/wscript b/src/test/ns3tcp/wscript new file mode 100644 index 000000000..25549a4b7 --- /dev/null +++ b/src/test/ns3tcp/wscript @@ -0,0 +1,16 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def configure(conf): + pass + +def build(bld): + ns3tcp = bld.create_ns3_module('ns3tcp') + ns3tcp.source = [ + 'ns3tcp-interop-test-suite.cc', + 'ns3tcp-cwnd-test-suite.cc', + ] + headers = bld.new_task_gen('ns3header') + headers.module = 'ns3tcp' + headers.source = [ + 'ns3tcp.h', + ] diff --git a/src/test/ns3wifi/ns3wifi.h b/src/test/ns3wifi/ns3wifi.h new file mode 100644 index 000000000..d400eb530 --- /dev/null +++ b/src/test/ns3wifi/ns3wifi.h @@ -0,0 +1,8 @@ +/** + * \ingroup tests + * \defgroup Ns3WifiTests ns-3 Wifi Implementation Tests + * + * \section Ns3WifiTestsOverview ns-3 Wifi Implementation Tests Overview + * + * ns-3 has a Wifi implemtation and we test it a litte. + */ diff --git a/src/test/ns3wifi/propagation-loss-models-test-suite.cc b/src/test/ns3wifi/propagation-loss-models-test-suite.cc new file mode 100644 index 000000000..55f9a1bfd --- /dev/null +++ b/src/test/ns3wifi/propagation-loss-models-test-suite.cc @@ -0,0 +1,579 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 The Boeing Company + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ns3/log.h" +#include "ns3/abort.h" +#include "ns3/test.h" +#include "ns3/pcap-file.h" +#include "ns3/config.h" +#include "ns3/string.h" +#include "ns3/uinteger.h" +#include "ns3/data-rate.h" +#include "ns3/inet-socket-address.h" +#include "ns3/internet-stack-helper.h" +#include "ns3/ipv4-address-helper.h" +#include "ns3/tcp-socket-factory.h" +#include "ns3/yans-wifi-helper.h" +#include "ns3/propagation-loss-model.h" +#include "ns3/propagation-delay-model.h" +#include "ns3/yans-wifi-channel.h" +#include "ns3/yans-wifi-phy.h" +#include "ns3/wifi-net-device.h" +#include "ns3/mobility-helper.h" +#include "ns3/constant-position-mobility-model.h" +#include "ns3/nqos-wifi-mac-helper.h" +#include "ns3/simulator.h" + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("Ns3WifiPropagationLossModelsTest"); + +// =========================================================================== +// This is a simple test to validate propagation loss models of ns-3 wifi. +// +// The basic configuration is, +// +// node 0 node 1 +// +------------+ +------------+ +// | ns-3 UDP | | ns-3 UDP | +// +------------+ +------------+ +// | 10.1.1.1 | | 10.1.1.2 | +// +------------+ +------------+ +// | wifi | | wifi | +// +------------+ +------------+ +// | | +// (((*))) (((*))) +// +// |<-- distance -->| +// +// +// We vary the propagation loss model and the distance between the nodes, +// looking at the received power and SNR for a packet sent between them. We +// compare the found values with values found in an "authoritative source." +// =========================================================================== +// +class Ns3FriisPropagationLossModelTestCase : public TestCase +{ +public: + Ns3FriisPropagationLossModelTestCase (); + virtual ~Ns3FriisPropagationLossModelTestCase (); + +private: + virtual bool DoRun (void); + + void SendPacket (uint32_t i, Ptr socket, uint32_t size); + void Receive (Ptr p, double snr, WifiMode mode, enum WifiPreamble preamble); + + uint32_t m_gotCallbacks; + + Ptr m_receiver; + uint32_t m_vectorIndex; + + typedef struct { + Vector m_position; + double m_snr; + double m_tolerance; + } TestVector; + + TestVectors m_testVectors; +}; + +Ns3FriisPropagationLossModelTestCase::Ns3FriisPropagationLossModelTestCase () + : TestCase ("Check to see that the ns-3 Friis propagation loss model provides correct SNR values"), + m_gotCallbacks (false), m_receiver (0), m_vectorIndex (0), m_testVectors () +{ +} + +Ns3FriisPropagationLossModelTestCase::~Ns3FriisPropagationLossModelTestCase () +{ +} + +void +Ns3FriisPropagationLossModelTestCase::Receive (Ptr p, double snr, WifiMode mode, enum WifiPreamble preamble) +{ + TestVector testVector = m_testVectors.Get (m_vectorIndex++); + if (GetErrorStatus () == false) + { + NS_TEST_EXPECT_MSG_EQ_TOL (snr, testVector.m_snr, testVector.m_tolerance, "Got unexpected SNR value"); + } + ++m_gotCallbacks; +} + +void +Ns3FriisPropagationLossModelTestCase::SendPacket (uint32_t i, Ptr socket, uint32_t size) +{ + TestVector testVector = m_testVectors.Get (i); + m_receiver->GetObject ()->SetPosition (testVector.m_position); + socket->Send (Create (size)); +} + +bool +Ns3FriisPropagationLossModelTestCase::DoRun (void) +{ + // + // We want to test the propagation loss model calculations at a few chosen + // distances and compare the results to those we have manually calculated + // according to the model documentation. The following "TestVector" objects + // will drive the test. + // + // For example, the first test vector provides a position to which the + // receiver node will be moved prior to transmitting a packet. It also + // specifies that when the packet is received, the SNR shold be found + // to be 1129.93 +- 0.005 in the ReceiveOkCallback. + // + TestVector testVector; + + testVector.m_position = Vector (100, 0, 0); + testVector.m_snr = 1128.93; + testVector.m_tolerance = 0.005; + m_testVectors.Add (testVector); + + testVector.m_position = Vector (500, 0, 0); + testVector.m_snr = 45.1571; + testVector.m_tolerance = 0.00005; + m_testVectors.Add (testVector); + + testVector.m_position = Vector (1000, 0, 0); + testVector.m_snr = 11.2893; + testVector.m_tolerance = 0.00005; + m_testVectors.Add (testVector); + + testVector.m_position = Vector (2000, 0, 0); + testVector.m_snr = 2.82232; + testVector.m_tolerance = 0.000005; + m_testVectors.Add (testVector); + + // + // Disable fragmentation for frames shorter than 2200 bytes. + // + Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200")); + + // + // Turn off RTS/CTS for frames shorter than 2200 bytes. + // + Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200")); + + // + // Create the two nodes in the system. Data will be sent from node zero to + // node one. + // + NodeContainer nodes; + nodes.Create (2); + + // + // Save a Ptr to the receiver node so we can get at its mobility model + // and change its position (distance) later. + // + m_receiver = nodes.Get (1); + + // + // Use the regular WifiHelper to orchestrate hooking the various pieces of + // the wifi system together. Tell it that we want to use an 802.11b phy. + // + WifiHelper wifi; + wifi.SetStandard (WIFI_PHY_STANDARD_80211b); + + // + // Create a physical layer helper and tell it we don't want any receiver + // gain. + // + YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); + wifiPhy.Set ("RxGain", DoubleValue (0) ); + + // + // Create the channel helper and tell it that signals will be moving at the + // speed of light. + // + YansWifiChannelHelper wifiChannel ; + wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); + + // + // The propagation loss model is one of our independent variables in the + // test. + // + wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel", + "Lambda", DoubleValue (0.125), + "SystemLoss", DoubleValue (1.)); + + // + // Create a yans wifi channel and tell the phy helper to use it. + // + wifiPhy.SetChannel (wifiChannel.Create ()); + + // + // Create a non-quality-of-service mac layer and set it to ad-hoc mode. + // + NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); + wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", + "DataMode", StringValue ("wifib-1mbs"), + "ControlMode",StringValue ("wifib-1mbs")); + wifiMac.SetType ("ns3::AdhocWifiMac"); + + // + // Create the wifi devices. + // + NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, nodes); + + // + // We need to reach down into the receiving wifi device's phy layer and hook + // the appropriate trace event to get the snr. This isn't one of the usual + // events so it takes some poking around to get there from here. + // + Ptr phy = devices.Get (1)->GetObject ()->GetPhy ()->GetObject (); + phy->SetReceiveOkCallback (MakeCallback (&Ns3FriisPropagationLossModelTestCase::Receive, this)); + + // + // Add mobility models to both nodes. This is used to place the two nodes a + // fixed distance apart. Node zero (the sender) is always at the origin and + // Node one (the receiver) is moved along the x-axis to a given distance from + // the origin. This distance is the second independent variable in our test. + // + MobilityHelper mobility; + Ptr positionAlloc = CreateObject (); + positionAlloc->Add (Vector (0., 0., 0.)); + positionAlloc->Add (Vector (0, 0., 0.)); + mobility.SetPositionAllocator (positionAlloc); + mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); + mobility.Install (nodes); + + // + // In order to use UDP sockets, we need to install the ns-3 internet stack + // on our nodes. + // + InternetStackHelper internet; + internet.Install (nodes); + + // + // Assign IP addresses to our nodes. The source node is going to end up + // as 10.1.1.1 and the destination will be 10.1.1.2 + // + Ipv4AddressHelper addresses; + addresses.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces = addresses.Assign (devices); + + // + // The destination is the wifi device on node one. + // + InetSocketAddress destaddr = InetSocketAddress (interfaces.GetAddress (1), 80); + + // + // We just want to send packets from the source to the destination node, so + // the simplest thing is to cook something up manually. + // + TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); + Ptr dest = Socket::CreateSocket (nodes.Get (1), tid); + dest->Bind (destaddr); + + Ptr source = Socket::CreateSocket (nodes.Get (0), tid); + source->Connect (destaddr); + + // + // Schedule the packet sends, one packet per simulated second. + // + for (uint32_t i = 0; i < m_testVectors.GetN (); ++i) + { + Time t = Seconds (1. * i); + Simulator::Schedule (t, &Ns3FriisPropagationLossModelTestCase::SendPacket, this, i, source, 1000); + } + + Simulator::Stop (Seconds(1. * m_testVectors.GetN ())); + Simulator::Run (); + + source->Close (); + source = 0; + + dest->Close (); + dest = 0; + + m_receiver = 0; + + Simulator::Destroy (); + + // + // If we've already reported an error, just leave it at that. + // + if (GetErrorStatus () == false) + { + NS_TEST_ASSERT_MSG_EQ (m_gotCallbacks, m_testVectors.GetN (), "Did not get expected number of ReceiveOkCallbacks"); + } + + return GetErrorStatus (); +} + +class Ns3LogDistancePropagationLossModelTestCase : public TestCase +{ +public: + Ns3LogDistancePropagationLossModelTestCase (); + virtual ~Ns3LogDistancePropagationLossModelTestCase (); + +private: + virtual bool DoRun (void); + + void SendPacket (uint32_t i, Ptr socket, uint32_t size); + void Receive (Ptr p, double snr, WifiMode mode, enum WifiPreamble preamble); + + uint32_t m_gotCallbacks; + + Ptr m_receiver; + uint32_t m_vectorIndex; + + typedef struct { + Vector m_position; + double m_snr; + double m_tolerance; + } TestVector; + + TestVectors m_testVectors; +}; + +Ns3LogDistancePropagationLossModelTestCase::Ns3LogDistancePropagationLossModelTestCase () + : TestCase ("Check to see that the ns-3 Log Distance propagation loss model provides correct SNR values"), + m_gotCallbacks (false), m_receiver (0), m_vectorIndex (0), m_testVectors () +{ +} + +Ns3LogDistancePropagationLossModelTestCase::~Ns3LogDistancePropagationLossModelTestCase () +{ +} + +void +Ns3LogDistancePropagationLossModelTestCase::Receive (Ptr p, double snr, WifiMode mode, enum WifiPreamble preamble) +{ + TestVector testVector = m_testVectors.Get (m_vectorIndex++); + if (GetErrorStatus () == false) + { + NS_TEST_EXPECT_MSG_EQ_TOL (snr, testVector.m_snr, testVector.m_tolerance, "Got unexpected SNR value"); + } + ++m_gotCallbacks; +} + +void +Ns3LogDistancePropagationLossModelTestCase::SendPacket (uint32_t i, Ptr socket, uint32_t size) +{ + TestVector testVector = m_testVectors.Get (i); + m_receiver->GetObject ()->SetPosition (testVector.m_position); + socket->Send (Create (size)); +} + +bool +Ns3LogDistancePropagationLossModelTestCase::DoRun (void) +{ + // + // We want to test the propagation loss model calculations at a few chosen + // distances and compare the results to those we have manually calculated + // according to the model documentation. The following "TestVector" objects + // will drive the test. + // + // For example, the first test vector provides a position to which the + // receiver node will be moved prior to transmitting a packet. It also + // specifies that when the packet is received, the SNR shold be found + // to be 1129.93 +- 0.005 in the ReceiveOkCallback. + // + TestVector testVector; + + testVector.m_position = Vector (10, 0, 0); + testVector.m_snr = 11289.3; + testVector.m_tolerance = 0.05; + m_testVectors.Add (testVector); + + testVector.m_position = Vector (20, 0, 0); + testVector.m_snr = 1411.16; + testVector.m_tolerance = 0.005; + m_testVectors.Add (testVector); + + testVector.m_position = Vector (40, 0, 0); + testVector.m_snr = 176.407; + testVector.m_tolerance = 0.0005; + m_testVectors.Add (testVector); + + testVector.m_position = Vector (80, 0, 0); + testVector.m_snr = 22.0494; + testVector.m_tolerance = 0.00005; + m_testVectors.Add (testVector); + + // + // Disable fragmentation for frames shorter than 2200 bytes. + // + Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200")); + + // + // Turn off RTS/CTS for frames shorter than 2200 bytes. + // + Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200")); + + // + // Create the two nodes in the system. Data will be sent from node zero to + // node one. + // + NodeContainer nodes; + nodes.Create (2); + + // + // Save a Ptr to the receiver node so we can get at its mobility model + // and change its position (distance) later. + // + m_receiver = nodes.Get (1); + + // + // Use the regular WifiHelper to orchestrate hooking the various pieces of + // the wifi system together. Tell it that we want to use an 802.11b phy. + // + WifiHelper wifi; + wifi.SetStandard (WIFI_PHY_STANDARD_80211b); + + // + // Create a physical layer helper and tell it we don't want any receiver + // gain. + // + YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); + wifiPhy.Set ("RxGain", DoubleValue (0) ); + + // + // Create the channel helper and tell it that signals will be moving at the + // speed of light. + // + YansWifiChannelHelper wifiChannel ; + wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); + + // + // The propagation loss model is one of our independent variables in the + // test. + // + wifiChannel.AddPropagationLoss ("ns3::LogDistancePropagationLossModel", + "Exponent", DoubleValue(3), + "ReferenceLoss", DoubleValue(40.045997)); + + // + // Create a yans wifi channel and tell the phy helper to use it. + // + wifiPhy.SetChannel (wifiChannel.Create ()); + + // + // Create a non-quality-of-service mac layer and set it to ad-hoc mode. + // + NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); + wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", + "DataMode", StringValue ("wifib-1mbs"), + "ControlMode",StringValue ("wifib-1mbs")); + wifiMac.SetType ("ns3::AdhocWifiMac"); + + // + // Create the wifi devices. + // + NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, nodes); + + // + // We need to reach down into the receiving wifi device's phy layer and hook + // the appropriate trace event to get the snr. This isn't one of the usual + // events so it takes some poking around to get there from here. + // + Ptr phy = devices.Get (1)->GetObject ()->GetPhy ()->GetObject (); + phy->SetReceiveOkCallback (MakeCallback (&Ns3LogDistancePropagationLossModelTestCase::Receive, this)); + + // + // Add mobility models to both nodes. This is used to place the two nodes a + // fixed distance apart. Node zero (the sender) is always at the origin and + // Node one (the receiver) is moved along the x-axis to a given distance from + // the origin. This distance is the second independent variable in our test. + // + MobilityHelper mobility; + Ptr positionAlloc = CreateObject (); + positionAlloc->Add (Vector (0., 0., 0.)); + positionAlloc->Add (Vector (0, 0., 0.)); + mobility.SetPositionAllocator (positionAlloc); + mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); + mobility.Install (nodes); + + // + // In order to use UDP sockets, we need to install the ns-3 internet stack + // on our nodes. + // + InternetStackHelper internet; + internet.Install (nodes); + + // + // Assign IP addresses to our nodes. The source node is going to end up + // as 10.1.1.1 and the destination will be 10.1.1.2 + // + Ipv4AddressHelper addresses; + addresses.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces = addresses.Assign (devices); + + // + // The destination is the wifi device on node one. + // + InetSocketAddress destaddr = InetSocketAddress (interfaces.GetAddress (1), 80); + + // + // We just want to send packets from the source to the destination node, so + // the simplest thing is to cook something up manually. + // + TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); + Ptr dest = Socket::CreateSocket (nodes.Get (1), tid); + dest->Bind (destaddr); + + Ptr source = Socket::CreateSocket (nodes.Get (0), tid); + source->Connect (destaddr); + + // + // Schedule the packet sends, one packet per simulated second. + // + for (uint32_t i = 0; i < m_testVectors.GetN (); ++i) + { + Time t = Seconds (1. * i); + Simulator::Schedule (t, &Ns3LogDistancePropagationLossModelTestCase::SendPacket, this, i, source, 1000); + } + + Simulator::Stop (Seconds(1. * m_testVectors.GetN ())); + Simulator::Run (); + + source->Close (); + source = 0; + + dest->Close (); + dest = 0; + + m_receiver = 0; + + Simulator::Destroy (); + + // + // If we've already reported an error, just leave it at that. + // + if (GetErrorStatus () == false) + { + NS_TEST_ASSERT_MSG_EQ (m_gotCallbacks, m_testVectors.GetN (), "Did not get expected number of ReceiveOkCallbacks"); + } + + return GetErrorStatus (); +} + +class Ns3WifiPropagationLossModelsTestSuite : public TestSuite +{ +public: + Ns3WifiPropagationLossModelsTestSuite (); +}; + +Ns3WifiPropagationLossModelsTestSuite::Ns3WifiPropagationLossModelsTestSuite () + : TestSuite ("ns3-wifi-propagation-loss-models", SYSTEM) +{ + AddTestCase (new Ns3FriisPropagationLossModelTestCase); + AddTestCase (new Ns3LogDistancePropagationLossModelTestCase); +} + +Ns3WifiPropagationLossModelsTestSuite ns3WifiPropagationLossModelsTestSuite; diff --git a/src/test/ns3wifi/waf b/src/test/ns3wifi/waf new file mode 100644 index 000000000..4283ec141 --- /dev/null +++ b/src/test/ns3wifi/waf @@ -0,0 +1 @@ +exec "`dirname "$0"`"/../../../waf "$@" diff --git a/src/test/ns3wifi/wifi-interference-test-suite.cc b/src/test/ns3wifi/wifi-interference-test-suite.cc new file mode 100644 index 000000000..1e2b2dab0 --- /dev/null +++ b/src/test/ns3wifi/wifi-interference-test-suite.cc @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include + +#include "ns3/log.h" +#include "ns3/callback.h" +#include "ns3/abort.h" +#include "ns3/test.h" +#include "ns3/pcap-file.h" +#include "ns3/config.h" +#include "ns3/string.h" +#include "ns3/uinteger.h" +#include "ns3/data-rate.h" +#include "ns3/inet-socket-address.h" +#include "ns3/internet-stack-helper.h" +#include "ns3/ipv4-address-helper.h" +#include "ns3/tcp-socket-factory.h" +#include "ns3/yans-wifi-helper.h" +#include "ns3/propagation-loss-model.h" +#include "ns3/propagation-delay-model.h" +#include "ns3/yans-wifi-channel.h" +#include "ns3/yans-wifi-phy.h" +#include "ns3/wifi-net-device.h" +#include "ns3/mobility-helper.h" +#include "ns3/constant-position-mobility-model.h" +#include "ns3/nqos-wifi-mac-helper.h" +#include "ns3/simulator.h" + +NS_LOG_COMPONENT_DEFINE ("WifiInterferenceTestSuite"); + +using namespace ns3; + +class WifiInterferenceTestCase : public TestCase +{ +public: + WifiInterferenceTestCase (); + virtual ~WifiInterferenceTestCase (); + +private: + virtual bool DoRun (void); + void ReceivePacket (Ptr socket); + static void GenerateTraffic (Ptr socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval); + void PrintEndSync (std::string context, uint32_t dataRate, double snr, double per); + double WifiSimpleInterference (std::string phyMode, double Prss, double Irss, double delta, uint32_t PpacketSize, + uint32_t IpacketSize, bool verbose, InternetStackHelper internet); + double m_PER; + double m_SNR; + uint32_t m_DataRate; +}; + +// Add some help text to this case to describe what it is intended to test +WifiInterferenceTestCase::WifiInterferenceTestCase () + : TestCase ("Test interference calculation when interfering frame exactly overlaps intended frame") +{ +} + +WifiInterferenceTestCase::~WifiInterferenceTestCase () +{ +} + +void +WifiInterferenceTestCase::ReceivePacket (Ptr socket) +{ + Address addr; + socket->GetSockName (addr); + InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr); + NS_LOG_UNCOND ("Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ()); +} + +void +WifiInterferenceTestCase::GenerateTraffic (Ptr socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval) +{ + if (pktCount > 0) + { + socket->Send (Create (pktSize)); + Simulator::Schedule (pktInterval, &WifiInterferenceTestCase::GenerateTraffic, socket, pktSize, pktCount-1, pktInterval); + } + else + { + socket->Close (); + } +} + +void +WifiInterferenceTestCase::PrintEndSync (std::string context, uint32_t dataRate, double snr, double per) +{ + NS_LOG_UNCOND ("EndSync: Received frame with dataRate=" << dataRate << ", SNR=" << snr << ", PER =" << per); + m_PER = per; + m_SNR = snr; + m_DataRate = dataRate; +} + +double +WifiInterferenceTestCase::WifiSimpleInterference (std::string phyMode,double Prss, double Irss, double delta, uint32_t PpacketSize, uint32_t IpacketSize, bool verbose, InternetStackHelper internet) +{ + + uint32_t numPackets = 1; + double interval = 1.0; // seconds + double startTime = 10.0; // seconds + double distanceToRx = 100.0; // meters + + double offset = 91; // This is a magic number used to set the + // transmit power, based on other configuration + + m_PER = 0; + m_SNR = 0; + m_DataRate = 0; + + // Convert to time object + Time interPacketInterval = Seconds (interval); + + // disable fragmentation for frames below 2200 bytes + Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200")); + // turn off RTS/CTS for frames below 2200 bytes + Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200")); + // Fix non-unicast data rate to be the same as that of unicast + Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode", + StringValue (phyMode)); + + NodeContainer c; + c.Create (3); + + // The below set of helpers will help us to put together the wifi NICs we want + WifiHelper wifi; + wifi.SetStandard (WIFI_PHY_STANDARD_80211b); + + YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); + // This is one parameter that matters when using FixedRssLossModel + // set it to zero; otherwise, gain will be added + wifiPhy.Set ("RxGain", DoubleValue (0) ); + wifiPhy.Set ("CcaMode1Threshold", DoubleValue (0.0) ); + + // ns-3 support RadioTap and Prism tracing extensions for 802.11b + wifiPhy.SetPcapFormat (YansWifiPhyHelper::PCAP_FORMAT_80211_RADIOTAP); + + YansWifiChannelHelper wifiChannel ; + wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); + wifiChannel.AddPropagationLoss ("ns3::LogDistancePropagationLossModel"); + wifiPhy.SetChannel (wifiChannel.Create ()); + + // Add a non-QoS upper mac, and disable rate control + NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); + wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", + "DataMode",StringValue(phyMode), + "ControlMode",StringValue(phyMode)); + // Set it to adhoc mode + wifiMac.SetType ("ns3::AdhocWifiMac"); + NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c.Get (0)); + // This will disable these sending devices from detecting a signal + // so that they do not backoff + wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (0.0) ); + wifiPhy.Set ("TxGain", DoubleValue (offset + Prss) ); + devices.Add (wifi.Install (wifiPhy, wifiMac, c.Get (1))); + wifiPhy.Set ("TxGain", DoubleValue (offset + Irss) ); + devices.Add (wifi.Install (wifiPhy, wifiMac, c.Get (2))); + + // Note that with FixedRssLossModel, the positions below are not + // used for received signal strength. + MobilityHelper mobility; + Ptr positionAlloc = CreateObject (); + positionAlloc->Add (Vector (0.0, 0.0, 0.0)); + positionAlloc->Add (Vector (distanceToRx, 0.0, 0.0)); + positionAlloc->Add (Vector (-1*distanceToRx, 0.0, 0.0)); + mobility.SetPositionAllocator (positionAlloc); + mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); + mobility.Install (c); + + // InternetStackHelper internet; + internet.Install (c); + + Ipv4AddressHelper ipv4; + NS_LOG_INFO ("Assign IP Addresses."); + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer i = ipv4.Assign (devices); + + TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); + Ptr recvSink = Socket::CreateSocket (c.Get (0), tid); + InetSocketAddress local = InetSocketAddress (Ipv4Address("10.1.1.1"), 80); + recvSink->Bind (local); + recvSink->SetRecvCallback (MakeCallback (&WifiInterferenceTestCase::ReceivePacket, this)); + + Ptr source = Socket::CreateSocket (c.Get (1), tid); + InetSocketAddress remote = InetSocketAddress (Ipv4Address ("255.255.255.255"), 80); + source->Connect (remote); + + // Interferer will send to a different port; we will not see a + // "Received packet" message + Ptr interferer = Socket::CreateSocket (c.Get (2), tid); + InetSocketAddress interferingAddr = InetSocketAddress (Ipv4Address ("255.255.255.255"), 49000); + interferer->Connect (interferingAddr); + + Config::Connect ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/EndSync", MakeCallback (&WifiInterferenceTestCase::PrintEndSync, this)); + // Tracing + wifiPhy.EnablePcap ("wifi-simple-interference", devices.Get (0)); + + Simulator::Schedule (Seconds (startTime), &GenerateTraffic, + source, PpacketSize, numPackets, interPacketInterval); + + Simulator::Schedule (Seconds (startTime + delta/1000000.0), &GenerateTraffic, + interferer, IpacketSize, numPackets, interPacketInterval); + + Simulator::Run (); + Simulator::Destroy (); + + return m_PER; +} + +bool +WifiInterferenceTestCase::DoRun (void) +{ + + std::string phyMode ("wifib-1mbs"); + double Prss = -90; // -dBm + double Irss = -90; // -dBm + double delta = 0; // microseconds + uint32_t PpacketSize = 1000; // bytes + uint32_t IpacketSize = 1000; // bytes + bool verbose = false; + double PER, PER1, PER2; + InternetStackHelper internet; + + // Compute the packet error rate (PER) when delta=0 microseconds. This + // means that the interferer arrives at exactly the same time as the + // intended packet + PER = WifiSimpleInterference (phyMode,Prss,Irss,delta,PpacketSize,IpacketSize,verbose,internet); + + // Now rerun this test case and compute the PER when the delta time between + // arrival of the intended frame and interferer is 1 microsecond. + delta = 1; + PER1 = WifiSimpleInterference (phyMode,Prss,Irss,delta,PpacketSize,IpacketSize,verbose,internet); + + // Now rerun this test case and compute the PER when the delta time between + // arrival of the intended frame and interferer is 2 microseconds. + delta = 2; + PER2 = WifiSimpleInterference (phyMode,Prss,Irss,delta,PpacketSize,IpacketSize,verbose,internet); + + double PERDiff1 = PER - PER1; + + double PERDiff2 = PER1 - PER2; + + NS_TEST_ASSERT_MSG_EQ (PERDiff1, PERDiff2, + "The PER difference due to 1 microsecond difference in arrival shouldn't depend on absolute arrival"); + + return false; +} + +class WifiInterferenceTestSuite : public TestSuite +{ +public: + WifiInterferenceTestSuite (); +}; + +WifiInterferenceTestSuite::WifiInterferenceTestSuite () + : TestSuite ("ns3-wifi-interference", UNIT) +{ + AddTestCase (new WifiInterferenceTestCase); +} + +WifiInterferenceTestSuite wifiInterferenceTestSuite; + diff --git a/src/test/ns3wifi/wscript b/src/test/ns3wifi/wscript new file mode 100644 index 000000000..5d1136c04 --- /dev/null +++ b/src/test/ns3wifi/wscript @@ -0,0 +1,16 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def configure(conf): + pass + +def build(bld): + ns3wifi = bld.create_ns3_module('ns3wifi') + ns3wifi.source = [ + 'propagation-loss-models-test-suite.cc', + 'wifi-interference-test-suite.cc', + ] + headers = bld.new_task_gen('ns3header') + headers.module = 'ns3wifi' + headers.source = [ + 'ns3wifi.h', + ] diff --git a/src/test/sample-test-suite.cc b/src/test/sample-test-suite.cc new file mode 100644 index 000000000..424a6e864 --- /dev/null +++ b/src/test/sample-test-suite.cc @@ -0,0 +1,66 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ + +// An essential include is test.h +#include "ns3/test.h" + +// Do not put your test classes in namespace ns3. You may find it useful +// to use the using directive to access the ns3 namespace directly +using namespace ns3; + +// This is an example TestCase. +class SampleTestCase1 : public TestCase +{ +public: + SampleTestCase1 (); + virtual ~SampleTestCase1 (); + +private: + virtual bool DoRun (void); +}; + +// Add some help text to this case to describe what it is intended to test +SampleTestCase1::SampleTestCase1 () + : TestCase ("Sample test case (does nothing)") +{ +} + +// This destructor does nothing but we include it as a reminder that +// the test case should clean up after itself +SampleTestCase1::~SampleTestCase1 () +{ +} + +// +// This method is the pure virtual method from class TestCase that every +// TestCase must implement +// +bool +SampleTestCase1::DoRun (void) +{ + // A wide variety of test macros are available in src/core/test.h + NS_TEST_ASSERT_MSG_EQ (true, true, "true doesn't equal true for some reason"); + // Use this one for floating point comparisons + NS_TEST_ASSERT_MSG_EQ_TOL (0.01, 0.01, 0.001, "Numbers are not equal within tolerance"); + + // Return false if an error has _not_ occurred + return false; +} + +// The TestSuite class names the TestSuite, identifies what type of TestSuite, +// and enables the TestCases to be run. Typically, only the constructor for +// this class must be defined +// +class SampleTestSuite : public TestSuite +{ +public: + SampleTestSuite (); +}; + +SampleTestSuite::SampleTestSuite () + : TestSuite ("sample", BVT) +{ + AddTestCase (new SampleTestCase1); +} + +// Do not forget to allocate an instance of this TestSuite +SampleTestSuite sampleTestSuite; diff --git a/src/test/wscript b/src/test/wscript new file mode 100644 index 000000000..494c1df3c --- /dev/null +++ b/src/test/wscript @@ -0,0 +1,12 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + test = bld.create_ns3_module('test', ['core']) + test.source = [ + 'sample-test-suite.cc', + ] + + headers = bld.new_task_gen('ns3header') + headers.module = 'test' + headers.source = [ + ] diff --git a/src/wscript b/src/wscript index 415470ccc..621b05043 100644 --- a/src/wscript +++ b/src/wscript @@ -27,6 +27,7 @@ all_modules = ( 'applications/onoff', 'applications/packet-sink', 'applications/udp-echo', + 'routing/nix-vector-routing', 'routing/olsr', 'routing/global-routing', 'routing/static-routing', @@ -37,8 +38,16 @@ all_modules = ( 'helper', 'contrib/stats', 'applications/v4ping', + 'devices/mesh', + 'devices/mesh/dot11s', + 'devices/mesh/flame', 'applications/ping6', 'applications/radvd', + 'test', + 'test/ns3tcp', + 'test/ns3wifi', + 'contrib/flow-monitor', + 'contrib/net-anim', ) def set_options(opt): @@ -59,7 +68,6 @@ def configure(conf): conf.sub_config('core') conf.sub_config('simulator') conf.sub_config('devices/emu') - conf.sub_config('devices/wifi') conf.sub_config('devices/tap-bridge') conf.sub_config('contrib') conf.sub_config('internet-stack') @@ -81,7 +89,7 @@ def create_ns3_module(bld, name, dependencies=()): module.module_deps = list(dependencies) if not module.env['ENABLE_STATIC_NS3']: module.env.append_value('CXXFLAGS', module.env['shlib_CXXFLAGS']) - elif module.env['CXX_NAME'] == 'gcc' and \ + elif module.env['CXX_NAME'] in ['gcc', 'icc'] and \ os.uname()[4] == 'x86_64' and \ module.env['ENABLE_PYTHON_BINDINGS']: # enable that flag for static builds only on x86-64 platforms diff --git a/test.py b/test.py new file mode 100755 index 000000000..f36074e0c --- /dev/null +++ b/test.py @@ -0,0 +1,910 @@ +#! /usr/bin/env python +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- +# +# Copyright (c) 2009 University of Washington +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +import os +import sys +import optparse +import subprocess +import threading +import Queue +import signal +import random +import xml.dom.minidom +import shutil + +# +# XXX This should really be part of a waf command to list the configuration +# items relative to optional ns-3 pieces. +# +# A list of interesting configuration items in the waf configuration +# cache which we may be interested in when deciding on which examples +# to run and how to run them. These are set by waf during the +# configuration phase and the corresponding assignments are usually +# found in the associated subdirectory wscript files. +# +interesting_config_items = [ + "NS3_BUILDDIR", + "NS3_MODULE_PATH", + "ENABLE_EMU", + "ENABLE_GSL", + "ENABLE_GTK_CONFIG_STORE", + "ENABLE_LIBXML2", + "ENABLE_NSC", + "ENABLE_PYTHON_BINDINGS", + "ENABLE_PYTHON_SCANNING", + "ENABLE_REAL_TIME", + "ENABLE_STATIC_NS3", + "ENABLE_SUDO", + "ENABLE_TAP", + "ENABLE_THREADING", +] + +# +# A list of examples to run as smoke tests just to ensure that they remain +# buildable and runnable over time. Also a condition under which to run +# the example (from the waf configuration). +# +# XXX Should this not be read from a configuration file somewhere and not +# hardcoded. +# +example_tests = [ + ("csma-bridge", "True"), + ("csma-bridge-one-hop", "True"), + ("csma-broadcast", "True"), + ("csma-multicast", "True"), + ("csma-one-subnet", "True"), + ("csma-packet-socket", "True"), + ("csma-ping", "True"), + ("csma-raw-ip-socket", "True"), + ("csma-star", "True"), + ("dynamic-global-routing", "True"), + ("first", "True"), + ("global-injection-slash32", "True"), + ("global-routing-slash32", "True"), + ("hello-simulator", "True"), + ("icmpv6-redirect", "True"), + ("mesh", "True"), + ("mixed-global-routing", "True"), + ("mixed-wireless", "True"), + ("multirate", "False"), # takes forever to run + ("nix-simple", "True"), + ("nms-p2p-nix", "False"), # takes forever to run + ("object-names", "True"), + ("ping6", "True"), + ("radvd", "True"), + ("radvd-two-prefix", "True"), + ("realtime-udp-echo", "ENABLE_REAL_TIME == True"), + ("second", "True"), + ("simple-alternate-routing", "True"), + ("simple-error-model", "True"), + ("simple-global-routing", "True"), + ("simple-point-to-point-olsr", "True"), + ("simple-routing-ping6", "True"), + ("simple-wifi-frame-aggregation", "True"), + ("star", "True"), + ("static-routing-slash32", "True"), + ("tcp-large-transfer", "True"), + ("tcp-nsc-zoo", "ENABLE_NSC == True"), + ("tcp-star-server", "True"), + ("test-ipv6", "True"), + ("third", "True"), + ("udp-echo", "True"), + ("virtual-net-device", "True"), + ("wifi-adhoc", "False"), # takes forever to run + ("wifi-ap", "True"), + ("wifi-wired-bridging", "True"), +] + +# +# Most of the examples produce gangs of trace files, so we want to find +# somewhere to put them that won't pollute the current directory. One +# obvious place is somewhere in /tmp. +# +TMP_TRACES_DIR = "/tmp/unchecked-traces" + +# +# The test suites are going to want to output status. They are running +# concurrently. This means that unless we are careful, the output of +# the test suites will be interleaved. Rather than introducing a lock +# file that could unintentionally start serializing execution, we ask +# the tests to write their output to a temporary directory and then +# put together the final output file when we "join" the test tasks back +# to the main thread. +# +TMP_OUTPUT_DIR = "/tmp/testpy" + +def get_node_text(node): + for child in node.childNodes: + if child.nodeType == child.TEXT_NODE: + return child.nodeValue + return "None" + +# +# A simple example of writing a text file with a test result summary. +# +def translate_to_text(results_file, text_file): + f = open(text_file, 'w') + dom = xml.dom.minidom.parse(results_file) + for suite in dom.getElementsByTagName("TestSuite"): + result = get_node_text(suite.getElementsByTagName("SuiteResult")[0]) + name = get_node_text(suite.getElementsByTagName("SuiteName")[0]) + time = get_node_text(suite.getElementsByTagName("SuiteTime")[0]) + output = "%s: Test Suite \"%s\" (%s)\n" % (result, name, time) + f.write(output) + if result != "CRASH": + for case in suite.getElementsByTagName("TestCase"): + result = get_node_text(case.getElementsByTagName("CaseResult")[0]) + name = get_node_text(case.getElementsByTagName("CaseName")[0]) + time = get_node_text(case.getElementsByTagName("CaseTime")[0]) + output = " %s: Test Case \"%s\" (%s)\n" % (result, name, time) + f.write(output) + + if result == "FAIL": + f.write(" Details:\n") + f.write(" Message: %s\n" % get_node_text(case.getElementsByTagName("CaseMessage")[0])) + f.write(" Condition: %s\n" % get_node_text(case.getElementsByTagName("CaseCondition")[0])) + f.write(" Actual: %s\n" % get_node_text(case.getElementsByTagName("CaseActual")[0])) + f.write(" Limit: %s\n" % get_node_text(case.getElementsByTagName("CaseLimit")[0])) + f.write(" File: %s\n" % get_node_text(case.getElementsByTagName("CaseFile")[0])) + f.write(" Line: %s\n" % get_node_text(case.getElementsByTagName("CaseLine")[0])) + + for example in dom.getElementsByTagName("Example"): + result = get_node_text(example.getElementsByTagName("Result")[0]) + name = get_node_text(example.getElementsByTagName("Name")[0]) + output = "%s: Example \"%s\"\n" % (result, name) + f.write(output) + + f.close() + +# +# A simple example of writing an HTML file with a test result summary. +# +def translate_to_html(results_file, html_file): + f = open(html_file, 'w') + f.write("\n") + f.write("\n") + f.write("

    ns-3 Test Results

    \n") + + dom = xml.dom.minidom.parse(results_file) + + f.write("

    Test Suites

    \n") + for suite in dom.getElementsByTagName("TestSuite"): + name = get_node_text(suite.getElementsByTagName("SuiteName")[0]) + result = get_node_text(suite.getElementsByTagName("SuiteResult")[0]) + time = get_node_text(suite.getElementsByTagName("SuiteTime")[0]) + + if result == "PASS": + f.write("

    %s: %s (%s)

    \n" % (result, name, time)) + else: + f.write("

    %s: %s (%s)

    \n" % (result, name, time)) + + + f.write("\n") + f.write("\n") + + if result == "CRASH": + f.write("\n") + f.write("\n" % result) + f.write("\n") + f.write("
    Result
    %s
    \n") + continue + + f.write("Test Case Name\n") + f.write(" Time \n") + + if result == "FAIL": + f.write("Details\n") + + for case in suite.getElementsByTagName("TestCase"): + f.write("\n") + name = get_node_text(case.getElementsByTagName("CaseName")[0]) + result = get_node_text(case.getElementsByTagName("CaseResult")[0]) + time = get_node_text(case.getElementsByTagName("CaseTime")[0]) + if result == "FAIL": + f.write("%s\n" % result) + f.write("%s\n" % name) + f.write("%s\n" % time) + f.write("") + f.write("Message: %s, " % get_node_text(case.getElementsByTagName("CaseMessage")[0])) + f.write("Condition: %s, " % get_node_text(case.getElementsByTagName("CaseCondition")[0])) + f.write("Actual: %s, " % get_node_text(case.getElementsByTagName("CaseActual")[0])) + f.write("Limit: %s, " % get_node_text(case.getElementsByTagName("CaseLimit")[0])) + f.write("File: %s, " % get_node_text(case.getElementsByTagName("CaseFile")[0])) + f.write("Line: %s" % get_node_text(case.getElementsByTagName("CaseLine")[0])) + f.write("\n") + else: + f.write("%s\n" % result) + f.write("%s\n" % name) + f.write("%s\n" % time) + f.write("\n") + + f.write("\n") + f.write("\n") + + f.write("

    Examples

    \n") + f.write("\n") + f.write("\n") + f.write("\n") + for example in dom.getElementsByTagName("Example"): + f.write("\n") + result = get_node_text(example.getElementsByTagName("Result")[0]) + if result in ["FAIL", "CRASH"]: + f.write("\n" % result) + else: + f.write("\n" % result) + name = get_node_text(example.getElementsByTagName("Name")[0]) + f.write("\n" % name) + f.write("\n") + + f.write("
    Result Example Name
    %s%s%s
    \n") + + f.write("\n") + f.write("\n") + f.close() + +# +# Python Control-C handling is broken in the presence of multiple threads. +# Signals get delivered to the runnable/running thread by default and if +# it is blocked, the signal is simply ignored. So we hook sigint and set +# a global variable telling the system to shut down gracefully. +# +thread_exit = False + +def sigint_hook(signal, frame): + global thread_exit + thread_exit = True + return 0 + +# +# Waf can be configured to compile in debug or optimized modes. In each +# case, the resulting built goes into a different directory. If we want +# test tests to run from the correct code-base, we have to figure out which +# mode waf is running in. This is called its active variant. +# +# XXX This function pokes around in the waf internal state file. To be a +# little less hacky, we should add a commmand to waf to return this info +# and use that result. +# +def read_waf_active_variant(): + for line in open("build/c4che/default.cache.py").readlines(): + if line.startswith("NS3_ACTIVE_VARIANT"): + exec(line, globals()) + break + + if options.verbose: + print "NS3_ACTIVE_VARIANT == %s" % NS3_ACTIVE_VARIANT + +# +# In general, the build process itself naturally takes care of figuring out +# which tests are built into the test runner. For example, if waf configure +# determines that ENABLE_EMU is false due to some missing dependency, +# the tests for the emu net device simply will not be built and will +# therefore not be included in the built test runner. +# +# Examples, however, are a different story. In that case, we are just given +# a list of examples that could be run. Instead of just failing, for example, +# nsc-tcp-zoo if NSC is not present, we look into the waf saved configuration +# for relevant configuration items. +# +# XXX This function pokes around in the waf internal state file. To be a +# little less hacky, we should add a commmand to waf to return this info +# and use that result. +# +def read_waf_config(): + for line in open("build/c4che/%s.cache.py" % NS3_ACTIVE_VARIANT).readlines(): + for item in interesting_config_items: + if line.startswith(item): + exec(line, globals()) + + if options.verbose: + for item in interesting_config_items: + print "%s ==" % item, eval(item) + +# +# It seems pointless to fork a process to run waf to fork a process to run +# the test runner, so we just run the test runner directly. The main thing +# that waf would do for us would be to sort out the shared library path but +# we can deal with that easily and do here. +# +# There can be many different ns-3 repositories on a system, and each has +# its own shared libraries, so ns-3 doesn't hardcode a shared library search +# path -- it is cooked up dynamically, so we do that too. +# +def make_library_path(): + global LIBRARY_PATH + + LIBRARY_PATH = "LD_LIBRARY_PATH='" + + if sys.platform == "darwin": + LIBRARY_PATH = "DYLD_LIBRARY_PATH='" + elif sys.platform == "win32": + LIBRARY_PATH = "PATH='" + elif sys.platform == "cygwin": + LIBRARY_PATH = "PATH='" + + for path in NS3_MODULE_PATH: + LIBRARY_PATH = LIBRARY_PATH + path + ":" + + LIBRARY_PATH = LIBRARY_PATH + "'" + +def run_job_synchronously(shell_command, directory): + cmd = "%s %s/%s/%s" % (LIBRARY_PATH, NS3_BUILDDIR, NS3_ACTIVE_VARIANT, shell_command) + if options.verbose: + print "Synchronously execute %s" % cmd + proc = subprocess.Popen(cmd, shell=True, cwd=directory, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_results = proc.communicate()[0] + return (proc.returncode, stdout_results) + +# +# This class defines a unit of testing work. It will typically refer to +# a test suite to run using the test-runner, or an example to run directly. +# +class Job(): + def __init__(self): + self.is_break = False + self.is_example = False + self.shell_command = "" + self.display_name = "" + self.cwd = "" + self.tmp_file_name = "" + self.returncode = False + + # + # A job is either a standard job or a special job indicating that a worker + # thread should exist. This special job is indicated by setting is_break + # to true. + # + def set_is_break(self, is_break): + self.is_break = is_break + + # + # Examples are treated differently than standard test suites. This is + # mostly because they are completely unaware that they are being run as + # tests. So we have to do some special case processing to make them look + # like tests. + # + def set_is_example(self, is_example): + self.is_example = is_example + + # + # This is the shell command that will be executed in the job. For example, + # + # "utils/test-runner --suite=some-test-suite" + # + def set_shell_command(self, shell_command): + self.shell_command = shell_command + + # + # This is the dispaly name of the job, typically the test suite or example + # name. For example, + # + # "some-test-suite" or "udp-echo" + # + def set_display_name(self, display_name): + self.display_name = display_name + + # + # This is the base directory of the repository out of which the tests are + # being run. It will be used deep down in the testing framework to determine + # where the source directory of the test was, and therefore where to find + # provided test vectors. For example, + # + # "/home/user/repos/ns-3-dev" + # + def set_basedir(self, basedir): + self.basedir = basedir + + # + # This is the current working directory that will be given to an executing + # test as it is being run. It will be used for examples to tell them where + # to write all of the pcap files that we will be carefully ignoring. For + # example, + # + # "/tmp/unchecked-traces" + # + def set_cwd(self, cwd): + self.cwd = cwd + + # + # This is the temporary results file name that will be given to an executing + # test as it is being run. We will be running all of our tests in parallel + # so there must be multiple temporary output files. These will be collected + # into a single XML file at the end and then be deleted. The file names are + # just giant random numbers, for example + # + # "/tmp/testpy/5437925246732857" + # + def set_tmp_file_name(self, tmp_file_name): + self.tmp_file_name = tmp_file_name + + # + # The return code received when the job process is executed. + # + def set_returncode(self, returncode): + self.returncode = returncode + +# +# The worker thread class that handles the actual running of a given test. +# Once spawned, it receives requests for work through its input_queue and +# ships the results back through the output_queue. +# +class worker_thread(threading.Thread): + def __init__(self, input_queue, output_queue): + threading.Thread.__init__(self) + self.input_queue = input_queue + self.output_queue = output_queue + + def run(self): + while True: + job = self.input_queue.get() + # + # Worker threads continue running until explicitly told to stop with + # a special job. + # + if job.is_break: + return + # + # If the global interrupt handler sets the thread_exit variable, + # we stop doing real work and just report back a "break" in the + # normal command processing has happened. + # + if thread_exit == True: + job.set_is_break(True) + self.output_queue.put(job) + continue + # + # Otherwise go about the business of running tests as normal. + # + else: + if options.verbose: + print "Launch %s" % job.shell_command + + if job.is_example: + # + # If we have an example, the shell command is all we need to + # know. It will be something like "examples/udp-echo" + # + (job.returncode, standard_out) = run_job_synchronously(job.shell_command, job.cwd) + else: + # + # If we're a test suite, we need to provide a little more info + # to the test runner, specifically the base directory and temp + # file name + # + (job.returncode, standard_out) = run_job_synchronously(job.shell_command + " --basedir=%s --out=%s" % + (job.basedir, job.tmp_file_name), job.cwd) + + if options.verbose: + print standard_out + + self.output_queue.put(job) + +# +# This is the main function that does the work of interacting with the test-runner +# itself. +# +def run_tests(): + # + # Run waf to make sure that everything is built, configured and ready to go + # unless we are explicitly told not to. + # + if options.nowaf == False: + proc = subprocess.Popen("./waf", shell=True) + proc.communicate() + + # + # Pull some interesting configuration information out of waf, primarily + # so we can know where executables can be found, but also to tell us what + # pieces of the system have been built. This will tell us what examples + # are runnable. + # + read_waf_active_variant() + read_waf_config() + make_library_path() + + # + # There are a couple of options that imply we can to exit before starting + # up a bunch of threads and running tests. Let's detect these cases and + # handle them without doing all of the hard work. + # + if options.kinds: + (rc, standard_out) = run_job_synchronously("utils/test-runner --kinds", os.getcwd()) + print standard_out + + if options.list: + (rc, standard_out) = run_job_synchronously("utils/test-runner --list", os.getcwd()) + print standard_out + + if options.kinds or options.list: + return + + # + # We communicate results in two ways. First, a simple message relating + # PASS, FAIL, or SKIP is always written to the standard output. It is + # expected that this will be one of the main use cases. A developer can + # just run test.py with no options and see that all of the tests still + # pass. + # + # The second main use case is when detailed status is requested (with the + # --text or --html options). Typicall this will be text if a developer + # finds a problem, or HTML for nightly builds. In these cases, an + # XML file is written containing the status messages from the test suites. + # This file is then read and translated into text or HTML. It is expected + # that nobody will really be interested in the XML, so we write it to + # somewhere in /tmp with a random name to avoid collisions. Just in case + # some strange once-in-a-lifetime error occurs, we always write the info + # so it can be found, we just may not use it. + # + # When we run examples as smoke tests, they are going to want to create + # lots and lots of trace files. We aren't really interested in the contents + # of the trace files, so we also just stash them off in /tmp somewhere. + # + if not os.path.exists(TMP_OUTPUT_DIR): + os.makedirs(TMP_OUTPUT_DIR) + + if not os.path.exists(TMP_TRACES_DIR): + os.makedirs(TMP_TRACES_DIR) + + # + # Create the main output file and start filling it with XML. We need to + # do this since the tests will just append individual results to this file. + # + xml_results_file = TMP_OUTPUT_DIR + "%d.xml" % random.randint(0, sys.maxint) + f = open(xml_results_file, 'w') + f.write('\n') + f.write('\n') + f.close() + + # + # We need to figure out what test suites to execute. We are either given one + # suite or example explicitly via the --suite or --example option, or we + # need to call into the test runner and ask it to list all of the available + # test suites. Further, we need to provide the constraint information if it + # has been given to us. + # + # This translates into allowing the following options with respect to the + # suites + # + # ./test,py: run all of the suites + # ./test.py --constrain=unit: run all unit suites + # ./test,py --suite=some-test-suite: run the single suite + # ./test,py --example=udp-echo: run no test suites + # ./test,py --suite=some-suite --example=some-example: run the single suite + # + # We can also use the --constrain option to provide an ordering of test + # execution quite easily. + # + if len(options.suite): + suites = options.suite + "\n" + elif len(options.example) == 0: + if len(options.constrain): + (rc, suites) = run_job_synchronously("utils/test-runner --list --constrain=%s" % options.constrain, os.getcwd()) + else: + (rc, suites) = run_job_synchronously("utils/test-runner --list", os.getcwd()) + else: + suites = "" + + # + # suite_list will either a single test suite name that the user has + # indicated she wants to run or a list of test suites provided by + # the test-runner possibly according to user provided constraints. + # We go through the trouble of setting up the parallel execution + # even in the case of a single suite to avoid having two process the + # results in two different places. + # + suite_list = suites.split('\n') + + # + # We now have a possibly large number of test suites to run, so we want to + # run them in parallel. We're going to spin up a number of worker threads + # that will run our test jobs for us. + # + # XXX Need to figure out number of CPUs without the multiprocessing + # dependency since multiprocessing is not standard `till Python 2.6 + # + input_queue = Queue.Queue(0) + output_queue = Queue.Queue(0) + + jobs = 0 + threads=[] + + try: + import multiprocessing + processors = multiprocessing.cpu_count() + except ImportError: + processors = 1 + for i in range(processors): + thread = worker_thread(input_queue, output_queue) + threads.append(thread) + thread.start() + + # + # We now have worker threads spun up, and a list of work to do. So, run + # through the list of test suites and dispatch a job to run each one. + # + # Dispatching will run with unlimited speed and the worker threads will + # execute as fast as possible from the queue. + # + for test in suite_list: + if len(test): + job = Job() + job.set_is_example(False) + job.set_display_name(test) + job.set_tmp_file_name(TMP_OUTPUT_DIR + "%d" % random.randint(0, sys.maxint)) + job.set_cwd(os.getcwd()) + job.set_basedir(os.getcwd()) + job.set_shell_command("utils/test-runner --suite='%s'" % test) + + if options.verbose: + print "Queue %s" % test + + input_queue.put(job) + jobs = jobs + 1 + + # + # We've taken care of the discovered or specified test suites. Now we + # have to deal with examples run as smoke tests. We have a list of all of + # the example programs it makes sense to try and run. Each example will + # have a condition associated with it that must evaluate to true for us + # to try and execute it. This is used to determine if the example has + # a dependency that is not satisfied. For example, if an example depends + # on NSC being configured by waf, that example should have a condition + # that evaluates to true if NSC is enabled. For example, + # + # ("tcp-nsc-zoo", "ENABLE_NSC == True"), + # + # In this case, the example "tcp-nsc-zoo" will only be run if we find the + # waf configuration variable "ENABLE_NSC" to be True. + # + # We don't care at all how the trace files come out, so we just write them + # to a single temporary directory. + # + # XXX As it stands, all of the trace files have unique names, and so file + # collisions can only happen if two instances of an example are running in + # two versions of the test.py process concurrently. We may want to create + # uniquely named temporary traces directories to avoid this problem. + # + # We need to figure out what examples to execute. We are either given one + # suite or example explicitly via the --suite or --example option, or we + # need to walk the list of examples looking for available example + # conditions. + # + # This translates into allowing the following options with respect to the + # suites + # + # ./test,py: run all of the examples + # ./test.py --constrain=unit run no examples + # ./test.py --constrain=example run all of the examples + # ./test,py --suite=some-test-suite: run no examples + # ./test,py --example=some-example: run the single example + # ./test,py --suite=some-suite --example=some-example: run the single example + # + # XXX could use constrain to separate out examples used for performance + # testing + # + if len(options.suite) == 0 and len(options.example) == 0: + if len(options.constrain) == 0 or options.constrain == "example": + for test, condition in example_tests: + if eval(condition) == True: + job = Job() + job.set_is_example(True) + job.set_display_name(test) + job.set_tmp_file_name("") + job.set_cwd(TMP_TRACES_DIR) + job.set_basedir(os.getcwd()) + job.set_shell_command("examples/%s" % test) + + if options.verbose: + print "Queue %s" % test + + input_queue.put(job) + jobs = jobs + 1 + elif len(options.example): + # + # If you tell me to run an example, I will try and run the example + # irrespective of any condition. + # + job = Job() + job.set_is_example(True) + job.set_display_name(options.example) + job.set_tmp_file_name("") + job.set_cwd(TMP_TRACES_DIR) + job.set_basedir(os.getcwd()) + job.set_shell_command("examples/%s" % options.example) + + if options.verbose: + print "Queue %s" % test + + input_queue.put(job) + jobs = jobs + 1 + + # + # Tell the worker threads to pack up and go home for the day. Each one + # will exit when they see their is_break task. + # + for i in range(processors): + job = Job() + job.set_is_break(True) + input_queue.put(job) + + # + # Now all of the tests have been dispatched, so all we have to do here + # in the main thread is to wait for them to complete. Keyboard interrupt + # handling is broken as mentioned above. We use a signal handler to catch + # sigint and set a global variable. When the worker threads sense this + # they stop doing real work and will just start throwing jobs back at us + # with is_break set to True. In this case, there are no real results so we + # ignore them. If there are real results, we always print PASS or FAIL to + # standard out as a quick indication of what happened. + # + for i in range(jobs): + job = output_queue.get() + if job.is_break: + continue + + if job.is_example: + kind = "Example" + else: + kind = "TestSuite" + + if job.returncode == 0: + status = "PASS" + else: + status = "FAIL" + + print "%s: %s %s" % (status, kind, job.display_name) + + if job.is_example == True: + # + # Examples are the odd man out here. They are written without any + # knowledge that they are going to be run as a test, so we need to + # cook up some kind of output for them. We're writing an xml file, + # so we do some simple XML that says we ran the example. + # + # XXX We could add some timing information to the examples, i.e. run + # them through time and print the results here. + # + f = open(xml_results_file, 'a') + f.write('\n') + example_name = " %s\n" % job.display_name + f.write(example_name) + if job.returncode == 0: + f.write(' PASS\n') + elif job.returncode == 1: + f.write(' FAIL\n') + else: + f.write(' CRASH\n') + + f.write('\n') + f.close() + else: + # + # If we're not running an example, we're running a test suite. + # These puppies are running concurrently and generating output + # that was written to a temporary file to avoid collisions. + # + # Now that we are executing sequentially in the main thread, we can + # concatenate the contents of the associated temp file to the main + # results file and remove that temp file. + # + # One thing to consider is that a test suite can crash just as + # well as any other program, so we need to deal with that + # possibility as well. If it ran correctly it will return 0 + # if it passed, or 1 if it failed. In this case, we can count + # on the results file it saved being complete. If it crashed, it + # will return some other code, and the file should be considered + # corrupt and useless. If the suite didn't create any XML, then + # we're going to have to do it ourselves. + # + if job.returncode == 0 or job.returncode == 1: + f_to = open(xml_results_file, 'a') + f_from = open(job.tmp_file_name, 'r') + f_to.write(f_from.read()) + f_to.close() + f_from.close() + else: + f = open(xml_results_file, 'a') + f.write("\n") + f.write(" %s\n" % job.display_name) + f.write(' CRASH\n') + f.write(' Execution times not available\n') + f.write("\n") + f.close() + + os.remove(job.tmp_file_name) + + # + # We have all of the tests run and the results written out. One final + # bit of housekeeping is to wait for all of the threads to close down + # so we can exit gracefully. + # + for thread in threads: + thread.join() + + # + # Back at the beginning of time, we started the body of an XML document + # since the test suites and examples were going to just write their + # individual pieces. So, we need to finish off and close out the XML + # document + # + f = open(xml_results_file, 'a') + f.write('\n') + f.close() + + # + # The last things to do are to translate the XML results file to "human + # readable form" if the user asked for it (or make an XML file somewhere) + # + if len(options.html): + translate_to_html(xml_results_file, options.html) + + if len(options.text): + translate_to_text(xml_results_file, options.text) + + if len(options.xml): + shutil.copyfile(xml_results_file, options.xml) + +def main(argv): + random.seed() + + parser = optparse.OptionParser() + parser.add_option("-c", "--constrain", action="store", type="string", dest="constrain", default="", + metavar="KIND", + help="constrain the test-runner by kind of test") + + parser.add_option("-e", "--example", action="store", type="string", dest="example", default="", + metavar="EXAMPLE", + help="specify a single example to run") + + parser.add_option("-k", "--kinds", action="store_true", dest="kinds", default=False, + help="print the kinds of tests available") + + parser.add_option("-l", "--list", action="store_true", dest="list", default=False, + help="print the list of known tests") + + parser.add_option("-n", "--nowaf", action="store_true", dest="nowaf", default=False, + help="do not run waf before starting testing") + + parser.add_option("-s", "--suite", action="store", type="string", dest="suite", default="", + metavar="TEST-SUITE", + help="specify a single test suite to run") + + parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, + help="print progress and informational messages") + + parser.add_option("-w", "--web", "--html", action="store", type="string", dest="html", default="", + metavar="HTML-FILE", + help="write detailed test results into HTML-FILE.html") + + parser.add_option("-t", "--text", action="store", type="string", dest="text", default="", + metavar="TEXT-FILE", + help="write detailed test results into TEXT-FILE.txt") + + parser.add_option("-x", "--xml", action="store", type="string", dest="xml", default="", + metavar="XML-FILE", + help="write detailed test results into XML-FILE.xml") + + global options + options = parser.parse_args()[0] + signal.signal(signal.SIGINT, sigint_hook) + run_tests() + return 0 + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/utils/test-runner.cc b/utils/test-runner.cc new file mode 100644 index 000000000..d12118c46 --- /dev/null +++ b/utils/test-runner.cc @@ -0,0 +1,248 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ns3/test.h" + +#include +#include +#include + +using namespace ns3; + +// +// Run one of the test suites. Returns an integer with the boolean sense of +// "an error has occurred." That is, 0 == false -> no error; 1 == true -> an +// error occurred. +// +int +main (int argc, char *argv[]) +{ + bool doVerbose = false; + bool doList = false; + bool doHelp = false; + bool doSuite = false; + bool doKinds = false; + + bool haveBasedir = false; + bool haveOutfile = false; + bool haveType = false; + + std::string suiteName; + std::string basedir; + std::string outfileName; + std::string typeName; + + for (int i = 1; i < argc; ++i) + { + std::string arg(argv[i]); + + if (arg.find ("--basedir=") != std::string::npos) + { + basedir = arg.substr (arg.find_first_of ("=") + 1, 9999); + haveBasedir = true; + } + + if (arg.find ("--constrain=") != std::string::npos) + { + typeName = arg.substr (arg.find_first_of ("=") + 1, 9999); + haveType = true; + } + + if (arg.compare ("--help") == 0) + { + doHelp = true; + } + + if (arg.compare ("--kinds") == 0) + { + doKinds = true; + } + + if (arg.compare ("--list") == 0) + { + doList = true; + } + + if (arg.find ("--out=") != std::string::npos) + { + outfileName = arg.substr (arg.find_first_of ("=") + 1, 9999); + haveOutfile = true; + } + + if (arg.find ("--suite=") != std::string::npos) + { + suiteName = arg.substr (arg.find_first_of ("=") + 1, 9999); + doSuite = true; + } + + if (arg.compare ("--verbose") == 0) + { + doVerbose = true; + } + } + + // + // A help request trumps everything else. If we have one, just print the help + // and leave. + // + if (doHelp) + { + std::cout << " --basedir=dir: Set the base directory (where to find src) to \"dir\"" << std::endl; + std::cout << " --constrain=test-type: Constrain checks to test suites of type \"test-type\"" << std::endl; + std::cout << " --help: Print this message" << std::endl; + std::cout << " --kinds: List all of the available kinds of tests" << std::endl; + std::cout << " --list: List all of the test suites (optionally constrained by test-type)" << std::endl; + std::cout << " --out=file-name: Set the test status output file to \"file-name\"" << std::endl; + std::cout << " --suite=suite-name: Run the test suite named \"suite-name\"" << std::endl; + std::cout << " --verbose: Turn on messages in the run test suites" << std::endl; + + return false; + } + + // + // A kinds request trumps everything remaining. If we are asked, just + // print the list of types and leave. + // + if (doKinds) + { + // + // Coming up with a string to represent a test type is completely up to + // us here. We just define the types as being a string composed of the + // enum defined in test.h converted to lower case. + // + std::cout << " bvt: Build Verification Tests (to see if build completed successfully)" << std::endl; + std::cout << " unit: Unit Tests (within modules to check basic functionality)" << std::endl; + std::cout << " system: System Tests (spans modules to check integration of modules)" << std::endl; + std::cout << " example: Examples (to see if example programs run successfully)" << std::endl; + std::cout << " performance: Performance Tests (check to see if the system is as fast as expected)" << std::endl; + + return false; + } + + // + // A list request is the first functional request. It trumps running the + // actual tests. If we get a list request, we don't run anything, we just + // do the requested list which may or may not be qualified by a typename. + // + if (doList) + { + for (uint32_t i = 0; i < TestRunner::GetNTestSuites (); ++i) + { + TestSuite *suite = TestRunner::GetTestSuite (i); + + // + // Filter the tests listed by type if requested. + // + if (haveType) + { + TestSuite::TestType type = suite->GetTestType (); + if (typeName == "bvt" && type != TestSuite::BVT) + { + continue; + } + + if (typeName == "unit" && type != TestSuite::UNIT) + { + continue; + } + + if (typeName == "system" && type != TestSuite::SYSTEM) + { + continue; + } + + if (typeName == "example" && type != TestSuite::EXAMPLE) + { + continue; + } + + if (typeName == "performance" && type != TestSuite::PERFORMANCE) + { + continue; + } + } + + // + // This creates a list of test suite names that can be used by the + // high level test manager to get a list of all tests. It will then + // typically launch individual tests in parallel, calling back here + // with a specific "suite=" to run. + // + std::cout << suite->GetName () << std::endl; + } + + return false; + } + + // + // If we haven't been asked to run a test suite, we are just going to happily + // try and run everything. Test suites are possibly going to need to figure + // out where there source directory is, and to do that they will need to know + // where the base directory of the distribution is (the directory in which + // "src" is found). We could try and run without it, but when it is needed, + // the test will fail with an assertion. So to be safe, we require a basedir + // to proceed. + // + + if (haveBasedir == false) + { + std::cout << "Must specify a base directory to run tests (use --basedir option)" << std::endl; + return true; + } + + // + // If given an output file, we just append the output of each test suite + // we're asked to run to the end of that file. We need to append since the + // higher level test runner may be just running a number of tests back to + // back. We leave it up to that code to decide how to deal with possible + // parallel operation -- we just append to a file here. If no output file + // is specified, we don't do any output and just return the sense of error + // given by the test. + // + std::ofstream *pofs = 0; + std::ofstream ofs; + + if (!outfileName.empty ()) + { + ofs.open (outfileName.c_str (), std::fstream::out | std::fstream::app); + pofs = &ofs; + } + + // + // If we have a specified test suite to run, then we only run that suite. + // The default case is to "run everything. We don't expect this to be done + // much since typically higher level code will be running suites in parallel + // but we'll do it if asked. + // + bool result = false; + + for (uint32_t i = 0; i < TestRunner::GetNTestSuites (); ++i) + { + TestSuite *testSuite = TestRunner::GetTestSuite (i); + if (doSuite == false || (doSuite == true && suiteName == testSuite->GetName ())) + { + testSuite->SetBaseDir (basedir); + testSuite->SetStream (pofs); + testSuite->SetVerbose (doVerbose); + result |= testSuite->Run (); + } + } + + ofs.close(); + return result; +} diff --git a/utils/wscript b/utils/wscript index 389cc25f8..d30726465 100644 --- a/utils/wscript +++ b/utils/wscript @@ -9,6 +9,11 @@ def build(bld): unit_tests.source = 'run-tests.cc' ## link unit test program with all ns3 modules unit_tests.uselib_local = 'ns3' + + test_runner = bld.create_ns3_program('test-runner', ['core']) + test_runner.install_path = None # do not install + test_runner.source = 'test-runner.cc' + test_runner.uselib_local = 'ns3' obj = bld.create_ns3_program('bench-simulator', ['simulator']) obj.source = 'bench-simulator.cc' diff --git a/wscript b/wscript index 8c360304a..4c1756993 100644 --- a/wscript +++ b/wscript @@ -141,6 +141,11 @@ def set_options(opt): help=('Run doxygen to generate html documentation from source comments'), action="store_true", default=False, dest='doxygen') + opt.add_option('--doxygen-no-build', + help=('Run doxygen to generate html documentation from source comments, ' + 'but do not wait for ns-3 to finish the full build.'), + action="store_true", default=False, + dest='doxygen_no_build') opt.add_option('--run', help=('Run a locally built program; argument can be a program name,' @@ -279,7 +284,7 @@ def configure(conf): env['PLATFORM'] = sys.platform - if conf.env['CXX_NAME'] == 'gcc': + if conf.env['CXX_NAME'] in ['gcc', 'icc']: if sys.platform == 'win32': env.append_value("LINKFLAGS", "-Wl,--enable-runtime-pseudo-reloc") elif sys.platform == 'cygwin': @@ -327,7 +332,7 @@ def configure(conf): env['ENABLE_STATIC_NS3'] = False if Options.options.enable_static: if env['PLATFORM'].startswith('linux') and \ - env['CXX_NAME'] == 'gcc': + env['CXX_NAME'] in ['gcc', 'icc']: if re.match('i[3-6]86', os.uname()[4]): conf.report_optional_feature("static", "Static build", True, '') env['ENABLE_STATIC_NS3'] = True @@ -353,8 +358,15 @@ def configure(conf): else: conf.report_optional_feature("static", "Static build", False, "option --enable-static not selected") + have_gsl = conf.pkg_check_modules('GSL', 'gsl', mandatory=False) + conf.env['ENABLE_GSL'] = have_gsl - + conf.report_optional_feature("GSL", "GNU Scientific Library (GSL)", + conf.env['ENABLE_GSL'], + "GSL not found") + if have_gsl: + conf.env.append_value('CXXDEFINES', "ENABLE_GSL") + conf.env.append_value('CCDEFINES', "ENABLE_GSL") # Write a summary of optional features status print "---- Summary of optional NS-3 features:" @@ -520,7 +532,7 @@ def build(bld): lib = bld.new_task_gen('cxx', 'shlib') lib.name = 'ns3' lib.target = 'ns3' - if lib.env['CXX_NAME'] == 'gcc' and env['WL_SONAME_SUPPORTED']: + if lib.env['CXX_NAME'] in ['gcc', 'icc'] and env['WL_SONAME_SUPPORTED']: lib.env.append_value('LINKFLAGS', '-Wl,--soname=%s' % ccroot.get_target_name(lib)) if sys.platform == 'cygwin': lib.features.append('implib') # workaround for WAF bug #472 @@ -555,9 +567,14 @@ def build(bld): regression.run_regression(bld, regression_traces) if Options.options.check: - Options.options.compile_targets += ',run-tests,ns3module' + Options.options.compile_targets += ',run-tests' + if env['ENABLE_PYTHON_BINDINGS']: + Options.options.compile_targets += ',ns3module,pybindgen-command' _run_check(bld) + if Options.options.doxygen_no_build: + doxygen() + raise SystemExit(0) def shutdown(ctx): bld = wutils.bld