Sync with ns-3-dev
This commit is contained in:
@@ -45,6 +45,8 @@ def register_types(module):
|
||||
module.add_class('IntToType', template_parameters=['6'])
|
||||
## int-to-type.h: ns3::IntToType<6>::v_e [enumeration]
|
||||
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 6 >'])
|
||||
## names.h: ns3::Names [class]
|
||||
module.add_class('Names')
|
||||
## object-base.h: ns3::ObjectBase [class]
|
||||
module.add_class('ObjectBase', allow_subclassing=True)
|
||||
## object-factory.h: ns3::ObjectFactory [class]
|
||||
@@ -225,6 +227,7 @@ def register_methods(root_module):
|
||||
register_Ns3IntToType__4_methods(root_module, root_module['ns3::IntToType< 4 >'])
|
||||
register_Ns3IntToType__5_methods(root_module, root_module['ns3::IntToType< 5 >'])
|
||||
register_Ns3IntToType__6_methods(root_module, root_module['ns3::IntToType< 6 >'])
|
||||
register_Ns3Names_methods(root_module, root_module['ns3::Names'])
|
||||
register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
|
||||
register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory'])
|
||||
register_Ns3RandomVariable_methods(root_module, root_module['ns3::RandomVariable'])
|
||||
@@ -446,6 +449,58 @@ def register_Ns3IntToType__6_methods(root_module, cls):
|
||||
cls.add_copy_constructor()
|
||||
return
|
||||
|
||||
def register_Ns3Names_methods(root_module, cls):
|
||||
## names.h: ns3::Names::Names(ns3::Names const & arg0) [copy constructor]
|
||||
cls.add_constructor([param('ns3::Names const &', 'arg0')])
|
||||
## names.h: ns3::Names::Names() [constructor]
|
||||
cls.add_constructor([])
|
||||
## names.h: static bool ns3::Names::Add(std::string name, ns3::Ptr<ns3::Object> obj) [member function]
|
||||
cls.add_method('Add',
|
||||
'bool',
|
||||
[param('std::string', 'name'), param('ns3::Ptr< ns3::Object >', 'obj')],
|
||||
is_static=True)
|
||||
## names.h: static bool ns3::Names::Add(std::string path, std::string name, ns3::Ptr<ns3::Object> object) [member function]
|
||||
cls.add_method('Add',
|
||||
'bool',
|
||||
[param('std::string', 'path'), param('std::string', 'name'), param('ns3::Ptr< ns3::Object >', 'object')],
|
||||
is_static=True)
|
||||
## names.h: static bool ns3::Names::Add(ns3::Ptr<ns3::Object> context, std::string name, ns3::Ptr<ns3::Object> object) [member function]
|
||||
cls.add_method('Add',
|
||||
'bool',
|
||||
[param('ns3::Ptr< ns3::Object >', 'context'), param('std::string', 'name'), param('ns3::Ptr< ns3::Object >', 'object')],
|
||||
is_static=True)
|
||||
## names.h: static bool ns3::Names::Rename(std::string oldpath, std::string newname) [member function]
|
||||
cls.add_method('Rename',
|
||||
'bool',
|
||||
[param('std::string', 'oldpath'), param('std::string', 'newname')],
|
||||
is_static=True)
|
||||
## names.h: static bool ns3::Names::Rename(std::string path, std::string oldname, std::string newname) [member function]
|
||||
cls.add_method('Rename',
|
||||
'bool',
|
||||
[param('std::string', 'path'), param('std::string', 'oldname'), param('std::string', 'newname')],
|
||||
is_static=True)
|
||||
## names.h: static bool ns3::Names::Rename(ns3::Ptr<ns3::Object> context, std::string oldname, std::string newname) [member function]
|
||||
cls.add_method('Rename',
|
||||
'bool',
|
||||
[param('ns3::Ptr< ns3::Object >', 'context'), param('std::string', 'oldname'), param('std::string', 'newname')],
|
||||
is_static=True)
|
||||
## names.h: static std::string ns3::Names::FindName(ns3::Ptr<ns3::Object> object) [member function]
|
||||
cls.add_method('FindName',
|
||||
'std::string',
|
||||
[param('ns3::Ptr< ns3::Object >', 'object')],
|
||||
is_static=True)
|
||||
## names.h: static std::string ns3::Names::FindPath(ns3::Ptr<ns3::Object> object) [member function]
|
||||
cls.add_method('FindPath',
|
||||
'std::string',
|
||||
[param('ns3::Ptr< ns3::Object >', 'object')],
|
||||
is_static=True)
|
||||
## names.h: static void ns3::Names::Delete() [member function]
|
||||
cls.add_method('Delete',
|
||||
'void',
|
||||
[],
|
||||
is_static=True)
|
||||
return
|
||||
|
||||
def register_Ns3ObjectBase_methods(root_module, cls):
|
||||
## object-base.h: ns3::ObjectBase::ObjectBase() [constructor]
|
||||
cls.add_constructor([])
|
||||
@@ -2004,7 +2059,7 @@ def register_functions(root_module):
|
||||
module.add_function('TypeNameGet',
|
||||
'std::string',
|
||||
[],
|
||||
template_parameters=['long long'])
|
||||
template_parameters=['long'])
|
||||
## type-name.h: extern std::string ns3::TypeNameGet() [free function]
|
||||
module.add_function('TypeNameGet',
|
||||
'std::string',
|
||||
@@ -2024,7 +2079,7 @@ def register_functions(root_module):
|
||||
module.add_function('TypeNameGet',
|
||||
'std::string',
|
||||
[],
|
||||
template_parameters=['unsigned long long'])
|
||||
template_parameters=['unsigned long'])
|
||||
## type-name.h: extern std::string ns3::TypeNameGet() [free function]
|
||||
module.add_function('TypeNameGet',
|
||||
'std::string',
|
||||
|
||||
@@ -37,6 +37,8 @@ def register_types(module):
|
||||
module.add_class('PointToPointHelper', allow_subclassing=False)
|
||||
## static-multicast-route-helper.h: ns3::StaticMulticastRouteHelper [class]
|
||||
module.add_class('StaticMulticastRouteHelper', allow_subclassing=False)
|
||||
## tap-bridge-helper.h: ns3::TapBridgeHelper [class]
|
||||
module.add_class('TapBridgeHelper', allow_subclassing=False)
|
||||
## udp-echo-helper.h: ns3::UdpEchoClientHelper [class]
|
||||
module.add_class('UdpEchoClientHelper', allow_subclassing=False)
|
||||
## udp-echo-helper.h: ns3::UdpEchoServerHelper [class]
|
||||
@@ -110,6 +112,7 @@ def register_methods(root_module):
|
||||
register_Ns3PacketSocketHelper_methods(root_module, root_module['ns3::PacketSocketHelper'])
|
||||
register_Ns3PointToPointHelper_methods(root_module, root_module['ns3::PointToPointHelper'])
|
||||
register_Ns3StaticMulticastRouteHelper_methods(root_module, root_module['ns3::StaticMulticastRouteHelper'])
|
||||
register_Ns3TapBridgeHelper_methods(root_module, root_module['ns3::TapBridgeHelper'])
|
||||
register_Ns3UdpEchoClientHelper_methods(root_module, root_module['ns3::UdpEchoClientHelper'])
|
||||
register_Ns3UdpEchoServerHelper_methods(root_module, root_module['ns3::UdpEchoServerHelper'])
|
||||
register_Ns3V4PingHelper_methods(root_module, root_module['ns3::V4PingHelper'])
|
||||
@@ -124,6 +127,8 @@ def register_Ns3ApplicationContainer_methods(root_module, cls):
|
||||
cls.add_constructor([])
|
||||
## application-container.h: ns3::ApplicationContainer::ApplicationContainer(ns3::Ptr<ns3::Application> application) [constructor]
|
||||
cls.add_constructor([param('ns3::Ptr< ns3::Application >', 'application')])
|
||||
## application-container.h: ns3::ApplicationContainer::ApplicationContainer(std::string name) [constructor]
|
||||
cls.add_constructor([param('std::string', 'name')])
|
||||
## application-container.h: __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Application>*,std::vector<ns3::Ptr<ns3::Application>, std::allocator<ns3::Ptr<ns3::Application> > > > ns3::ApplicationContainer::Begin() const [member function]
|
||||
cls.add_method('Begin',
|
||||
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Application > const, std::vector< ns3::Ptr< ns3::Application > > >',
|
||||
@@ -152,6 +157,10 @@ def register_Ns3ApplicationContainer_methods(root_module, cls):
|
||||
cls.add_method('Add',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Application >', 'application')])
|
||||
## application-container.h: void ns3::ApplicationContainer::Add(std::string name) [member function]
|
||||
cls.add_method('Add',
|
||||
'void',
|
||||
[param('std::string', 'name')])
|
||||
## application-container.h: void ns3::ApplicationContainer::Start(ns3::Time start) [member function]
|
||||
cls.add_method('Start',
|
||||
'void',
|
||||
@@ -247,11 +256,31 @@ def register_Ns3CsmaHelper_methods(root_module, cls):
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_const=True)
|
||||
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string name) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('std::string', 'name')],
|
||||
is_const=True)
|
||||
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::CsmaChannel> channel) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')],
|
||||
is_const=True)
|
||||
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr<ns3::Node> node, std::string channelName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node'), param('std::string', 'channelName')],
|
||||
is_const=True)
|
||||
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, ns3::Ptr<ns3::CsmaChannel> channel) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('std::string', 'nodeName'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')],
|
||||
is_const=True)
|
||||
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, std::string channelName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('std::string', 'nodeName'), param('std::string', 'channelName')],
|
||||
is_const=True)
|
||||
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
@@ -262,6 +291,11 @@ def register_Ns3CsmaHelper_methods(root_module, cls):
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')],
|
||||
is_const=True)
|
||||
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, std::string channelName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('ns3::NodeContainer const &', 'c'), param('std::string', 'channelName')],
|
||||
is_const=True)
|
||||
## csma-helper.h: void ns3::CsmaHelper::InstallStar(ns3::Ptr<ns3::Node> hub, ns3::NodeContainer spokes, ns3::NetDeviceContainer & hubDevices, ns3::NetDeviceContainer & spokeDevices) [member function]
|
||||
cls.add_method('InstallStar',
|
||||
'void',
|
||||
@@ -325,6 +359,11 @@ def register_Ns3EmuHelper_methods(root_module, cls):
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_const=True)
|
||||
## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(std::string nodeName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('std::string', 'nodeName')],
|
||||
is_const=True)
|
||||
## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::NodeContainer const & c) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
@@ -336,6 +375,11 @@ def register_Ns3EmuHelper_methods(root_module, cls):
|
||||
def register_Ns3InternetStackHelper_methods(root_module, cls):
|
||||
## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper() [constructor]
|
||||
cls.add_constructor([])
|
||||
## internet-stack-helper.h: void ns3::InternetStackHelper::Install(std::string nodeName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'void',
|
||||
[param('std::string', 'nodeName')],
|
||||
is_const=True)
|
||||
## internet-stack-helper.h: void ns3::InternetStackHelper::Install(ns3::Ptr<ns3::Node> node) const [member function]
|
||||
cls.add_method('Install',
|
||||
'void',
|
||||
@@ -437,6 +481,10 @@ def register_Ns3MobilityHelper_methods(root_module, cls):
|
||||
cls.add_method('PushReferenceMobilityModel',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Object >', 'reference')])
|
||||
## mobility-helper.h: void ns3::MobilityHelper::PushReferenceMobilityModel(std::string referenceName) [member function]
|
||||
cls.add_method('PushReferenceMobilityModel',
|
||||
'void',
|
||||
[param('std::string', 'referenceName')])
|
||||
## mobility-helper.h: void ns3::MobilityHelper::PopReferenceMobilityModel() [member function]
|
||||
cls.add_method('PopReferenceMobilityModel',
|
||||
'void',
|
||||
@@ -451,6 +499,11 @@ def register_Ns3MobilityHelper_methods(root_module, cls):
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_const=True)
|
||||
## mobility-helper.h: void ns3::MobilityHelper::Install(std::string nodeName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'void',
|
||||
[param('std::string', 'nodeName')],
|
||||
is_const=True)
|
||||
## mobility-helper.h: void ns3::MobilityHelper::Install(ns3::NodeContainer container) const [member function]
|
||||
cls.add_method('Install',
|
||||
'void',
|
||||
@@ -483,6 +536,8 @@ def register_Ns3NetDeviceContainer_methods(root_module, cls):
|
||||
cls.add_constructor([])
|
||||
## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::Ptr<ns3::NetDevice> dev) [constructor]
|
||||
cls.add_constructor([param('ns3::Ptr< ns3::NetDevice >', 'dev')])
|
||||
## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(std::string devName) [constructor]
|
||||
cls.add_constructor([param('std::string', 'devName')])
|
||||
## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & a, ns3::NetDeviceContainer const & b) [constructor]
|
||||
cls.add_constructor([param('ns3::NetDeviceContainer const &', 'a'), param('ns3::NetDeviceContainer const &', 'b')])
|
||||
## net-device-container.h: __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::NetDevice>*,std::vector<ns3::Ptr<ns3::NetDevice>, std::allocator<ns3::Ptr<ns3::NetDevice> > > > ns3::NetDeviceContainer::Begin() const [member function]
|
||||
@@ -521,6 +576,8 @@ def register_Ns3NodeContainer_methods(root_module, cls):
|
||||
cls.add_constructor([])
|
||||
## node-container.h: ns3::NodeContainer::NodeContainer(ns3::Ptr<ns3::Node> node) [constructor]
|
||||
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'node')])
|
||||
## node-container.h: ns3::NodeContainer::NodeContainer(std::string nodeName) [constructor]
|
||||
cls.add_constructor([param('std::string', 'nodeName')])
|
||||
## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b) [constructor]
|
||||
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b')])
|
||||
## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c) [constructor]
|
||||
@@ -561,6 +618,10 @@ def register_Ns3NodeContainer_methods(root_module, cls):
|
||||
cls.add_method('Add',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')])
|
||||
## node-container.h: void ns3::NodeContainer::Add(std::string nodeName) [member function]
|
||||
cls.add_method('Add',
|
||||
'void',
|
||||
[param('std::string', 'nodeName')])
|
||||
## node-container.h: static ns3::NodeContainer ns3::NodeContainer::GetGlobal() [member function]
|
||||
cls.add_method('GetGlobal',
|
||||
'ns3::NodeContainer',
|
||||
@@ -595,6 +656,10 @@ def register_Ns3OlsrHelper_methods(root_module, cls):
|
||||
cls.add_method('Install',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')])
|
||||
## olsr-helper.h: void ns3::OlsrHelper::Install(std::string nodeName) [member function]
|
||||
cls.add_method('Install',
|
||||
'void',
|
||||
[param('std::string', 'nodeName')])
|
||||
## olsr-helper.h: void ns3::OlsrHelper::InstallAll() [member function]
|
||||
cls.add_method('InstallAll',
|
||||
'void',
|
||||
@@ -648,6 +713,11 @@ def register_Ns3PacketSocketHelper_methods(root_module, cls):
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_const=True)
|
||||
## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(std::string nodeName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'void',
|
||||
[param('std::string', 'nodeName')],
|
||||
is_const=True)
|
||||
## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(ns3::NodeContainer c) const [member function]
|
||||
cls.add_method('Install',
|
||||
'void',
|
||||
@@ -730,6 +800,18 @@ def register_Ns3PointToPointHelper_methods(root_module, cls):
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('ns3::Ptr< ns3::Node >', 'a'), param('ns3::Ptr< ns3::Node >', 'b')])
|
||||
## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::Ptr<ns3::Node> a, std::string bName) [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('ns3::Ptr< ns3::Node >', 'a'), param('std::string', 'bName')])
|
||||
## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(std::string aName, ns3::Ptr<ns3::Node> b) [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('std::string', 'aName'), param('ns3::Ptr< ns3::Node >', 'b')])
|
||||
## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(std::string aNode, std::string bNode) [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::NetDeviceContainer',
|
||||
[param('std::string', 'aNode'), param('std::string', 'bNode')])
|
||||
## point-to-point-helper.h: void ns3::PointToPointHelper::InstallStar(ns3::Ptr<ns3::Node> hub, ns3::NodeContainer spokes, ns3::NetDeviceContainer & hubDevices, ns3::NetDeviceContainer & spokeDevices) [member function]
|
||||
cls.add_method('InstallStar',
|
||||
'void',
|
||||
@@ -740,14 +822,38 @@ def register_Ns3PointToPointHelper_methods(root_module, cls):
|
||||
def register_Ns3StaticMulticastRouteHelper_methods(root_module, cls):
|
||||
## static-multicast-route-helper.h: ns3::StaticMulticastRouteHelper::StaticMulticastRouteHelper() [constructor]
|
||||
cls.add_constructor([])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::AddMulticastRoute(ns3::Ptr<ns3::Node> arg0, ns3::Ipv4Address source, ns3::Ipv4Address group, ns3::Ptr<ns3::NetDevice> input, ns3::NetDeviceContainer output) [member function]
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::AddMulticastRoute(ns3::Ptr<ns3::Node> n, ns3::Ipv4Address source, ns3::Ipv4Address group, ns3::Ptr<ns3::NetDevice> input, ns3::NetDeviceContainer output) [member function]
|
||||
cls.add_method('AddMulticastRoute',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'arg0'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('ns3::Ptr< ns3::NetDevice >', 'input'), param('ns3::NetDeviceContainer', 'output')])
|
||||
[param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('ns3::Ptr< ns3::NetDevice >', 'input'), param('ns3::NetDeviceContainer', 'output')])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::AddMulticastRoute(std::string n, ns3::Ipv4Address source, ns3::Ipv4Address group, ns3::Ptr<ns3::NetDevice> input, ns3::NetDeviceContainer output) [member function]
|
||||
cls.add_method('AddMulticastRoute',
|
||||
'void',
|
||||
[param('std::string', 'n'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('ns3::Ptr< ns3::NetDevice >', 'input'), param('ns3::NetDeviceContainer', 'output')])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::AddMulticastRoute(ns3::Ptr<ns3::Node> n, ns3::Ipv4Address source, ns3::Ipv4Address group, std::string inputName, ns3::NetDeviceContainer output) [member function]
|
||||
cls.add_method('AddMulticastRoute',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('std::string', 'inputName'), param('ns3::NetDeviceContainer', 'output')])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::AddMulticastRoute(std::string nName, ns3::Ipv4Address source, ns3::Ipv4Address group, std::string inputName, ns3::NetDeviceContainer output) [member function]
|
||||
cls.add_method('AddMulticastRoute',
|
||||
'void',
|
||||
[param('std::string', 'nName'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('std::string', 'inputName'), param('ns3::NetDeviceContainer', 'output')])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::SetDefaultMulticastRoute(ns3::Ptr<ns3::Node> n, ns3::Ptr<ns3::NetDevice> nd) [member function]
|
||||
cls.add_method('SetDefaultMulticastRoute',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ptr< ns3::NetDevice >', 'nd')])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::SetDefaultMulticastRoute(ns3::Ptr<ns3::Node> n, std::string ndName) [member function]
|
||||
cls.add_method('SetDefaultMulticastRoute',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'n'), param('std::string', 'ndName')])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::SetDefaultMulticastRoute(std::string nName, ns3::Ptr<ns3::NetDevice> nd) [member function]
|
||||
cls.add_method('SetDefaultMulticastRoute',
|
||||
'void',
|
||||
[param('std::string', 'nName'), param('ns3::Ptr< ns3::NetDevice >', 'nd')])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::SetDefaultMulticastRoute(std::string nName, std::string ndName) [member function]
|
||||
cls.add_method('SetDefaultMulticastRoute',
|
||||
'void',
|
||||
[param('std::string', 'nName'), param('std::string', 'ndName')])
|
||||
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::JoinMulticastGroup(ns3::Ptr<ns3::Node> n, ns3::Ipv4Address source, ns3::Ipv4Address group) [member function]
|
||||
cls.add_method('JoinMulticastGroup',
|
||||
'void',
|
||||
@@ -767,6 +873,11 @@ def register_Ns3UdpEchoClientHelper_methods(root_module, cls):
|
||||
'ns3::ApplicationContainer',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_const=True)
|
||||
## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(std::string nodeName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::ApplicationContainer',
|
||||
[param('std::string', 'nodeName')],
|
||||
is_const=True)
|
||||
## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(ns3::NodeContainer c) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::ApplicationContainer',
|
||||
@@ -787,6 +898,11 @@ def register_Ns3UdpEchoServerHelper_methods(root_module, cls):
|
||||
'ns3::ApplicationContainer',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_const=True)
|
||||
## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(std::string nodeName) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::ApplicationContainer',
|
||||
[param('std::string', 'nodeName')],
|
||||
is_const=True)
|
||||
## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(ns3::NodeContainer c) const [member function]
|
||||
cls.add_method('Install',
|
||||
'ns3::ApplicationContainer',
|
||||
@@ -890,6 +1006,10 @@ def register_Ns3YansWifiPhyHelper_methods(root_module, cls):
|
||||
cls.add_method('SetChannel',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::YansWifiChannel >', 'channel')])
|
||||
## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetChannel(std::string channelName) [member function]
|
||||
cls.add_method('SetChannel',
|
||||
'void',
|
||||
[param('std::string', 'channelName')])
|
||||
## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::Set(std::string name, ns3::AttributeValue const & v) [member function]
|
||||
cls.add_method('Set',
|
||||
'void',
|
||||
|
||||
@@ -109,6 +109,8 @@ def register_types(module):
|
||||
module.add_class('Channel', parent=root_module['ns3::Object'])
|
||||
## drop-tail-queue.h: ns3::DropTailQueue [class]
|
||||
module.add_class('DropTailQueue', parent=root_module['ns3::Queue'])
|
||||
## drop-tail-queue.h: ns3::DropTailQueue::Mode [enumeration]
|
||||
module.add_enum('Mode', ['ILLEGAL', 'PACKETS', 'BYTES'], outer_class=root_module['ns3::DropTailQueue'])
|
||||
## ethernet-header.h: ns3::EthernetHeader [class]
|
||||
module.add_class('EthernetHeader', parent=root_module['ns3::Header'])
|
||||
## ethernet-trailer.h: ns3::EthernetTrailer [class]
|
||||
@@ -2296,6 +2298,14 @@ def register_Ns3DropTailQueue_methods(root_module, cls):
|
||||
is_static=True)
|
||||
## drop-tail-queue.h: ns3::DropTailQueue::DropTailQueue() [constructor]
|
||||
cls.add_constructor([])
|
||||
## drop-tail-queue.h: void ns3::DropTailQueue::SetMode(ns3::DropTailQueue::Mode mode) [member function]
|
||||
cls.add_method('SetMode',
|
||||
'void',
|
||||
[param('ns3::DropTailQueue::Mode', 'mode')])
|
||||
## drop-tail-queue.h: ns3::DropTailQueue::Mode ns3::DropTailQueue::GetMode() [member function]
|
||||
cls.add_method('GetMode',
|
||||
'ns3::DropTailQueue::Mode',
|
||||
[])
|
||||
## drop-tail-queue.h: bool ns3::DropTailQueue::DoEnqueue(ns3::Ptr<ns3::Packet> p) [member function]
|
||||
cls.add_method('DoEnqueue',
|
||||
'bool',
|
||||
|
||||
@@ -1330,6 +1330,43 @@ def register_Ns3Ns2CalendarScheduler_methods(root_module, cls):
|
||||
cls.add_copy_constructor()
|
||||
return
|
||||
|
||||
def register_Ns3Ns2CalendarScheduler_methods(root_module, cls):
|
||||
## ns2-calendar-scheduler.h: ns3::Ns2CalendarScheduler::Ns2CalendarScheduler(ns3::Ns2CalendarScheduler const & arg0) [copy constructor]
|
||||
cls.add_constructor([param('ns3::Ns2CalendarScheduler const &', 'arg0')])
|
||||
## ns2-calendar-scheduler.h: static ns3::TypeId ns3::Ns2CalendarScheduler::GetTypeId() [member function]
|
||||
cls.add_method('GetTypeId',
|
||||
'ns3::TypeId',
|
||||
[],
|
||||
is_static=True)
|
||||
## ns2-calendar-scheduler.h: ns3::Ns2CalendarScheduler::Ns2CalendarScheduler() [constructor]
|
||||
cls.add_constructor([])
|
||||
## ns2-calendar-scheduler.h: void ns3::Ns2CalendarScheduler::Insert(ns3::Scheduler::Event const & ev) [member function]
|
||||
cls.add_method('Insert',
|
||||
'void',
|
||||
[param('ns3::Scheduler::Event const &', 'ev')],
|
||||
is_virtual=True)
|
||||
## ns2-calendar-scheduler.h: bool ns3::Ns2CalendarScheduler::IsEmpty() const [member function]
|
||||
cls.add_method('IsEmpty',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## ns2-calendar-scheduler.h: ns3::Scheduler::Event ns3::Ns2CalendarScheduler::PeekNext() const [member function]
|
||||
cls.add_method('PeekNext',
|
||||
'ns3::Scheduler::Event',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## ns2-calendar-scheduler.h: ns3::Scheduler::Event ns3::Ns2CalendarScheduler::RemoveNext() [member function]
|
||||
cls.add_method('RemoveNext',
|
||||
'ns3::Scheduler::Event',
|
||||
[],
|
||||
is_virtual=True)
|
||||
## ns2-calendar-scheduler.h: void ns3::Ns2CalendarScheduler::Remove(ns3::Scheduler::Event const & ev) [member function]
|
||||
cls.add_method('Remove',
|
||||
'void',
|
||||
[param('ns3::Scheduler::Event const &', 'ev')],
|
||||
is_virtual=True)
|
||||
return
|
||||
|
||||
def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls):
|
||||
## realtime-simulator-impl.h: static ns3::TypeId ns3::RealtimeSimulatorImpl::GetTypeId() [member function]
|
||||
cls.add_method('GetTypeId',
|
||||
|
||||
235
bindings/python/ns3_module_tap_bridge.py
Normal file
235
bindings/python/ns3_module_tap_bridge.py
Normal file
@@ -0,0 +1,235 @@
|
||||
from pybindgen import Module, FileCodeSink, param, retval, cppclass
|
||||
|
||||
def register_types(module):
|
||||
root_module = module.get_root()
|
||||
|
||||
## tap-bridge.h: ns3::TapBridge [class]
|
||||
module.add_class('TapBridge', parent=root_module['ns3::NetDevice'])
|
||||
|
||||
## Register a nested module for the namespace Config
|
||||
|
||||
nested_module = module.add_cpp_namespace('Config')
|
||||
register_types_ns3_Config(nested_module)
|
||||
|
||||
|
||||
## Register a nested module for the namespace TimeStepPrecision
|
||||
|
||||
nested_module = module.add_cpp_namespace('TimeStepPrecision')
|
||||
register_types_ns3_TimeStepPrecision(nested_module)
|
||||
|
||||
|
||||
## Register a nested module for the namespace internal
|
||||
|
||||
nested_module = module.add_cpp_namespace('internal')
|
||||
register_types_ns3_internal(nested_module)
|
||||
|
||||
|
||||
## Register a nested module for the namespace olsr
|
||||
|
||||
nested_module = module.add_cpp_namespace('olsr')
|
||||
register_types_ns3_olsr(nested_module)
|
||||
|
||||
|
||||
def register_types_ns3_Config(module):
|
||||
root_module = module.get_root()
|
||||
|
||||
|
||||
def register_types_ns3_TimeStepPrecision(module):
|
||||
root_module = module.get_root()
|
||||
|
||||
|
||||
def register_types_ns3_internal(module):
|
||||
root_module = module.get_root()
|
||||
|
||||
|
||||
def register_types_ns3_olsr(module):
|
||||
root_module = module.get_root()
|
||||
|
||||
|
||||
def register_methods(root_module):
|
||||
register_Ns3TapBridge_methods(root_module, root_module['ns3::TapBridge'])
|
||||
return
|
||||
|
||||
def register_Ns3TapBridge_methods(root_module, cls):
|
||||
## tap-bridge.h: ns3::TapBridge::TapBridge(ns3::TapBridge const & arg0) [copy constructor]
|
||||
cls.add_constructor([param('ns3::TapBridge const &', 'arg0')])
|
||||
## tap-bridge.h: static ns3::TypeId ns3::TapBridge::GetTypeId() [member function]
|
||||
cls.add_method('GetTypeId',
|
||||
'ns3::TypeId',
|
||||
[],
|
||||
is_static=True)
|
||||
## tap-bridge.h: ns3::TapBridge::TapBridge() [constructor]
|
||||
cls.add_constructor([])
|
||||
## tap-bridge.h: ns3::Ptr<ns3::NetDevice> ns3::TapBridge::GetBridgedNetDevice() [member function]
|
||||
cls.add_method('GetBridgedNetDevice',
|
||||
'ns3::Ptr< ns3::NetDevice >',
|
||||
[])
|
||||
## tap-bridge.h: void ns3::TapBridge::SetBridgedNetDevice(ns3::Ptr<ns3::NetDevice> bridgedDevice) [member function]
|
||||
cls.add_method('SetBridgedNetDevice',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::NetDevice >', 'bridgedDevice')])
|
||||
## tap-bridge.h: void ns3::TapBridge::Start(ns3::Time tStart) [member function]
|
||||
cls.add_method('Start',
|
||||
'void',
|
||||
[param('ns3::Time', 'tStart')])
|
||||
## tap-bridge.h: void ns3::TapBridge::Stop(ns3::Time tStop) [member function]
|
||||
cls.add_method('Stop',
|
||||
'void',
|
||||
[param('ns3::Time', 'tStop')])
|
||||
## tap-bridge.h: void ns3::TapBridge::SetName(std::string const name) [member function]
|
||||
cls.add_method('SetName',
|
||||
'void',
|
||||
[param('std::string const', 'name')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: std::string ns3::TapBridge::GetName() const [member function]
|
||||
cls.add_method('GetName',
|
||||
'std::string',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: void ns3::TapBridge::SetIfIndex(uint32_t const index) [member function]
|
||||
cls.add_method('SetIfIndex',
|
||||
'void',
|
||||
[param('uint32_t const', 'index')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: uint32_t ns3::TapBridge::GetIfIndex() const [member function]
|
||||
cls.add_method('GetIfIndex',
|
||||
'uint32_t',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: ns3::Ptr<ns3::Channel> ns3::TapBridge::GetChannel() const [member function]
|
||||
cls.add_method('GetChannel',
|
||||
'ns3::Ptr< ns3::Channel >',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: ns3::Address ns3::TapBridge::GetAddress() const [member function]
|
||||
cls.add_method('GetAddress',
|
||||
'ns3::Address',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::SetMtu(uint16_t const mtu) [member function]
|
||||
cls.add_method('SetMtu',
|
||||
'bool',
|
||||
[param('uint16_t const', 'mtu')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: uint16_t ns3::TapBridge::GetMtu() const [member function]
|
||||
cls.add_method('GetMtu',
|
||||
'uint16_t',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::IsLinkUp() const [member function]
|
||||
cls.add_method('IsLinkUp',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: void ns3::TapBridge::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
|
||||
cls.add_method('SetLinkChangeCallback',
|
||||
'void',
|
||||
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::IsBroadcast() const [member function]
|
||||
cls.add_method('IsBroadcast',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: ns3::Address ns3::TapBridge::GetBroadcast() const [member function]
|
||||
cls.add_method('GetBroadcast',
|
||||
'ns3::Address',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::IsMulticast() const [member function]
|
||||
cls.add_method('IsMulticast',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: ns3::Address ns3::TapBridge::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
|
||||
cls.add_method('GetMulticast',
|
||||
'ns3::Address',
|
||||
[param('ns3::Ipv4Address', 'multicastGroup')],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::IsPointToPoint() const [member function]
|
||||
cls.add_method('IsPointToPoint',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::IsBridge() const [member function]
|
||||
cls.add_method('IsBridge',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
|
||||
cls.add_method('Send',
|
||||
'bool',
|
||||
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
|
||||
cls.add_method('SendFrom',
|
||||
'bool',
|
||||
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: ns3::Ptr<ns3::Node> ns3::TapBridge::GetNode() const [member function]
|
||||
cls.add_method('GetNode',
|
||||
'ns3::Ptr< ns3::Node >',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: void ns3::TapBridge::SetNode(ns3::Ptr<ns3::Node> node) [member function]
|
||||
cls.add_method('SetNode',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::NeedsArp() const [member function]
|
||||
cls.add_method('NeedsArp',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: void ns3::TapBridge::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function]
|
||||
cls.add_method('SetReceiveCallback',
|
||||
'void',
|
||||
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: void ns3::TapBridge::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function]
|
||||
cls.add_method('SetPromiscReceiveCallback',
|
||||
'void',
|
||||
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
|
||||
is_virtual=True)
|
||||
## tap-bridge.h: bool ns3::TapBridge::SupportsSendFrom() const [member function]
|
||||
cls.add_method('SupportsSendFrom',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: ns3::Address ns3::TapBridge::GetMulticast(ns3::Ipv6Address addr) const [member function]
|
||||
cls.add_method('GetMulticast',
|
||||
'ns3::Address',
|
||||
[param('ns3::Ipv6Address', 'addr')],
|
||||
is_const=True, is_virtual=True)
|
||||
## tap-bridge.h: void ns3::TapBridge::DoDispose() [member function]
|
||||
cls.add_method('DoDispose',
|
||||
'void',
|
||||
[],
|
||||
visibility='protected', is_virtual=True)
|
||||
## tap-bridge.h: void ns3::TapBridge::ReceiveFromBridgedDevice(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<const ns3::Packet> packet, uint16_t protocol, ns3::Address const & src, ns3::Address const & dst, ns3::NetDevice::PacketType packetType) [member function]
|
||||
cls.add_method('ReceiveFromBridgedDevice',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'src'), param('ns3::Address const &', 'dst'), param('ns3::NetDevice::PacketType', 'packetType')],
|
||||
visibility='protected')
|
||||
return
|
||||
|
||||
def register_functions(root_module):
|
||||
module = root_module
|
||||
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
|
||||
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
|
||||
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
|
||||
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
|
||||
return
|
||||
|
||||
def register_functions_ns3_Config(module, root_module):
|
||||
return
|
||||
|
||||
def register_functions_ns3_TimeStepPrecision(module, root_module):
|
||||
return
|
||||
|
||||
def register_functions_ns3_internal(module, root_module):
|
||||
return
|
||||
|
||||
def register_functions_ns3_olsr(module, root_module):
|
||||
return
|
||||
|
||||
@@ -86,6 +86,7 @@ def main():
|
||||
ns3modulegen_core_customizations.Simulator_customizations(root_module)
|
||||
ns3modulegen_core_customizations.CommandLine_customizations(root_module)
|
||||
ns3modulegen_core_customizations.TypeId_customizations(root_module)
|
||||
ns3modulegen_core_customizations.add_std_ofstream(root_module)
|
||||
|
||||
|
||||
for local_module in LOCAL_MODULES:
|
||||
@@ -141,6 +142,10 @@ def main():
|
||||
root_module.classes.remove(root_module['ns3::%s' % clsname])
|
||||
root_module.enums.remove(root_module['ns3::RealtimeSimulatorImpl::SynchronizationMode'])
|
||||
|
||||
if 'TapBridge' not in enabled_features:
|
||||
for clsname in ['TapBridge', 'TapBridgeHelper']:
|
||||
root_module.classes.remove(root_module['ns3::%s' % clsname])
|
||||
|
||||
root_module.generate(out, '_ns3')
|
||||
|
||||
out.close()
|
||||
|
||||
@@ -530,3 +530,20 @@ def TypeId_customizations(module):
|
||||
flags=["METH_VARARGS", "METH_KEYWORDS", "METH_STATIC"])
|
||||
|
||||
|
||||
def add_std_ofstream(module):
|
||||
module.add_include('<fstream>')
|
||||
ostream = module.add_class('ostream', foreign_cpp_namespace='::std')
|
||||
ostream.set_cannot_be_constructed("abstract base class")
|
||||
ofstream = module.add_class('ofstream', foreign_cpp_namespace='::std', parent=ostream)
|
||||
ofstream.add_enum('openmode', [
|
||||
('app', 'std::ios_base::app'),
|
||||
('ate', 'std::ios_base::ate'),
|
||||
('binary', 'std::ios_base::binary'),
|
||||
('in', 'std::ios_base::in'),
|
||||
('out', 'std::ios_base::out'),
|
||||
('trunc', 'std::ios_base::trunc'),
|
||||
])
|
||||
ofstream.add_constructor([Parameter.new("const char *", 'filename'),
|
||||
Parameter.new("::std::ofstream::openmode", 'mode', default_value="std::ios_base::out")])
|
||||
ofstream.add_method('close', None, [])
|
||||
|
||||
|
||||
@@ -20,17 +20,18 @@ import ns3_module_node
|
||||
import ns3_module_contrib
|
||||
import ns3_module_point_to_point
|
||||
import ns3_module_stats
|
||||
import ns3_module_tap_bridge
|
||||
import ns3_module_internet_stack
|
||||
import ns3_module_wifi
|
||||
import ns3_module_csma
|
||||
import ns3_module_emu
|
||||
import ns3_module_bridge
|
||||
import ns3_module_onoff
|
||||
import ns3_module_packet_sink
|
||||
import ns3_module_v4ping
|
||||
import ns3_module_global_routing
|
||||
import ns3_module_onoff
|
||||
import ns3_module_olsr
|
||||
import ns3_module_udp_echo
|
||||
import ns3_module_olsr
|
||||
import ns3_module_helper
|
||||
|
||||
def module_init():
|
||||
@@ -128,6 +129,17 @@ def register_types(module):
|
||||
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)
|
||||
|
||||
try:
|
||||
import ns3_module_tap_bridge__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_tap_bridge__local.register_types(module)
|
||||
|
||||
root_module.end_section('ns3_module_tap_bridge')
|
||||
root_module.begin_section('ns3_module_internet_stack')
|
||||
ns3_module_internet_stack.register_types(module)
|
||||
|
||||
@@ -183,6 +195,17 @@ def register_types(module):
|
||||
ns3_module_bridge__local.register_types(module)
|
||||
|
||||
root_module.end_section('ns3_module_bridge')
|
||||
root_module.begin_section('ns3_module_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)
|
||||
|
||||
@@ -216,28 +239,6 @@ def register_types(module):
|
||||
ns3_module_global_routing__local.register_types(module)
|
||||
|
||||
root_module.end_section('ns3_module_global_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_olsr')
|
||||
ns3_module_olsr.register_types(module)
|
||||
|
||||
try:
|
||||
import ns3_module_olsr__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_olsr__local.register_types(module)
|
||||
|
||||
root_module.end_section('ns3_module_olsr')
|
||||
root_module.begin_section('ns3_module_udp_echo')
|
||||
ns3_module_udp_echo.register_types(module)
|
||||
|
||||
@@ -249,6 +250,17 @@ def register_types(module):
|
||||
ns3_module_udp_echo__local.register_types(module)
|
||||
|
||||
root_module.end_section('ns3_module_udp_echo')
|
||||
root_module.begin_section('ns3_module_olsr')
|
||||
ns3_module_olsr.register_types(module)
|
||||
|
||||
try:
|
||||
import ns3_module_olsr__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_olsr__local.register_types(module)
|
||||
|
||||
root_module.end_section('ns3_module_olsr')
|
||||
root_module.begin_section('ns3_module_helper')
|
||||
ns3_module_helper.register_types(module)
|
||||
|
||||
@@ -393,6 +405,17 @@ def register_methods(root_module):
|
||||
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)
|
||||
|
||||
try:
|
||||
import ns3_module_tap_bridge__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_tap_bridge__local.register_methods(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_tap_bridge')
|
||||
root_module.begin_section('ns3_module_internet_stack')
|
||||
ns3_module_internet_stack.register_methods(root_module)
|
||||
|
||||
@@ -448,6 +471,17 @@ def register_methods(root_module):
|
||||
ns3_module_bridge__local.register_methods(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_bridge')
|
||||
root_module.begin_section('ns3_module_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)
|
||||
|
||||
@@ -481,28 +515,6 @@ def register_methods(root_module):
|
||||
ns3_module_global_routing__local.register_methods(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_global_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_olsr')
|
||||
ns3_module_olsr.register_methods(root_module)
|
||||
|
||||
try:
|
||||
import ns3_module_olsr__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_olsr__local.register_methods(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_olsr')
|
||||
root_module.begin_section('ns3_module_udp_echo')
|
||||
ns3_module_udp_echo.register_methods(root_module)
|
||||
|
||||
@@ -514,6 +526,17 @@ def register_methods(root_module):
|
||||
ns3_module_udp_echo__local.register_methods(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_udp_echo')
|
||||
root_module.begin_section('ns3_module_olsr')
|
||||
ns3_module_olsr.register_methods(root_module)
|
||||
|
||||
try:
|
||||
import ns3_module_olsr__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_olsr__local.register_methods(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_olsr')
|
||||
root_module.begin_section('ns3_module_helper')
|
||||
ns3_module_helper.register_methods(root_module)
|
||||
|
||||
@@ -617,6 +640,17 @@ def register_functions(root_module):
|
||||
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)
|
||||
|
||||
try:
|
||||
import ns3_module_tap_bridge__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_tap_bridge__local.register_functions(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_tap_bridge')
|
||||
root_module.begin_section('ns3_module_internet_stack')
|
||||
ns3_module_internet_stack.register_functions(root_module)
|
||||
|
||||
@@ -672,6 +706,17 @@ def register_functions(root_module):
|
||||
ns3_module_bridge__local.register_functions(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_bridge')
|
||||
root_module.begin_section('ns3_module_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)
|
||||
|
||||
@@ -705,28 +750,6 @@ def register_functions(root_module):
|
||||
ns3_module_global_routing__local.register_functions(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_global_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_olsr')
|
||||
ns3_module_olsr.register_functions(root_module)
|
||||
|
||||
try:
|
||||
import ns3_module_olsr__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_olsr__local.register_functions(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_olsr')
|
||||
root_module.begin_section('ns3_module_udp_echo')
|
||||
ns3_module_udp_echo.register_functions(root_module)
|
||||
|
||||
@@ -738,6 +761,17 @@ def register_functions(root_module):
|
||||
ns3_module_udp_echo__local.register_functions(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_udp_echo')
|
||||
root_module.begin_section('ns3_module_olsr')
|
||||
ns3_module_olsr.register_functions(root_module)
|
||||
|
||||
try:
|
||||
import ns3_module_olsr__local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
ns3_module_olsr__local.register_functions(root_module)
|
||||
|
||||
root_module.end_section('ns3_module_olsr')
|
||||
root_module.begin_section('ns3_module_helper')
|
||||
ns3_module_helper.register_functions(root_module)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import Build
|
||||
import Utils
|
||||
|
||||
## https://launchpad.net/pybindgen/
|
||||
REQUIRED_PYBINDGEN_VERSION = (0, 9, 0, 605)
|
||||
REQUIRED_PYBINDGEN_VERSION = (0, 10, 0, 626)
|
||||
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Primary documentation for the @command{ns-3} project is available in
|
||||
four forms:
|
||||
@itemize @bullet
|
||||
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
|
||||
@item @uref{http://www.nsnam.org/tutorial/index.html,,ns-3 Tutorial}
|
||||
@item @uref{http://www.nsnam.org/docs/tutorial/tutorial.html,,ns-3 Tutorial}
|
||||
@item Reference Manual (this document)
|
||||
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
|
||||
@end itemize
|
||||
@@ -27,7 +27,7 @@ This is an @command{ns-3} reference manual.
|
||||
Primary documentation for the @command{ns-3} project is available in
|
||||
four forms:
|
||||
@itemize @bullet
|
||||
@item @uref{http://www.nsnam.org/tutorial/index.html,,ns-3 Tutorial}
|
||||
@item @uref{http://www.nsnam.org/docs/tutorial/tutorial.html,,ns-3 Tutorial}
|
||||
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen}: Documentation of the public APIs of the simulator
|
||||
@item Reference Manual (this document)
|
||||
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
|
||||
|
||||
@@ -272,21 +272,19 @@ If you run the script now, you should see the following output:
|
||||
~/repos/ns-3-dev > ./waf --run scratch/first
|
||||
Entering directory `/home/craigdo/repos/ns-3-dev/build'
|
||||
Compilation finished successfully
|
||||
0ns UdpEchoServerApplication:UdpEchoServer()
|
||||
0ns UdpEchoClientApplication:UdpEchoClient()
|
||||
1000000000ns UdpEchoServerApplication:StartApplication()
|
||||
2000000000ns UdpEchoClientApplication:StartApplication()
|
||||
2000000000ns UdpEchoClientApplication:ScheduleTransmit()
|
||||
2000000000ns UdpEchoClientApplication:Send()
|
||||
2000000000ns UdpEchoClientApplication:Send(): Sent 1024 bytes to 10.1.1.2
|
||||
2003686400ns UdpEchoServerApplication:HandleRead(): Received 1024 bytes
|
||||
from 10.1.1.1
|
||||
2003686400ns UdpEchoServerApplication:HandleRead(): Echoing packet
|
||||
2007372800ns UdpEchoClientApplication:HandleRead(0x62c8c0, 0x62d020)
|
||||
2007372800ns UdpEchoClientApplication:HandleRead(): Received 1024 bytes
|
||||
from 10.1.1.2
|
||||
10000000000ns UdpEchoServerApplication:StopApplication()
|
||||
10000000000ns UdpEchoClientApplication:StopApplication()
|
||||
0s UdpEchoServerApplication:UdpEchoServer()
|
||||
0s UdpEchoClientApplication:UdpEchoClient()
|
||||
1s UdpEchoServerApplication:StartApplication()
|
||||
2s UdpEchoClientApplication:StartApplication()
|
||||
2s UdpEchoClientApplication:ScheduleTransmit()
|
||||
2s UdpEchoClientApplication:Send()
|
||||
2s UdpEchoClientApplication:Send(): Sent 1024 bytes to 10.1.1.2
|
||||
2.00369s UdpEchoServerApplication:HandleRead(): Received 1024 bytes from 10.1.1.1
|
||||
2.00369s UdpEchoServerApplication:HandleRead(): Echoing packet
|
||||
2.00737s UdpEchoClientApplication:HandleRead(0x62c8c0, 0x62d020)
|
||||
2.00737s UdpEchoClientApplication:HandleRead(): Received 1024 bytes from 10.1.1.2
|
||||
10s UdpEchoServerApplication:StopApplication()
|
||||
10s UdpEchoClientApplication:StopApplication()
|
||||
UdpEchoClientApplication:DoDispose()
|
||||
UdpEchoServerApplication:DoDispose()
|
||||
UdpEchoClientApplication:~UdpEchoClient()
|
||||
@@ -295,7 +293,7 @@ If you run the script now, you should see the following output:
|
||||
@end verbatim
|
||||
|
||||
You can see that the constructor for the UdpEchoServer was called at a
|
||||
simulation time of 0 nanoseconds. This is actually happening before the
|
||||
simulation time of 0 seconds. This is actually happening before the
|
||||
simulation starts. The same for the UdpEchoClient constructor.
|
||||
|
||||
Recall that the @code{first.cc} script started the echo server application at
|
||||
|
||||
@@ -36,14 +36,21 @@ NS_LOG_COMPONENT_DEFINE ("SecondScriptExample");
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
||||
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
||||
bool verbose = true;
|
||||
|
||||
uint32_t nCsma = 3;
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
|
||||
cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);
|
||||
|
||||
cmd.Parse (argc,argv);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
||||
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
||||
}
|
||||
|
||||
NodeContainer p2pNodes;
|
||||
p2pNodes.Create (2);
|
||||
|
||||
|
||||
@@ -40,16 +40,24 @@ NS_LOG_COMPONENT_DEFINE ("ThirdScriptExample");
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
||||
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
||||
|
||||
bool verbose = true;
|
||||
|
||||
uint32_t nCsma = 3;
|
||||
uint32_t nWifi = 3;
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
|
||||
cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
|
||||
cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);
|
||||
|
||||
cmd.Parse (argc,argv);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
||||
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
||||
}
|
||||
|
||||
NodeContainer p2pNodes;
|
||||
p2pNodes.Create (2);
|
||||
|
||||
|
||||
@@ -154,9 +154,13 @@ def main(argv):
|
||||
# Config::Connect ("/NodeList/*/DeviceList/*/Phy/Tx", MakeCallback (&PhyTxTrace));
|
||||
# Config::Connect ("/NodeList/*/DeviceList/*/Phy/State", MakeCallback (&PhyStateTrace));
|
||||
|
||||
ascii = ns3.ofstream("wifi-ap.tr")
|
||||
ns3.YansWifiPhyHelper.EnableAsciiAll(ascii)
|
||||
|
||||
ns3.Simulator.Run()
|
||||
|
||||
ns3.Simulator.Destroy()
|
||||
ascii.close()
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@@ -37,6 +37,30 @@ def _find_tests(testdir):
|
||||
tests.sort()
|
||||
return tests
|
||||
|
||||
def diff(dir1, dir2, verbose):
|
||||
import filecmp
|
||||
comp = filecmp.dircmp(dir1, dir2)
|
||||
differ = (comp.left_only or comp.right_only or comp.diff_files)
|
||||
if differ:
|
||||
if verbose:
|
||||
comp.report()
|
||||
import difflib
|
||||
for diff_fname in comp.diff_files:
|
||||
if not (diff_fname.endswith(".tr") or diff_fname.endswith(".mob")):
|
||||
print "The different file %r does not sound like a text file, not compared." % (diff_fname,)
|
||||
diff_file1 = open(os.path.join(dir1, diff_fname), "rt").readlines()
|
||||
diff_file2 = open(os.path.join(dir2, diff_fname), "rt").readlines()
|
||||
diff = difflib.unified_diff(diff_file1, diff_file2)
|
||||
count = 0
|
||||
print "Differences in file %r" % (diff_fname,)
|
||||
for line in diff:
|
||||
print line
|
||||
count += 1
|
||||
if count > 100:
|
||||
break
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
class regression_test_task(Task.TaskBase):
|
||||
after = 'cc cxx cc_link cxx_link'
|
||||
@@ -136,17 +160,7 @@ class regression_test_task(Task.TaskBase):
|
||||
print >> sys.stderr, ex
|
||||
return 1
|
||||
|
||||
if Options.options.verbose:
|
||||
#diffCmd = "diff traces " + refTestDirName + " | head"
|
||||
diffCmd = subprocess.Popen([self.env['DIFF'], trace_output_path, reference_traces_path],
|
||||
stdout=subprocess.PIPE)
|
||||
headCmd = subprocess.Popen("head", stdin=diffCmd.stdout)
|
||||
rc2 = headCmd.wait()
|
||||
diffCmd.stdout.close()
|
||||
rc1 = diffCmd.wait()
|
||||
rc = rc1 or rc2
|
||||
else:
|
||||
rc = subprocess.Popen([self.env['DIFF'], trace_output_path, reference_traces_path], stdout=dev_null()).wait()
|
||||
rc = diff(trace_output_path, reference_traces_path, Options.options.verbose)
|
||||
if rc:
|
||||
print "----------"
|
||||
print "Traces differ in test: ", self.test_name
|
||||
@@ -154,6 +168,8 @@ class regression_test_task(Task.TaskBase):
|
||||
print "Traces in directory: " + trace_output_path
|
||||
print "Run the following command for details:"
|
||||
print "\tdiff -u %s %s" % (reference_traces_path, trace_output_path)
|
||||
if not Options.options.verbose:
|
||||
print "Or re-run regression testing with option -v"
|
||||
print "----------"
|
||||
return rc
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
"""Generic trace-comparison-type regression test."""
|
||||
"""Compare that Second generates correct traces."""
|
||||
|
||||
arguments = ["--verbose=0"]
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
"""Generic trace-comparison-type regression test."""
|
||||
"""Compare that Third generates correct traces."""
|
||||
|
||||
arguments = ["--verbose=0"]
|
||||
|
||||
|
||||
@@ -35,4 +35,55 @@ CallbackValue::DeserializeFromString (std::string value, Ptr<const AttributeChec
|
||||
|
||||
ATTRIBUTE_CHECKER_IMPLEMENT (Callback);
|
||||
|
||||
#if (__GNUC__ >= 3)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cxxabi.h>
|
||||
#include "log.h"
|
||||
|
||||
std::string
|
||||
CallbackBase::Demangle(const std::string& mangled)
|
||||
{
|
||||
int status;
|
||||
char* demangled = abi::__cxa_demangle(mangled.c_str(),
|
||||
NULL, NULL, &status);
|
||||
|
||||
std::string ret;
|
||||
if (status == 0) {
|
||||
NS_ASSERT(demangled);
|
||||
ret = demangled;
|
||||
}
|
||||
else if (status == -1) {
|
||||
NS_LOG_UNCOND("Callback demangling failed: Memory allocation failure occured.");
|
||||
ret = mangled;
|
||||
}
|
||||
else if (status == -2) {
|
||||
NS_LOG_UNCOND("Callback demangling failed: Mangled name is not a valid under the C++ ABI mangling rules.");
|
||||
ret = mangled;
|
||||
}
|
||||
else if (status == -3) {
|
||||
NS_LOG_UNCOND("Callback demangling failed: One of the arguments is invalid.");
|
||||
ret = mangled;
|
||||
}
|
||||
else {
|
||||
NS_LOG_UNCOND("Callback demangling failed: status " << status);
|
||||
ret = mangled;
|
||||
}
|
||||
|
||||
if (demangled) {
|
||||
free(demangled);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
std::string
|
||||
CallbackBase::Demangle(const std::string& mangled)
|
||||
{
|
||||
return mangled;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -340,6 +340,8 @@ public:
|
||||
protected:
|
||||
CallbackBase (Ptr<CallbackImplBase> impl) : m_impl (impl) {}
|
||||
Ptr<CallbackImplBase> m_impl;
|
||||
|
||||
static std::string Demangle(const std::string& mangled);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -476,9 +478,9 @@ private:
|
||||
void DoAssign (Ptr<const CallbackImplBase> other) {
|
||||
if (!DoCheckType (other))
|
||||
{
|
||||
NS_FATAL_ERROR ("Incompatible types. (feed to \"c++filt -t\")"
|
||||
" got=" << typeid (*other).name () <<
|
||||
", expected=" << typeid (CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> *).name ());
|
||||
NS_FATAL_ERROR ("Incompatible types. (feed to \"c++filt -t\" if needed)" << std::endl <<
|
||||
"got=" << Demangle ( typeid (*other).name () ) << std::endl <<
|
||||
"expected=" << Demangle ( typeid (CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> *).name () ));
|
||||
}
|
||||
m_impl = const_cast<CallbackImplBase *> (PeekPointer (other));
|
||||
}
|
||||
|
||||
@@ -370,22 +370,30 @@ bool
|
||||
BridgeNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
|
||||
iter != m_ports.end (); iter++)
|
||||
{
|
||||
Ptr<NetDevice> port = *iter;
|
||||
port->SendFrom (packet, m_address, dest, protocolNumber);
|
||||
}
|
||||
|
||||
return true;
|
||||
return SendFrom (packet, m_address, dest, protocolNumber);
|
||||
}
|
||||
|
||||
bool
|
||||
BridgeNetDevice::SendFrom (Ptr<Packet> packet, const Address& src, const Address& dest, uint16_t protocolNumber)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
Mac48Address dst = Mac48Address::ConvertFrom (dest);
|
||||
|
||||
// try to use the learned state if data is unicast
|
||||
if (!dst.IsGroup ())
|
||||
{
|
||||
Ptr<NetDevice> outPort = GetLearnedState (dst);
|
||||
if (outPort != NULL)
|
||||
{
|
||||
outPort->SendFrom (packet, src, dest, protocolNumber);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// data was not unicast or no state has been learned for that mac
|
||||
// address => flood through all ports.
|
||||
for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
|
||||
iter != m_ports.end (); iter++)
|
||||
iter != m_ports.end (); iter++)
|
||||
{
|
||||
Ptr<NetDevice> port = *iter;
|
||||
port->SendFrom (packet, src, dest, protocolNumber);
|
||||
|
||||
@@ -411,10 +411,15 @@ CsmaNetDevice::TransmitStart ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
|
||||
//
|
||||
// This function is called to start the process of transmitting a packet. We
|
||||
// expect that a Ptr to the packet to be transmitted has been placed in
|
||||
// m_currentPkt.
|
||||
|
||||
NS_LOG_LOGIC ("m_currentPkt=" << m_currentPkt);
|
||||
NS_LOG_LOGIC ("UID is " << m_currentPkt->GetUid ());
|
||||
|
||||
//
|
||||
// This function is called to start the process of transmitting a packet.
|
||||
// We need to tell the channel that we've started wiggling the wire and
|
||||
// schedule an event that will be executed when it's time to tell the
|
||||
// channel that we're done wiggling the wire.
|
||||
@@ -487,20 +492,43 @@ CsmaNetDevice::TransmitAbort (void)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
|
||||
//
|
||||
// When we started transmitting the current packet, it was placed in
|
||||
// m_currentPkt. So we had better find one there.
|
||||
//
|
||||
NS_ASSERT_MSG (m_currentPkt != 0, "CsmaNetDevice::TransmitAbort(): m_currentPkt zero");
|
||||
NS_LOG_LOGIC ("m_currentPkt=" << m_currentPkt);
|
||||
NS_LOG_LOGIC ("Pkt UID is " << m_currentPkt->GetUid () << ")");
|
||||
|
||||
//
|
||||
// Since we were transmitting a packet, that packet had better be on the transmit queue.
|
||||
// Hit the drop trace source.
|
||||
//
|
||||
m_currentPkt = m_queue->Dequeue ();
|
||||
NS_ASSERT_MSG (m_currentPkt != 0, "No Packet on queue during CsmaNetDevice::TransmitAbort()");
|
||||
// XXX Should there be a separate transmit drop trace?
|
||||
//
|
||||
m_dropTrace (m_currentPkt);
|
||||
|
||||
//
|
||||
// The last one failed. Let's try to transmit the next one (if there)
|
||||
//
|
||||
// We're done with that one, so reset the backoff algorithm and ready the
|
||||
// transmit state machine.
|
||||
//
|
||||
m_backoff.ResetBackoffTime ();
|
||||
m_txMachineState = READY;
|
||||
TransmitStart ();
|
||||
|
||||
//
|
||||
// If there is another packet on the input queue, we need to start trying to
|
||||
// get that out. If the queue is empty we just wait until someone puts one
|
||||
// in.
|
||||
//
|
||||
if (m_queue->IsEmpty ())
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentPkt = m_queue->Dequeue ();
|
||||
NS_ASSERT_MSG (m_currentPkt != 0, "CsmaNetDevice::TransmitAbort(): IsEmpty false but no Packet on queue?");
|
||||
TransmitStart ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -514,11 +542,18 @@ CsmaNetDevice::TransmitCompleteEvent (void)
|
||||
// schedule an event that will be executed when it's time to re-enable
|
||||
// the transmitter after the interframe gap.
|
||||
//
|
||||
NS_ASSERT_MSG (m_txMachineState == BUSY, "Must be BUSY if transmitting");
|
||||
NS_ASSERT_MSG (m_txMachineState == BUSY, "CsmaNetDevice::transmitCompleteEvent(): Must be BUSY if transmitting");
|
||||
NS_ASSERT (m_channel->GetState () == TRANSMITTING);
|
||||
m_txMachineState = GAP;
|
||||
|
||||
//
|
||||
// When we started transmitting the current packet, it was placed in
|
||||
// m_currentPkt. So we had better find one there.
|
||||
//
|
||||
NS_ASSERT_MSG (m_currentPkt != 0, "CsmaNetDevice::TransmitCompleteEvent(): m_currentPkt zero");
|
||||
NS_LOG_LOGIC ("m_currentPkt=" << m_currentPkt);
|
||||
NS_LOG_LOGIC ("Pkt UID is " << m_currentPkt->GetUid () << ")");
|
||||
|
||||
m_channel->TransmitEnd ();
|
||||
|
||||
NS_LOG_LOGIC ("Schedule TransmitReadyEvent in " << m_tInterframeGap.GetSeconds () << "sec");
|
||||
@@ -536,9 +571,17 @@ CsmaNetDevice::TransmitReadyEvent (void)
|
||||
// gap has passed. If there are pending transmissions, we use this opportunity
|
||||
// to start the next transmit.
|
||||
//
|
||||
NS_ASSERT_MSG (m_txMachineState == GAP, "Must be in interframe gap");
|
||||
NS_ASSERT_MSG (m_txMachineState == GAP, "CsmaNetDevice::TransmitReadyEvent(): Must be in interframe gap");
|
||||
m_txMachineState = READY;
|
||||
|
||||
//
|
||||
// When we started transmitting the current packet, it was placed in
|
||||
// m_currentPkt. So we had better find one there.
|
||||
//
|
||||
NS_ASSERT_MSG (m_currentPkt != 0, "CsmaNetDevice::TransmitCompleteEvent(): m_currentPkt zero");
|
||||
NS_LOG_LOGIC ("m_currentPkt=" << m_currentPkt);
|
||||
NS_LOG_LOGIC ("Pkt UID is " << m_currentPkt->GetUid () << ")");
|
||||
|
||||
//
|
||||
// Get the next packet from the queue for transmitting
|
||||
//
|
||||
|
||||
@@ -46,12 +46,7 @@ MobilityHelper::SetPositionAllocator (Ptr<PositionAllocator> allocator)
|
||||
{
|
||||
m_position = allocator;
|
||||
}
|
||||
void
|
||||
MobilityHelper::SetPositionAllocator (std::string allocatorName)
|
||||
{
|
||||
Ptr<PositionAllocator> allocator = Names::Find<PositionAllocator> (allocatorName);
|
||||
m_position = allocator;
|
||||
}
|
||||
|
||||
void
|
||||
MobilityHelper::SetPositionAllocator (std::string type,
|
||||
std::string n1, const AttributeValue &v1,
|
||||
|
||||
@@ -50,13 +50,6 @@ public:
|
||||
* \param allocator allocate initial node positions
|
||||
*/
|
||||
void SetPositionAllocator (Ptr<PositionAllocator> allocator);
|
||||
/**
|
||||
* Set the position allocator which will be used to allocate the initial
|
||||
* position of every node initialized during MobilityModel::Install.
|
||||
*
|
||||
* \param allocator allocate initial node positions
|
||||
*/
|
||||
void SetPositionAllocator (std::string allocatorName);
|
||||
|
||||
/**
|
||||
* \param type the type of mobility model to use.
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/enum.h"
|
||||
#include "ns3/uinteger.h"
|
||||
#include "drop-tail-queue.h"
|
||||
|
||||
@@ -31,10 +32,22 @@ TypeId DropTailQueue::GetTypeId (void)
|
||||
static TypeId tid = TypeId ("ns3::DropTailQueue")
|
||||
.SetParent<Queue> ()
|
||||
.AddConstructor<DropTailQueue> ()
|
||||
.AddAttribute ("MaxPackets", "The maximum number of packets accepted by this DropTailQueue.",
|
||||
.AddAttribute ("Mode",
|
||||
"Whether to use Bytes (see MaxBytes) or Packets (see MaxPackets) as the maximum queue size metric.",
|
||||
EnumValue (PACKETS),
|
||||
MakeEnumAccessor (&DropTailQueue::SetMode),
|
||||
MakeEnumChecker (BYTES, "Bytes",
|
||||
PACKETS, "Packets"))
|
||||
.AddAttribute ("MaxPackets",
|
||||
"The maximum number of packets accepted by this DropTailQueue.",
|
||||
UintegerValue (100),
|
||||
MakeUintegerAccessor (&DropTailQueue::m_maxPackets),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
.AddAttribute ("MaxBytes",
|
||||
"The maximum number of bytes accepted by this DropTailQueue.",
|
||||
UintegerValue (100 * 65535),
|
||||
MakeUintegerAccessor (&DropTailQueue::m_maxBytes),
|
||||
MakeUintegerChecker<uint32_t> ())
|
||||
;
|
||||
|
||||
return tid;
|
||||
@@ -52,19 +65,45 @@ DropTailQueue::~DropTailQueue ()
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
}
|
||||
|
||||
void
|
||||
DropTailQueue::SetMode (enum Mode mode)
|
||||
{
|
||||
NS_LOG_FUNCTION (mode);
|
||||
m_mode = mode;
|
||||
}
|
||||
|
||||
DropTailQueue::Mode
|
||||
DropTailQueue::GetMode (void)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
return m_mode;
|
||||
}
|
||||
|
||||
bool
|
||||
DropTailQueue::DoEnqueue (Ptr<Packet> p)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << p);
|
||||
|
||||
if (m_packets.size () >= m_maxPackets)
|
||||
if (m_mode == PACKETS && (m_packets.size () >= m_maxPackets))
|
||||
{
|
||||
NS_LOG_LOGIC ("Queue full -- droppping pkt");
|
||||
NS_LOG_LOGIC ("Queue full (at max packets) -- droppping pkt");
|
||||
Drop (p);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_mode == BYTES && (m_bytesInQueue + p->GetSize () >= m_maxBytes))
|
||||
{
|
||||
NS_LOG_LOGIC ("Queue full (packet would exceed max bytes) -- droppping pkt");
|
||||
Drop (p);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_bytesInQueue += p->GetSize ();
|
||||
m_packets.push(p);
|
||||
|
||||
NS_LOG_LOGIC ("Number packets " << m_packets.size ());
|
||||
NS_LOG_LOGIC ("Number bytes " << m_bytesInQueue);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -81,9 +120,13 @@ DropTailQueue::DoDequeue (void)
|
||||
|
||||
Ptr<Packet> p = m_packets.front ();
|
||||
m_packets.pop ();
|
||||
m_bytesInQueue -= p->GetSize ();
|
||||
|
||||
NS_LOG_LOGIC ("Popped " << p);
|
||||
|
||||
NS_LOG_LOGIC ("Number packets " << m_packets.size ());
|
||||
NS_LOG_LOGIC ("Number bytes " << m_bytesInQueue);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -100,6 +143,9 @@ DropTailQueue::DoPeek (void) const
|
||||
|
||||
Ptr<Packet> p = m_packets.front ();
|
||||
|
||||
NS_LOG_LOGIC ("Number packets " << m_packets.size ());
|
||||
NS_LOG_LOGIC ("Number bytes " << m_bytesInQueue);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,14 +44,41 @@ public:
|
||||
|
||||
virtual ~DropTailQueue();
|
||||
|
||||
/**
|
||||
* Enumeration of the modes supported in the class.
|
||||
*
|
||||
*/
|
||||
enum Mode {
|
||||
ILLEGAL, /**< Mode not set */
|
||||
PACKETS, /**< Use number of packets for maximum queue size */
|
||||
BYTES, /**< Use number of bytes for maximum queue size */
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the operating mode of this device.
|
||||
*
|
||||
* \param mode The operating mode of this device.
|
||||
*
|
||||
*/
|
||||
void SetMode (DropTailQueue::Mode mode);
|
||||
|
||||
/**
|
||||
* Get the encapsulation mode of this device.
|
||||
*
|
||||
* \returns The encapsulation mode of this device.
|
||||
*/
|
||||
DropTailQueue::Mode GetMode (void);
|
||||
|
||||
private:
|
||||
virtual bool DoEnqueue (Ptr<Packet> p);
|
||||
virtual Ptr<Packet> DoDequeue (void);
|
||||
virtual Ptr<const Packet> DoPeek (void) const;
|
||||
|
||||
private:
|
||||
std::queue<Ptr<Packet> > m_packets;
|
||||
uint32_t m_maxPackets;
|
||||
uint32_t m_maxBytes;
|
||||
uint32_t m_bytesInQueue;
|
||||
Mode m_mode;
|
||||
};
|
||||
|
||||
}; // namespace ns3
|
||||
|
||||
6
wscript
6
wscript
@@ -256,9 +256,6 @@ def configure(conf):
|
||||
conf.env['NS3_ENABLED_MODULES'] = ['ns3-'+mod for mod in
|
||||
Options.options.enable_modules.split(',')]
|
||||
|
||||
# we cannot run regression tests without diff
|
||||
conf.find_program('diff', var='DIFF')
|
||||
|
||||
# for suid bits
|
||||
conf.find_program('sudo', var='SUDO')
|
||||
|
||||
@@ -464,9 +461,6 @@ def build(bld):
|
||||
Options.options.compile_targets = os.path.basename(program_name)
|
||||
|
||||
if Options.options.regression or Options.options.regression_generate:
|
||||
if not env['DIFF']:
|
||||
raise Utils.WafError("Cannot run regression tests: the 'diff' program is not installed.")
|
||||
|
||||
regression_traces = env['REGRESSION_TRACES']
|
||||
if not regression_traces:
|
||||
raise Utils.WafError("Cannot run regression tests: reference traces directory not given"
|
||||
|
||||
Reference in New Issue
Block a user