From c2f68833ac674aa0170e4960ad35cf58c3b316cb Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Wed, 25 Nov 2009 10:51:37 +0000 Subject: [PATCH 1/5] Forgot to update the olsr-tc-regression traces (bug 739) --- .../test/olsr-tc-regression-test-0-1.pcap | Bin 2372 -> 2372 bytes .../test/olsr-tc-regression-test-1-1.pcap | Bin 3444 -> 3444 bytes .../test/olsr-tc-regression-test-2-1.pcap | Bin 2372 -> 2372 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/routing/olsr/test/olsr-tc-regression-test-0-1.pcap b/src/routing/olsr/test/olsr-tc-regression-test-0-1.pcap index 067f8fd4a1615c1098f3810eadc97d506972e9e9..da5ad3711eedb285078d28d6f4db850a7bc5fba5 100644 GIT binary patch delta 136 zcmX>ibVO)E86)e&@?;=!8%RvHXUqnYs~L-dq&yRdoXi9g`446nGlSUonL*;gEX_bt wo=J4_82jZV$1@X1nK>X=o5+o|YehSEc%nlOu=Kz^-m;ibVO)E8DrbT@?;=!8%RvHXUqnYs~L-dq&yRdoXi9g`446nGlSUonL*;gEX_bt wo=J4_82jZV$1@X1nK>X=o5+o|YehSEc%nlOu=Kz^-m;TKNETKNEibVO)E86)e&@?;=!8%RvHXUqnYs~L-dq&yRdoXi9g`446nGlSUonL*;gEX_bt wo=J4_82jZV$1@X1nK>X=o5+o|YehSEc%nlOu=Kz^-m;ibVO)E8DrbT@?;=!8%RvHXUqnYs~L-dq&yRdoXi9g`446nGlSUonL*;gEX_bt wo=J4_82jZV$1@X1nK>X=o5+o|YehSEc%nlOu=Kz^-m; Date: Wed, 25 Nov 2009 11:41:46 +0000 Subject: [PATCH 2/5] python scanning: order from chaos: pre-sort the ns3 module dependency graph to improve stability of the result --- bindings/python/ns3modulescan.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/python/ns3modulescan.py b/bindings/python/ns3modulescan.py index 1a2530f29..d6bb26efd 100644 --- a/bindings/python/ns3modulescan.py +++ b/bindings/python/ns3modulescan.py @@ -262,7 +262,11 @@ def ns3_module_scan(top_builddir, pygen_file_name, everything_h, cflags): ## do a topological sort on the modules graph from topsort import topsort graph = [] - for ns3_module_name, (ns3_module_deps, dummy) in ns3_modules.iteritems(): + module_names = ns3_modules.keys() + module_names.sort() + for ns3_module_name in module_names: + ns3_module_deps = list(ns3_modules[ns3_module_name][0]) + ns3_module_deps.sort() for dep in ns3_module_deps: graph.append((dep, ns3_module_name)) sorted_ns3_modules = topsort(graph) From ffde19c1a0799fe0476377c328b7649e4610f943 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Wed, 25 Nov 2009 11:41:55 +0000 Subject: [PATCH 3/5] python apidefs rescan --- .../apidefs/gcc-ILP32/ns3_module_core.py | 2 +- .../apidefs/gcc-ILP32/ns3_module_dot11s.py | 8 +- .../apidefs/gcc-ILP32/ns3_module_helper.py | 258 +++- .../apidefs/gcc-ILP32/ns3_module_simulator.py | 4 +- .../apidefs/gcc-ILP32/ns3_module_wifi.py | 20 +- .../gcc-ILP32/ns3modulegen_generated.py | 1126 +++++++---------- .../apidefs/gcc-LP64/ns3_module_dot11s.py | 12 +- .../apidefs/gcc-LP64/ns3_module_helper.py | 258 +++- .../apidefs/gcc-LP64/ns3_module_simulator.py | 4 +- .../apidefs/gcc-LP64/ns3_module_wifi.py | 20 +- .../gcc-LP64/ns3modulegen_generated.py | 1126 +++++++---------- 11 files changed, 1505 insertions(+), 1333 deletions(-) diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py index 353d404e4..fc2520d55 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py @@ -3372,7 +3372,7 @@ def register_functions(root_module): module.add_function('TypeNameGet', 'std::string', [], - template_parameters=['long']) + template_parameters=['long long']) ## type-name.h: extern std::string ns3::TypeNameGet() [free function] module.add_function('TypeNameGet', 'std::string', diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_dot11s.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_dot11s.py index 656d9baef..9edab2a1b 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_dot11s.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_dot11s.py @@ -79,12 +79,12 @@ def register_types_ns3_dot11s(module): 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::dot11sPathSelectionMetric [enumeration] - module.add_enum('dot11sPathSelectionMetric', ['METRIC_AIRTIME']) - ## 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::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] diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py index 25e0f7cf7..4648f4ae2 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py @@ -3,6 +3,8 @@ from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandler def register_types(module): root_module = module.get_root() + ## animation-interface.h: ns3::AnimationInterface [class] + module.add_class('AnimationInterface') ## application-container.h: ns3::ApplicationContainer [class] module.add_class('ApplicationContainer') ## athstats-helper.h: ns3::AthstatsHelper [class] @@ -11,6 +13,8 @@ def register_types(module): module.add_class('BridgeHelper', allow_subclassing=False) ## csma-helper.h: ns3::CsmaHelper [class] module.add_class('CsmaHelper', allow_subclassing=False) + ## csma-star-helper.h: ns3::CsmaStarHelper [class] + module.add_class('CsmaStarHelper', allow_subclassing=False) ## emu-helper.h: ns3::EmuHelper [class] module.add_class('EmuHelper', allow_subclassing=False) ## flow-monitor-helper.h: ns3::FlowMonitorHelper [class] @@ -55,8 +59,14 @@ def register_types(module): module.add_class('PacketSocketHelper', allow_subclassing=False) ## ping6-helper.h: ns3::Ping6Helper [class] module.add_class('Ping6Helper', allow_subclassing=False) + ## 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) ## point-to-point-helper.h: ns3::PointToPointHelper [class] module.add_class('PointToPointHelper', allow_subclassing=False) + ## point-to-point-star-helper.h: ns3::PointToPointStarHelper [class] + module.add_class('PointToPointStarHelper', allow_subclassing=False) ## tap-bridge-helper.h: ns3::TapBridgeHelper [class] module.add_class('TapBridgeHelper', allow_subclassing=False) ## udp-echo-helper.h: ns3::UdpEchoClientHelper [class] @@ -93,6 +103,8 @@ 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']) + ## canvas-location.h: ns3::CanvasLocation [class] + module.add_class('CanvasLocation', 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] @@ -181,10 +193,12 @@ def register_types_ns3_olsr(module): def register_methods(root_module): + register_Ns3AnimationInterface_methods(root_module, root_module['ns3::AnimationInterface']) 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_Ns3CsmaStarHelper_methods(root_module, root_module['ns3::CsmaStarHelper']) 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']) @@ -206,7 +220,10 @@ def register_methods(root_module): 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_Ns3PointToPointDumbbellHelper_methods(root_module, root_module['ns3::PointToPointDumbbellHelper']) + register_Ns3PointToPointGridHelper_methods(root_module, root_module['ns3::PointToPointGridHelper']) register_Ns3PointToPointHelper_methods(root_module, root_module['ns3::PointToPointHelper']) + register_Ns3PointToPointStarHelper_methods(root_module, root_module['ns3::PointToPointStarHelper']) 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']) @@ -224,11 +241,35 @@ def register_methods(root_module): 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_Ns3CanvasLocation_methods(root_module, root_module['ns3::CanvasLocation']) 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_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::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_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')]) @@ -422,14 +463,6 @@ def register_Ns3CsmaHelper_methods(root_module, cls): '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', @@ -444,6 +477,56 @@ def register_Ns3CsmaHelper_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_Ns3CsmaStarHelper_methods(root_module, cls): + ## csma-star-helper.h: ns3::CsmaStarHelper::CsmaStarHelper(ns3::CsmaStarHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CsmaStarHelper const &', 'arg0')]) + ## csma-star-helper.h: ns3::CsmaStarHelper::CsmaStarHelper(uint32_t numSpokes, ns3::CsmaHelper csmaHelper) [constructor] + cls.add_constructor([param('uint32_t', 'numSpokes'), param('ns3::CsmaHelper', 'csmaHelper')]) + ## csma-star-helper.h: void ns3::CsmaStarHelper::AssignIpv4Addresses(ns3::Ipv4AddressHelper address) [member function] + cls.add_method('AssignIpv4Addresses', + 'void', + [param('ns3::Ipv4AddressHelper', 'address')]) + ## csma-star-helper.h: ns3::Ptr ns3::CsmaStarHelper::GetHub() const [member function] + cls.add_method('GetHub', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## csma-star-helper.h: ns3::NetDeviceContainer ns3::CsmaStarHelper::GetHubDevices() const [member function] + cls.add_method('GetHubDevices', + 'ns3::NetDeviceContainer', + [], + is_const=True) + ## csma-star-helper.h: ns3::Ipv4Address ns3::CsmaStarHelper::GetHubIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetHubIpv4Address', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## csma-star-helper.h: ns3::Ptr ns3::CsmaStarHelper::GetSpoke(uint32_t arg0) const [member function] + cls.add_method('GetSpoke', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'arg0')], + is_const=True) + ## csma-star-helper.h: ns3::NetDeviceContainer ns3::CsmaStarHelper::GetSpokeDevices() const [member function] + cls.add_method('GetSpokeDevices', + 'ns3::NetDeviceContainer', + [], + is_const=True) + ## csma-star-helper.h: ns3::Ipv4Address ns3::CsmaStarHelper::GetSpokeIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetSpokeIpv4Address', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## csma-star-helper.h: void ns3::CsmaStarHelper::InstallStack(ns3::InternetStackHelper stack) [member function] + cls.add_method('InstallStack', + 'void', + [param('ns3::InternetStackHelper', 'stack')]) + ## csma-star-helper.h: uint32_t ns3::CsmaStarHelper::SpokeCount() const [member function] + cls.add_method('SpokeCount', + 'uint32_t', + [], + is_const=True) + 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')]) @@ -1245,6 +1328,92 @@ def register_Ns3Ping6Helper_methods(root_module, cls): [param('ns3::Ipv6Address', 'ip')]) 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::AssignIpv4Addresses(ns3::Ipv4AddressHelper leftIp, ns3::Ipv4AddressHelper rightIp, ns3::Ipv4AddressHelper routerIp) [member function] + cls.add_method('AssignIpv4Addresses', + '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::GetLeftIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetLeftIpv4Address', + '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::GetRightIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetRightIpv4Address', + '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: void ns3::PointToPointGridHelper::AssignIpv4Addresses(ns3::Ipv4AddressHelper rowIp, ns3::Ipv4AddressHelper colIp) [member function] + cls.add_method('AssignIpv4Addresses', + '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::GetIpv4Address(uint32_t row, uint32_t col) [member function] + cls.add_method('GetIpv4Address', + '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_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')]) @@ -1320,14 +1489,6 @@ def register_Ns3PointToPointHelper_methods(root_module, cls): 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', @@ -1342,6 +1503,50 @@ def register_Ns3PointToPointHelper_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_Ns3PointToPointStarHelper_methods(root_module, cls): + ## point-to-point-star-helper.h: ns3::PointToPointStarHelper::PointToPointStarHelper(ns3::PointToPointStarHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointStarHelper const &', 'arg0')]) + ## point-to-point-star-helper.h: ns3::PointToPointStarHelper::PointToPointStarHelper(uint32_t numSpokes, ns3::PointToPointHelper p2pHelper) [constructor] + cls.add_constructor([param('uint32_t', 'numSpokes'), param('ns3::PointToPointHelper', 'p2pHelper')]) + ## point-to-point-star-helper.h: void ns3::PointToPointStarHelper::AssignIpv4Addresses(ns3::Ipv4AddressHelper address) [member function] + cls.add_method('AssignIpv4Addresses', + 'void', + [param('ns3::Ipv4AddressHelper', 'address')]) + ## point-to-point-star-helper.h: void ns3::PointToPointStarHelper::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-star-helper.h: ns3::Ptr ns3::PointToPointStarHelper::GetHub() const [member function] + cls.add_method('GetHub', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## point-to-point-star-helper.h: ns3::Ipv4Address ns3::PointToPointStarHelper::GetHubIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetHubIpv4Address', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-star-helper.h: ns3::Ptr ns3::PointToPointStarHelper::GetSpoke(uint32_t arg0) const [member function] + cls.add_method('GetSpoke', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-star-helper.h: ns3::Ipv4Address ns3::PointToPointStarHelper::GetSpokeIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetSpokeIpv4Address', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-star-helper.h: void ns3::PointToPointStarHelper::InstallStack(ns3::InternetStackHelper stack) [member function] + cls.add_method('InstallStack', + 'void', + [param('ns3::InternetStackHelper', 'stack')]) + ## point-to-point-star-helper.h: uint32_t ns3::PointToPointStarHelper::SpokeCount() const [member function] + cls.add_method('SpokeCount', + 'uint32_t', + [], + is_const=True) + 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')]) @@ -1844,6 +2049,27 @@ def register_Ns3AthstatsWifiTraceSink_methods(root_module, cls): [param('std::string', 'context'), param('ns3::Mac48Address', 'address')]) return +def register_Ns3CanvasLocation_methods(root_module, cls): + ## canvas-location.h: ns3::CanvasLocation::CanvasLocation(ns3::CanvasLocation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CanvasLocation const &', 'arg0')]) + ## canvas-location.h: ns3::CanvasLocation::CanvasLocation() [constructor] + cls.add_constructor([]) + ## canvas-location.h: ns3::Vector ns3::CanvasLocation::GetLocation() const [member function] + cls.add_method('GetLocation', + 'ns3::Vector', + [], + is_const=True) + ## canvas-location.h: static ns3::TypeId ns3::CanvasLocation::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## canvas-location.h: void ns3::CanvasLocation::SetLocation(ns3::Vector const & location) [member function] + cls.add_method('SetLocation', + 'void', + [param('ns3::Vector const &', 'location')]) + return + def register_Ns3MeshStack_methods(root_module, cls): ## mesh-stack-installer.h: ns3::MeshStack::MeshStack() [constructor] cls.add_constructor([]) diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py index 47d13f278..a83268dde 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_simulator.py @@ -1574,7 +1574,7 @@ def register_functions(root_module): 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] + ## high-precision.h: 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')]) @@ -1586,7 +1586,7 @@ def register_functions(root_module): 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] + ## high-precision.h: 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')]) diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_wifi.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_wifi.py index 30a701c72..c32f5fd31 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_wifi.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_wifi.py @@ -9,6 +9,8 @@ def register_types(module): 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_STANDARD_80211p_CCH', 'WIFI_PHY_STANDARD_80211p_SCH', 'WIFI_PHY_UNKNOWN']) + ## qos-tag.h: ns3::UserPriority [enumeration] + module.add_enum('UserPriority', ['UP_BK', 'UP_BE', 'UP_EE', 'UP_CL', 'UP_VI', 'UP_VO', 'UP_NC']) ## 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] @@ -1994,11 +1996,6 @@ def register_Ns3QosTag_methods(root_module, cls): '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', @@ -2009,6 +2006,11 @@ def register_Ns3QosTag_methods(root_module, cls): 'uint32_t', [], is_const=True, is_virtual=True) + ## qos-tag.h: uint8_t ns3::QosTag::GetTid() const [member function] + cls.add_method('GetTid', + 'uint8_t', + [], + is_const=True) ## qos-tag.h: static ns3::TypeId ns3::QosTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2024,10 +2026,14 @@ def register_Ns3QosTag_methods(root_module, cls): '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', + ## qos-tag.h: void ns3::QosTag::SetTid(uint8_t tid) [member function] + cls.add_method('SetTid', 'void', [param('uint8_t', 'tid')]) + ## qos-tag.h: void ns3::QosTag::SetUserPriority(ns3::UserPriority up) [member function] + cls.add_method('SetUserPriority', + 'void', + [param('ns3::UserPriority', 'up')]) return def register_Ns3RandomPropagationDelayModel_methods(root_module, cls): diff --git a/bindings/python/apidefs/gcc-ILP32/ns3modulegen_generated.py b/bindings/python/apidefs/gcc-ILP32/ns3modulegen_generated.py index a9dafcd89..30d43dd6a 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3modulegen_generated.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3modulegen_generated.py @@ -15,32 +15,32 @@ import sys import ns3_module_core import ns3_module_simulator import ns3_module_test -import ns3_module_mobility import ns3_module_common +import ns3_module_mobility import ns3_module_contrib import ns3_module_node +import ns3_module_bridge +import ns3_module_csma +import ns3_module_emu +import ns3_module_global_routing +import ns3_module_internet_stack +import ns3_module_list_routing +import ns3_module_onoff +import ns3_module_packet_sink +import ns3_module_point_to_point +import ns3_module_static_routing +import ns3_module_stats import ns3_module_tap_bridge import ns3_module_v4ping -import ns3_module_static_routing -import ns3_module_packet_sink -import ns3_module_stats -import ns3_module_onoff -import ns3_module_point_to_point -import ns3_module_internet_stack -import ns3_module_csma -import ns3_module_list_routing import ns3_module_virtual_net_device import ns3_module_wifi -import ns3_module_emu -import ns3_module_bridge -import ns3_module_global_routing -import ns3_module_udp_echo +import ns3_module_aodv +import ns3_module_flow_monitor import ns3_module_nix_vector_routing import ns3_module_olsr -import ns3_module_aodv -import ns3_module_radvd import ns3_module_ping6 -import ns3_module_flow_monitor +import ns3_module_radvd +import ns3_module_udp_echo import ns3_module_mesh import ns3_module_helper import ns3_module_dot11s @@ -86,17 +86,6 @@ def register_types(module): ns3_module_test__local.register_types(module) root_module.end_section('ns3_module_test') - 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) @@ -108,6 +97,17 @@ def register_types(module): ns3_module_common__local.register_types(module) root_module.end_section('ns3_module_common') + 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_contrib') ns3_module_contrib.register_types(module) @@ -130,6 +130,127 @@ def register_types(module): ns3_module_node__local.register_types(module) root_module.end_section('ns3_module_node') + 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_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_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_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_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_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_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_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_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_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_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_tap_bridge') ns3_module_tap_bridge.register_types(module) @@ -152,94 +273,6 @@ def register_types(module): ns3_module_v4ping__local.register_types(module) root_module.end_section('ns3_module_v4ping') - 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_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_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_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_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_virtual_net_device') ns3_module_virtual_net_device.register_types(module) @@ -262,50 +295,28 @@ def register_types(module): ns3_module_wifi__local.register_types(module) root_module.end_section('ns3_module_wifi') - root_module.begin_section('ns3_module_emu') - ns3_module_emu.register_types(module) + root_module.begin_section('ns3_module_aodv') + ns3_module_aodv.register_types(module) try: - import ns3_module_emu__local + import ns3_module_aodv__local except ImportError: pass else: - ns3_module_emu__local.register_types(module) + ns3_module_aodv__local.register_types(module) - root_module.end_section('ns3_module_emu') - root_module.begin_section('ns3_module_bridge') - ns3_module_bridge.register_types(module) + root_module.end_section('ns3_module_aodv') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_types(module) try: - import ns3_module_bridge__local + import ns3_module_flow_monitor__local except ImportError: pass else: - ns3_module_bridge__local.register_types(module) + ns3_module_flow_monitor__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) - - 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_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.end_section('ns3_module_flow_monitor') root_module.begin_section('ns3_module_nix_vector_routing') ns3_module_nix_vector_routing.register_types(module) @@ -328,28 +339,6 @@ def register_types(module): ns3_module_olsr__local.register_types(module) root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_aodv') - ns3_module_aodv.register_types(module) - - try: - import ns3_module_aodv__local - except ImportError: - pass - else: - ns3_module_aodv__local.register_types(module) - - root_module.end_section('ns3_module_aodv') - 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) @@ -361,17 +350,28 @@ def register_types(module): ns3_module_ping6__local.register_types(module) root_module.end_section('ns3_module_ping6') - root_module.begin_section('ns3_module_flow_monitor') - ns3_module_flow_monitor.register_types(module) + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_types(module) try: - import ns3_module_flow_monitor__local + import ns3_module_radvd__local except ImportError: pass else: - ns3_module_flow_monitor__local.register_types(module) + ns3_module_radvd__local.register_types(module) - root_module.end_section('ns3_module_flow_monitor') + root_module.end_section('ns3_module_radvd') + 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_mesh') ns3_module_mesh.register_types(module) @@ -416,14 +416,6 @@ def register_types(module): 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') @@ -513,10 +505,6 @@ 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) @@ -550,17 +538,6 @@ def register_methods(root_module): ns3_module_test__local.register_methods(root_module) root_module.end_section('ns3_module_test') - 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) @@ -572,6 +549,17 @@ 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_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_contrib') ns3_module_contrib.register_methods(root_module) @@ -594,6 +582,127 @@ 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_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_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_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_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_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_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_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_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_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_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_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_tap_bridge') ns3_module_tap_bridge.register_methods(root_module) @@ -616,94 +725,6 @@ def register_methods(root_module): ns3_module_v4ping__local.register_methods(root_module) root_module.end_section('ns3_module_v4ping') - 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_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_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_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_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_virtual_net_device') ns3_module_virtual_net_device.register_methods(root_module) @@ -726,50 +747,28 @@ 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_emu') - ns3_module_emu.register_methods(root_module) + root_module.begin_section('ns3_module_aodv') + ns3_module_aodv.register_methods(root_module) try: - import ns3_module_emu__local + import ns3_module_aodv__local except ImportError: pass else: - ns3_module_emu__local.register_methods(root_module) + ns3_module_aodv__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) + root_module.end_section('ns3_module_aodv') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_methods(root_module) try: - import ns3_module_bridge__local + import ns3_module_flow_monitor__local except ImportError: pass else: - ns3_module_bridge__local.register_methods(root_module) + ns3_module_flow_monitor__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) - - 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_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.end_section('ns3_module_flow_monitor') root_module.begin_section('ns3_module_nix_vector_routing') ns3_module_nix_vector_routing.register_methods(root_module) @@ -792,28 +791,6 @@ def register_methods(root_module): ns3_module_olsr__local.register_methods(root_module) root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_aodv') - ns3_module_aodv.register_methods(root_module) - - try: - import ns3_module_aodv__local - except ImportError: - pass - else: - ns3_module_aodv__local.register_methods(root_module) - - root_module.end_section('ns3_module_aodv') - 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) @@ -825,17 +802,28 @@ 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_flow_monitor') - ns3_module_flow_monitor.register_methods(root_module) + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_methods(root_module) try: - import ns3_module_flow_monitor__local + import ns3_module_radvd__local except ImportError: pass else: - ns3_module_flow_monitor__local.register_methods(root_module) + ns3_module_radvd__local.register_methods(root_module) - root_module.end_section('ns3_module_flow_monitor') + root_module.end_section('ns3_module_radvd') + 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_mesh') ns3_module_mesh.register_methods(root_module) @@ -882,140 +870,6 @@ def 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: 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') @@ -1051,17 +905,6 @@ def register_functions(root_module): ns3_module_test__local.register_functions(root_module) root_module.end_section('ns3_module_test') - 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) @@ -1073,6 +916,17 @@ 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_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_contrib') ns3_module_contrib.register_functions(root_module) @@ -1095,6 +949,127 @@ 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_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_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_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_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_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_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_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_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_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_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_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_tap_bridge') ns3_module_tap_bridge.register_functions(root_module) @@ -1117,94 +1092,6 @@ def register_functions(root_module): ns3_module_v4ping__local.register_functions(root_module) root_module.end_section('ns3_module_v4ping') - 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_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_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_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_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_virtual_net_device') ns3_module_virtual_net_device.register_functions(root_module) @@ -1227,50 +1114,28 @@ 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_emu') - ns3_module_emu.register_functions(root_module) + root_module.begin_section('ns3_module_aodv') + ns3_module_aodv.register_functions(root_module) try: - import ns3_module_emu__local + import ns3_module_aodv__local except ImportError: pass else: - ns3_module_emu__local.register_functions(root_module) + ns3_module_aodv__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) + root_module.end_section('ns3_module_aodv') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_functions(root_module) try: - import ns3_module_bridge__local + import ns3_module_flow_monitor__local except ImportError: pass else: - ns3_module_bridge__local.register_functions(root_module) + ns3_module_flow_monitor__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) - - 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_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.end_section('ns3_module_flow_monitor') root_module.begin_section('ns3_module_nix_vector_routing') ns3_module_nix_vector_routing.register_functions(root_module) @@ -1293,28 +1158,6 @@ def register_functions(root_module): ns3_module_olsr__local.register_functions(root_module) root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_aodv') - ns3_module_aodv.register_functions(root_module) - - try: - import ns3_module_aodv__local - except ImportError: - pass - else: - ns3_module_aodv__local.register_functions(root_module) - - root_module.end_section('ns3_module_aodv') - 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) @@ -1326,17 +1169,28 @@ 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_flow_monitor') - ns3_module_flow_monitor.register_functions(root_module) + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_functions(root_module) try: - import ns3_module_flow_monitor__local + import ns3_module_radvd__local except ImportError: pass else: - ns3_module_flow_monitor__local.register_functions(root_module) + ns3_module_radvd__local.register_functions(root_module) - root_module.end_section('ns3_module_flow_monitor') + root_module.end_section('ns3_module_radvd') + 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_mesh') ns3_module_mesh.register_functions(root_module) diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_dot11s.py b/bindings/python/apidefs/gcc-LP64/ns3_module_dot11s.py index b6cb85547..5b7e668a2 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_dot11s.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_dot11s.py @@ -77,14 +77,14 @@ def register_types_ns3_dot11s(module): 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::dot11sPathSelectionMetric [enumeration] - module.add_enum('dot11sPathSelectionMetric', ['METRIC_AIRTIME']) - ## 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::dot11sPathSelectionProtocol [enumeration] - module.add_enum('dot11sPathSelectionProtocol', ['PROTOCOL_HWMP']) ## 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] diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py b/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py index 25e0f7cf7..4648f4ae2 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py @@ -3,6 +3,8 @@ from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandler def register_types(module): root_module = module.get_root() + ## animation-interface.h: ns3::AnimationInterface [class] + module.add_class('AnimationInterface') ## application-container.h: ns3::ApplicationContainer [class] module.add_class('ApplicationContainer') ## athstats-helper.h: ns3::AthstatsHelper [class] @@ -11,6 +13,8 @@ def register_types(module): module.add_class('BridgeHelper', allow_subclassing=False) ## csma-helper.h: ns3::CsmaHelper [class] module.add_class('CsmaHelper', allow_subclassing=False) + ## csma-star-helper.h: ns3::CsmaStarHelper [class] + module.add_class('CsmaStarHelper', allow_subclassing=False) ## emu-helper.h: ns3::EmuHelper [class] module.add_class('EmuHelper', allow_subclassing=False) ## flow-monitor-helper.h: ns3::FlowMonitorHelper [class] @@ -55,8 +59,14 @@ def register_types(module): module.add_class('PacketSocketHelper', allow_subclassing=False) ## ping6-helper.h: ns3::Ping6Helper [class] module.add_class('Ping6Helper', allow_subclassing=False) + ## 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) ## point-to-point-helper.h: ns3::PointToPointHelper [class] module.add_class('PointToPointHelper', allow_subclassing=False) + ## point-to-point-star-helper.h: ns3::PointToPointStarHelper [class] + module.add_class('PointToPointStarHelper', allow_subclassing=False) ## tap-bridge-helper.h: ns3::TapBridgeHelper [class] module.add_class('TapBridgeHelper', allow_subclassing=False) ## udp-echo-helper.h: ns3::UdpEchoClientHelper [class] @@ -93,6 +103,8 @@ 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']) + ## canvas-location.h: ns3::CanvasLocation [class] + module.add_class('CanvasLocation', 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] @@ -181,10 +193,12 @@ def register_types_ns3_olsr(module): def register_methods(root_module): + register_Ns3AnimationInterface_methods(root_module, root_module['ns3::AnimationInterface']) 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_Ns3CsmaStarHelper_methods(root_module, root_module['ns3::CsmaStarHelper']) 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']) @@ -206,7 +220,10 @@ def register_methods(root_module): 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_Ns3PointToPointDumbbellHelper_methods(root_module, root_module['ns3::PointToPointDumbbellHelper']) + register_Ns3PointToPointGridHelper_methods(root_module, root_module['ns3::PointToPointGridHelper']) register_Ns3PointToPointHelper_methods(root_module, root_module['ns3::PointToPointHelper']) + register_Ns3PointToPointStarHelper_methods(root_module, root_module['ns3::PointToPointStarHelper']) 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']) @@ -224,11 +241,35 @@ def register_methods(root_module): 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_Ns3CanvasLocation_methods(root_module, root_module['ns3::CanvasLocation']) 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_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::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_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')]) @@ -422,14 +463,6 @@ def register_Ns3CsmaHelper_methods(root_module, cls): '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', @@ -444,6 +477,56 @@ def register_Ns3CsmaHelper_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_Ns3CsmaStarHelper_methods(root_module, cls): + ## csma-star-helper.h: ns3::CsmaStarHelper::CsmaStarHelper(ns3::CsmaStarHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CsmaStarHelper const &', 'arg0')]) + ## csma-star-helper.h: ns3::CsmaStarHelper::CsmaStarHelper(uint32_t numSpokes, ns3::CsmaHelper csmaHelper) [constructor] + cls.add_constructor([param('uint32_t', 'numSpokes'), param('ns3::CsmaHelper', 'csmaHelper')]) + ## csma-star-helper.h: void ns3::CsmaStarHelper::AssignIpv4Addresses(ns3::Ipv4AddressHelper address) [member function] + cls.add_method('AssignIpv4Addresses', + 'void', + [param('ns3::Ipv4AddressHelper', 'address')]) + ## csma-star-helper.h: ns3::Ptr ns3::CsmaStarHelper::GetHub() const [member function] + cls.add_method('GetHub', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## csma-star-helper.h: ns3::NetDeviceContainer ns3::CsmaStarHelper::GetHubDevices() const [member function] + cls.add_method('GetHubDevices', + 'ns3::NetDeviceContainer', + [], + is_const=True) + ## csma-star-helper.h: ns3::Ipv4Address ns3::CsmaStarHelper::GetHubIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetHubIpv4Address', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## csma-star-helper.h: ns3::Ptr ns3::CsmaStarHelper::GetSpoke(uint32_t arg0) const [member function] + cls.add_method('GetSpoke', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'arg0')], + is_const=True) + ## csma-star-helper.h: ns3::NetDeviceContainer ns3::CsmaStarHelper::GetSpokeDevices() const [member function] + cls.add_method('GetSpokeDevices', + 'ns3::NetDeviceContainer', + [], + is_const=True) + ## csma-star-helper.h: ns3::Ipv4Address ns3::CsmaStarHelper::GetSpokeIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetSpokeIpv4Address', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## csma-star-helper.h: void ns3::CsmaStarHelper::InstallStack(ns3::InternetStackHelper stack) [member function] + cls.add_method('InstallStack', + 'void', + [param('ns3::InternetStackHelper', 'stack')]) + ## csma-star-helper.h: uint32_t ns3::CsmaStarHelper::SpokeCount() const [member function] + cls.add_method('SpokeCount', + 'uint32_t', + [], + is_const=True) + 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')]) @@ -1245,6 +1328,92 @@ def register_Ns3Ping6Helper_methods(root_module, cls): [param('ns3::Ipv6Address', 'ip')]) 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::AssignIpv4Addresses(ns3::Ipv4AddressHelper leftIp, ns3::Ipv4AddressHelper rightIp, ns3::Ipv4AddressHelper routerIp) [member function] + cls.add_method('AssignIpv4Addresses', + '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::GetLeftIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetLeftIpv4Address', + '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::GetRightIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetRightIpv4Address', + '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: void ns3::PointToPointGridHelper::AssignIpv4Addresses(ns3::Ipv4AddressHelper rowIp, ns3::Ipv4AddressHelper colIp) [member function] + cls.add_method('AssignIpv4Addresses', + '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::GetIpv4Address(uint32_t row, uint32_t col) [member function] + cls.add_method('GetIpv4Address', + '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_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')]) @@ -1320,14 +1489,6 @@ def register_Ns3PointToPointHelper_methods(root_module, cls): 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', @@ -1342,6 +1503,50 @@ def register_Ns3PointToPointHelper_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_Ns3PointToPointStarHelper_methods(root_module, cls): + ## point-to-point-star-helper.h: ns3::PointToPointStarHelper::PointToPointStarHelper(ns3::PointToPointStarHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PointToPointStarHelper const &', 'arg0')]) + ## point-to-point-star-helper.h: ns3::PointToPointStarHelper::PointToPointStarHelper(uint32_t numSpokes, ns3::PointToPointHelper p2pHelper) [constructor] + cls.add_constructor([param('uint32_t', 'numSpokes'), param('ns3::PointToPointHelper', 'p2pHelper')]) + ## point-to-point-star-helper.h: void ns3::PointToPointStarHelper::AssignIpv4Addresses(ns3::Ipv4AddressHelper address) [member function] + cls.add_method('AssignIpv4Addresses', + 'void', + [param('ns3::Ipv4AddressHelper', 'address')]) + ## point-to-point-star-helper.h: void ns3::PointToPointStarHelper::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-star-helper.h: ns3::Ptr ns3::PointToPointStarHelper::GetHub() const [member function] + cls.add_method('GetHub', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## point-to-point-star-helper.h: ns3::Ipv4Address ns3::PointToPointStarHelper::GetHubIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetHubIpv4Address', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-star-helper.h: ns3::Ptr ns3::PointToPointStarHelper::GetSpoke(uint32_t arg0) const [member function] + cls.add_method('GetSpoke', + 'ns3::Ptr< ns3::Node >', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-star-helper.h: ns3::Ipv4Address ns3::PointToPointStarHelper::GetSpokeIpv4Address(uint32_t arg0) const [member function] + cls.add_method('GetSpokeIpv4Address', + 'ns3::Ipv4Address', + [param('uint32_t', 'arg0')], + is_const=True) + ## point-to-point-star-helper.h: void ns3::PointToPointStarHelper::InstallStack(ns3::InternetStackHelper stack) [member function] + cls.add_method('InstallStack', + 'void', + [param('ns3::InternetStackHelper', 'stack')]) + ## point-to-point-star-helper.h: uint32_t ns3::PointToPointStarHelper::SpokeCount() const [member function] + cls.add_method('SpokeCount', + 'uint32_t', + [], + is_const=True) + 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')]) @@ -1844,6 +2049,27 @@ def register_Ns3AthstatsWifiTraceSink_methods(root_module, cls): [param('std::string', 'context'), param('ns3::Mac48Address', 'address')]) return +def register_Ns3CanvasLocation_methods(root_module, cls): + ## canvas-location.h: ns3::CanvasLocation::CanvasLocation(ns3::CanvasLocation const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CanvasLocation const &', 'arg0')]) + ## canvas-location.h: ns3::CanvasLocation::CanvasLocation() [constructor] + cls.add_constructor([]) + ## canvas-location.h: ns3::Vector ns3::CanvasLocation::GetLocation() const [member function] + cls.add_method('GetLocation', + 'ns3::Vector', + [], + is_const=True) + ## canvas-location.h: static ns3::TypeId ns3::CanvasLocation::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## canvas-location.h: void ns3::CanvasLocation::SetLocation(ns3::Vector const & location) [member function] + cls.add_method('SetLocation', + 'void', + [param('ns3::Vector const &', 'location')]) + return + def register_Ns3MeshStack_methods(root_module, cls): ## mesh-stack-installer.h: ns3::MeshStack::MeshStack() [constructor] cls.add_constructor([]) diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py b/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py index 47d13f278..a83268dde 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_simulator.py @@ -1574,7 +1574,7 @@ def register_functions(root_module): 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] + ## high-precision.h: 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')]) @@ -1586,7 +1586,7 @@ def register_functions(root_module): 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] + ## high-precision.h: 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')]) diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_wifi.py b/bindings/python/apidefs/gcc-LP64/ns3_module_wifi.py index 30a701c72..c32f5fd31 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_wifi.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_wifi.py @@ -9,6 +9,8 @@ def register_types(module): 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_STANDARD_80211p_CCH', 'WIFI_PHY_STANDARD_80211p_SCH', 'WIFI_PHY_UNKNOWN']) + ## qos-tag.h: ns3::UserPriority [enumeration] + module.add_enum('UserPriority', ['UP_BK', 'UP_BE', 'UP_EE', 'UP_CL', 'UP_VI', 'UP_VO', 'UP_NC']) ## 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] @@ -1994,11 +1996,6 @@ def register_Ns3QosTag_methods(root_module, cls): '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', @@ -2009,6 +2006,11 @@ def register_Ns3QosTag_methods(root_module, cls): 'uint32_t', [], is_const=True, is_virtual=True) + ## qos-tag.h: uint8_t ns3::QosTag::GetTid() const [member function] + cls.add_method('GetTid', + 'uint8_t', + [], + is_const=True) ## qos-tag.h: static ns3::TypeId ns3::QosTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2024,10 +2026,14 @@ def register_Ns3QosTag_methods(root_module, cls): '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', + ## qos-tag.h: void ns3::QosTag::SetTid(uint8_t tid) [member function] + cls.add_method('SetTid', 'void', [param('uint8_t', 'tid')]) + ## qos-tag.h: void ns3::QosTag::SetUserPriority(ns3::UserPriority up) [member function] + cls.add_method('SetUserPriority', + 'void', + [param('ns3::UserPriority', 'up')]) return def register_Ns3RandomPropagationDelayModel_methods(root_module, cls): diff --git a/bindings/python/apidefs/gcc-LP64/ns3modulegen_generated.py b/bindings/python/apidefs/gcc-LP64/ns3modulegen_generated.py index 781810f50..8b689e5be 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3modulegen_generated.py +++ b/bindings/python/apidefs/gcc-LP64/ns3modulegen_generated.py @@ -15,32 +15,32 @@ import sys import ns3_module_core import ns3_module_simulator import ns3_module_test -import ns3_module_mobility import ns3_module_common +import ns3_module_mobility import ns3_module_contrib import ns3_module_node +import ns3_module_bridge +import ns3_module_csma +import ns3_module_emu +import ns3_module_global_routing +import ns3_module_internet_stack +import ns3_module_list_routing +import ns3_module_onoff +import ns3_module_packet_sink +import ns3_module_point_to_point +import ns3_module_static_routing +import ns3_module_stats import ns3_module_tap_bridge import ns3_module_v4ping -import ns3_module_static_routing -import ns3_module_packet_sink -import ns3_module_stats -import ns3_module_onoff -import ns3_module_point_to_point -import ns3_module_internet_stack -import ns3_module_csma -import ns3_module_list_routing import ns3_module_virtual_net_device import ns3_module_wifi -import ns3_module_emu -import ns3_module_bridge -import ns3_module_global_routing -import ns3_module_udp_echo +import ns3_module_aodv +import ns3_module_flow_monitor import ns3_module_nix_vector_routing import ns3_module_olsr -import ns3_module_aodv -import ns3_module_radvd import ns3_module_ping6 -import ns3_module_flow_monitor +import ns3_module_radvd +import ns3_module_udp_echo import ns3_module_mesh import ns3_module_helper import ns3_module_dot11s @@ -86,17 +86,6 @@ def register_types(module): ns3_module_test__local.register_types(module) root_module.end_section('ns3_module_test') - 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) @@ -108,6 +97,17 @@ def register_types(module): ns3_module_common__local.register_types(module) root_module.end_section('ns3_module_common') + 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_contrib') ns3_module_contrib.register_types(module) @@ -130,6 +130,127 @@ def register_types(module): ns3_module_node__local.register_types(module) root_module.end_section('ns3_module_node') + 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_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_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_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_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_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_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_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_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_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_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_tap_bridge') ns3_module_tap_bridge.register_types(module) @@ -152,94 +273,6 @@ def register_types(module): ns3_module_v4ping__local.register_types(module) root_module.end_section('ns3_module_v4ping') - 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_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_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_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_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_virtual_net_device') ns3_module_virtual_net_device.register_types(module) @@ -262,50 +295,28 @@ def register_types(module): ns3_module_wifi__local.register_types(module) root_module.end_section('ns3_module_wifi') - root_module.begin_section('ns3_module_emu') - ns3_module_emu.register_types(module) + root_module.begin_section('ns3_module_aodv') + ns3_module_aodv.register_types(module) try: - import ns3_module_emu__local + import ns3_module_aodv__local except ImportError: pass else: - ns3_module_emu__local.register_types(module) + ns3_module_aodv__local.register_types(module) - root_module.end_section('ns3_module_emu') - root_module.begin_section('ns3_module_bridge') - ns3_module_bridge.register_types(module) + root_module.end_section('ns3_module_aodv') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_types(module) try: - import ns3_module_bridge__local + import ns3_module_flow_monitor__local except ImportError: pass else: - ns3_module_bridge__local.register_types(module) + ns3_module_flow_monitor__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) - - 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_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.end_section('ns3_module_flow_monitor') root_module.begin_section('ns3_module_nix_vector_routing') ns3_module_nix_vector_routing.register_types(module) @@ -328,28 +339,6 @@ def register_types(module): ns3_module_olsr__local.register_types(module) root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_aodv') - ns3_module_aodv.register_types(module) - - try: - import ns3_module_aodv__local - except ImportError: - pass - else: - ns3_module_aodv__local.register_types(module) - - root_module.end_section('ns3_module_aodv') - 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) @@ -361,17 +350,28 @@ def register_types(module): ns3_module_ping6__local.register_types(module) root_module.end_section('ns3_module_ping6') - root_module.begin_section('ns3_module_flow_monitor') - ns3_module_flow_monitor.register_types(module) + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_types(module) try: - import ns3_module_flow_monitor__local + import ns3_module_radvd__local except ImportError: pass else: - ns3_module_flow_monitor__local.register_types(module) + ns3_module_radvd__local.register_types(module) - root_module.end_section('ns3_module_flow_monitor') + root_module.end_section('ns3_module_radvd') + 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_mesh') ns3_module_mesh.register_types(module) @@ -416,14 +416,6 @@ def register_types(module): 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') @@ -513,10 +505,6 @@ 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) @@ -550,17 +538,6 @@ def register_methods(root_module): ns3_module_test__local.register_methods(root_module) root_module.end_section('ns3_module_test') - 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) @@ -572,6 +549,17 @@ 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_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_contrib') ns3_module_contrib.register_methods(root_module) @@ -594,6 +582,127 @@ 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_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_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_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_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_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_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_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_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_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_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_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_tap_bridge') ns3_module_tap_bridge.register_methods(root_module) @@ -616,94 +725,6 @@ def register_methods(root_module): ns3_module_v4ping__local.register_methods(root_module) root_module.end_section('ns3_module_v4ping') - 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_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_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_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_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_virtual_net_device') ns3_module_virtual_net_device.register_methods(root_module) @@ -726,50 +747,28 @@ 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_emu') - ns3_module_emu.register_methods(root_module) + root_module.begin_section('ns3_module_aodv') + ns3_module_aodv.register_methods(root_module) try: - import ns3_module_emu__local + import ns3_module_aodv__local except ImportError: pass else: - ns3_module_emu__local.register_methods(root_module) + ns3_module_aodv__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) + root_module.end_section('ns3_module_aodv') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_methods(root_module) try: - import ns3_module_bridge__local + import ns3_module_flow_monitor__local except ImportError: pass else: - ns3_module_bridge__local.register_methods(root_module) + ns3_module_flow_monitor__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) - - 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_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.end_section('ns3_module_flow_monitor') root_module.begin_section('ns3_module_nix_vector_routing') ns3_module_nix_vector_routing.register_methods(root_module) @@ -792,28 +791,6 @@ def register_methods(root_module): ns3_module_olsr__local.register_methods(root_module) root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_aodv') - ns3_module_aodv.register_methods(root_module) - - try: - import ns3_module_aodv__local - except ImportError: - pass - else: - ns3_module_aodv__local.register_methods(root_module) - - root_module.end_section('ns3_module_aodv') - 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) @@ -825,17 +802,28 @@ 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_flow_monitor') - ns3_module_flow_monitor.register_methods(root_module) + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_methods(root_module) try: - import ns3_module_flow_monitor__local + import ns3_module_radvd__local except ImportError: pass else: - ns3_module_flow_monitor__local.register_methods(root_module) + ns3_module_radvd__local.register_methods(root_module) - root_module.end_section('ns3_module_flow_monitor') + root_module.end_section('ns3_module_radvd') + 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_mesh') ns3_module_mesh.register_methods(root_module) @@ -882,140 +870,6 @@ def 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: 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') @@ -1051,17 +905,6 @@ def register_functions(root_module): ns3_module_test__local.register_functions(root_module) root_module.end_section('ns3_module_test') - 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) @@ -1073,6 +916,17 @@ 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_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_contrib') ns3_module_contrib.register_functions(root_module) @@ -1095,6 +949,127 @@ 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_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_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_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_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_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_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_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_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_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_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_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_tap_bridge') ns3_module_tap_bridge.register_functions(root_module) @@ -1117,94 +1092,6 @@ def register_functions(root_module): ns3_module_v4ping__local.register_functions(root_module) root_module.end_section('ns3_module_v4ping') - 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_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_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_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_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_virtual_net_device') ns3_module_virtual_net_device.register_functions(root_module) @@ -1227,50 +1114,28 @@ 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_emu') - ns3_module_emu.register_functions(root_module) + root_module.begin_section('ns3_module_aodv') + ns3_module_aodv.register_functions(root_module) try: - import ns3_module_emu__local + import ns3_module_aodv__local except ImportError: pass else: - ns3_module_emu__local.register_functions(root_module) + ns3_module_aodv__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) + root_module.end_section('ns3_module_aodv') + root_module.begin_section('ns3_module_flow_monitor') + ns3_module_flow_monitor.register_functions(root_module) try: - import ns3_module_bridge__local + import ns3_module_flow_monitor__local except ImportError: pass else: - ns3_module_bridge__local.register_functions(root_module) + ns3_module_flow_monitor__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) - - 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_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.end_section('ns3_module_flow_monitor') root_module.begin_section('ns3_module_nix_vector_routing') ns3_module_nix_vector_routing.register_functions(root_module) @@ -1293,28 +1158,6 @@ def register_functions(root_module): ns3_module_olsr__local.register_functions(root_module) root_module.end_section('ns3_module_olsr') - root_module.begin_section('ns3_module_aodv') - ns3_module_aodv.register_functions(root_module) - - try: - import ns3_module_aodv__local - except ImportError: - pass - else: - ns3_module_aodv__local.register_functions(root_module) - - root_module.end_section('ns3_module_aodv') - 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) @@ -1326,17 +1169,28 @@ 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_flow_monitor') - ns3_module_flow_monitor.register_functions(root_module) + root_module.begin_section('ns3_module_radvd') + ns3_module_radvd.register_functions(root_module) try: - import ns3_module_flow_monitor__local + import ns3_module_radvd__local except ImportError: pass else: - ns3_module_flow_monitor__local.register_functions(root_module) + ns3_module_radvd__local.register_functions(root_module) - root_module.end_section('ns3_module_flow_monitor') + root_module.end_section('ns3_module_radvd') + 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_mesh') ns3_module_mesh.register_functions(root_module) From c90822280429d7ea2d3a4137497e55f1def64598 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 26 Nov 2009 14:53:53 +0100 Subject: [PATCH 4/5] document the new --tempdir option --- utils/test-runner.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/test-runner.cc b/utils/test-runner.cc index 3c0d4da28..e8bf122d4 100644 --- a/utils/test-runner.cc +++ b/utils/test-runner.cc @@ -117,6 +117,7 @@ main (int argc, char *argv[]) if (doHelp) { std::cout << " --basedir=dir: Set the base directory (where to find src) to \"dir\"" << std::endl; + std::cout << " --tempdir=dir: Set the temporary directory (where to find data files) 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; From abcb6e40051fe518c6d5305a29e34305d50bdf3b Mon Sep 17 00:00:00 2001 From: Mohamed Amine Ismail Date: Fri, 27 Nov 2009 17:06:45 +0100 Subject: [PATCH 5/5] Adding 3 new applications:udp-client, udp-server, udp-trace-client. --- AUTHORS | 1 + .../udp-client-server/udp-client-server.cc | 104 +++++++ .../udp-trace-client-server.cc | 100 ++++++ examples/udp-client-server/waf | 1 + examples/udp-client-server/wscript | 8 + examples/wscript | 1 + .../udp-client-server/packet-loss-counter.cc | 124 ++++++++ .../udp-client-server/packet-loss-counter.h | 56 ++++ .../udp-client-server/seq-ts-header.cc | 96 ++++++ .../udp-client-server/seq-ts-header.h | 61 ++++ .../udp-client-server-test.cc | 287 +++++++++++++++++ .../udp-client-server/udp-client.cc | 155 ++++++++++ .../udp-client-server/udp-client.h | 85 +++++ .../udp-client-server/udp-server.cc | 164 ++++++++++ .../udp-client-server/udp-server.h | 94 ++++++ .../udp-client-server/udp-trace-client.cc | 292 ++++++++++++++++++ .../udp-client-server/udp-trace-client.h | 135 ++++++++ src/applications/udp-client-server/waf | 1 + src/applications/udp-client-server/wscript | 21 ++ src/helper/udp-client-server-helper.cc | 127 ++++++++ src/helper/udp-client-server-helper.h | 178 +++++++++++ src/helper/wscript | 2 + src/wscript | 1 + 23 files changed, 2094 insertions(+) create mode 100644 examples/udp-client-server/udp-client-server.cc create mode 100644 examples/udp-client-server/udp-trace-client-server.cc create mode 100644 examples/udp-client-server/waf create mode 100644 examples/udp-client-server/wscript create mode 100644 src/applications/udp-client-server/packet-loss-counter.cc create mode 100644 src/applications/udp-client-server/packet-loss-counter.h create mode 100644 src/applications/udp-client-server/seq-ts-header.cc create mode 100644 src/applications/udp-client-server/seq-ts-header.h create mode 100644 src/applications/udp-client-server/udp-client-server-test.cc create mode 100644 src/applications/udp-client-server/udp-client.cc create mode 100644 src/applications/udp-client-server/udp-client.h create mode 100644 src/applications/udp-client-server/udp-server.cc create mode 100644 src/applications/udp-client-server/udp-server.h create mode 100644 src/applications/udp-client-server/udp-trace-client.cc create mode 100644 src/applications/udp-client-server/udp-trace-client.h create mode 100644 src/applications/udp-client-server/waf create mode 100644 src/applications/udp-client-server/wscript create mode 100644 src/helper/udp-client-server-helper.cc create mode 100644 src/helper/udp-client-server-helper.h diff --git a/AUTHORS b/AUTHORS index f016de8f2..8bdbed2f5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,6 +12,7 @@ Angelos Chatzipapas (chatzipa@ceid.upatras.gr) Luis Cortes (cortes@gatech.edu) Craig Dowell (craigdo@ee.washington.edu) David Gross (gdavid.devel@gmail.com) +Mohamed Amine Ismail (amine.ismail@sophia.inria.fr, iamine@udcast.com) Tom Henderson (tomhend@u.washington.edu) Sam Jansen (sam.jansen@gmail.com) Liu Jian (liujatp@gmail.com) diff --git a/examples/udp-client-server/udp-client-server.cc b/examples/udp-client-server/udp-client-server.cc new file mode 100644 index 000000000..60aab2bb4 --- /dev/null +++ b/examples/udp-client-server/udp-client-server.cc @@ -0,0 +1,104 @@ +/* -*- 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 + */ + +// Network topology +// +// n0 n1 +// | | +// ======= +// LAN +// +// - UDP flows from n0 to n1 + +#include +#include "ns3/core-module.h" +#include "ns3/simulator-module.h" +#include "ns3/helper-module.h" + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("UdpClientServerExample"); + +int +main (int argc, char *argv[]) +{ +// +// Enable logging for UdpClient and +// + LogComponentEnable ("UdpClient", LOG_LEVEL_INFO); + LogComponentEnable ("UdpServer", LOG_LEVEL_INFO); + +// +// Explicitly create the nodes required by the topology (shown above). +// + NS_LOG_INFO ("Create nodes."); + NodeContainer n; + n.Create (2); + + InternetStackHelper internet; + internet.Install (n); + + NS_LOG_INFO ("Create channels."); +// +// Explicitly create the channels required by the topology (shown above). +// + CsmaHelper csma; + csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate(5000000))); + csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2))); + csma.SetDeviceAttribute ("Mtu", UintegerValue (1400)); + NetDeviceContainer d = csma.Install (n); + + Ipv4AddressHelper ipv4; +// +// We've got the "hardware" in place. Now we need to add IP addresses. +// + NS_LOG_INFO ("Assign IP Addresses."); + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer i = ipv4.Assign (d); + + NS_LOG_INFO ("Create Applications."); +// +// Create one udpServer applications on node one. +// + uint16_t port = 4000; + UdpServerHelper server (port); + ApplicationContainer apps = server.Install (n.Get(1)); + apps.Start (Seconds (1.0)); + apps.Stop (Seconds (10.0)); + +// +// Create one UdpClient application to send UDP datagrams from node zero to +// node one. +// + uint32_t MaxPacketSize = 1024; + Time interPacketInterval = Seconds (0.05); + uint32_t maxPacketCount = 320; + UdpClientHelper client (i.GetAddress (1), port); + client.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount)); + client.SetAttribute ("Interval", TimeValue (interPacketInterval)); + client.SetAttribute ("PacketSize", UintegerValue (MaxPacketSize)); + apps = client.Install (n.Get (0)); + apps.Start (Seconds (2.0)); + apps.Stop (Seconds (10.0)); + +// +// Now, do the actual simulation. +// + NS_LOG_INFO ("Run Simulation."); + Simulator::Run (); + Simulator::Destroy (); + NS_LOG_INFO ("Done."); +} diff --git a/examples/udp-client-server/udp-trace-client-server.cc b/examples/udp-client-server/udp-trace-client-server.cc new file mode 100644 index 000000000..f9324f1e1 --- /dev/null +++ b/examples/udp-client-server/udp-trace-client-server.cc @@ -0,0 +1,100 @@ +/* -*- 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 + */ + +// Network topology +// +// n0 n1 +// | | +// ======= +// LAN +// +// - UDP flows from n0 to n1 + +#include +#include "ns3/core-module.h" +#include "ns3/simulator-module.h" +#include "ns3/helper-module.h" + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("UdpTraceClientServerExample"); + +int +main (int argc, char *argv[]) +{ +// +// Enable logging for UdpClient and +// + LogComponentEnable ("UdpTraceClient", LOG_LEVEL_INFO); + LogComponentEnable ("UdpServer", LOG_LEVEL_INFO); + +// +// Explicitly create the nodes required by the topology (shown above). +// + NS_LOG_INFO ("Create nodes."); + NodeContainer n; + n.Create (2); + + InternetStackHelper internet; + internet.Install (n); + + NS_LOG_INFO ("Create channels."); +// +// Explicitly create the channels required by the topology (shown above). +// + CsmaHelper csma; + csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate(5000000))); + csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2))); + csma.SetDeviceAttribute ("Mtu", UintegerValue (1400)); + NetDeviceContainer d = csma.Install (n); + + Ipv4AddressHelper ipv4; +// +// We've got the "hardware" in place. Now we need to add IP addresses. +// + NS_LOG_INFO ("Assign IP Addresses."); + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer i = ipv4.Assign (d); + + NS_LOG_INFO ("Create Applications."); +// +// Create one udpServer applications on node one. +// + uint16_t port = 4000; + UdpServerHelper server (port); + ApplicationContainer apps = server.Install (n.Get(1)); + apps.Start (Seconds (1.0)); + apps.Stop (Seconds (10.0)); + +// +// Create one UdpTraceClient application to send UDP datagrams from node zero to +// node one. +// + uint32_t MaxPacketSize = 1400; + UdpTraceClientHelper client (i.GetAddress (1), port,""); + client.SetAttribute ("MaxPacketSize", UintegerValue (MaxPacketSize)); + apps = client.Install (n.Get (0)); + apps.Start (Seconds (2.0)); + apps.Stop (Seconds (10.0)); + +// +// Now, do the actual simulation. +// + NS_LOG_INFO ("Run Simulation."); + Simulator::Run (); + Simulator::Destroy (); + NS_LOG_INFO ("Done."); +} diff --git a/examples/udp-client-server/waf b/examples/udp-client-server/waf new file mode 100644 index 000000000..941d56b43 --- /dev/null +++ b/examples/udp-client-server/waf @@ -0,0 +1 @@ +exec "`dirname "$0"`"/../../waf "$@" diff --git a/examples/udp-client-server/wscript b/examples/udp-client-server/wscript new file mode 100644 index 000000000..9a7815c0b --- /dev/null +++ b/examples/udp-client-server/wscript @@ -0,0 +1,8 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + obj = bld.create_ns3_program('udp-client-server', ['csma', 'internet-stack']) + obj.source = 'udp-client-server.cc' + + obj = bld.create_ns3_program('udp-trace-client-server', ['csma', 'internet-stack']) + obj.source = 'udp-trace-client-server.cc' diff --git a/examples/wscript b/examples/wscript index b441943ac..e40b05092 100644 --- a/examples/wscript +++ b/examples/wscript @@ -20,3 +20,4 @@ def build(bld): bld.add_subdirs('tutorial') bld.add_subdirs('udp') bld.add_subdirs('wireless') + bld.add_subdirs('udp-client-server') diff --git a/src/applications/udp-client-server/packet-loss-counter.cc b/src/applications/udp-client-server/packet-loss-counter.cc new file mode 100644 index 000000000..3a5cf1ece --- /dev/null +++ b/src/applications/udp-client-server/packet-loss-counter.cc @@ -0,0 +1,124 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 INRIA, UDCAST + * + * 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: Amine Ismail + * + */ + +#include "ns3/log.h" +#include "ns3/simulator.h" +#include "ns3/uinteger.h" +#include "packet-loss-counter.h" + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("PacketLossCounter"); + + +PacketLossCounter::PacketLossCounter (uint8_t bitmapSize) + : m_lost (0), + m_bitMapSize (0), + m_lastMaxSeqNum (0), + m_receiveBitMap (0) +{ + SetBitMapSize (bitmapSize); +} + +PacketLossCounter::~PacketLossCounter () +{ + delete [] m_receiveBitMap; +} + +uint16_t +PacketLossCounter::GetBitMapSize () const +{ + return m_bitMapSize * 8; +} + +void +PacketLossCounter::SetBitMapSize (uint16_t winSize) +{ + + NS_ASSERT_MSG(winSize%8==0,"The packet window size should be a multiple of 8"); + m_bitMapSize = winSize/8; + if (m_receiveBitMap!=0) + { + delete [] m_receiveBitMap; + } + m_receiveBitMap = new uint8_t [m_bitMapSize] (); + memset (m_receiveBitMap,0,m_bitMapSize); +} + +uint32_t +PacketLossCounter::GetLost () const +{ + return m_lost; +} + +bool +PacketLossCounter::GetBit(uint32_t seqNum) +{ + return ((m_receiveBitMap[(seqNum%(m_bitMapSize*8))/8] >> (7-(seqNum%8)))&0x01); +} + +void +PacketLossCounter::SetBit(uint32_t seqNum, bool val) +{ + if (val) + { + m_receiveBitMap[(seqNum%(m_bitMapSize*8))/8] |= 0x80 >> (seqNum%8); + } + else + { + m_receiveBitMap[(seqNum%(m_bitMapSize*8))/8] &= ~(0x80 >> (seqNum%8)); + } +} + +/* + * This algo works as follows: + * When a packet is received: + * 1) From the last received packet to the current one: + * 1.1) check the corresponding bit in the bitMAP. + * This bit indicates if the packet with (SeqNum-bitMapSizeInBit) is + * received (1) or not (0) + * 1.2) Mark the packet as lost (0) in the bitMap + * 2) Mark the current packet as received (1) in the bitMap + * 3) Update the value of the last received packet + */ + +void +PacketLossCounter::NotifyReceived (uint32_t seqNum) +{ + if (seqNum>(uint32_t)(m_bitMapSize*8)-1) + { + for (uint32_t i=m_lastMaxSeqNum+1; i<=seqNum;i++) + { + if (GetBit(i)!=1) + { + NS_LOG_INFO ("Packet lost: " << i-(m_bitMapSize*8)); + m_lost++; + } + SetBit(i, 0); + } + } + SetBit(seqNum, 1); + if (seqNum>m_lastMaxSeqNum) + { + m_lastMaxSeqNum = seqNum; + } +} +} diff --git a/src/applications/udp-client-server/packet-loss-counter.h b/src/applications/udp-client-server/packet-loss-counter.h new file mode 100644 index 000000000..c44af898e --- /dev/null +++ b/src/applications/udp-client-server/packet-loss-counter.h @@ -0,0 +1,56 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2007,2008,2009 INRIA, UDCAST + * + * 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: Amine Ismail + * + * + */ +#ifndef _PACKET_LOSS_COUNTER_H_ +#define _PACKET_LOSS_COUNTER_H_ + + +#include "ns3/application.h" +#include "ns3/event-id.h" +#include "ns3/ptr.h" +#include "ns3/address.h" + +namespace ns3 { + +class Socket; +class Packet; + +class PacketLossCounter +{ +public: + PacketLossCounter (uint8_t bitmapSize); + ~PacketLossCounter (); + void NotifyReceived (uint32_t seq); + uint32_t GetLost (void) const; + uint16_t GetBitMapSize (void) const; + void SetBitMapSize (uint16_t size); +private: + bool GetBit (uint32_t seqNum); + void SetBit (uint32_t seqNum, bool val); + + uint32_t m_lost; + uint16_t m_bitMapSize; + uint32_t m_lastMaxSeqNum; + uint8_t * m_receiveBitMap; +}; +} + +#endif /* PACKETLOSSCOUNTER_H_ */ diff --git a/src/applications/udp-client-server/seq-ts-header.cc b/src/applications/udp-client-server/seq-ts-header.cc new file mode 100644 index 000000000..bb7b6ce0d --- /dev/null +++ b/src/applications/udp-client-server/seq-ts-header.cc @@ -0,0 +1,96 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 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/assert.h" +#include "ns3/log.h" +#include "ns3/header.h" +#include "ns3/simulator.h" +#include "seq-ts-header.h" + +NS_LOG_COMPONENT_DEFINE ("SeqTsHeader"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (SeqTsHeader); + +SeqTsHeader::SeqTsHeader () + : m_seq (0), + m_ts (Simulator::Now ().GetTimeStep ()) +{} + +void +SeqTsHeader::SetSeq (uint32_t seq) +{ + m_seq = seq; +} +uint32_t +SeqTsHeader::GetSeq (void) const +{ + return m_seq; +} + +Time +SeqTsHeader::GetTs (void) const +{ + return TimeStep (m_ts); +} + +TypeId +SeqTsHeader::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::SeqTsHeader") + .SetParent
() + .AddConstructor () + ; + return tid; +} +TypeId +SeqTsHeader::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} +void +SeqTsHeader::Print (std::ostream &os) const +{ + os << "(seq=" << m_seq << " time=" << TimeStep (m_ts).GetSeconds () << ")"; +} +uint32_t +SeqTsHeader::GetSerializedSize (void) const +{ + return 4+8; +} + +void +SeqTsHeader::Serialize (Buffer::Iterator start) const +{ + Buffer::Iterator i = start; + i.WriteHtonU32 (m_seq); + i.WriteHtonU64 (m_ts); +} +uint32_t +SeqTsHeader::Deserialize (Buffer::Iterator start) +{ + Buffer::Iterator i = start; + m_seq = i.ReadNtohU32 (); + m_ts = i.ReadNtohU64 (); + return GetSerializedSize (); +} + +} // namespace ns3 diff --git a/src/applications/udp-client-server/seq-ts-header.h b/src/applications/udp-client-server/seq-ts-header.h new file mode 100644 index 000000000..09a27c3a4 --- /dev/null +++ b/src/applications/udp-client-server/seq-ts-header.h @@ -0,0 +1,61 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 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 SEQ_TS_HEADER_H +#define SEQ_TS_HEADER_H + +#include "ns3/header.h" +#include "ns3/nstime.h" + +namespace ns3 { +/** + * \ingroup udpclientserver + * \class SeqTsHeader + * \brief Packet header for Udp client/server application + * The header is made of a 32bits sequence number followed by + * a 64bits time stamp. + */ +class SeqTsHeader : public Header +{ +public: + SeqTsHeader (); + + /** + * \param seq the sequence number + */ + void SetSeq (uint32_t seq); + uint32_t GetSeq (void) const; + Time GetTs (void) const; + + static TypeId GetTypeId (void); + private: + 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); + + uint32_t m_seq; + uint64_t m_ts; +}; + +} // namespace ns3 + +#endif /* SEQ_TS_HEADER_H */ diff --git a/src/applications/udp-client-server/udp-client-server-test.cc b/src/applications/udp-client-server/udp-client-server-test.cc new file mode 100644 index 000000000..a74f74d8c --- /dev/null +++ b/src/applications/udp-client-server/udp-client-server-test.cc @@ -0,0 +1,287 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2007,2008, 2009 INRIA, UDcast + * + * 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: Mohamed Amine Ismail + * + */ + +#include +#include "ns3/log.h" +#include "ns3/abort.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/udp-client-server-helper.h" +#include "ns3/csma-helper.h" +#include "ns3/test.h" +#include "ns3/simulator.h" + +using namespace ns3; + +/** + * Test that all the udp packets generated by an udpClient application are + * correctly received by an udpServer application + */ + +class UdpClientServerTestCase: public TestCase +{ +public: + UdpClientServerTestCase (); + virtual ~UdpClientServerTestCase (); + +private: + virtual bool DoRun (void); + +}; + +UdpClientServerTestCase::UdpClientServerTestCase () : + TestCase ("Test that all the udp packets generated by an udpClient application are correctly received by an udpServer application") +{ +} + +UdpClientServerTestCase::~UdpClientServerTestCase () +{ +} + +bool UdpClientServerTestCase::DoRun (void) +{ + NodeContainer n; + n.Create (2); + + InternetStackHelper internet; + internet.Install (n); + + CsmaHelper csma; + csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate(5000000))); + csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2))); + csma.SetDeviceAttribute ("Mtu", UintegerValue (1400)); + NetDeviceContainer d = csma.Install (n); + + Ipv4AddressHelper ipv4; + + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer i = ipv4.Assign (d); + + uint16_t port = 4000; + UdpServerHelper server (port); + ApplicationContainer apps = server.Install (n.Get(1)); + apps.Start (Seconds (1.0)); + apps.Stop (Seconds (10.0)); + + uint32_t MaxPacketSize = 1024; + Time interPacketInterval = Seconds (1.); + uint32_t maxPacketCount = 10; + UdpClientHelper client (i.GetAddress (1), port); + client.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount)); + client.SetAttribute ("Interval", TimeValue (interPacketInterval)); + client.SetAttribute ("PacketSize", UintegerValue (MaxPacketSize)); + apps = client.Install (n.Get (0)); + apps.Start (Seconds (2.0)); + apps.Stop (Seconds (10.0)); + + Simulator::Run (); + Simulator::Destroy (); + + if ((server.GetServer ()->GetLost () != 0) + || (server.GetServer ()->GetReceived () != 8)) + { + return true; // there was an error + } + return false; + +} + +/** + * Test that all the udp packets generated by an udpTraceClient application are + * correctly received by an udpServer application + */ + +class UdpTraceClientServerTestCase: public TestCase +{ +public: + UdpTraceClientServerTestCase (); + virtual ~UdpTraceClientServerTestCase (); + +private: + virtual bool DoRun (void); + +}; + +UdpTraceClientServerTestCase::UdpTraceClientServerTestCase () : + TestCase ("Test that all the udp packets generated by an udpTraceClient application are correctly received by an udpServer application") +{ +} + +UdpTraceClientServerTestCase::~UdpTraceClientServerTestCase () +{ +} + +bool UdpTraceClientServerTestCase::DoRun (void) +{ + + + NodeContainer n; + n.Create (2); + + InternetStackHelper internet; + internet.Install (n); + + + CsmaHelper csma; + csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate(5000000))); + csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2))); + csma.SetDeviceAttribute ("Mtu", UintegerValue (1400)); + NetDeviceContainer d = csma.Install (n); + + Ipv4AddressHelper ipv4; + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer i = ipv4.Assign (d); + + uint16_t port = 4000; + UdpServerHelper server (port); + ApplicationContainer apps = server.Install (n.Get(1)); + apps.Start (Seconds (1.0)); + apps.Stop (Seconds (10.0)); + + uint32_t MaxPacketSize = 1400; + UdpTraceClientHelper client (i.GetAddress (1), port,""); + client.SetAttribute ("MaxPacketSize", UintegerValue (MaxPacketSize)); + apps = client.Install (n.Get (0)); + apps.Start (Seconds (2.0)); + apps.Stop (Seconds (10.0)); + + Simulator::Run (); + Simulator::Destroy (); + + if ((server.GetServer ()->GetLost () != 0)|| + (server.GetServer ()->GetReceived () != 247)) + { + return true; // there was an error + } + + return false; +} + + +/** + * Test that all the PacketLossCounter class checks loss correctly in different cases + */ + +class PacketLossCounterTestCase: public TestCase +{ +public: + PacketLossCounterTestCase (); + virtual ~PacketLossCounterTestCase (); + +private: + virtual bool DoRun (void); + +}; + +PacketLossCounterTestCase::PacketLossCounterTestCase () : + TestCase ("Test that all the PacketLossCounter class checks loss correctly in different cases") +{ +} + +PacketLossCounterTestCase::~PacketLossCounterTestCase () +{ +} + +bool PacketLossCounterTestCase::DoRun (void) +{ + PacketLossCounter lossCounter(32); + for (uint32_t i=0;i<64;i++) + { + lossCounter.NotifyReceived(i); + } + + if (lossCounter.GetLost()!=0) // Check that 0 packets are lost + { + return true; + } + for (uint32_t i=65;i<128;i++) // drop (1) seqNum 64 + { + lossCounter.NotifyReceived(i); + } + if (lossCounter.GetLost()!=1) //chek that 1 packet is lost + { + return true; + } + for (uint32_t i=134;i<200;i++) // drop seqNum 128,129,130,131,132,133 + { + lossCounter.NotifyReceived(i); + } + if (lossCounter.GetLost()!=7) //chek that 7 (6+1) packet are lost + { + return true; + } + // reordering without loss + lossCounter.NotifyReceived(205); + lossCounter.NotifyReceived(206); + lossCounter.NotifyReceived(207); + lossCounter.NotifyReceived(200); + lossCounter.NotifyReceived(201); + lossCounter.NotifyReceived(202); + lossCounter.NotifyReceived(203); + lossCounter.NotifyReceived(204); + for (uint32_t i=205;i<250;i++) + { + lossCounter.NotifyReceived(i); + } + if (lossCounter.GetLost()!=7) + { + return true; + } + + // reordering with loss + lossCounter.NotifyReceived(255); + // drop (2) seqNum 250, 251 + lossCounter.NotifyReceived(252); + lossCounter.NotifyReceived(253); + lossCounter.NotifyReceived(254); + for (uint32_t i=256;i<300;i++) + { + lossCounter.NotifyReceived(i); + } + if (lossCounter.GetLost()!=9) //chek that 7 (6+1+2) packet are lost + { + return true; + } + + + return false; + +} +class UdpClientServerTestSuite: public TestSuite +{ +public: + UdpClientServerTestSuite (); +}; + +UdpClientServerTestSuite::UdpClientServerTestSuite () : + TestSuite ("udp-client-server", UNIT) +{ + AddTestCase (new UdpTraceClientServerTestCase); + AddTestCase (new UdpClientServerTestCase); + AddTestCase (new PacketLossCounterTestCase); +} + +UdpClientServerTestSuite udpClientServerTestSuite; diff --git a/src/applications/udp-client-server/udp-client.cc b/src/applications/udp-client-server/udp-client.cc new file mode 100644 index 000000000..011fdf551 --- /dev/null +++ b/src/applications/udp-client-server/udp-client.cc @@ -0,0 +1,155 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2007,2008,2009 INRIA, UDCAST + * + * 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: Amine Ismail + * + */ +#include "ns3/log.h" +#include "ns3/ipv4-address.h" +#include "ns3/nstime.h" +#include "ns3/inet-socket-address.h" +#include "ns3/socket.h" +#include "ns3/simulator.h" +#include "ns3/socket-factory.h" +#include "ns3/packet.h" +#include "ns3/uinteger.h" +#include "udp-client.h" +#include "seq-ts-header.h" +#include +#include + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("UdpClient"); +NS_OBJECT_ENSURE_REGISTERED ( UdpClient); + +TypeId +UdpClient::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::UdpClient") + .SetParent () + .AddConstructor () + .AddAttribute ("MaxPackets", + "The maximum number of packets the application will send", + UintegerValue (100), + MakeUintegerAccessor (&UdpClient::m_count), + MakeUintegerChecker ()) + .AddAttribute ("Interval", + "The time to wait between packets", TimeValue (Seconds (1.0)), + MakeTimeAccessor (&UdpClient::m_interval), + MakeTimeChecker ()) + .AddAttribute ( + "RemoteAddress", + "The destination Ipv4Address of the outbound packets", + Ipv4AddressValue (), + MakeIpv4AddressAccessor (&UdpClient::m_peerAddress), + MakeIpv4AddressChecker ()) + .AddAttribute ("RemotePort", "The destination port of the outbound packets", + UintegerValue (100), + MakeUintegerAccessor (&UdpClient::m_peerPort), + MakeUintegerChecker ()) + .AddAttribute ("PacketSize", + "Size of packets generated. The minimum packet size is 12 bytes which is the size of the header carrying the sequence number and the time stamp.", + UintegerValue (1024), + MakeUintegerAccessor (&UdpClient::m_size), + MakeUintegerChecker (12,1500)) + ; + return tid; +} + +UdpClient::UdpClient () +{ + NS_LOG_FUNCTION_NOARGS (); + m_sent = 0; + m_socket = 0; + m_sendEvent = EventId (); +} + +UdpClient::~UdpClient () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +void +UdpClient::SetRemote (Ipv4Address ip, uint16_t port) +{ + m_peerAddress = ip; + m_peerPort = port; +} + +void +UdpClient::DoDispose (void) +{ + NS_LOG_FUNCTION_NOARGS (); + Application::DoDispose (); +} + +void +UdpClient::StartApplication (void) +{ + NS_LOG_FUNCTION_NOARGS (); + + if (m_socket == 0) + { + TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); + m_socket = Socket::CreateSocket (GetNode (), tid); + m_socket->Bind (); + m_socket->Connect (InetSocketAddress (m_peerAddress, m_peerPort)); + } + + m_socket->SetRecvCallback (MakeNullCallback > ()); + m_sendEvent = Simulator::Schedule (Seconds (0.0), &UdpClient::Send, this); +} + +void +UdpClient::StopApplication () +{ + NS_LOG_FUNCTION_NOARGS (); + Simulator::Cancel (m_sendEvent); +} + +void +UdpClient::Send (void) +{ + NS_LOG_FUNCTION_NOARGS (); + NS_ASSERT (m_sendEvent.IsExpired ()); + SeqTsHeader seqTs; + seqTs.SetSeq (m_sent); + Ptr p = Create (m_size-(8+4)); // 8+4 : the size of the seqTs header + p->AddHeader (seqTs); + + if ((m_socket->Send (p)) >= 0) + { + ++m_sent; + NS_LOG_INFO ("TraceDelay TX " << m_size << " bytes to " + << m_peerAddress << " Uid: " << p->GetUid () + << " Time: " << (Simulator::Now ()).GetSeconds ()); + + } + else + { + NS_LOG_INFO ("Error while sending " << m_size << " bytes to " + << m_peerAddress); + } + + if (m_sent < m_count) + { + m_sendEvent = Simulator::Schedule (m_interval, &UdpClient::Send, this); + } +} + +} // Namespace ns3 diff --git a/src/applications/udp-client-server/udp-client.h b/src/applications/udp-client-server/udp-client.h new file mode 100644 index 000000000..e262d9cc5 --- /dev/null +++ b/src/applications/udp-client-server/udp-client.h @@ -0,0 +1,85 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2007,2008,2009 INRIA, UDCAST + * + * 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: Amine Ismail + * + * + */ + +#ifndef __UDP_CLIENT_H__ +#define __UDP_CLIENT_H__ + +#include "ns3/application.h" +#include "ns3/event-id.h" +#include "ns3/ptr.h" +#include "ns3/ipv4-address.h" + +namespace ns3 { + +class Socket; +class Packet; + +/** + * \ingroup udpclientserver + * \class UdpClient + * \brief A Udp client. Sends UDP packet carrying sequence number and time stamp + * in their payloads + * + */ +class UdpClient : public Application +{ +public: + static TypeId + GetTypeId (void); + + UdpClient (); + + virtual ~UdpClient (); + + /** + * \brief set the remote address and port + * \param ip remote IP address + * \param port remote port + */ + void SetRemote (Ipv4Address ip, uint16_t port); + +protected: + virtual void DoDispose (void); + +private: + + virtual void StartApplication (void); + virtual void StopApplication (void); + + void ScheduleTransmit (Time dt); + void Send (void); + + uint32_t m_count; + Time m_interval; + uint32_t m_size; + + uint32_t m_sent; + Ptr m_socket; + Ipv4Address m_peerAddress; + uint16_t m_peerPort; + EventId m_sendEvent; + +}; + +} // namespace ns3 + +#endif // __UDP_CLIENT_H__ diff --git a/src/applications/udp-client-server/udp-server.cc b/src/applications/udp-client-server/udp-server.cc new file mode 100644 index 000000000..730e9fc05 --- /dev/null +++ b/src/applications/udp-client-server/udp-server.cc @@ -0,0 +1,164 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2007,2008,2009 INRIA, UDCAST + * + * 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: Amine Ismail + * + */ + +#include "ns3/log.h" +#include "ns3/ipv4-address.h" +#include "ns3/nstime.h" +#include "ns3/inet-socket-address.h" +#include "ns3/socket.h" +#include "ns3/simulator.h" +#include "ns3/socket-factory.h" +#include "ns3/packet.h" +#include "ns3/uinteger.h" +#include "packet-loss-counter.h" + +#include "seq-ts-header.h" +#include "udp-server.h" + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("UdpServer"); +NS_OBJECT_ENSURE_REGISTERED ( UdpServer); + + +TypeId +UdpServer::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::UdpServer") + .SetParent () + .AddConstructor () + .AddAttribute ("Port", + "Port on which we listen for incoming packets.", + UintegerValue (100), + MakeUintegerAccessor (&UdpServer::m_port), + MakeUintegerChecker ()) + .AddAttribute ("PacketWindowSize", + "The size of the window used to compute the packet loss. This value should be a multiple of 8.", + UintegerValue (32), + MakeUintegerAccessor (&UdpServer::GetPacketWindowSize, + &UdpServer::SetPacketWindowSize), + MakeUintegerChecker (8,256)) + ; + return tid; +} + +UdpServer::UdpServer () + : m_lossCounter (0) +{ + NS_LOG_FUNCTION_NOARGS (); + m_received=0; +} + +UdpServer::~UdpServer () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +uint16_t +UdpServer::GetPacketWindowSize () const +{ + return m_lossCounter.GetBitMapSize (); +} + +void +UdpServer::SetPacketWindowSize (uint16_t size) +{ + m_lossCounter.SetBitMapSize (size); +} + +uint32_t +UdpServer::GetLost (void) const +{ + return m_lossCounter.GetLost (); +} + +uint32_t +UdpServer::GetReceived (void) const +{ + + return m_received; + +} + +void +UdpServer::DoDispose (void) +{ + NS_LOG_FUNCTION_NOARGS (); + Application::DoDispose (); +} + +void +UdpServer::StartApplication (void) +{ + NS_LOG_FUNCTION_NOARGS (); + + if (m_socket == 0) + { + TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); + m_socket = Socket::CreateSocket (GetNode (), tid); + InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), + m_port); + m_socket->Bind (local); + } + + m_socket->SetRecvCallback (MakeCallback (&UdpServer::HandleRead, this)); + +} + +void +UdpServer::StopApplication () +{ + NS_LOG_FUNCTION_NOARGS (); + + if (m_socket != 0) + { + m_socket->SetRecvCallback (MakeNullCallback > ()); + } +} + +void +UdpServer::HandleRead (Ptr socket) +{ + Ptr packet; + Address from; + while (packet = socket->RecvFrom (from)) + { + if (packet->GetSize () > 0) + { + SeqTsHeader seqTs; + packet->RemoveHeader (seqTs); + Time delay = Simulator::Now () - seqTs.GetTs (); + uint32_t currentSequenceNumber = seqTs.GetSeq (); + NS_LOG_INFO ("TraceDelay: RX " << packet->GetSize () << + " bytes from "<< InetSocketAddress::ConvertFrom(from).GetIpv4 () << + " Sequence Number: " << currentSequenceNumber << + " Uid: " << packet->GetUid () << + " TXtime: " << seqTs.GetTs () << + " RXtime: " << Simulator::Now () << + " Delay: " << delay) ; + + m_lossCounter.NotifyReceived (currentSequenceNumber); + m_received++; + } + } +} + +} // Namespace ns3 diff --git a/src/applications/udp-client-server/udp-server.h b/src/applications/udp-client-server/udp-server.h new file mode 100644 index 000000000..42dd7ce21 --- /dev/null +++ b/src/applications/udp-client-server/udp-server.h @@ -0,0 +1,94 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2007,2008,2009 INRIA, UDCAST + * + * 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: Amine Ismail + * + * + */ + +#ifndef __UDP_SERVER_H__ +#define __UDP_SERVER_H__ + +#include "ns3/application.h" +#include "ns3/event-id.h" +#include "ns3/ptr.h" +#include "ns3/address.h" +#include "packet-loss-counter.h" +namespace ns3 { +/** + * \ingroup applications + * \defgroup udpclientserver UdpClientServer + */ + +/** + * \ingroup udpclientserver + * \class UdpServer + * \brief A Udp server. Receives UDP packets from a remote host. UDP packets + * carry a 32bits sequence number followed by a 64bits time stamp in their + * payloads. The application uses, the sequence number to determine if a packet + * is lost, and the time stamp to compute the delay + */ +class UdpServer : public Application +{ +public: + static TypeId GetTypeId (void); + UdpServer (); + virtual ~UdpServer (); + /** + * returns the number of lost packets + * \return the number of lost packets + */ + uint32_t GetLost (void) const; + + /** + * \brief returns the number of received packets + * \return the number of received packets + */ + uint32_t GetReceived (void) const; + + /** + * \return the size of the window used for checking loss. + */ + uint16_t GetPacketWindowSize () const; + + /** + * \brief Set the size of the window used for checking loss. This value should + * be a multiple of 8 + * \param size the size of the window used for checking loss. This value should + * be a multiple of 8 + */ + void SetPacketWindowSize (uint16_t size); +protected: + virtual void DoDispose (void); + +private: + + virtual void StartApplication (void); + virtual void StopApplication (void); + + void HandleRead (Ptr socket); + + uint16_t m_port; + Ptr m_socket; + Address m_local; + uint32_t m_received; + PacketLossCounter m_lossCounter; +}; + +} // namespace ns3 + +#endif // __UDP_SERVER_H__ diff --git a/src/applications/udp-client-server/udp-trace-client.cc b/src/applications/udp-client-server/udp-trace-client.cc new file mode 100644 index 000000000..d814c5b9d --- /dev/null +++ b/src/applications/udp-client-server/udp-trace-client.cc @@ -0,0 +1,292 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2007,2008, 2009 INRIA, UDcast + * + * 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: Mohamed Amine Ismail + * + */ +#include "ns3/log.h" +#include "ns3/ipv4-address.h" +#include "ns3/nstime.h" +#include "ns3/inet-socket-address.h" +#include "ns3/socket.h" +#include "ns3/simulator.h" +#include "ns3/socket-factory.h" +#include "ns3/packet.h" +#include "ns3/uinteger.h" +#include "ns3/string.h" +#include "seq-ts-header.h" +#include "udp-trace-client.h" +#include +#include +#include + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("UdpTraceClient"); +NS_OBJECT_ENSURE_REGISTERED ( UdpTraceClient); + +struct UdpTraceClient::TraceEntry UdpTraceClient::g_defaultEntries[] = { + {0, 534, 'I'}, + {40, 1542, 'P'}, + {120, 134, 'B'}, + {80, 390, 'B'}, + {240, 765, 'P'}, + {160, 407, 'B'}, + {200, 504, 'B'}, + {360, 903, 'P'}, + {280, 421, 'B'}, + {320, 587, 'B'} +}; + +TypeId +UdpTraceClient::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::UdpTraceClient") + .SetParent () + .AddConstructor () + .AddAttribute ("RemoteAddress", + "The destination Ipv4Address of the outbound packets", + Ipv4AddressValue (), + MakeIpv4AddressAccessor (&UdpTraceClient::m_peerAddress), + MakeIpv4AddressChecker ()) + .AddAttribute ("RemotePort", + "The destination port of the outbound packets", + UintegerValue (100), + MakeUintegerAccessor (&UdpTraceClient::m_peerPort), + MakeUintegerChecker ()) + .AddAttribute ("MaxPacketSize", + "The maximum size of a packet.", + UintegerValue (1024), + MakeUintegerAccessor (&UdpTraceClient::m_maxPacketSize), + MakeUintegerChecker ()) + .AddAttribute ("TraceFilename", + "Name of file to load a trace from. By default, uses a hardcoded trace.", + StringValue (""), + MakeStringAccessor (&UdpTraceClient::SetTraceFile), + MakeStringChecker ()) + + ; + return tid; +} + +UdpTraceClient::UdpTraceClient () +{ + NS_LOG_FUNCTION_NOARGS (); + m_sent = 0; + m_socket = 0; + m_sendEvent = EventId (); + m_maxPacketSize = 1400; +} + +UdpTraceClient::UdpTraceClient (Ipv4Address ip, uint16_t port, + char *traceFile) +{ + NS_LOG_FUNCTION_NOARGS (); + m_sent = 0; + m_socket = 0; + m_sendEvent = EventId (); + m_peerAddress = ip; + m_peerPort = port; + m_currentEntry = 0; + m_maxPacketSize = 1400; + if (traceFile != NULL) + { + SetTraceFile (traceFile); + } +} + +UdpTraceClient::~UdpTraceClient () +{ + m_entries.clear (); + NS_LOG_FUNCTION_NOARGS (); +} + +void +UdpTraceClient::SetRemote (Ipv4Address ip, uint16_t port) +{ + m_entries.clear (); + m_peerAddress = ip; + m_peerPort = port; +} + +void +UdpTraceClient::SetTraceFile (std::string traceFile) +{ + if (traceFile == "") + { + LoadDefaultTrace (); + } + else + { + LoadTrace (traceFile); + } +} + +void +UdpTraceClient::SetMaxPacketSize (uint16_t maxPacketSize){ + m_maxPacketSize = maxPacketSize; +} + + +uint16_t UdpTraceClient::GetMaxPacketSize (void){ + return m_maxPacketSize; +} + + +void +UdpTraceClient::DoDispose (void) +{ + NS_LOG_FUNCTION_NOARGS (); + Application::DoDispose (); +} + +void +UdpTraceClient::LoadTrace (std::string filename) +{ + uint32_t time, index, prevTime = 0; + uint16_t size; + char frameType; + TraceEntry entry; + std::ifstream ifTraceFile; + ifTraceFile.open (filename.c_str (), std::ifstream::in); + m_entries.clear (); + if (!ifTraceFile.good ()) + { + LoadDefaultTrace (); + } + while (ifTraceFile.good ()) + { + ifTraceFile >> index >> frameType >> time >> size; + if (frameType == 'B') + { + entry.timeToSend = 0; + } + else + { + entry.timeToSend = time - prevTime; + prevTime = time; + } + entry.packetSize = size; + entry.frameType = frameType; + m_entries.push_back (entry); + } + ifTraceFile.close (); + m_currentEntry = 0; +} + +void +UdpTraceClient::LoadDefaultTrace (void) +{ + uint32_t prevTime = 0; + for (uint32_t i = 0; i < (sizeof (g_defaultEntries) / sizeof (struct TraceEntry)); i++) + { + struct TraceEntry entry = g_defaultEntries[i]; + if (entry.frameType == 'B') + { + entry.timeToSend = 0; + } + else + { + uint32_t tmp = entry.timeToSend; + entry.timeToSend -= prevTime; + prevTime = tmp; + } + m_entries.push_back (entry); + } + m_currentEntry = 0; +} + +void +UdpTraceClient::StartApplication (void) +{ + NS_LOG_FUNCTION (this); + + if (m_socket == 0) + { + TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); + m_socket = Socket::CreateSocket (GetNode (), tid); + m_socket->Bind (); + m_socket->Connect (InetSocketAddress (m_peerAddress, m_peerPort)); + } + m_socket->SetRecvCallback (MakeNullCallback > ()); + m_sendEvent = Simulator::Schedule (Seconds (0.0), &UdpTraceClient::Send, this); +} + +void +UdpTraceClient::StopApplication () +{ + NS_LOG_FUNCTION (this); + Simulator::Cancel (m_sendEvent); +} + +void +UdpTraceClient::SendPacket (uint32_t size) +{ + Ptr p; + uint32_t packetSize; + if (size>12) + { + packetSize = size - 12; // 12 is the size of the SeqTsHeader + } + else + { + packetSize = 0; + } + p = Create (packetSize); + SeqTsHeader seqTs; + seqTs.SetSeq (m_sent); + p->AddHeader (seqTs); + if ((m_socket->Send (p)) >= 0) + { + ++m_sent; + NS_LOG_INFO ("Sent " << size << " bytes to " + << m_peerAddress); + } + else + { + NS_LOG_INFO ("Error while sending " << size << " bytes to " + << m_peerAddress); + } +} + +void +UdpTraceClient::Send (void) +{ + NS_LOG_FUNCTION_NOARGS (); + + NS_ASSERT (m_sendEvent.IsExpired ()); + Ptr p; + struct TraceEntry *entry = &m_entries[m_currentEntry]; + do + { + for (int i = 0; i < entry->packetSize / m_maxPacketSize; i++) + { + SendPacket (m_maxPacketSize); + } + + uint16_t sizetosend = entry->packetSize % m_maxPacketSize; + SendPacket (sizetosend); + + m_currentEntry++; + m_currentEntry %= m_entries.size (); + entry = &m_entries[m_currentEntry]; + } + while (entry->timeToSend == 0); + m_sendEvent = Simulator::Schedule (MilliSeconds (entry->timeToSend), &UdpTraceClient::Send, this); +} + +} // Namespace ns3 diff --git a/src/applications/udp-client-server/udp-trace-client.h b/src/applications/udp-client-server/udp-trace-client.h new file mode 100644 index 000000000..a1e8c2ffb --- /dev/null +++ b/src/applications/udp-client-server/udp-trace-client.h @@ -0,0 +1,135 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2007,2008, 2009 INRIA, UDcast + * + * 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: Mohamed Amine Ismail + * + */ + +#ifndef __UDP_TRACE_CLIENT__ +#define __UDP_TRACE_CLIENT__ + +#include "ns3/application.h" +#include "ns3/event-id.h" +#include "ns3/ptr.h" +#include "ns3/ipv4-address.h" +#include +namespace ns3 { + +class Socket; +class Packet; + +/** + * \ingroup udpclientserver + * \class UdpTraceClient + * \brief A trace based streamer + * + * sends udp packets based on a trace file of an MPEG4 stream + * trace files could be downloaded form : + * http://www.tkn.tu-berlin.de/research/trace/ltvt.html (the 2 first lines of + * the file should be removed) + * A valid trace file is a file with 4 columns: + * -1- the first one represents the frame index + * -2- the second one indicates the type of the frame: I, P or B + * -3- the third one indicates the time on which the frame was generated by the encoder + * -4- the fourth one indicates the frame size in byte + * if no valid MPEG4 trace file is provided to the application the trace from + * g_defaultEntries array will be loaded. + */ +class UdpTraceClient : public Application +{ +public: + static TypeId + GetTypeId (void); + /** + * \brief creates a traceBasedStreamer application + */ + UdpTraceClient (); + + /** + * \brief creates a traceBasedStreamer application + * \param dataSize ip the destination ip address to which the stream will be sent + * \param port the destination udp port to which the stream will be sent + * \param traceFile a path to an MPEG4 trace file formatted as follows: + * FrameNo Frametype Time[ms] Length [byte] + * FrameNo Frametype Time[ms] Length [byte] + * ... + * + * + */ + + UdpTraceClient (Ipv4Address ip, uint16_t port, char *traceFile); + ~UdpTraceClient (); + + /** + * \brief set the destination IP address and port + * \param ip the destination ip address to which the stream will be sent + * \param port the destination udp port to which the stream will be sent + */ + void SetRemote (Ipv4Address ip, uint16_t port); + + /** + * \brief set the trace file to be used by the application + * \param traceFile a path to an MPEG4 trace file formatted as follows: + * Frame No Frametype Time[ms] Length [byte] + * Frame No Frametype Time[ms] Length [byte] + * ... + */ + void SetTraceFile (std::string filename); + + /** + * \return the maximum packet size + */ + uint16_t GetMaxPacketSize(void); + + /** + * \param maxPacketSize The maximum packet size + */ + void SetMaxPacketSize(uint16_t maxPacketSize); + +protected: + virtual void DoDispose (void); + +private: + void LoadTrace (std::string filename); + void LoadDefaultTrace (void); + virtual void StartApplication (void); + virtual void StopApplication (void); + void ScheduleTransmit (Time dt); + void Send (void); + void SendPacket (uint32_t size); + + + struct TraceEntry + { + uint32_t timeToSend; + uint16_t packetSize; + char frameType; + }; + uint32_t m_sent; + Ptr m_socket; + Ipv4Address m_peerAddress; + uint16_t m_peerPort; + EventId m_sendEvent; + std::vector m_entries; + uint32_t m_currentEntry; + static struct TraceEntry g_defaultEntries[]; + uint16_t m_maxPacketSize; +}; + +} // namespace ns3 + +#endif // __UDP_TRACE_CLIENT__ diff --git a/src/applications/udp-client-server/waf b/src/applications/udp-client-server/waf new file mode 100644 index 000000000..4283ec141 --- /dev/null +++ b/src/applications/udp-client-server/waf @@ -0,0 +1 @@ +exec "`dirname "$0"`"/../../../waf "$@" diff --git a/src/applications/udp-client-server/wscript b/src/applications/udp-client-server/wscript new file mode 100644 index 000000000..6d40e8a12 --- /dev/null +++ b/src/applications/udp-client-server/wscript @@ -0,0 +1,21 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + module = bld.create_ns3_module('udp-client-server', ['internet-stack']) + module.source = [ + 'udp-client.cc', + 'udp-server.cc', + 'seq-ts-header.cc', + 'udp-trace-client.cc', + 'udp-client-server-test.cc', + 'packet-loss-counter.cc', + ] + headers = bld.new_task_gen('ns3header') + headers.module = 'udp-client-server' + headers.source = [ + 'udp-client.h', + 'udp-server.h', + 'udp-trace-client.h', + 'packet-loss-counter.h', + ] + diff --git a/src/helper/udp-client-server-helper.cc b/src/helper/udp-client-server-helper.cc new file mode 100644 index 000000000..58897da70 --- /dev/null +++ b/src/helper/udp-client-server-helper.cc @@ -0,0 +1,127 @@ +/* -*- 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: Mohamed Amine Ismail + */ +#include "udp-client-server-helper.h" +#include "ns3/udp-server.h" +#include "ns3/udp-client.h" +#include "ns3/udp-trace-client.h" +#include "ns3/uinteger.h" +#include "ns3/string.h" + +namespace ns3 { + +UdpServerHelper::UdpServerHelper () +{} + +UdpServerHelper::UdpServerHelper (uint16_t port) +{ + m_factory.SetTypeId (UdpServer::GetTypeId ()); + SetAttribute ("Port", UintegerValue (port)); +} + +void +UdpServerHelper::SetAttribute (std::string name, const AttributeValue &value) +{ + m_factory.Set (name, value); +} + +ApplicationContainer +UdpServerHelper::Install (NodeContainer c) +{ + ApplicationContainer apps; + for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i) + { + Ptr node = *i; + + m_server = m_factory.Create (); + node->AddApplication (m_server); + apps.Add (m_server); + + } + return apps; +} + +Ptr +UdpServerHelper::GetServer (void) +{ + return m_server; +} + +UdpClientHelper::UdpClientHelper () +{} + +UdpClientHelper::UdpClientHelper (Ipv4Address address, uint16_t port) +{ + m_factory.SetTypeId (UdpClient::GetTypeId ()); + SetAttribute ("RemoteAddress", Ipv4AddressValue (address)); + SetAttribute ("RemotePort", UintegerValue (port)); +} + +void +UdpClientHelper::SetAttribute (std::string name, const AttributeValue &value) +{ + m_factory.Set (name, value); +} + +ApplicationContainer +UdpClientHelper::Install (NodeContainer c) +{ + ApplicationContainer apps; + for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i) + { + Ptr node = *i; + Ptr client = m_factory.Create (); + node->AddApplication (client); + apps.Add (client); + } + return apps; +} + +UdpTraceClientHelper::UdpTraceClientHelper () +{} + +UdpTraceClientHelper::UdpTraceClientHelper (Ipv4Address address, uint16_t port, std::string filename) +{ + m_factory.SetTypeId (UdpTraceClient::GetTypeId ()); + SetAttribute ("RemoteAddress", Ipv4AddressValue (address)); + SetAttribute ("RemotePort", UintegerValue (port)); + SetAttribute ("TraceFilename", StringValue (filename)); +} + +void +UdpTraceClientHelper::SetAttribute (std::string name, const AttributeValue &value) +{ + m_factory.Set (name, value); +} + +ApplicationContainer +UdpTraceClientHelper::Install (NodeContainer c) +{ + ApplicationContainer apps; + for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i) + { + Ptr node = *i; + Ptr client = m_factory.Create (); + node->AddApplication (client); + apps.Add (client); + } + return apps; +} + +} // namespace ns3 diff --git a/src/helper/udp-client-server-helper.h b/src/helper/udp-client-server-helper.h new file mode 100644 index 000000000..8d704d846 --- /dev/null +++ b/src/helper/udp-client-server-helper.h @@ -0,0 +1,178 @@ +/* -*- 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: Mohamed Amine Ismail + */ +#ifndef UDP_CLIENT_SERVER_HELPER_H +#define UDP_CLIENT_SERVER_HELPER_H + +#include +#include "application-container.h" +#include "node-container.h" +#include "ns3/object-factory.h" +#include "ns3/ipv4-address.h" +#include "ns3/udp-server.h" +#include "ns3/udp-client.h" +namespace ns3 { + /** + * \brief Create a server application which waits for input udp packets + * and uses the information carried into their payload to compute + * delay and to determine if some packets are lost. + */ +class UdpServerHelper +{ +public: + /** + * Create UdpServerHelper which will make life easier for people trying + * to set up simulations with udp-client-server application. + * + */ + UdpServerHelper (); + + /** + * Create UdpServerHelper which will make life easier for people trying + * to set up simulations with udp-client-server application. + * + * \param port The port the server will wait on for incoming packets + */ + UdpServerHelper (uint16_t port); + + /** + * Record an attribute to be set in each Application after it is is created. + * + * \param name the name of the attribute to set + * \param value the value of the attribute to set + */ + void SetAttribute (std::string name, const AttributeValue &value); + + /** + * Create one udp server application on each of the Nodes in the + * NodeContainer. + * + * \param c The nodes on which to create the Applications. The nodes + * are specified by a NodeContainer. + * \returns The applications created, one Application per Node in the + * NodeContainer. + */ + ApplicationContainer Install (NodeContainer c); + Ptr GetServer(void); +private: + ObjectFactory m_factory; + Ptr m_server; +}; + +/** + * \brief Create a client application which sends udp packets carrying + * a 32bit sequence numbre and a 64 bit time stamp. + * + */ +class UdpClientHelper +{ + +public: + /** + * Create UdpClientHelper which will make life easier for people trying + * to set up simulations with udp-client-server. + * + */ + UdpClientHelper (); + + /** + * Create UdpClientHelper which will make life easier for people trying + * to set up simulations with udp-client-server. + * + * \param ip The IP address of the remote udp server + * \param port The port number of the remote udp server + */ + + UdpClientHelper (Ipv4Address ip, uint16_t port); + + /** + * Record an attribute to be set in each Application after it is is created. + * + * \param name the name of the attribute to set + * \param value the value of the attribute to set + */ + void SetAttribute (std::string name, const AttributeValue &value); + + /** + * \param c the nodes + * + * Create one udp client application on each of the input nodes + * + * \returns the applications created, one application per input node. + */ + ApplicationContainer Install (NodeContainer c); + +private: + ObjectFactory m_factory; +}; + /** + * Create udpTraceClient application which sends udp packets based on a trace + * file of an MPEG4 stream. Trace files could be downloaded form : + * http://www.tkn.tu-berlin.de/research/trace/ltvt.html (the 2 first lines of + * the file should be removed) + * A valid trace file is a file with 4 columns: + * -1- the first one represents the frame index + * -2- the second one indicates the type of the frame: I, P or B + * -3- the third one indicates the time on which the frame was generated by the encoder + * -4- the fourth one indicates the frame size in byte +*/ +class UdpTraceClientHelper +{ +public: + /** + * Create UdpTraceClientHelper which will make life easier for people trying + * to set up simulations with udp-client-server. + * + */ + UdpTraceClientHelper (); + + /** + * Create UdpTraceClientHelper which will make life easier for people trying + * to set up simulations with udp-client-server. + * + * \param ip The IP address of the remote udp server + * \param port The port number of the remote udp server + * \param filename the file from which packet traces will be loaded + */ + UdpTraceClientHelper (Ipv4Address ip, uint16_t port, std::string filename); + + /** + * Record an attribute to be set in each Application after it is is created. + * + * \param name the name of the attribute to set + * \param value the value of the attribute to set + */ + void SetAttribute (std::string name, const AttributeValue &value); + + /** + * \param c the nodes + * + * Create one udp trace client application on each of the input nodes + * + * \returns the applications created, one application per input node. + */ + ApplicationContainer Install (NodeContainer c); + +private: + ObjectFactory m_factory; +}; + +} // namespace ns3 + +#endif /* UDP_CLIENT_SERVER_H */ diff --git a/src/helper/wscript b/src/helper/wscript index 1fe25d705..b3d6ad7b7 100644 --- a/src/helper/wscript +++ b/src/helper/wscript @@ -47,6 +47,7 @@ def build(bld): 'point-to-point-grid-helper.cc', 'point-to-point-star-helper.cc', 'csma-star-helper.cc', + 'udp-client-server-helper.cc', ] headers = bld.new_task_gen('ns3header') @@ -97,6 +98,7 @@ def build(bld): 'point-to-point-grid-helper.h', 'point-to-point-star-helper.h', 'csma-star-helper.h', + 'udp-client-server-helper.h', ] env = bld.env_of_name('default') diff --git a/src/wscript b/src/wscript index 8d8b7a2bd..7b2b298ad 100644 --- a/src/wscript +++ b/src/wscript @@ -47,6 +47,7 @@ all_modules = ( 'test/ns3tcp', 'test/ns3wifi', 'contrib/flow-monitor', + 'applications/udp-client-server', ) def set_options(opt):